Skip to content

Commit

Permalink
reverted formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
perscheBo authored and f3l1x committed Dec 1, 2019
1 parent e3b7e4a commit 70100f0
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions src/nusoap.php
Original file line number Diff line number Diff line change
Expand Up @@ -6785,16 +6785,25 @@ function __construct($xml, $encoding = 'UTF-8', $method = '', $decode_utf8 = tru
// Set the element handlers for the parser.
xml_set_element_handler($this->parser, 'start_element', 'end_element');
xml_set_character_data_handler($this->parser, 'character_data');

// Parse the XML file.
if (!xml_parse($this->parser, $xml, true)) {
// Display an error message.
$err = sprintf('XML error parsing SOAP payload on line %d: %s',
xml_get_current_line_number($this->parser),
xml_error_string(xml_get_error_code($this->parser)));
$this->debug($err);
$this->debug("XML payload:\n" . $xml);
$this->setError($err);
$parseErrors = array();
$chunkSize = 4096;
for($pointer = 0; $pointer < strlen($xml) && empty($parseErrors); $pointer += $chunkSize) {
$xmlString = substr($xml, $pointer, $chunkSize);
if(!xml_parse($this->parser, $xmlString, false)) {
$parseErrors['lineNumber'] = xml_get_current_line_number($this->parser);
$parseErrors['errorString'] = xml_error_string(xml_get_error_code($this->parser));
};
}
//Tell the script that is the end of the parsing (by setting is_final to TRUE)
xml_parse($this->parser, '', true);

if(!empty($parseErrors)){
// Display an error message.
$err = sprintf('XML error parsing SOAP payload on line %d: %s',
$parseErrors['lineNumber'],
$parseErrors['errorString']);
$this->debug($err);
$this->setError($err);
} else {
$this->debug('in nusoap_parser ctor, message:');
$this->appendDebug($this->varDump($this->message));
Expand Down

0 comments on commit 70100f0

Please sign in to comment.