svn: /web/php/trunk/ error.php manual/add-note.php manual/change.php manual-lookup.php search.php

From: Date: Sat, 12 Jun 2010 02:41:10 +0000
Subject: svn: /web/php/trunk/ error.php manual/add-note.php manual/change.php manual-lookup.php search.php
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-8350@lists.php.net to get a copy of this message
philip Sat, 12 Jun 2010 02:41:10 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=300398 Log: Fixed minor logic issues, as per E_NOTICE errors found within the logs. Changed paths: U web/php/trunk/error.php U web/php/trunk/manual/add-note.php U web/php/trunk/manual/change.php U web/php/trunk/manual-lookup.php U web/php/trunk/search.php Modified: web/php/trunk/error.php =================================================================== --- web/php/trunk/error.php 2010-06-12 02:34:33 UTC (rev 300397) +++ web/php/trunk/error.php 2010-06-12 02:41:10 UTC (rev 300398) @@ -56,6 +56,12 @@ $URI = urldecode(preg_replace("!(\\?.*$)!", "", $URI)); // ============================================================================ +// An empty URI is useless at this point, so let's give them the search page +if (empty($URI)) { + mirror_redirect("/search.php"); +} + +// ============================================================================ // Perform a redirect for manual figures, other images display a 404 automatically if (preg_match("!^manual/(\\w+)/(print|printwn)/figures/(.+)$!", $URI, $parts)) { mirror_redirect("/manual/$parts[1]/figures/$parts[3]"); Modified: web/php/trunk/manual/add-note.php =================================================================== --- web/php/trunk/manual/add-note.php 2010-06-12 02:34:33 UTC (rev 300397) +++ web/php/trunk/manual/add-note.php 2010-06-12 02:41:10 UTC (rev 300398) @@ -230,7 +230,7 @@ <ul> <li> <strong>Bugs</strong>. Instead - <a href="http://bugs.php.net/report.php?bug_type=Documentation+problem&amp;manpage=<?php echo clean($_POST['sect']); ?>">report a bug</a> + <a href="http://bugs.php.net/report.php?bug_type=Documentation+problem<?php echo isset($_POST['sect']) ? '&amp;manpage=' . clean($_POST['sect']) : ''; ?>">report a bug</a> for this manual page to the bug database. </li> <li> Modified: web/php/trunk/manual/change.php =================================================================== --- web/php/trunk/manual/change.php 2010-06-12 02:34:33 UTC (rev 300397) +++ web/php/trunk/manual/change.php 2010-06-12 02:41:10 UTC (rev 300398) @@ -1,6 +1,9 @@ <?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/" . $_GET['page']); +mirror_redirect("/manual/" . $page); ?> \ No newline at end of file Modified: web/php/trunk/manual-lookup.php =================================================================== --- web/php/trunk/manual-lookup.php 2010-06-12 02:34:33 UTC (rev 300397) +++ web/php/trunk/manual-lookup.php 2010-06-12 02:41:10 UTC (rev 300398) @@ -7,21 +7,31 @@ // BC code, so pattern and function can both be used as // parameters to specify the function name -if (empty($_GET['function']) && !empty($_GET['pattern'])) { - $_GET['function'] = $_GET['pattern']; +$function = ''; +if (empty($_GET['function'])) { + if (!empty($_GET['pattern'])) { + $function = htmlspecialchars($_GET['pattern'], ENT_QUOTES, 'UTF-8'); + } +} else { + $function = htmlspecialchars($_GET['function'], ENT_QUOTES, 'UTF-8'); } // Prepare data for search -if ($MQ) { $_GET['function'] = stripslashes($_GET['function']); } -$_GET['function'] = strtolower($_GET['function']); +if ($function) { + if ($MQ) { + $function = stripslashes($function); + } + + $function = strtolower($function); -// Try to find appropriate manual page -if ($file = find_manual_page($LANG, $_GET['function'])) { - mirror_redirect($file); + // Try to find appropriate manual page + if ($file = find_manual_page($LANG, $function)) { + mirror_redirect($file); + } } // Fall back to a quick reference search -$notfound = $_GET['function']; +$notfound = $function; include $_SERVER['DOCUMENT_ROOT'] . '/quickref.php'; ?> Modified: web/php/trunk/search.php =================================================================== --- web/php/trunk/search.php 2010-06-12 02:34:33 UTC (rev 300397) +++ web/php/trunk/search.php 2010-06-12 02:41:10 UTC (rev 300398) @@ -34,6 +34,10 @@ // 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']);

« previous php.webmaster (#8350) next »