mirror of
https://github.com/php/web-php.git
synced 2026-03-23 23:02:13 +01:00
The $Id$ keywords were used in Subversion where they can be substituted with filename, last revision number change, last changed date, and last user who changed it. In Git this functionality is different and can be done with Git attribute ident. These need to be defined manually for each file in the .gitattributes file and are afterwards replaced with 40-character hexadecimal blob object name which is based only on the particular file contents. This patch simplifies handling of $Id$ keywords by removing them since they are not used anymore.
67 lines
1.8 KiB
PHP
67 lines
1.8 KiB
PHP
<?php // vim: et
|
|
$_SERVER['BASE_PAGE'] = 'search.php';
|
|
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc';
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
$_FORM = &$_GET;
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
// If PHP added some slashes to quotes, get rid of them
|
|
if ($MQ) {
|
|
foreach ($_FORM as $name => $value) {
|
|
$_FORM[$name] = stripslashes($value);
|
|
}
|
|
}
|
|
|
|
// We received something to search for
|
|
if (!empty($_FORM['pattern'])) {
|
|
|
|
if (empty($_FORM['show'])) {
|
|
$_FORM['show'] = 'all';
|
|
}
|
|
|
|
// Never allow a comma in the show string, that would confuse our JS
|
|
$_FORM['show'] = str_replace(",", "", $_FORM['show']);
|
|
|
|
$ucp = urlencode($_FORM['pattern']);
|
|
|
|
// Do redirections for external search engines
|
|
switch ($_FORM['show']) {
|
|
case "quickref" :
|
|
case "404quickref" :
|
|
$langparam = (isset($EXPL_LANG) ? "&lang=$EXPL_LANG" : "");
|
|
mirror_redirect("/manual-lookup.php?pattern={$ucp}{$langparam}&scope={$_FORM['show']}");
|
|
break;
|
|
|
|
|
|
case "manual":
|
|
case "404manual":
|
|
mirror_redirect($MYSITE . "results.php?q={$ucp}&p={$_FORM['show']}&l=$LANG");
|
|
break;
|
|
|
|
// Covers the rest
|
|
default:
|
|
$p = urlencode($_FORM['show']);
|
|
mirror_redirect($MYSITE . "results.php?q={$ucp}&l=$LANG&p=$p");
|
|
break;
|
|
}
|
|
}
|
|
|
|
// No pattern provided, print search page
|
|
else {
|
|
|
|
// Print out common header
|
|
$link = array(
|
|
"rel" => "search",
|
|
"type" => "application/opensearchdescription+xml",
|
|
"href" => $MYSITE . "phpnetimprovedsearch.src",
|
|
"title" => "Add PHP.net search"
|
|
);
|
|
site_header("Search", array("link" => array($link), "current" => "help"));
|
|
|
|
google_cse();
|
|
site_footer();
|
|
}
|