cvs: phpweb / ws.php

From: Date: Tue, 28 Feb 2006 07:36:13 +0000
Subject: cvs: phpweb / ws.php
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-30714@lists.php.net to get a copy of this message
rasmus Tue Feb 28 07:36:13 2006 UTC Modified files: /phpweb ws.php Log: Make sure profile is valid http://cvs.php.net/viewcvs.cgi/phpweb/ws.php?r1=1.1&r2=1.2&diff_format=u Index: phpweb/ws.php diff -u phpweb/ws.php:1.1 phpweb/ws.php:1.2 --- phpweb/ws.php:1.1 Tue Feb 28 00:50:12 2006 +++ phpweb/ws.php Tue Feb 28 07:36:13 2006 @@ -7,13 +7,18 @@ $r = isset($_REQUEST['results']) ? (int)$_REQUEST['results'] : 10; $s = isset($_REQUEST['start']) ? (int)$_REQUEST['start'] : 1; $l = isset($_REQUEST['lang']) ? htmlspecialchars($_REQUEST['lang']) : 'en'; -$p = isset($_REQUEST['profile']) ? htmlspecialchars($_REQUEST['profile']) : 'all'; $sites = array( 'all'=>'site=php.net', 'local'=>'site=www.php.net', 'news'=>'site=news.php.net'); -$request = "{$conf['svc']}?appid={$conf['appid']}&query=$q&start=$s&results=$r&{$sites[$p]}&language=$l&output=php"; +if(isset($sites[$_REQUEST['profile']])) $p = $sites[$_REQUEST['profile']]; +else $p = $sites['all']; + +$request = "{$conf['svc']}?appid={$conf['appid']}&query=$q&start=$s&results=$r&{$p}&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; else echo serialize($http_response_header[0]); +$fp = fopen("/tmp/ws.log","a"); +fputs($fp,"$request\n"); +fclose($fp); ?>

« previous php.mirrors (#30714) next »