|
@@ 234-245 (lines=12) @@
|
| 231 |
|
return $result; |
| 232 |
|
}); |
| 233 |
|
|
| 234 |
|
$this->registerMediaTypeParser('application/xml', function ($input) { |
| 235 |
|
$backup = libxml_disable_entity_loader(true); |
| 236 |
|
$backup_errors = libxml_use_internal_errors(true); |
| 237 |
|
$result = simplexml_load_string($input); |
| 238 |
|
libxml_disable_entity_loader($backup); |
| 239 |
|
libxml_clear_errors(); |
| 240 |
|
libxml_use_internal_errors($backup_errors); |
| 241 |
|
if ($result === false) { |
| 242 |
|
return null; |
| 243 |
|
} |
| 244 |
|
return $result; |
| 245 |
|
}); |
| 246 |
|
|
| 247 |
|
$this->registerMediaTypeParser('text/xml', function ($input) { |
| 248 |
|
$backup = libxml_disable_entity_loader(true); |
|
@@ 247-258 (lines=12) @@
|
| 244 |
|
return $result; |
| 245 |
|
}); |
| 246 |
|
|
| 247 |
|
$this->registerMediaTypeParser('text/xml', function ($input) { |
| 248 |
|
$backup = libxml_disable_entity_loader(true); |
| 249 |
|
$backup_errors = libxml_use_internal_errors(true); |
| 250 |
|
$result = simplexml_load_string($input); |
| 251 |
|
libxml_disable_entity_loader($backup); |
| 252 |
|
libxml_clear_errors(); |
| 253 |
|
libxml_use_internal_errors($backup_errors); |
| 254 |
|
if ($result === false) { |
| 255 |
|
return null; |
| 256 |
|
} |
| 257 |
|
return $result; |
| 258 |
|
}); |
| 259 |
|
|
| 260 |
|
$this->registerMediaTypeParser('application/x-www-form-urlencoded', function ($input) { |
| 261 |
|
parse_str($input, $data); |