Permalink
Browse files

Follow redirects when fetching XML files.

Previously file_get_contents followed redirects, restore that behavior.
See fb275c5
  • Loading branch information...
markstory committed Jan 17, 2013
1 parent 23d4807 commit 689745d7054fb7adae1b1f1faad99945c1a65521
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/Cake/Utility/Xml.php
View
@@ -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.'));

0 comments on commit 689745d

Please sign in to comment.