From 44ace60f77ede6081e32e516bfd52d597d3f72a6 Mon Sep 17 00:00:00 2001 From: Herman van Rink Date: Tue, 8 Feb 2011 08:15:01 -0500 Subject: [PATCH] PMASA-2011-1 fixes --- changelog.php | 18 ++++++++++++------ license.php | 11 ++++++++++- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/changelog.php b/changelog.php index 7b8c6f3ec..637efd105 100644 --- a/changelog.php +++ b/changelog.php @@ -15,13 +15,19 @@ require('./libraries/vendor_config.php'); /** * Read changelog. */ -if (substr(CHANGELOG_FILE, -3) == '.gz') { - ob_start(); - readgzfile(CHANGELOG_FILE); - $changelog = ob_get_contents(); - ob_end_clean(); +// Check if the Changelog file is available, some distributions remove these. +if (is_readable(CHANGELOG_FILE)) { + if (substr(CHANGELOG_FILE, -3) == '.gz') { + ob_start(); + readgzfile(CHANGELOG_FILE); + $changelog = ob_get_contents(); + ob_end_clean(); + } else { + $changelog = file_get_contents(CHANGELOG_FILE); + } } else { - $changelog = file_get_contents(CHANGELOG_FILE); + echo "The Changelog file is not available on this system, please visit www.phpmyadmin.net for more information."; + exit; } /** diff --git a/license.php b/license.php index 029461129..6d638781d 100644 --- a/license.php +++ b/license.php @@ -19,5 +19,14 @@ require('./libraries/vendor_config.php'); * */ header('Content-type: text/plain; charset=iso-8859-1'); -readfile(LICENSE_FILE); + +$filename = LICENSE_FILE; + +// 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."; +} + ?>