Skip to content

Commit

Permalink
When raiseError() is passed an object, examine if message should be s…
Browse files Browse the repository at this point in the history
…kipped or not.
  • Loading branch information
convissor committed Dec 23, 2011
1 parent 24e82c6 commit 6cbc32b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions PEAR.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -487,6 +487,12 @@ function &raiseError($message = null,
$error_class = $message->getType(); $error_class = $message->getType();
$message->error_message_prefix = ''; $message->error_message_prefix = '';
$message = $message->getMessage(); $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 ( if (
Expand Down

6 comments on commit 6cbc32b

@CloCkWeRX
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Possibly a BC break :(

@convissor
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this a BC issue?

@CloCkWeRX
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@helgi
Copy link
Member

@helgi helgi commented on 6cbc32b Dec 29, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

@till
Copy link
Member

@till till commented on 6cbc32b Dec 29, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for a version check.

@convissor
Copy link
Member Author

@convissor convissor commented on 6cbc32b Dec 29, 2011 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.