Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.10.15

Bug #20203 Fatal error with charset parameter in XML content type
Submitted: 2014-02-17 23:28 UTC
From: timidri Assigned: doconnor
Status: Closed Package: PEAR (version 1.9.4)
PHP Version: 5_3 SVN-2014-02-17 OS: RHEL 6.2
Roadmaps: 1.9.5    
Subscription  


 [2014-02-17 23:28 UTC] timidri (Dimitri Tischenko)
Description: ------------ I receive warnings and a fatal error when trying to install pear.phpqatools.org/phpqatools and pear.drush.org/drush # pear version PEAR Version: 1.9.4 PHP Version: 5.3.3 Zend Engine Version: 2.3.0 Running on: Linux $hostname 2.6.32-220.7.1.el6.x86_64 #1 SMP Fri Feb 10 15:22:22 EST 2012 x86_64 Test script: --------------- pear channel-discover pear.phpqatools.org pear install phpqatools/phpqatools pear channel-discover pear.drush.org pear install drush/drush Expected result: ---------------- phpqatools installed drush isntalled Actual result: -------------- Notice: Array to string conversion in PEAR/REST/13.php on line 80 PHP Notice: Array to string conversion in /usr/share/pear/PEAR/REST/13.php on line 80 Warning: Invalid argument supplied for foreach() in PEAR/REST/13.php on line 84 PHP Warning: Invalid argument supplied for foreach() in /usr/share/pear/PEAR/REST/13.php on line 84 PHP Fatal error: Cannot use string offset as an array in /usr/share/pear/PEAR/REST/10.php on line 263

Comments

 [2014-02-18 15:45 UTC] baranga (Baran Ga)
Same for me. I traced it down to this: in PEAR_REST::retrieveData the response get checked for content-type of "text/xml" but github delivers "text/xml; charset=utf-8" so the check fails and pear believes the response isn't xml. # pear version PEAR Version: 1.9.4 PHP Version: 5.3.10-1ubuntu3.9 Zend Engine Version: 2.3.0
 [2014-02-19 23:37 UTC] misilot (Thomas Misilo)
I added: case 'text/xml; charset=utf-8' : To the "switch ($headers['content-type']) {" in REST.php and it was able to download and install phpqatools
 [2014-02-19 23:41 UTC] misilot (Thomas Misilo)
 [2014-02-27 18:57 UTC] avb (Alexey Borzov)
-Status: Open +Status: Closed -Assigned To: +Assigned To: doconnor
The proper fix was in PR #9 https://github.com/pear/pear-core/pull/9 https://github.com/Smarre/pear-core/commit/8d569263eac91ad9484b45acb3a6381759138f3c Already applied to master by Daniel O'Connor.
 [2014-02-28 20:56 UTC] cgras (Christophe Gras)
After adding "'text/xml; charset=utf-8' : " in PEAR_REST::retrieveData method, don't forget to clear the PEAR cache before retry the install process: pear clear-cache Thanks Thomas for this tip, it helps me to achieve phpqatools install on a Ubuntu 12.04 LTS box
 [2014-05-30 00:33 UTC] cweiske (Christian Weiske)
-Summary: Fatal error when trying to install phpqatools or drush +Summary: Fatal error with charset parameter in XML content type -Roadmap Versions: +Roadmap Versions: 1.9.5
 [2014-05-30 02:05 UTC] cweiske (Christian Weiske)
 [2014-06-03 03:48 UTC] cweiske (Christian Weiske)
Cherry-picked into stable branch for version 1.9.5.
 [2014-11-17 23:23 UTC] mbiama (Roger Mbiama)