svn: /pear/pear-core/ tags/PEAR-1.9.5/PEAR.php tags/PEAR-1.9.5/package.xml tags/PEAR-1.9.5/package2.xml trunk/PEAR.php trunk/tests/PEAR/bug18656.phpt

[email protected] (Helgi Þormar Þorbjörnsson) Fri, 08 Jul 2011 23:58:23 +0000
Newsgroups php.pear.cvs,php.pear.core
Message-ID <[email protected]>
--7023963a5fbd53c5663ac7d14c0a49fa8fd21626
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

dufuz                                    Fri, 08 Jul 2011 23:58:23 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=313083

Log:
Fixed Bug #18656: E_WARNING errors from is_a() usage in PEAR::isError on PHP 5.4+ [dufuz]

Bug: http://pear.php.net/bugs/18656 (unknown) 
      
Changed paths:
    U   pear/pear-core/tags/PEAR-1.9.5/PEAR.php
    U   pear/pear-core/tags/PEAR-1.9.5/package.xml
    U   pear/pear-core/tags/PEAR-1.9.5/package2.xml
    U   pear/pear-core/trunk/PEAR.php
    A   pear/pear-core/trunk/tests/PEAR/bug18656.phpt

Modified: pear/pear-core/tags/PEAR-1.9.5/PEAR.php
===================================================================
--- pear/pear-core/tags/PEAR-1.9.5/PEAR.php	2011-07-08 23:58:05 UTC (rev 313082)
+++ pear/pear-core/tags/PEAR-1.9.5/PEAR.php	2011-07-08 23:58:23 UTC (rev 313083)
@@ -249,7 +249,7 @@
      */
     function isError($data, $code = null)
     {
-        if (!is_a($data, 'PEAR_Error')) {
+        if (!is_object || !is_a($data, 'PEAR_Error')) {
             return false;
         }


Modified: pear/pear-core/tags/PEAR-1.9.5/package.xml
===================================================================
--- pear/pear-core/tags/PEAR-1.9.5/package.xml	2011-07-08 23:58:05 UTC (rev 313082)
+++ pear/pear-core/tags/PEAR-1.9.5/package.xml	2011-07-08 23:58:23 UTC (rev 313083)
@@ -86,21 +86,13 @@
   </maintainer>
   </maintainers>
  <release>
-  <version>1.9.4</version>
+  <version>1.9.5</version>
   <date>2011-07-06</date>
   <license>New BSD License</license>
   <state>stable</state>
   <notes>
   Bug Fixes:
-  * Bug #17350: "pear install --force" doesn't uninstall files from previous pkg versions [dufuz]
-  * Bug #18362: A whitespace TEMP_DIR path breaks install/upgrade functionality [dufuz]
-  * Bug #18440: bad tmp folder path on install : Unable to create path for C:/Program/tmp [dufuz]
-  * Bug #18581: "config-get -c" not returning channel's configuration when using alias [dufuz]
-  * Bug #18639: regression: installing xdebug fails most likely due to another fix [dufuz]
-
-  Features
-  * All System (the class) functions can now take in spaced paths as long as they are surrounded in quotes.
-    Prior to this it was possible to do that by passing all values in as an array (by product of #18362, #18440) [dufuz]
+  * Bug #18656: E_WARNING errors from is_a() usage in PEAR::isError on PHP 5.4+ [dufuz]
   </notes>
   <deps>
    <dep type="php" rel="ge" version="4.4.0"/>
@@ -695,5 +687,23 @@
     of their pecl package but rather in a sub directory, such as xhprof. [dufuz]
   </notes>
    </release>
+    <release>
+  <version>1.9.4</version>
+  <date>2011-07-06</date>
+  <license>New BSD License</license>
+  <state>stable</state>
+  <notes>
+  Bug Fixes:
+  * Bug #17350: "pear install --force" doesn't uninstall files from previous pkg versions [dufuz]
+  * Bug #18362: A whitespace TEMP_DIR path breaks install/upgrade functionality [dufuz]
+  * Bug #18440: bad tmp folder path on install : Unable to create path for C:/Program/tmp [dufuz]
+  * Bug #18581: "config-get -c" not returning channel's configuration when using alias [dufuz]
+  * Bug #18639: regression: installing xdebug fails most likely due to another fix [dufuz]
+
+  Features
+  * All System (the class) functions can now take in spaced paths as long as they are surrounded in quotes.
+    Prior to this it was possible to do that by passing all values in as an array (by product of #18362, #18440) [dufuz]
+  </notes>
+    </release>
  </changelog>
 </package>

Modified: pear/pear-core/tags/PEAR-1.9.5/package2.xml
===================================================================
--- pear/pear-core/tags/PEAR-1.9.5/package2.xml	2011-07-08 23:58:05 UTC (rev 313082)
+++ pear/pear-core/tags/PEAR-1.9.5/package2.xml	2011-07-08 23:58:23 UTC (rev 313083)
@@ -84,7 +84,7 @@
  <date>2011-07-06</date>
  <time>15:30:00</time>
  <version>
-  <release>1.9.4</release>
+  <release>1.9.5</release>
   <api>1.9.4</api>
  </version>
  <stability>
@@ -94,15 +94,7 @@
  <license uri="http://opensource.org/licenses/bsd-license.php">New BSD License</license>
  <notes>
   Bug Fixes:
-  * Bug #17350: "pear install --force" doesn't uninstall files from previous pkg versions [dufuz]
-  * Bug #18362: A whitespace TEMP_DIR path breaks install/upgrade functionality [dufuz]
-  * Bug #18440: bad tmp folder path on install : Unable to create path for C:/Program/tmp [dufuz]
-  * Bug #18581: "config-get -c" not returning channel's configuration when using alias [dufuz]
-  * Bug #18639: regression: installing xdebug fails most likely due to another fix [dufuz]
-
-  Features
-  * All System (the class) functions can now take in spaced paths as long as they are surrounded in quotes.
-    Prior to this it was possible to do that by passing all values in as an array (by product of #18362, #18440) [dufuz]
+  * Bug #18656: E_WARNING errors from is_a() usage in PEAR::isError on PHP 5.4+ [dufuz]
  </notes>
  <contents>
   <dir name="/">
@@ -891,5 +883,30 @@
     their pecl package but rather in a sub directory, such as xhprof. [dufuz]
  </notes>
   </release>
+  <release>
+ <date>2011-07-06</date>
+ <time>15:30:00</time>
+ <version>
+  <release>1.9.4</release>
+  <api>1.9.4</api>
+ </version>
+ <stability>
+  <release>stable</release>
+  <api>stable</api>
+ </stability>
+ <license uri="http://opensource.org/licenses/bsd-license.php">New BSD License</license>
+ <notes>
+  Bug Fixes:
+  * Bug #17350: "pear install --force" doesn't uninstall files from previous pkg versions [dufuz]
+  * Bug #18362: A whitespace TEMP_DIR path breaks install/upgrade functionality [dufuz]
+  * Bug #18440: bad tmp folder path on install : Unable to create path for C:/Program/tmp [dufuz]
+  * Bug #18581: "config-get -c" not returning channel's configuration when using alias [dufuz]
+  * Bug #18639: regression: installing xdebug fails most likely due to another fix [dufuz]
+
+  Features
+  * All System (the class) functions can now take in spaced paths as long as they are surrounded in quotes.
+    Prior to this it was possible to do that by passing all values in as an array (by product of #18362, #18440) [dufuz]
+ </notes>
+  </release>
  </changelog>
 </package>

Modified: pear/pear-core/trunk/PEAR.php
===================================================================
--- pear/pear-core/trunk/PEAR.php	2011-07-08 23:58:05 UTC (rev 313082)
+++ pear/pear-core/trunk/PEAR.php	2011-07-08 23:58:23 UTC (rev 313083)
@@ -249,7 +249,7 @@
      */
     function isError($data, $code = null)
     {
-        if (!is_a($data, 'PEAR_Error')) {
+        if (!is_object($data) || !is_a($data, 'PEAR_Error')) {
             return false;
         }


Added: pear/pear-core/trunk/tests/PEAR/bug18656.phpt
===================================================================
--- pear/pear-core/trunk/tests/PEAR/bug18656.phpt	                        (rev 0)
+++ pear/pear-core/trunk/tests/PEAR/bug18656.phpt	2011-07-08 23:58:23 UTC (rev 313083)
@@ -0,0 +1,16 @@
+--TEST--
+Bug #18656: E_WARNING errors from is_a() usage in PEAR::isError on PHP 5.4+
+--SKIPIF--
+<?php
+if (!getenv('PHP_PEAR_RUNTESTS')) {
+    echo 'skip';
+}
+?>
+--FILE--
+<?php
+require_once 'PEAR.php';
+
+var_dump(PEAR::isError('string to trigger warning', 'PEAR_Error'));
+?>
+--EXPECT--
+bool(false)
\ No newline at end of file

--7023963a5fbd53c5663ac7d14c0a49fa8fd21626--