1
0
mirror of https://github.com/php/web-php.git synced 2026-03-23 23:02:13 +01:00

fix two typos that prevented the search in a specific language to work

tune the regexes, so that the mirror specific part isnt shown
This commit is contained in:
Nuno Lopes
2006-02-28 16:30:04 +00:00
parent bd3f68a8c2
commit d8f2555365
2 changed files with 4 additions and 4 deletions

View File

@@ -7,7 +7,7 @@ include $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc';
// Prepare data for search
if ($MQ) {
$q = stripslashes($_GET['q']); //query
$l = stripslashes($GET['l']); // language
$l = stripslashes($_GET['l']); // language
} else {
$q = $_GET['q'];
$l = $_GET['l'];
@@ -66,9 +66,9 @@ foreach($res['ResultSet']['Result'] as $i => $hit) {
}
// rewrite mirrors urls (\w\w\d? or www)
$real_url = preg_replace('!^http://\w{2,3}\.php\.net/(.*)$!', $MYSITE . '$1', $hit['Url']);
$real_url = preg_replace('!^http://\w{2,3}\.php\.net(.*)$!', '$1', $hit['Url']);
$displayurl = preg_replace('!^http://(.+[^/])/?$!', '$1', $hit['Url']);
$displayurl = preg_replace('!^http://(?:\w{2,3}\.)?(.+[^/])/?$!', '$1', $hit['Url']);
$display_title = str_replace('PHP:', '', $hit['Title']);
echo <<<EOB
<li>

View File

@@ -75,7 +75,7 @@ if (!empty($_FORM['pattern'])) {
}
case "manual":
mirror_redirect($MYSITE . "results.php?q={$ucp}&p=manual&lang=$LANG");
mirror_redirect($MYSITE . "results.php?q={$ucp}&p=manual&l=$LANG");
break;
case "news_archive":