mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Follow redirects when fetching XML files.
Previously file_get_contents followed redirects, restore that behavior.
See fb275c5fa2
This commit is contained in:
parent
23d4807933
commit
689745d705
1 changed files with 1 additions and 1 deletions
|
@ -101,7 +101,7 @@ class Xml {
|
|||
} elseif (file_exists($input)) {
|
||||
return self::_loadXml(file_get_contents($input), $options);
|
||||
} elseif (strpos($input, 'http://') === 0 || strpos($input, 'https://') === 0) {
|
||||
$socket = new HttpSocket();
|
||||
$socket = new HttpSocket(array('redirect' => 10));
|
||||
$response = $socket->get($input);
|
||||
if (!$response->isOk()) {
|
||||
throw new XmlException(__d('cake_dev', 'XML cannot be read.'));
|
||||
|
|
Loading…
Reference in a new issue