Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohamed Ashraf <mohamed.ashraf.213@gmail.com>2013-06-24 17:38:13 +0400
committerMohamed Ashraf <mohamed.ashraf.213@gmail.com>2013-06-24 17:38:13 +0400
commit3541a6d2b59fcfaedf8250016afd84321211f3b9 (patch)
treec4114eda2b73605c9e281df5308561e802b374c9 /js/get_scripts.js.php
parent3b9fad42e09abc62442bdf63675f03d8acd7fce5 (diff)
error reporting now respects settings
Diffstat (limited to 'js/get_scripts.js.php')
-rw-r--r--js/get_scripts.js.php21
1 files changed, 19 insertions, 2 deletions
diff --git a/js/get_scripts.js.php b/js/get_scripts.js.php
index 564fda7dd2..ed263896bc 100644
--- a/js/get_scripts.js.php
+++ b/js/get_scripts.js.php
@@ -6,17 +6,26 @@
*
* @package PhpMyAdmin
*/
+
chdir('..');
+// Avoid loading the full common.inc.php because this would add many
+// non-js-compatible stuff like DOCTYPE
+define('PMA_MINIMUM_COMMON', true);
+require_once './libraries/common.inc.php';
+// Close session early as we won't write anything there
+session_write_close();
+
// Send correct type
header('Content-Type: text/javascript; charset=UTF-8');
// Enable browser cache for 1 hour
-header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 3600) . ' GMT');
+header('Expires: ' . gmdate('D, d M Y H:i:s', time() - 3600) . ' GMT');
if (! empty($_GET['scripts']) && is_array($_GET['scripts'])) {
foreach ($_GET['scripts'] as $script) {
// Sanitise filename
$script_name = 'js';
+
$path = explode("/", $script);
foreach ($path as $index => $filename) {
if (! preg_match("@^\.+$@", $filename)
@@ -27,6 +36,15 @@ if (! empty($_GET['scripts']) && is_array($_GET['scripts'])) {
$script_name .= DIRECTORY_SEPARATOR . $filename;
}
}
+ // if error reporting is enabled serve the unminified files
+ if($GLOBALS['cfg']['ErrorReporting']) {
+ $unminified = "sources" . DIRECTORY_SEPARATOR . $script_name;
+ // only serve the unminified files if they exist
+ if (is_readable($unminified)) {
+ $script_name = $unminified;
+ }
+ }
+
// Output file contents
if (preg_match("@\.js$@", $script_name) && is_readable($script_name)) {
readfile($script_name);
@@ -34,5 +52,4 @@ if (! empty($_GET['scripts']) && is_array($_GET['scripts'])) {
}
}
}
-
?>