diff --git a/libraries/Error_Handler.class.php b/libraries/Error_Handler.class.php
index b6b9bf0..609791c 100644
--- a/libraries/Error_Handler.class.php
+++ b/libraries/Error_Handler.class.php
@@ -99,8 +99,16 @@ class PMA_Error_Handler
      */
     public function handleError($errno, $errstr, $errfile, $errline)
     {
+        $this->addError($errstr, $errno, $errfile, $errline, $escape=true);
+    }
+
+    public function addError($errstr, $errno, $errfile, $errline, $escape=true)
+    {
+        if ($escape) {
+            $errstr = htmlspecialchars($errstr);
+        }
         // create error object
-        $error = new PMA_Error($errno, htmlspecialchars($errstr), $errfile, $errline);
+        $error = new PMA_Error($errno, $errstr, $errfile, $errline);
 
         // do not repeat errors
         $this->_errors[$error->getHash()] = $error;
@@ -131,6 +139,7 @@ class PMA_Error_Handler
         }
     }
 
+
     /**
      * log error to configured log facility
      *
diff --git a/libraries/core.lib.php b/libraries/core.lib.php
index 93be5fe..eb698ff 100644
--- a/libraries/core.lib.php
+++ b/libraries/core.lib.php
@@ -277,7 +277,12 @@ function PMA_warnMissingExtension($extension, $fatal = false, $extra = '')
     if ($fatal) {
         PMA_fatalError($message);
     } else {
-        trigger_error($message, E_USER_WARNING);
+        $GLOBALS['error_handler']->addError(
+            $message, 
+            E_USER_WARNING,
+            '',
+            '',
+            $escape=false);
     }
 }
 
diff --git a/test/libraries/core/PMA_warnMissingExtension_test.php b/test/libraries/core/PMA_warnMissingExtension_test.php
index 1e11c73..661e6c7 100644
--- a/test/libraries/core/PMA_warnMissingExtension_test.php
+++ b/test/libraries/core/PMA_warnMissingExtension_test.php
@@ -15,6 +15,11 @@ require_once 'libraries/core.lib.php';
 class PMA_warnMissingExtension_test extends PHPUnit_Framework_TestCase
 {
 
+    protected function setUp() {
+        require_once './libraries/Error_Handler.class.php';
+        $GLOBALS['error_handler'] = new PMA_Error_Handler();
+    }
+
     function testMissingExtention(){
         $ext = 'php_ext';
         $this->setExpectedException('PHPUnit_Framework_Error',
