Skip to content
Snippets Groups Projects
Commit cda63d33 authored by Tim Steiner's avatar Tim Steiner
Browse files

Prevent an infinite loop in the migration tool.

git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x@169 20a16fea-79d4-4915-8869-1ea9d5ebf173
parent 414ee8ae
No related branches found
No related tags found
No related merge requests found
......@@ -477,8 +477,12 @@ class Unl_Migration_Tool
while (strpos($parts['path'], '/./') !== FALSE) {
$parts['path'] = strtr($parts['path'], array('/./', '/'));
}
$i = 0;
while (strpos($parts['path'], '/../') !== FALSE) {
$parts['path'] = preg_replace('/\\/[^\\/]*\\/\\.\\.\\//', '/', $parts['path']);
$parts['path'] = preg_replace('/^\\/\\.\\.\\//', '/', $parts['path']);
// Prevent infinite loops if we get some crazy url.
if ($i++ > 100) exit;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment