From d7ffee57e1d1e3499ee3f9163f4967d8b08e8066 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sun, 11 Oct 2009 12:27:21 +0000 Subject: [PATCH] [core] Removed context from the error handler --- ChangeLog | 1 + libraries/Error.class.php | 24 +----------------------- libraries/Error_Handler.class.php | 8 +++++--- 3 files changed, 7 insertions(+), 26 deletions(-) diff --git a/ChangeLog b/ChangeLog index a306c864c..df189a1eb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -42,6 +42,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA thanks to Derek Schaefer - drummingds1 + [lang] Turkish update, thanks to Burak Yavuz + [auth] Add custom port configuration in signon, thanks to Gary Smith +- [core] Removed context from the error handler 3.2.3.0 (not yet released) - patch #2856664 [export] Date, time, and datetime column types now export correctly to diff --git a/libraries/Error.class.php b/libraries/Error.class.php index e1112e170..849287e43 100644 --- a/libraries/Error.class.php +++ b/libraries/Error.class.php @@ -77,14 +77,6 @@ class PMA_Error extends PMA_Message */ protected $_line = 0; - /** - * Holds any variables defined in the context where the error occured - * f. e. $this if the error occured in an object method - * - * @var array - */ - protected $_context = array(); - /** * Holds the backtrace for this error * @@ -107,21 +99,18 @@ class PMA_Error extends PMA_Message * @uses PMA_Error::setMessage() * @uses PMA_Error::setFile() * @uses PMA_Error::setLine() - * @uses PMA_Error::setContext() * @uses PMA_Error::setBacktrace() * @param integer $errno * @param string $errstr * @param string $errfile * @param integer $errline - * @param array $errcontext */ - public function __construct($errno, $errstr, $errfile, $errline, $errcontext) + public function __construct($errno, $errstr, $errfile, $errline) { $this->setNumber($errno); $this->setMessage($errstr, false); $this->setFile($errfile); $this->setLine($errline); - $this->setContext($errcontext); $backtrace = debug_backtrace(); // remove last two calls: debug_backtrace() and handleError() @@ -142,17 +131,6 @@ class PMA_Error extends PMA_Message $this->_backtrace = $backtrace; } - /** - * sets PMA_Error::$_context - * - * @uses PMA_Error::$_context to set it - * @param array $context - */ - public function setContext($context) - { - $this->_context = $context; - } - /** * sets PMA_Error::$_line * diff --git a/libraries/Error_Handler.class.php b/libraries/Error_Handler.class.php index d311fdd76..fab7a3986 100644 --- a/libraries/Error_Handler.class.php +++ b/libraries/Error_Handler.class.php @@ -88,6 +88,9 @@ class PMA_Error_Handler * E_COMPILE_WARNING, * and most of E_STRICT raised in the file where set_error_handler() is called. * + * Do not use the context parameter as we want to avoid storing the + * complete $GLOBALS inside $_SESSION['errors'] + * * @uses E_USER_NOTICE * @uses E_USER_WARNING * @uses E_STRICT @@ -110,12 +113,11 @@ class PMA_Error_Handler * @param string $errstr * @param string $errfile * @param integer $errline - * @param array $errcontext */ - public function handleError($errno, $errstr, $errfile, $errline, $errcontext) + public function handleError($errno, $errstr, $errfile, $errline) { // create error object - $error = new PMA_Error($errno, $errstr, $errfile, $errline, $errcontext); + $error = new PMA_Error($errno, $errstr, $errfile, $errline); // do not repeat errors $this->_errors[$error->getHash()] = $error;