cvs: phpweb / results.php

From: Date: Tue, 28 Feb 2006 13:04:51 +0000
Subject: cvs: phpweb / results.php
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-30723@lists.php.net to get a copy of this message
nlopess Tue Feb 28 13:04:51 2006 UTC Modified files: /phpweb results.php Log: tune the regexes that rewrite the URLs. should fix the problems with non-mirrors URLs rewriting http://cvs.php.net/viewcvs.cgi/phpweb/results.php?r1=1.8&r2=1.9&diff_format=u Index: phpweb/results.php diff -u phpweb/results.php:1.8 phpweb/results.php:1.9 --- phpweb/results.php:1.8 Tue Feb 28 12:05:29 2006 +++ phpweb/results.php Tue Feb 28 13:04:50 2006 @@ -1,5 +1,5 @@ <?php -// $Id: results.php,v 1.8 2006/02/28 12:05:29 nlopess Exp $ +// $Id: results.php,v 1.9 2006/02/28 13:04:50 nlopess Exp $ $_SERVER['BASE_PAGE'] = 'results.php'; include $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; #include $_SERVER['DOCUMENT_ROOT'] . '/include/loadavg.inc'; @@ -65,12 +65,10 @@ } } - if(empty($_GET['p']) || $_GET['p'] == 'local') { - $real_url = preg_replace('!^http://[\w]+\.php\.net/(.*)$!', $MYSITE . '\\1', $hit['Url']); - } else { - $real_url = $hit['Url']; - } - $displayurl = preg_replace('!^http://(.+[^/])(/?)$!', '\\1', $hit['Url']); + // rewrite mirrors urls (\w\w\d? or www) + $real_url = preg_replace('!^http://\w{2,3}\.php\.net/(.*)$!', $MYSITE . '$1', $hit['Url']); + + $displayurl = preg_replace('!^http://(.+[^/])/?$!', '$1', $hit['Url']); $display_title = str_replace('PHP:', '', $hit['Title']); echo <<<EOB <li>

« previous php.mirrors (#30723) next »