Merge branch 'QA_4_7'

This commit is contained in:
Michal Čihař 2017-02-20 10:08:18 +01:00
commit 5ad0c08868
2 changed files with 15 additions and 2 deletions

View File

@ -85,6 +85,7 @@ phpMyAdmin - ChangeLog
- issue #13010 Copy database: SQL error for copying PMADB metadata
- issue #13002 Fixed OpenDocument exports
- issue #13000 Align NULL values according to the column alignment
- issue #13021 Show phpMyAdmin errors even with error_reporting set to 0
4.6.6 (2017-01-23)
- issue #12759 Fix Notice regarding 'Undefined index: old_usergroup'

View File

@ -28,6 +28,11 @@ class ErrorHandler
*/
protected $hide_location = false;
/**
* Initial error reporting state
*/
protected $error_reporting = 0;
/**
* Constructor - set PHP error handler
*
@ -43,6 +48,7 @@ class ErrorHandler
if (!defined('TESTSUITE')) {
set_error_handler(array($this, 'handleError'));
}
$this->error_reporting = error_reporting();
}
/**
@ -149,8 +155,14 @@ class ErrorHandler
*/
public function handleError($errno, $errstr, $errfile, $errline)
{
// check if Error Control Operator (@) was used.
if (error_reporting() == 0) {
/**
* Check if Error Control Operator (@) was used, but still show
* user errors even in this case.
*/
if (error_reporting() == 0 &&
$this->error_reporting != 0 &&
($errno & (E_USER_WARNING | E_USER_ERROR | E_USER_NOTICE)) == 0
) {
return;
}
$this->addError($errstr, $errno, $errfile, $errline, true);