cURLing Also LJ Avatar // VOID-STAR.NET

100% cheshire.

cURLing Also LJ Avatar

One of the plugins I use here at β is Also LJ Avatar. Essentially, it allows users to have their LJ/IJ/DJ/etc. userpics when commenting instead of their Gravatar, as per the WordPress default. It’s a cool plugin.

However, it uses file_get_contents(); an insecure include method which is disabled by many hosts (including mine).

Luckily, it’s easy pie to replace this function call with cURL; something which is generally not disallowed. To do so, hit up line 104 in also-lj-avatar.php:

104
$userinfo = file_get_contents($url);

And replace it with:

104
105
106
107
108
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_URL, $url);
  $userinfo = curl_exec($ch);
  curl_close($ch);

Easy.

153 words posted 597 days ago at 9:26 am.

Tell Dee what you think?

Filed under WordPress and tagged with , , .

Crossposted to dee.dreamwidth.org, loqia.insanejournal.com, loqia.journalfen.net.

Related posts...


Add a Comment

Add a Comment

A legitimate email address or OpenID-enabled URL (e.g. your Dreamwidth journal) is required. Links to LiveJournal accounts will be removed due to malware on that site. First-time comments are both welcome and moderated. Some HTML is allowed. There is no free speech.