cvs: phpweb / results.php
| From: | Rasmus Lerdorf | Date: | Fri, 24 Mar 2006 16:30:09 +0000 |
| Subject: | cvs: phpweb / results.php | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-31015@lists.php.net to get a copy of this message | ||
rasmus Fri Mar 24 16:30:09 2006 UTC
Modified files:
/phpweb results.php
Log:
We need that ?: operator
http://cvs.php.net/viewcvs.cgi/phpweb/results.php?r1=1.20&r2=1.21&diff_format=u
Index: phpweb/results.php
diff -u phpweb/results.php:1.20 phpweb/results.php:1.21
--- phpweb/results.php:1.20 Tue Mar 7 22:14:25 2006
+++ phpweb/results.php Fri Mar 24 16:30:08 2006
@@ -1,5 +1,5 @@
<?php
-// $Id: results.php,v 1.20 2006/03/07 22:14:25 nlopess Exp $
+// $Id: results.php,v 1.21 2006/03/24 16:30:08 rasmus Exp $
$_SERVER['BASE_PAGE'] = 'results.php';
include $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc';
#include $_SERVER['DOCUMENT_ROOT'] . '/include/loadavg.inc';
@@ -9,18 +9,19 @@
$q = stripslashes($_GET['q']); //query
$l = stripslashes($_GET['l']); // language
} else {
- $q = $_GET['q'];
- $l = $_GET['l'];
+ $q = isset($_GET['q']) ? $_GET['q'] : '';
+ $l = isset($_GET['l']) ? $_GET['l'] : 'en';
}
$q = urlencode($q);
$l = urlencode($l);
-$s = (int) $_GET['start'];
+$s = isset($_GET['start']) ? (int)$_GET['start'] : 1;
+$profile = isset($_GET['p']) ? $_GET['p'] : 'all';
$per_page = 10;
$valid_profiles = array('all', 'local', 'manual', 'news',
'bugs', 'pear', 'pecl', 'talks');
-$scope = in_array($_GET['p'], $valid_profiles) ? $_GET['p'] : 'all';
+$scope = in_array($profile, $valid_profiles) ? $profile : 'all';
$srch_host = "www.php.net";
$srch_rqst =
"/ws.php?profile=$scope&q=$q&lang=$l&results=$per_page&start=$s&mirror=".trim(substr($MYSITE,7),'/');
$url = "http://".$srch_host.$srch_rqst;