Exemplo n.º 1
0
// ============================================================================
// Try to find the page using the preferred language as a manual page
include_once $_SERVER['DOCUMENT_ROOT'] . "/include/manual-lookup.inc";
$try = find_manual_page($LANG, $URI);
if ($try) {
    status_header(200);
    include_once $_SERVER['DOCUMENT_ROOT'] . $try;
    exit;
}
// BC. The class methods are now classname.methodname
if (preg_match("!^manual/(.+)/function\\.(.+)-(.+).php\$!", $URI, $array)) {
    $try = find_manual_page($array[1], $array[2] . "." . $array[3]);
    if ($try) {
        status_header(301);
        mirror_redirect($try);
        exit;
    }
}
// ============================================================================
// 404 page for manual pages (eg. not built language)
if (strpos($URI, "manual/") === 0) {
    error_404_manual();
}
// ============================================================================
// If no match was found till this point, the last action is to start a
// search with the URI the user typed in
$fallback = myphpnet_urlsearch() === MYPHPNET_URL_MANUAL ? "404manual" : "404quickref";
mirror_redirect('/search.php?show=' . $fallback . '&lang=' . urlencode($LANG) . '&pattern=' . substr($_SERVER['REQUEST_URI'], 1));
/*
 * vim: set et ts=4 sw=4 ft=php: :
 */
Exemplo n.º 2
0
/*
 This page is either directly called from the browser, in
 which case it will always show the full list of "functions"
 in the user's preferred language version of the PHP
 documentation.
 In other cases this file is included from manual-lookup.php,
 which sets $notfound, so we know what function to search for,
 and display results for that search.
*/
// Ensure that our environment is set up
$_SERVER['BASE_PAGE'] = 'quickref.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc';
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/errors.inc';
include $_SERVER['DOCUMENT_ROOT'] . '/include/results.inc';
if (empty($notfound)) {
    mirror_redirect("/search.php");
}
// Print out the table of found (or all) functions. The HTML comments are
// needed to support MyCroft search (Mozilla browser family and Sherlock for MacOSX)
function quickref_table($functions, $sort = true)
{
    global $LANG;
    $funcs = "<!-- result list start -->\n";
    $funcs .= "<ul id=\"quickref_functions\">\n";
    // Prepare the data
    if ($sort) {
        asort($functions);
    }
    // Print out all rows
    foreach ($functions as $file => $name) {
        $funcs .= "<li><a href=\"/manual/{$LANG}/{$file}\">{$name}</a></li>\n";
Exemplo n.º 3
0
<?php

// $Id$
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc';
$page = isset($_GET['page']) ? htmlspecialchars($_GET['page'], ENT_QUOTES, 'UTF-8') : '';
// Redirect to new manual page
mirror_redirect("/manual/" . $page);
Exemplo n.º 4
0
    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
        // Covers the rest
        default:
            $p = urlencode($_FORM['show']);
            mirror_redirect($MYSITE . "results.php?q={$ucp}&l={$LANG}&p={$p}");
            break;
    }
} 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();
}
Exemplo n.º 5
0
<?php

// $Id$
$_SERVER['BASE_PAGE'] = 'security/index.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc';
if (!isset($_COOKIE["MAGIC_COOKIE"])) {
    mirror_redirect("/manual/security");
    exit;
}
$SIDEBAR_DATA = <<<EOT
<br />
<div id="securitySidebar">
 <h3><a href="/security/">Security Center?</a></h3>
 <p>In an effort to make security related information more readily available, the PHP Security Response Team created a new Security Center on March 1st, 2007. The Security Center will serve as the central location where interested parties can find information about security threats, fixes and/or workarounds and any other related meterial.</p>

 <h3>Security related books</h3>
 <ul>
  <li><a href="http://www.amazon.com/exec/obidos/ASIN/0973862106/">Guide to PHP Security</a></li>
  <li><a href="http://www.amazon.com/exec/obidos/ASIN/059600656X/">Essential PHP Security</a></li>
 </ul>

 <h3>Other links</h3>
 <ul>
  <li><a href="http://php.net/manual/security">PHP manual on security</a></li>
  <li><a href="http://www.suhosin.org">Suhosin</a></li>
  <li><a href="http://phpsec.org/projects/guide/">PHP Security Consortium</a></li>
 </ul>
</div>
EOT;
site_header("PHP Security center");
echo "<h1>PHP Security Center</h1>\n";
Exemplo n.º 6
0
$_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';
Exemplo n.º 7
0
<?php

// $Id$
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc';
// We only support English right now
$LANG = "en";
mirror_redirect("/manual/{$LANG}/index.php");
Exemplo n.º 8
0
<?php

// $Id$
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc';
$i = 0;
do {
    $y = date("Y") - $i;
    if (file_exists("./{$y}.php")) {
        mirror_redirect("/archive/{$y}.php");
        break;
    }
} while (++$i < 3);
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/errors.inc';
error_noservice();