[Plugin: Pretty Link] Workaround for CURLOPT_FOLLOWLOCATION error
-
The CURLOPT_FOLLOWLOCATION option was causing an error to display because of how MediaTemple is locking things down. Added a clause to use file_get_contents() with an URL wrapper if they’re enabled. Thought I’d suggest it as an option.
In PrliUrlUtils.php:
function curl_read_remote_file($url) { if(ini_get('allow_url_fopen')) { $data = file_get_contents($url); return $data; } else if(function_exists('curl_init')) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $data = curl_exec($ch); curl_close($ch); return $data; } return false; }
- The topic ‘[Plugin: Pretty Link] Workaround for CURLOPT_FOLLOWLOCATION error’ is closed to new replies.