cvs: phpweb / results.php
| From: | Hannes Magnusson | Date: | Sat, 25 Aug 2007 14:46:31 +0000 |
| Subject: | cvs: phpweb / results.php | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-36290@lists.php.net to get a copy of this message | ||
bjori Sat Aug 25 14:46:31 2007 UTC
Modified files:
/phpweb results.php
Log:
- Suppress errors when fetching results
- If file_get_contents() fails, unserialize() will return false, not string
#Apparently many mirrors have error reporting enabled
http://cvs.php.net/viewvc.cgi/phpweb/results.php?r1=1.25&r2=1.26&diff_format=u
Index: phpweb/results.php
diff -u phpweb/results.php:1.25 phpweb/results.php:1.26
--- phpweb/results.php:1.25 Sun Jul 16 02:47:20 2006
+++ phpweb/results.php Sat Aug 25 14:46:30 2007
@@ -1,5 +1,5 @@
<?php
-// $Id: results.php,v 1.25 2006/07/16 02:47:20 rasmus Exp $
+// $Id: results.php,v 1.26 2007/08/25 14:46:30 bjori Exp $
$_SERVER['BASE_PAGE'] = 'results.php';
include $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc';
#include $_SERVER['DOCUMENT_ROOT'] . '/include/loadavg.inc';
@@ -29,7 +29,7 @@
$url = "http://".$srch_host.$srch_rqst;
if(function_exists('file_get_contents') && ini_get('allow_url_fopen'))
{
- $data = file_get_contents($url);
+ $data = @file_get_contents($url);
} else {
// Let's find another way
if(function_exists('curl_exec')) {
@@ -58,7 +58,7 @@
// HTTP status line is passed on, signifies an error
site_header('Search results');
-if (is_string($res)) {
+if (!is_array($res)) {
echo '<h2>Internal error, please try later</h2>';
exit;
}