[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_8-24815-g2c4e79e
Michal Čihař
nijel at users.sourceforge.net
Wed Dec 14 18:06:00 CET 2011
The branch, master has been updated
via 2c4e79edc04f566bd3ee45b35cae0f80da8f511f (commit)
from b8522b5e1af7249b1c53aa5b7b552848d72ac31c (commit)
- Log -----------------------------------------------------------------
commit 2c4e79edc04f566bd3ee45b35cae0f80da8f511f
Author: Michal Čihař <michal at cihar.com>
Date: Wed Dec 14 18:02:30 2011 +0100
Do not store too many error messages in session
In case of some bug in our code (like missing flags on fields meta in
mysql DBI), the session would explode to huge size (hundreths of
megabytes). Now we limit number of messages to store to 20 (what should
be more than enough for regular usage). Developers still should have
$GLOBALS['cfg']['Error_Handler']['gather'] enabled and will get all
errors.
-----------------------------------------------------------------------
Summary of changes:
libraries/Error_Handler.class.php | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/libraries/Error_Handler.class.php b/libraries/Error_Handler.class.php
index 8f14c08..fb3968f 100644
--- a/libraries/Error_Handler.class.php
+++ b/libraries/Error_Handler.class.php
@@ -53,6 +53,15 @@ class PMA_Error_Handler
} else {
// remember only not displayed errors
foreach ($this->_errors as $key => $error) {
+ /**
+ * We don't want to store all errors here as it would explode user
+ * session. In case you want them all set
+ * $GLOBALS['cfg']['Error_Handler']['gather'] to true
+ */
+ if (count($_SESSION['errors']) >= 20) {
+ $error = new PMA_Error(0, __('Too many error messages, some are not displayed.'), __FILE__, __LINE__);
+ $_SESSION['errors'][$error->getHash()] = $error;
+ }
if (($error instanceof PMA_Error) && ! $error->isDisplayed()) {
$_SESSION['errors'][$key] = $error;
}
hooks/post-receive
--
phpMyAdmin
More information about the Git
mailing list