From c6239d0e996fa296864bf5195ac67c0d5addc84d Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Sun, 30 Dec 2012 23:07:33 +0100 Subject: [PATCH] Special handling of root namespace in file moves --- helper.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/helper.php b/helper.php index c04e0dd..dec5152 100644 --- a/helper.php +++ b/helper.php @@ -243,8 +243,10 @@ public function movemeta($opts) { * @param string $extregex Regular expression for matching the extension of the file that shall be moved */ private function move_files($dir, $opts, $extregex) { - $old_path = $dir.'/'.utf8_encodeFN(str_replace(':', '/', $opts['ns'])).'/'; - $new_path = $dir.'/'.utf8_encodeFN(str_replace(':', '/', $opts['newns'])).'/'; + $old_path = $dir.'/'; + if ($opts['ns'] != '') $old_path .= utf8_encodeFN(str_replace(':', '/', $opts['ns'])).'/'; + $new_path = $dir.'/'; + if ($opts['newns'] != '') $new_path .= utf8_encodeFN(str_replace(':', '/', $opts['newns'])).'/'; $regex = '/^'.preg_quote(utf8_encodeFN($opts['name'])).'('.$extregex.')$/u'; $dh = @opendir($old_path);