Ignore:
Timestamp:
Aug 9, 2012, 2:12:23 PM (12 years ago)
Author:
mistic100
Message:

compatibility with Lightbox

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/gvideo/include/functions.inc.php

    r17383 r17488  
    193193 
    194194  return $video;
     195}
     196
     197/**
     198 * test if a download method is available
     199 * @return: bool
     200 */
     201if (!function_exists('test_remote_download'))
     202{
     203  function test_remote_download()
     204  {
     205    return function_exists('curl_init') || ini_get('allow_url_fopen');
     206  }
    195207}
    196208
     
    224236     
    225237      curl_setopt($ch, CURLOPT_URL, $src);
    226       curl_setopt($ch, CURLOPT_HEADER, 0);
     238      curl_setopt($ch, CURLOPT_HEADER, false);
    227239      curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept-language: en"));
    228240      curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)');
     
    243255      }
    244256     
    245       if (($out = curl_exec($ch)) === false)
     257      $out = curl_exec($ch);
     258      curl_close($ch);
     259     
     260      if ($out === false)
    246261      {
    247262        return 'file_error';
    248263      }
    249      
    250       curl_close($ch);
    251      
    252       if (!$return)
     264      else if (!$return)
    253265      {
    254266        fclose($newf);
Note: See TracChangeset for help on using the changeset viewer.