cvs: phpweb / source.php
| From: | Gabor Hojtsy | Date: | Wed, 06 Sep 2006 21:20:45 +0000 |
| Subject: | cvs: phpweb / source.php | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-32360@lists.php.net to get a copy of this message | ||
goba Wed Sep 6 21:20:45 2006 UTC
Modified files:
/phpweb source.php
Log:
remove silly array handling and some rewording
http://cvs.php.net/viewvc.cgi/phpweb/source.php?r1=1.24&r2=1.25&diff_format=u
Index: phpweb/source.php
diff -u phpweb/source.php:1.24 phpweb/source.php:1.25
--- phpweb/source.php:1.24 Sat May 21 15:43:29 2005
+++ phpweb/source.php Wed Sep 6 21:20:45 2006
@@ -1,20 +1,17 @@
<?php
-// $Id: source.php,v 1.24 2005/05/21 15:43:29 rasmus Exp $
+// $Id: source.php,v 1.25 2006/09/06 21:20:45 goba Exp $
$_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.
-</p>
-
-<p>
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="simple">
+<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>
@@ -29,13 +26,12 @@
</ul>
<p>
- Of course, if you want to see the source of this page, have a look
- <a href="/source.php?url=/source.php">here</a>.
- You can also browse the cvs repository for this website on
- <a href="http://cvs.php.net/cvs.php/phpweb/">cvs.php.net</a>.
+ Of course, if you want to see the <a href="/source.php?url=/source.php">source
+ of this page, we have it available.
+ You can also browse the CVS repository for this website on
+ <a href="http://cvs.php.net/viewvc.cgi/phpweb/">cvs.php.net</a>.
</p>
';
-
site_header("Show Source");
// No file param specified
@@ -54,16 +50,12 @@
if (!empty($dir) && !preg_match("!^(\\.|/)$!", $dir)) {
// Check if the specified dir is valid
- $legal_dirs = array(
- "/manual" => 1,
- "/include" => 1,
- "/stats" => 1,
- "/error" => 1,
- "/license" => 1
- );
- if ((preg_match("!^/manual/!", $dir) || isset($legal_dirs[$dir])) &&
strpos($dir, "..") === FALSE) {
+ $legal_dirs = array("/manual", "/include", "/stats",
"/error", "/license");
+ 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']);
}
@@ -78,5 +70,3 @@
}
site_footer();
-
-?>