Is there a way we could do this without using allow_url_fopen? they've got it turned off on my servers.

CommentFileSizeAuthor
#2 picasa_allow_url_fopen.txt1.09 KBcyberswat

Comments

cyberswat’s picture

Assigned: Unassigned » cyberswat

I'll check into it and see what workarounds are available ... Thanks

cyberswat’s picture

StatusFileSize
new1.09 KB

Try this ... replace line 226
$contents = file_get_contents($loc);

with the following

  $tryCurl = 0;
  if(ini_get('allow_url_fopen') != 1) {
    @ini_set('allow_url_fopen', '1');
  }
  if(ini_get('allow_url_fopen') != 1) {
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL,$loc);
    curl_setopt($ch, CURLOPT_FAILONERROR, 1);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
    curl_setopt($ch, CURLOPT_TIMEOUT, 3);
    $contents = curl_exec($ch);
    curl_close($ch);
  } else {
    $contents = file_get_contents($loc);
  }

Or simply run the attached patch.

cyberswat’s picture

Status: Active » Needs review
Anthony Gettig’s picture

For what it's worth, this patch worked like a charm for me. Thanks a ton!

pedrofaria’s picture

//$contents = file_get_contents($loc);
$rs = drupal_http_request($loc);
$contents = $rs->data;

its more easy to change for it...

use drupal schema!

cya!

cyberswat’s picture

very nice ... I knew there had to be an easier Drupal correct way of doing this. Thanks!

mabunixda’s picture

Thanks for the patch! you made my day :)

RingoDS’s picture

Can a new release be made with the above patch applied? It's december now and I still had to apply the patch myself.

cyberswat’s picture

Status: Needs review » Closed (fixed)

FIxed in 5.x-3.1