Follow redirects when fetching XML files.

Previously file_get_contents followed redirects, restore that behavior.
See fb275c5fa2
This commit is contained in:
mark_story 2013-01-17 09:51:47 -05:00
parent 23d4807933
commit 689745d705

View file

@ -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.'));