cvs: pear-core /PEAR Exception.php

From: Date: Sat, 04 Sep 2004 03:43:21 +0000
Subject: cvs: pear-core /PEAR Exception.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-cvs+get-23612@lists.php.net to get a copy of this message
cellog Fri Sep 3 23:43:21 2004 EDT Modified files: /pear-core/PEAR Exception.php Log: fix potential problem - if a single warning array is passed in, things would get flummoxed http://cvs.php.net/diff.php/pear-core/PEAR/Exception.php?r1=1.14&r2=1.15&ty=u Index: pear-core/PEAR/Exception.php diff -u pear-core/PEAR/Exception.php:1.14 pear-core/PEAR/Exception.php:1.15 --- pear-core/PEAR/Exception.php:1.14 Fri Sep 3 19:16:40 2004 +++ pear-core/PEAR/Exception.php Fri Sep 3 23:43:21 2004 @@ -19,7 +19,7 @@ // | Greg Beaver <cellog@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Exception.php,v 1.14 2004/09/03 23:16:40 cellog Exp $ +// $Id: Exception.php,v 1.15 2004/09/04 03:43:21 cellog Exp $ define('PEAR_EXCEPTION_PRINT', -2); define('PEAR_EXCEPTION_TRIGGER', -4); @@ -89,7 +89,7 @@ * * @since PHP 5 * @package PEAR - * @version $Revision: 1.14 $ + * @version $Revision: 1.15 $ * @author Tomas V.V.Cox <cox@idecnet.com> * @author Hans Lellelid <hans@velum.net> * @author Bertrand Mansion <bmansion@mamasam.com> @@ -118,6 +118,10 @@ $this->cause = null; } elseif ($p2 instanceof Exception || is_array($p2)) { $code = $p3; + if (is_array($p2) && isset($p2['message'])) { + // fix potential problem of passing in a single warning + $p2 = array($p2); + } $this->cause = $p2; } else { $code = null;

« previous php.pear.cvs (#23612) next »