Skip to content

Commit

Permalink
Follow redirects when fetching XML files.
Browse files Browse the repository at this point in the history
Previously file_get_contents followed redirects, restore that behavior.
See fb275c5
  • Loading branch information
markstory committed Jan 17, 2013
1 parent 23d4807 commit 689745d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Cake/Utility/Xml.php
Expand Up @@ -101,7 +101,7 @@ public static function build($input, $options = array()) {
} 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.'));
Expand Down

0 comments on commit 689745d

Please sign in to comment.