Quellcode durchsuchen

ZF-8547
- Altered previous exception support to enforce integer as code in 5.3 and 5.2 support

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@19843 44c647ce-9c0f-0410-b52a-842ac1e357ba

ralph vor 16 Jahren
Ursprung
Commit
4f52d6ef6c
1 geänderte Dateien mit 8 neuen und 1 gelöschten Zeilen
  1. 8 1
      library/Zend/Exception.php

+ 8 - 1
library/Zend/Exception.php

@@ -42,7 +42,7 @@ if (version_compare(PHP_VERSION, '5.3.0', '<')) {
          */
         public function __construct($msg = '', $code = 0, Exception $previous = null)
         {
-            parent::__construct($msg, $code);
+            parent::__construct($msg, (int) $code);
             $this->_previous = $previous;
         }
 
@@ -80,5 +80,12 @@ if (version_compare(PHP_VERSION, '5.3.0', '<')) {
      */
     class Zend_Exception extends Exception
     {
+        public function __construct($msg = '', $code = 0, Exception $previous = null)
+        {
+            if (!is_int($code)) {
+                $code = (int) $code;
+            }
+            parent::__construct($msg, $code, $previous);
+        }
     }
 }