cvs: phpweb / search.php

From: Date: Thu, 24 Oct 2002 13:51:55 +0000
Subject: cvs: phpweb / search.php
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-13214@lists.php.net to get a copy of this message
sander Thu Oct 24 09:51:55 2002 EDT Modified files: /phpweb search.php Log: Fix referer detection - only allow .php.net domains - fixes #20055 # Note: untested except for php -l Index: phpweb/search.php diff -u phpweb/search.php:1.34 phpweb/search.php:1.35 --- phpweb/search.php:1.34 Thu Sep 26 13:55:58 2002 +++ phpweb/search.php Thu Oct 24 09:51:54 2002 @@ -135,9 +135,10 @@ $form="http://www.php.net/search.php"; } if (!isset($base)) { - if (ereg("^(.+//[^/]+)/",$HTTP_REFERER,$reg)) { - $base=$reg[1]; + if (eregi("^http://([^.]+)\.php\.net/", $HTTP_REFERER, $matches) && !in_array($matches[1], array('bonsai', 'bugs', 'conf', 'cvs', 'gtk', 'lxr', 'master', 'news', 'pear', 'qa', 'smarty', 'snaps'))) { + $base = "http://{$matches[1]}.php.net"; } + unset($matches); if ($base == $MYSITE) { $base = "-"; }

« previous php.mirrors (#13214) next »