forked from php/web-php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
manual-lookup.php
41 lines (34 loc) · 1.18 KB
/
manual-lookup.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
// $Id$
$_SERVER['BASE_PAGE'] = 'manual-lookup.php';
include $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc';
include $_SERVER['DOCUMENT_ROOT'] . '/include/loadavg.inc';
include $_SERVER['DOCUMENT_ROOT'] . '/include/manual-lookup.inc';
// BC code, so pattern and function can both be used as
// parameters to specify the function name
$function = '';
if (!empty($_GET['function']) && is_string($_GET['function'])) {
$function = htmlspecialchars($_GET['function'], ENT_QUOTES, 'UTF-8');
} elseif (!empty($_GET['pattern']) && is_string($_GET['pattern'])) {
$function = htmlspecialchars($_GET['pattern'], ENT_QUOTES, 'UTF-8');
}
if(!empty($_GET['scope']) && is_string($_GET['scope'])) {
$scope = htmlspecialchars($_GET['scope'], ENT_QUOTES, 'UTF-8');
} else {
$scope = '';
}
// Prepare data for search
if ($function) {
if ($MQ) {
$function = stripslashes($function);
}
$function = strtolower($function);
// Try to find appropriate manual page
if ($file = find_manual_page($LANG, $function)) {
mirror_redirect($file);
}
}
// Fall back to a quick reference search
$notfound = $function;
include $_SERVER['DOCUMENT_ROOT'] . '/quickref.php';
?>