web/lib/Zend/Service/Amazon/SimpleDb/Response.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_Service_Amazon
    16  * @package    Zend_Service_Amazon
    17  * @subpackage SimpleDb
    17  * @subpackage SimpleDb
    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  */
    20  */
    21 
    21 
    22 /**
    22 /**
    23  * @see Zend_Http_Response
    23  * @see Zend_Http_Response
    24  */
    24  */
    25 require_once 'Zend/Http/Response.php';
    25 require_once 'Zend/Http/Response.php';
    26 
    26 
       
    27 /** @see Zend_Xml_Security */
       
    28 require_once 'Zend/Xml/Security.php';
       
    29 
    27 /**
    30 /**
    28  * @category   Zend
    31  * @category   Zend
    29  * @package    Zend_Service_Amazon
    32  * @package    Zend_Service_Amazon
    30  * @subpackage SimpleDb
    33  * @subpackage SimpleDb
    31  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    34  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
    32  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    35  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    33  */
    36  */
    34 class Zend_Service_Amazon_SimpleDb_Response
    37 class Zend_Service_Amazon_SimpleDb_Response
    35 {
    38 {
    36     /**
    39     /**
   118             $body = $this->_httpResponse->getBody();
   121             $body = $this->_httpResponse->getBody();
   119         } catch (Zend_Http_Exception $e) {
   122         } catch (Zend_Http_Exception $e) {
   120             $body = false;
   123             $body = false;
   121         }
   124         }
   122 
   125 
   123 
   126         return Zend_Xml_Security::scan($body);
   124         return simplexml_load_string($body);
       
   125     }
   127     }
   126 
   128 
   127     /**
   129     /**
   128      * Get HTTP response object
   130      * Get HTTP response object
   129      *
   131      *
   151             if ($body !== false) {
   153             if ($body !== false) {
   152                 // turn off libxml error handling
   154                 // turn off libxml error handling
   153                 $errors = libxml_use_internal_errors();
   155                 $errors = libxml_use_internal_errors();
   154 
   156 
   155                 $this->_document = new DOMDocument();
   157                 $this->_document = new DOMDocument();
   156                 if (!$this->_document->loadXML($body)) {
   158                 $this->_document = Zend_Xml_Security::scan($body, $this->_document);
   157                     $this->_document = false;
       
   158                 }
       
   159 
   159 
   160                 // reset libxml error handling
   160                 // reset libxml error handling
   161                 libxml_clear_errors();
   161                 libxml_clear_errors();
   162                 libxml_use_internal_errors($errors);
   162                 libxml_use_internal_errors($errors);
   163             } else {
   163             } else {