diff --git a/changelog.php b/changelog.php index 9ab2e399a..ad45e6282 100644 --- a/changelog.php +++ b/changelog.php @@ -7,20 +7,30 @@ */ /** - * Load paths. + * Gets core libraries and defines some variables */ -require('./libraries/vendor_config.php'); +require_once './libraries/common.inc.php'; + +$filename = CHANGELOG_FILE; /** * Read changelog. */ -if (substr(CHANGELOG_FILE, -3) == '.gz') { - ob_start(); - readgzfile(CHANGELOG_FILE); - $changelog = ob_get_contents(); - ob_end_clean(); +// Check if the file is available, some distributions remove these. +if (is_readable($filename)) { + + // Test if the if is in a compressed format + if (substr($filename, -3) == '.gz') { + ob_start(); + readgzfile($filename); + $changelog = ob_get_contents(); + ob_end_clean(); + } else { + $changelog = file_get_contents($filename); + } } else { - $changelog = file_get_contents(CHANGELOG_FILE); + printf(__('The %s file is not available on this system, please visit www.phpmyadmin.net for more information.'), $filename); + exit; } /** diff --git a/license.php b/license.php index b4b394f57..851b52c0c 100644 --- a/license.php +++ b/license.php @@ -10,13 +10,22 @@ */ /** - * Load paths. + * Gets core libraries and defines some variables */ -require('./libraries/vendor_config.php'); +require_once './libraries/common.inc.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 { + printf(__('The %s file is not available on this system, please visit www.phpmyadmin.net for more information.'), $filename); +} + ?>