Skip to content

Commit

Permalink
Special handling of root namespace in file moves
Browse files Browse the repository at this point in the history
  • Loading branch information
michitux committed Dec 30, 2012
1 parent 45dd5ba commit c6239d0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c6239d0

Please sign in to comment.