Permalink
Browse files

When raiseError() is passed an object, examine if message should be s…

…kipped or not.
  • Loading branch information...
1 parent 24e82c6 commit 6cbc32b6cf79094fb267621ed2090567eca41bd4 @convissor convissor committed Dec 23, 2011
Showing with 6 additions and 0 deletions.
  1. +6 −0 PEAR.php
View
@@ -487,6 +487,12 @@ function &raiseError($message = null,
$error_class = $message->getType();
$message->error_message_prefix = '';
$message = $message->getMessage();
+
+ // Make sure right data gets passed.
+ $r = new ReflectionClass($error_class);
+ $c = $r->getConstructor();
+ $p = array_shift($c->getParameters());
+ $skipmsg = ($p->getName() != 'message');
}
if (

6 comments on commit 6cbc32b

Owner

CloCkWeRX commented on 6cbc32b Dec 24, 2011

http://au2.php.net/ReflectionClass
ReflectionClass class
(PHP 5)

Possibly a BC break :(

Owner

convissor replied Dec 25, 2011

How is this a BC issue?

Owner

CloCkWeRX replied Dec 26, 2011

It shouldn't work at all in PHP < 5.0.0 because of ReflectionClass. The minimum dep is PHP 4.4.0 for the PEAR package.

Owner

helgi replied Dec 29, 2011

@convissor This is a major BC break due to PEAR being 4.4+ and not 5+. You either need to wrap this in a PHP version check or remove it.

Owner

till replied Dec 29, 2011

+1 for a version check.

Owner

convissor replied Dec 29, 2011

Please sign in to comment.