[Phpmyadmin-git] [SCM] phpMyAdmin branch, QA_3_3, updated. RELEASE_3_3_9-9-g6135612

Michal Čihař nijel at users.sourceforge.net
Thu Jan 6 09:59:59 CET 2011


The branch, QA_3_3 has been updated
       via  6135612dbb1150c6a0a6287246c8103ee637de93 (commit)
       via  6b91d2ef54d15ee56662859abaf0b4795f7293c7 (commit)
       via  9ebd401b0ea4efea8ddc8cd846da559bf420ccaa (commit)
       via  8928900532d111e849362b6359571a3b079eb9ea (commit)
      from  066b746befdacf10d87f2eaf3de8ee68f745a447 (commit)


- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 .gitignore               |    8 ++++
 error.php                |   90 ----------------------------------------------
 libraries/common.inc.php |    1 -
 libraries/core.lib.php   |   15 +++-----
 libraries/error.inc.php  |   57 +++++++++++++++++++++++++++++
 phpinfo.php              |    4 --
 themes/.gitignore        |    1 +
 7 files changed, 72 insertions(+), 104 deletions(-)
 delete mode 100644 error.php
 create mode 100644 libraries/error.inc.php

diff --git a/.gitignore b/.gitignore
index 8a1aa74..a773f8e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,5 +19,13 @@ phpmyadmin.wpj
 .settings
 .buildpath
 .cache
+.idea
 *.sw[op]
+# Locales
 locale
+# Backups
+*~
+# Javascript sources
+sources
+# API documentation
+apidoc
diff --git a/error.php b/error.php
deleted file mode 100644
index 7e86ffb..0000000
--- a/error.php
+++ /dev/null
@@ -1,90 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * phpMyAdmin fatal error display page
- *
- * @version $Id$
- * @package phpMyAdmin
- */
-
-/**
- * Input sanitizing.
- */
-require_once './libraries/sanitizing.lib.php';
-
-/* Get variables */
-if (! empty($_REQUEST['lang']) && is_string($_REQUEST['lang'])) {
-    $lang = htmlspecialchars($_REQUEST['lang']);
-} else {
-    $lang = 'en';
-}
-
-if (! empty($_REQUEST['dir']) && is_string($_REQUEST['dir'])) {
-    $dir = htmlspecialchars($_REQUEST['dir']);
-} else {
-    $dir = 'ltr';
-}
-
-if (! empty($_REQUEST['type']) && is_string($_REQUEST['type'])) {
-    $type = htmlspecialchars($_REQUEST['type']);
-} else {
-    $type = 'error';
-}
-
-// force utf-8 to avoid XSS with crafted URL and utf-7 in charset parameter
-$charset = 'utf-8';
-
-header('Content-Type: text/html; charset=' . $charset);
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $lang; ?>" dir="<?php echo $dir; ?>">
-<head>
-    <link rel="icon" href="./favicon.ico" type="image/x-icon" />
-    <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
-    <title>phpMyAdmin</title>
-    <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset; ?>" />
-    <style type="text/css">
-    <!--
-    html {
-        padding: 0;
-        margin: 0;
-    }
-    body  {
-        font-family: sans-serif;
-        font-size: small;
-        color: #000000;
-        background-color: #F5F5F5;
-        margin: 1em;
-    }
-    h1 {
-        margin: 0;
-        padding: 0.3em;
-        font-size: 1.4em;
-        font-weight: bold;
-        color: #ffffff;
-        background-color: #ff0000;
-    }
-    p {
-        margin: 0;
-        padding: 0.5em;
-        border: 0.1em solid red;
-        background-color: #ffeeee;
-    }
-    //-->
-    </style>
-</head>
-<body>
-<h1>phpMyAdmin - <?php echo $type; ?></h1>
-<p><?php
-if (!empty($_REQUEST['error'])) {
-    if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) {
-        echo PMA_sanitize(stripslashes($_REQUEST['error']));
-    } else {
-        echo PMA_sanitize($_REQUEST['error']);
-    }
-} else {
-    echo 'No error message!';
-}
-?></p>
-</body>
-</html>
diff --git a/libraries/common.inc.php b/libraries/common.inc.php
index 86416a5..dd51900 100644
--- a/libraries/common.inc.php
+++ b/libraries/common.inc.php
@@ -325,7 +325,6 @@ $goto_whitelist = array(
     'db_printview.php',
     'db_search.php',
     //'Documentation.html',
-    //'error.php',
     'export.php',
     'import.php',
     //'index.php',
diff --git a/libraries/core.lib.php b/libraries/core.lib.php
index f7f9da4..fa4f007 100644
--- a/libraries/core.lib.php
+++ b/libraries/core.lib.php
@@ -261,21 +261,18 @@ function PMA_fatalError($error_message, $message_args = null)
     $error_message = strtr($error_message, array('<br />' => '[br]'));
 
     // Displays the error message
-    // (do not use & for parameters sent by header)
-    $query_params = array(
-        'lang'  => $GLOBALS['available_languages'][$GLOBALS['lang']][2],
-        'dir'   => $GLOBALS['text_dir'],
-        'type'  => $GLOBALS['strError'],
-        'error' => $error_message,
-    );
-    header('Location: ' . (defined('PMA_SETUP') ? '../' : '') . 'error.php?'
-            . http_build_query($query_params, null, '&'));
+    $lang = $GLOBALS['available_languages'][$GLOBALS['lang']][2];
+    $dir = $GLOBALS['text_dir'];
+    $type = $GLOBALS['strError'];
+    $error = $error_message;
 
     // on fatal errors it cannot hurt to always delete the current session
     if (isset($GLOBALS['session_name']) && isset($_COOKIE[$GLOBALS['session_name']])) {
         PMA_removeCookie($GLOBALS['session_name']);
     }
 
+    require('./libraries/error.inc.php');
+
     exit;
 }
 
