cvs: phpweb /include site.inc

From: Date: Sat, 07 Jun 2008 19:13:17 +0000
Subject: cvs: phpweb /include site.inc
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-1887@lists.php.net to get a copy of this message
philip Sat Jun 7 19:13:17 2008 UTC Modified files: /phpweb/include site.inc Log: fix http://cvs.php.net/viewvc.cgi/phpweb/include/site.inc?r1=1.260&r2=1.261&diff_format=u Index: phpweb/include/site.inc diff -u phpweb/include/site.inc:1.260 phpweb/include/site.inc:1.261 --- phpweb/include/site.inc:1.260 Sat Jun 7 10:29:45 2008 +++ phpweb/include/site.inc Sat Jun 7 19:13:17 2008 @@ -1,6 +1,6 @@ <?php // -*- C++ -*- -// $Id: site.inc,v 1.260 2008/06/07 10:29:45 bjori Exp $ +// $Id: site.inc,v 1.261 2008/06/07 19:13:17 philip Exp $ // Define $MIRRORS array, and some constants include $_SERVER['DOCUMENT_ROOT'] . '/include/mirrors.inc'; @@ -182,12 +182,16 @@ $opts = array('user_agent' => 'php.net'); if (version_compare(PHP_VERSION, '5.1.0', '>')) { - $context = stream_context_get_defaul(array('http' => $opts)); + $context = stream_context_get_default(array('http' => $opts)); } elseif (version_compare(PHP_VERSION, '5.0.0', '>')) { $context = stream_context_create(array('http' => $opts)); } - $data = @file_get_contents($url, false, $context); + if ($context) { + $data = @file_get_contents($url, false, $context); + } else { + $data = @file_get_contents($url, false); + } if ($headers) { return $http_response_header;

« previous php.webmaster (#1887) next »