Lines Matching +full:check +full:- +full:attr
29 $this->message =& $message;
35 … // merged from WP #10698 - this method avoids the RAM usage of preg_replace on very large messages
36 $header = preg_replace('/<\?xml.*?\?' . '>/s', '', substr($this->message, 0, 100), 1);
37 $this->message = trim(substr_replace($this->message, $header, 0, 100));
38 if ('' == $this->message) {
43 $header = preg_replace('/^<!DOCTYPE[^>]*+>/i', '', substr($this->message, 0, 200), 1);
44 $this->message = trim(substr_replace($this->message, $header, 0, 200));
45 if ('' == $this->message) {
49 // Check that the root tag is valid
50 $root_tag = substr($this->message, 0, strcspn(substr($this->message, 0, 20), "> \t\r\n"));
60 if ($element_limit && 2 * $element_limit < substr_count($this->message, '<')) {
64 $this->_parser = xml_parser_create();
66 xml_parser_set_option($this->_parser, XML_OPTION_CASE_FOLDING, false);
68 xml_set_element_handler($this->_parser, [$this, 'tagOpen'], [$this, 'tagClose']);
69 xml_set_character_data_handler($this->_parser, [$this, 'cdata']);
73 if (strlen($this->message) <= $chunk_size) {
76 $part = substr($this->message, 0, $chunk_size);
77 $this->message = substr($this->message, $chunk_size);
78 if (!xml_parse($this->_parser, $part, $final)) {
85 xml_parser_free($this->_parser);
88 if ($this->messageType === 'fault') {
89 $this->faultCode = $this->params[0]['faultCode'];
90 $this->faultString = $this->params[0]['faultString'];
99 * @param $attr
101 public function tagOpen($parser, $tag, $attr) argument
103 $this->_currentTagContents = '';
104 $this->_currentTag = $tag;
109 $this->messageType = $tag;
113 $this->_arraystructstypes[] = 'array';
114 $this->_arraystructs[] = [];
117 $this->_arraystructstypes[] = 'struct';
118 $this->_arraystructs[] = [];
130 $this->_currentTagContents .= $cdata;
144 $value = (int)trim($this->_currentTagContents);
148 $value = (double)trim($this->_currentTagContents);
152 $value = (string)($this->_currentTagContents);
156 $value = new Date(trim($this->_currentTagContents));
161 if (trim($this->_currentTagContents) != '') {
162 $value = (string)$this->_currentTagContents;
167 $value = (boolean)trim($this->_currentTagContents);
171 $value = base64_decode($this->_currentTagContents);
177 $value = array_pop($this->_arraystructs);
178 array_pop($this->_arraystructstypes);
182 array_pop($this->_currentStructName);
185 $this->_currentStructName[] = trim($this->_currentTagContents);
188 $this->methodName = trim($this->_currentTagContents);
193 if (count($this->_arraystructs) > 0) {
195 if ($this->_arraystructstypes[count($this->_arraystructstypes) - 1] === 'struct') {
197 …$this->_arraystructs[count($this->_arraystructs) - 1][$this->_currentStructName[count($this->_curr…
200 $this->_arraystructs[count($this->_arraystructs) - 1][] = $value;
204 $this->params[] = $value;
207 $this->_currentTagContents = '';