<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>
<channel>
	<title>Comments on: Ma.gnolia Sidebar Widget</title>
	<atom:link href="http://www.animejb.net/2006/11/06/magnolia-sidebar-widget/feed" rel="self" type="application/rss+xml" />
	<link>http://www.animejb.net/2006/11/06/magnolia-sidebar-widget</link>
	<description>The House of AnimeJB</description>
	<pubDate>Tue, 06 Jan 2009 06:32:12 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Social bookmarking &#171; mja.blog</title>
		<link>http://www.animejb.net/2006/11/06/magnolia-sidebar-widget/comment-page-1#comment-16802</link>
		<dc:creator>Social bookmarking &#171; mja.blog</dc:creator>
		<pubDate>Sat, 09 Feb 2008 11:36:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.animejb.net/2006/11/06/magnolia-sidebar-widget/#comment-16802</guid>
		<description>[...] thank you to House of AnimeJB for the Ma.gnolia widget for Wordpress. You&#8217;ve made my decision between the two services just [...]</description>
		<content:encoded><![CDATA[<p>[...] thank you to House of AnimeJB for the Ma.gnolia widget for Wordpress. You&#8217;ve made my decision between the two services just [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joshua Cender</title>
		<link>http://www.animejb.net/2006/11/06/magnolia-sidebar-widget/comment-page-1#comment-456</link>
		<dc:creator>Joshua Cender</dc:creator>
		<pubDate>Thu, 18 Jan 2007 21:05:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.animejb.net/2006/11/06/magnolia-sidebar-widget/#comment-456</guid>
		<description>Hey I found a couple of issues with your script. The file that grabs the data from the ma.gnolia server (magUrl.php) makes a couple of assumptions about the environment that might not be true.

1. It assumes that "register globals" is turned on by accessing the GET variables directly. PHP no longer ships with register globals turned on by default, and it may even be removed in the next version of PHP. You can pretty much assume that anyone on a shared host will not have access to these variables. Better to define these variables explicity before using them:

$url =     $_GET[url];
$api_key = $_GET[api_key];
$person =  $_GET[person];
$limit =   $_GET[limit];
$tags =    $_GET[tags];

2. It also assumes that fopen URL access is enabled. Many hosts such as dreamhost have disabled this feature for security reasons. Trying to access a remote file using get_file_contents will fail in this case. Luckily, most hosts that do this will compile PHP with cURL support. Here is an alternative to get_file contents using curl:

$ch = curl_init();
$timeout = 5; // set to zero for no timeout
curl_setopt ($ch, CURLOPT_URL, $mag_url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents = curl_exec($ch);
curl_close($ch);

// display file
echo $file_contents;


Of course many homebrew versions of PHP don't bother to include curl support, so maybe you want to include a check in your script that will try curl, and then fallback on get_file_contents if that fails?

Anyway, once I added these changes, the script worked fine (before, the XHR request failed, and no links were returned).

Something else I just noticed was that anyone who uses your plugin has their API key passed in plain text to and from the web browser. Correct me if I'm wrong, but wouldn't this allow a malicious person to grab your API key to add/delete links to your ma.nolia bookmarks? Perhaps you should consider keeping the API key server side instead of passing it to the browser.</description>
		<content:encoded><![CDATA[<p>Hey I found a couple of issues with your script. The file that grabs the data from the ma.gnolia server (magUrl.php) makes a couple of assumptions about the environment that might not be true.</p>
<p>1. It assumes that &#8220;register globals&#8221; is turned on by accessing the GET variables directly. PHP no longer ships with register globals turned on by default, and it may even be removed in the next version of PHP. You can pretty much assume that anyone on a shared host will not have access to these variables. Better to define these variables explicity before using them:</p>
<p>$url =     $_GET[url];<br />
$api_key = $_GET[api_key];<br />
$person =  $_GET[person];<br />
$limit =   $_GET[limit];<br />
$tags =    $_GET[tags];</p>
<p>2. It also assumes that fopen URL access is enabled. Many hosts such as dreamhost have disabled this feature for security reasons. Trying to access a remote file using get_file_contents will fail in this case. Luckily, most hosts that do this will compile PHP with cURL support. Here is an alternative to get_file contents using curl:</p>
<p>$ch = curl_init();<br />
$timeout = 5; // set to zero for no timeout<br />
curl_setopt ($ch, CURLOPT_URL, $mag_url);<br />
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);<br />
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);<br />
$file_contents = curl_exec($ch);<br />
curl_close($ch);</p>
<p>// display file<br />
echo $file_contents;</p>
<p>Of course many homebrew versions of PHP don&#8217;t bother to include curl support, so maybe you want to include a check in your script that will try curl, and then fallback on get_file_contents if that fails?</p>
<p>Anyway, once I added these changes, the script worked fine (before, the XHR request failed, and no links were returned).</p>
<p>Something else I just noticed was that anyone who uses your plugin has their API key passed in plain text to and from the web browser. Correct me if I&#8217;m wrong, but wouldn&#8217;t this allow a malicious person to grab your API key to add/delete links to your ma.nolia bookmarks? Perhaps you should consider keeping the API key server side instead of passing it to the browser.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Calophi</title>
		<link>http://www.animejb.net/2006/11/06/magnolia-sidebar-widget/comment-page-1#comment-407</link>
		<dc:creator>Calophi</dc:creator>
		<pubDate>Mon, 15 Jan 2007 15:45:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.animejb.net/2006/11/06/magnolia-sidebar-widget/#comment-407</guid>
		<description>Hi Vicky,

There's still a bug in this where it has to match the URL exactly - if you look at my own installation, if you go to animejb.net instead of www.animejb.net it does the same thing.  I have no idea how to fix it at the moment.</description>
		<content:encoded><![CDATA[<p>Hi Vicky,</p>
<p>There&#8217;s still a bug in this where it has to match the URL exactly - if you look at my own installation, if you go to animejb.net instead of <a href="http://www.animejb.net" rel="nofollow">http://www.animejb.net</a> it does the same thing.  I have no idea how to fix it at the moment.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vicky</title>
		<link>http://www.animejb.net/2006/11/06/magnolia-sidebar-widget/comment-page-1#comment-365</link>
		<dc:creator>Vicky</dc:creator>
		<pubDate>Wed, 10 Jan 2007 23:04:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.animejb.net/2006/11/06/magnolia-sidebar-widget/#comment-365</guid>
		<description>I've just installed and activated this widget on Wordpress.  I've added my username, api key etc. however all I'm seeing in the sidebar is the title but none of the links.  What could I be doing wrong?  thanks.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve just installed and activated this widget on Wordpress.  I&#8217;ve added my username, api key etc. however all I&#8217;m seeing in the sidebar is the title but none of the links.  What could I be doing wrong?  thanks.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
