Skip to content

Commit 5a49e1d

Browse files
mfurlendSapbasu15
authored andcommitted
Added LIBXML_NOWARNING to simplexml_load_string calls to suppress PHP 7 warning
1 parent ed1aecc commit 5a49e1d

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

lib/AuthorizeNetCP.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function __construct($response, $delimiter, $encap_char, $custom_fields)
119119
// If it's an XML response
120120
if (substr($response, 0, 5) == "<?xml") {
121121

122-
$this->xml = @simplexml_load_string($response);
122+
$this->xml = @simplexml_load_string($response, 'SimpleXMLElement', LIBXML_NOWARNING);
123123
// Set all fields
124124
$this->version = array_pop(array_slice(explode('"', $response), 1,1));
125125
$this->response_code = (string)$this->xml->ResponseCode;

lib/shared/AuthorizeNetXMLResponse.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ public function __construct($response)
2626
{
2727
$this->response = $response;
2828
if ($response) {
29-
$this->xml = @simplexml_load_string($response);
29+
$this->xml = @simplexml_load_string($response,'SimpleXMLElement', LIBXML_NOWARNING);
3030

3131
// Remove namespaces for use with XPath.
32-
$this->xpath_xml = @simplexml_load_string(preg_replace('/ xmlns:xsi[^>]+/','',$response));
32+
$this->xpath_xml = @simplexml_load_string(preg_replace('/ xmlns:xsi[^>]+/','',$response),'SimpleXMLElement', LIBXML_NOWARNING);
3333
}
3434
}
3535

@@ -125,4 +125,4 @@ protected function _getElementContents($elementName)
125125
}
126126
}
127127

128-
}
128+
}

0 commit comments

Comments
 (0)