diff --git a/results.php b/results.php index 1e529372c..2da87a34e 100644 --- a/results.php +++ b/results.php @@ -19,10 +19,10 @@ $l = urlencode($l); $s = (int) $_GET['start']; $per_page = 15; -$valid_profiles = array('all', 'local', 'news', 'bugs', 'pear', 'pecl', 'talks'); +$valid_profiles = array('all', 'local', 'manual', 'news', 'bugs', 'pear', 'pecl', 'talks'); $scope = in_array($_GET['p'], $valid_profiles) ? $_GET['p'] : 'all'; -$data = file_get_contents("http://www.php.net/ws.php?profile=$scope&q=$q&results=$per_page&start=$s"); +$data = file_get_contents("http://www.php.net/ws.php?profile=$scope&q=$q&lang=$l&results=$per_page&start=$s"); $res = unserialize($data); // HTTP status line is passed on, signifies an error diff --git a/ws.php b/ws.php index 0851466cf..9d5519653 100644 --- a/ws.php +++ b/ws.php @@ -8,21 +8,23 @@ $q = urlencode($raw); $r = isset($_REQUEST['results']) ? (int)$_REQUEST['results'] : 10; $s = isset($_REQUEST['start']) ? (int)$_REQUEST['start'] : 1; $l = isset($_REQUEST['lang']) ? htmlspecialchars($_REQUEST['lang']) : 'en'; -$sites = array( 'all'=>'site=php.net', - 'local'=>'site=www.php.net', - 'news'=>'site=news.php.net', - 'bugs'=>'site=bugs.php.net', - 'pear'=>'site=pear.php.net', - 'pecl'=>'site=pecl.php.net', - 'talks'=>'site=talks.php.net', +$sites = array( 'all'=>'php.net', + 'local'=>'www.php.net', + 'manual'=>'www.php.net', + 'news'=>'news.php.net', + 'bugs'=>'bugs.php.net', + 'pear'=>'pear.php.net', + 'pecl'=>'pecl.php.net', + 'talks'=>'talks.php.net', ); + if(isset($sites[$_REQUEST['profile']])) { $scope = $_REQUEST['profile']; } else { $scope = 'all'; } -$request = "{$conf['svc']}?appid={$conf['appid']}&query=$q&start=$s&results=$r&{$sites[$scope]}&language=$l&output=php"; +$request = "{$conf['svc']}?appid={$conf['appid']}&query=$q&start=$s&results=$r&site={$sites[$scope]}&language=$l&output=php"; $data = @file_get_contents($request); list($version,$status_code,$msg) = explode(' ',$http_response_header[0], 3); if($status_code==200) echo $data;