cvs: pearweb /public_html source.php

From: Date: Wed, 15 Aug 2001 17:51:43 +0000
Subject: cvs: pearweb /public_html source.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-531@lists.php.net to get a copy of this message
mj Wed Aug 15 13:51:43 2001 EDT Modified files: /pearweb/public_html source.php Log: * added some patches by Aaron S. Hawley <Aaron.Hawley@uvm.edu> Index: pearweb/public_html/source.php diff -u pearweb/public_html/source.php:1.3 pearweb/public_html/source.php:1.4 --- pearweb/public_html/source.php:1.3 Wed Aug 15 08:56:53 2001 +++ pearweb/public_html/source.php Wed Aug 15 13:51:43 2001 @@ -1,28 +1,24 @@ <?php -// $Id: source.php,v 1.3 2001/08/15 12:56:53 mj Exp $ +// $Id: source.php,v 1.4 2001/08/15 17:51:43 mj Exp $ + $SIDEBAR_DATA=' -<P> -The syntax highlighted source is automatically generated by PHP from -the plaintext script. -</P> -<P> -If you want to see the source of this page, have a look -<A href="/source.php?url=/source.php">here</A>. -</P> +<p>The syntax highlighted source is automatically generated by PHP from +the plaintext script.</p> +<p>If you want to see the source of this page, have a look +<a href="/source.php?url=/source.php">here</a>.</p> '; response_header('Show Source'); +echo "<h2>Show Source</h2>\n"; -echo "<H2>Show Source</H2>\n"; - -if (!isset($url)) { - echo "No page URL specified."; - commonFooter(); +if (empty($url)) { + echo "<p>No page URL specified.</p>"; + response_footer(); exit; } ?> -Source of: <?php echo $url; ?><BR> +<p>Source of: <?php echo $url; ?></p> <?php @@ -31,10 +27,10 @@ $legal_dirs = array( "/manual" => 1, "/include" => 1, - "/stats" => 1); + "/stats" => 1); $dir = dirname($url); -if (isset($dir) && isset($legal_dirs[$dir])) { +if (isset($legal_dirs[$dir])) { $page_name = $DOCUMENT_ROOT . $url; } else { $page_name = basename($url); @@ -44,9 +40,11 @@ if (file_exists($page_name) && !is_dir($page_name)) { show_source($page_name); -} else if (is_dir($page_name)) { - echo "<P>No file specified. Can't show source for a directory.</P>\n"; +} else if (@is_dir($page_name)) { + echo "<p>No file specified. Can't show source for a directory.</p>\n"; +} else { + echo "<p>Invalid URL specified.</p>\n"; } response_footer(); -?> +?>

« previous php.pear.cvs (#531) next »