From 87fad589653478875ba6f86a5c5ceec805d0f8b2 Mon Sep 17 00:00:00 2001 From: Herman van Rink Date: Tue, 8 Feb 2011 07:57:34 -0500 Subject: [PATCH] PMASA-2011-1 fixes --- changelog.php | 10 +++++++++- license.php | 11 ++++++++++- readme.php | 10 +++++++++- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/changelog.php b/changelog.php index 2b0dc3ae09..1b4807aa49 100644 --- a/changelog.php +++ b/changelog.php @@ -6,7 +6,15 @@ * @version $Id$ */ -$changelog = htmlspecialchars(file_get_contents('ChangeLog')); +$filename = 'ChangeLog'; + +// Check if the file is available, some distributions remove these. +if (is_readable($filename)) { + $changelog = htmlspecialchars(file_get_contents($filename)); +} else { + echo "The $filename file is not available on this system, please visit www.phpmyadmin.net for more information."; + exit; +} $replaces = array( '@(http://[./a-zA-Z0-9.-]*[/a-zA-Z0-9])@' diff --git a/license.php b/license.php index 91927f41ae..c8c2957991 100644 --- a/license.php +++ b/license.php @@ -13,5 +13,14 @@ * */ header('Content-type: text/plain; charset=iso-8859-1'); -readfile('LICENSE'); + +$filename = 'LICENSE'; + +// Check if the file is available, some distributions remove these. +if (is_readable($filename)) { + readfile($filename); +} else { + echo "The $filename file is not available on this system, please visit www.phpmyadmin.net for more information."; +} + ?> diff --git a/readme.php b/readme.php index 34fecce0eb..7f59a4e2f3 100644 --- a/readme.php +++ b/readme.php @@ -13,5 +13,13 @@ * */ header('Content-type: text/plain; charset=utf-8'); -readfile('README'); + +$filename = 'README'; + +// Check if the file is available, some distributions remove these. +if (is_readable($filename)) { + readfile($filename); +} else { + echo "The $filename file is not available on this system, please visit www.phpmyadmin.net for more information."; +} ?>