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