Commit: 41e1d8353d3e3e013effc7969b9ea92e9605626e Author: Hannes Magnusson <[email protected]> Wed, 20 Nov 2013 16:43:10 -0800 Parents: a6651e93c9ab16bc9d1e47e05dcc5c9937ffd9db Branches: master
Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=41e1d8353d3e3e013effc7969b9ea92e9605626e Log: This was cool in the 90s.. Besides, the links to source.php have been dropped Changed paths: D source.php M urlhowto.php Diff: diff --git a/source.php b/source.php deleted file mode 100644 index 2d51bcc..0000000 --- a/source.php +++ /dev/null @@ -1,72 +0,0 @@ -<?php -// $Id$ -$_SERVER['BASE_PAGE'] = 'source.php'; -include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; -$SIDEBAR_DATA = ' -<h3>Our source is open</h3> -<p> - The syntax highlighted source is automatically generated by PHP from - the plaintext script. - If you\'re interested in what\'s behind the several functions we - used, you can always take a look at the source of the following files: -</p> - -<ul class="toc"> - <li><a href="/source.php?url=/include/prepend.inc">prepend.inc</a></li> - <li><a href="/source.php?url=/include/site.inc">site.inc</a></li> - <li><a href="/source.php?url=/include/mirrors.inc">mirrors.inc</a></li> - <li><a href="/source.php?url=/include/countries.inc">countries.inc</a></li> - <li><a href="/source.php?url=/include/languages.inc">languages.inc</a></li> - <li><a href="/source.php?url=/include/langchooser.inc">langchooser.inc</a></li> - <li><a href="/source.php?url=/include/ip-to-country.inc">ip-to-country.inc</a></li> - <li><a href="/source.php?url=/include/layout.inc">layout.inc</a></li> - <li><a href="/source.php?url=/include/last_updated.inc">last_updated.inc</a></li> - <li><a href="/source.php?url=/include/shared-manual.inc">shared-manual.inc</a></li> - <li><a href="/source.php?url=/include/manual-lookup.inc">manual-lookup.inc</a></li> -</ul> - -<p> - Of course, if you want to see the <a href="/source.php?url=/source.php">source - of this page</a>, we have it available. - You can also browse the Git repository for this website on - <a href="http://git.php.net/?p=web/php.git;a=summary">git.php.net</a>. -</p> -'; -site_header("Show Source", array("current" => "community")); - -// No file param specified -if (!isset($_GET['url']) || (isset($_GET['url']) && !is_string($_GET['url']))) { - echo "<h1>No page URL specified</h1>"; - site_footer(); - exit; -} - -echo "<h1>Source of: " . htmlentities($_GET['url'], ENT_IGNORE, 'UTF-8') . "</h1>"; - -// Get dirname of the specified URL part -$dir = dirname($_GET['url']); - -// Some dir was present in the filename -if (!empty($dir) && !preg_match("!^(\\.|/)$!", $dir)) { - - // Check if the specified dir is valid - $legal_dirs = array("/manual", "/include", "/stats", "/error", "/license", "/conferences", "/archive", "/releases", "/security"); - if ((preg_match("!^/manual/!", $dir) || in_array($dir, $legal_dirs)) && - strpos($dir, "..") === FALSE) { - $page_name = $_SERVER['DOCUMENT_ROOT'] . $_GET['url']; - } else { $page_name = FALSE; } - -} else { - $page_name = $_SERVER['DOCUMENT_ROOT'] . '/' . basename($_GET['url']); -} - -// Provide some feedback based on the file found -if (!$page_name || @is_dir($page_name)) { - echo "<p>Invalid file or folder specified</p>\n"; -} elseif (file_exists($page_name)) { - highlight_php(join("", file($page_name))); -} else { - echo "<p>This file does not exist.</p>\n"; -} - -site_footer(); diff --git a/urlhowto.php b/urlhowto.php index 196bd12..abf2c49 100644 --- a/urlhowto.php +++ b/urlhowto.php @@ -181,26 +181,5 @@ function a($href) { manual page for the phpversion() function. </p> -<h1>Get it on your site</h1> - -<p> - What enables PHP.net to have this feature is a combination of some - ErrorDocument Apache settings, redirecting the browser to another page - in case of an "Error 401/3/4" and a little search script that looks up - page names or functions names in the manual corresponding to what - you searched for in <tt><?php echo $MYSITE; ?>search_for_this</tt>. - We also have a general language selection method. -</p> - -<p> - Everything behind this feature is available here: -</p> -<ul> - <li><a href="/mirroring.php">Mirroring instructions</a> (see the three ErrorDocument settings)</li> - <li><a href="/source.php?url=/include/langchooser.inc">include/langchooser.inc</a></li> - <li><a href="/source.php?url=/error.php">error.php</a></li> - <li><a href="/source.php?url=/include/manual-lookup.inc">include/manual-lookup.inc</a></li> - <li><a href="/source.php?url=/search.php">search.php</a></li> -</ul> <?php site_footer(); ?> -- PHP Webmaster List Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
