web/lib/Zend/Rest/Client/Result.php
changeset 1230 68c69c656a2c
parent 807 877f952ae2bd
equal deleted inserted replaced
1229:5a6b6e770365 1230:68c69c656a2c
    13  * to license@zend.com so we can send you a copy immediately.
    13  * to license@zend.com so we can send you a copy immediately.
    14  *
    14  *
    15  * @category   Zend
    15  * @category   Zend
    16  * @package    Zend_Rest
    16  * @package    Zend_Rest
    17  * @subpackage Client
    17  * @subpackage Client
    18  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    18  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    20  * @version    $Id: Result.php 24593 2012-01-05 20:35:02Z matthew $
    20  * @version    $Id$
    21  */
    21  */
       
    22 
       
    23 require_once 'Zend/Xml/Security.php';
    22 
    24 
    23 /**
    25 /**
    24  * @category   Zend
    26  * @category   Zend
    25  * @package    Zend_Rest
    27  * @package    Zend_Rest
    26  * @subpackage Client
    28  * @subpackage Client
    27  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    29  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
    28  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    30  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    29  */
    31  */
    30 class Zend_Rest_Client_Result implements IteratorAggregate {
    32 class Zend_Rest_Client_Result implements IteratorAggregate {
    31     /**
    33     /**
    32      * @var SimpleXMLElement
    34      * @var SimpleXMLElement
    46      * @return void
    48      * @return void
    47      */
    49      */
    48     public function __construct($data)
    50     public function __construct($data)
    49     {
    51     {
    50         set_error_handler(array($this, 'handleXmlErrors'));
    52         set_error_handler(array($this, 'handleXmlErrors'));
    51         $this->_sxml = simplexml_load_string($data);
    53         $this->_sxml = Zend_Xml_Security::scan($data); 
    52         restore_error_handler();
    54         restore_error_handler();
    53         if($this->_sxml === false) {
    55         if($this->_sxml === false) {
    54             if ($this->_errstr === null) {
    56             if ($this->_errstr === null) {
    55                 $message = "An error occured while parsing the REST response with simplexml.";
    57                 $message = "An error occured while parsing the REST response with simplexml.";
    56             } else {
    58             } else {