diff --git a/libraries/error.inc.php b/libraries/error.inc.php
new file mode 100644
index 0000000..95d8847
--- /dev/null
+++ b/libraries/error.inc.php
@@ -0,0 +1,57 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * phpMyAdmin fatal error display page
+ *
+ * @package phpMyAdmin
+ */
+
+if (! defined('PHPMYADMIN')) {
+    exit;
+}
+
+header('Content-Type: text/html; charset=utf-8');
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $lang; ?>" dir="<?php echo $dir; ?>">
+<head>
+    <link rel="icon" href="./favicon.ico" type="image/x-icon" />
+    <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
+    <title>phpMyAdmin</title>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <style type="text/css">
+    <!--
+    html {
+        padding: 0;
+        margin: 0;
+    }
+    body  {
+        font-family: sans-serif;
+        font-size: small;
+        color: #000000;
+        background-color: #F5F5F5;
+        margin: 1em;
+    }
+    h1 {
+        margin: 0;
+        padding: 0.3em;
+        font-size: 1.4em;
+        font-weight: bold;
+        color: #ffffff;
+        background-color: #ff0000;
+    }
+    p {
+        margin: 0;
+        padding: 0.5em;
+        border: 0.1em solid red;
+        background-color: #ffeeee;
+    }
+    //-->
+    </style>
+</head>
+<body>
+<h1>phpMyAdmin - <?php echo $error_header; ?></h1>
+<p><?php echo PMA_sanitize($error_message); ?></p>
+</body>
+</html>
+
diff --git a/phpinfo.php b/phpinfo.php
index 043db95..15f1818 100644
--- a/phpinfo.php
+++ b/phpinfo.php
@@ -7,10 +7,6 @@
  */
 
 /**
- * @ignore
- */
-define('PMA_MINIMUM_COMMON', true);
-/**
  * Gets core libraries and defines some variables
  */
 require_once './libraries/common.inc.php';
diff --git a/themes/.gitignore b/themes/.gitignore
index 410d2dc..5bae234 100644
--- a/themes/.gitignore
+++ b/themes/.gitignore
@@ -16,6 +16,7 @@ original_small
 paradice
 pixeline
 pmahomme
+programmersdarkside
 silk
 silkline
 smooth_yellow


hooks/post-receive
-- 
phpMyAdmin




More information about the Git mailing list