Changeset 52393 for trunk/src/wp-includes/SimplePie/Parser.php
- Timestamp:
- 12/20/2021 07:31:37 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/SimplePie/Parser.php
r47733 r52393 165 165 166 166 // Parse! 167 if (!xml_parse($xml, $data, true)) 168 { 169 $this->error_code = xml_get_error_code($xml); 170 $this->error_string = xml_error_string($this->error_code); 167 $wrapper = @is_writable(sys_get_temp_dir()) ? 'php://temp' : 'php://memory'; 168 if (($stream = fopen($wrapper, 'r+')) && 169 fwrite($stream, $data) && 170 rewind($stream)) 171 { 172 //Parse by chunks not to use too much memory 173 do 174 { 175 $stream_data = fread($stream, 1048576); 176 if (!xml_parse($xml, $stream_data === false ? '' : $stream_data, feof($stream))) 177 { 178 $this->error_code = xml_get_error_code($xml); 179 $this->error_string = xml_error_string($this->error_code); 180 $return = false; 181 break; 182 } 183 } while (!feof($stream)); 184 fclose($stream); 185 } 186 else 187 { 171 188 $return = false; 172 189 } 190 173 191 $this->current_line = xml_get_current_line_number($xml); 174 192 $this->current_column = xml_get_current_column_number($xml);
Note: See TracChangeset
for help on using the changeset viewer.