Permalink
Browse files

fix PEAR2_Exception if non-string is passed in, remove Phar if it exi…

…sts when creating it
  • Loading branch information...
1 parent 5ee8ab0 commit 15764a514dfa3e684297d58d822e26a8e8d4f8a8 @cellog cellog committed Oct 7, 2007
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/Exception.php
View
@@ -134,7 +134,7 @@ public function __construct($message, $p2 = null, $p3 = null)
} elseif (is_object($p2) || is_array($p2)) {
if (!is_array($p2) && !($p2 instanceof Exception)) {
if (!($p2 instanceof PEAR2_MultiErrors)) {
- throw new PEAR2_Exception('exception cause must be Exception, ' .
+ throw new Exception('exception cause must be Exception, ' .
'array, or PEAR2_MultiErrors');
}
}
@@ -144,6 +144,9 @@ public function __construct($message, $p2 = null, $p3 = null)
$code = null;
$this->cause = null;
}
+ if (!is_string($message)) {
+ throw new Exception('exception message must be a string, was ' . gettype($message));
+ }
parent::__construct($message, $code);
$this->signal();
}

0 comments on commit 15764a5

Please sign in to comment.