Code Duplication    Length = 11-13 lines in 2 locations

htdocs/class/file/folder.php 2 locations

@@ 440-450 (lines=11) @@
437
        if (!$mode) {
438
            $mode = $this->mode;
439
        }
440
        if ($recursive === false && is_dir($path)) {
441
            if (chmod($path, intval($mode, 8))) {
442
                $this->messages[] = sprintf('%s changed to %s', $path, $mode);
443
444
                return true;
445
            } else {
446
                $this->errors[] = sprintf('%s NOT changed to %s', $path, $mode);
447
448
                return false;
449
            }
450
        }
451
        if (is_dir($path)) {
452
            list($paths) = $this->tree($path);
453
            foreach ($paths as $key => $fullpath) {
@@ 562-574 (lines=13) @@
559
            return true;
560
        }
561
        $nextPathname = substr($pathname, 0, strrpos($pathname, '/'));
562
        if ($this->create($nextPathname, $mode)) {
563
            if (!file_exists($pathname)) {
564
                if (mkdir($pathname, intval($mode, 8))) {
565
                    $this->messages[] = sprintf('%s created', $pathname);
566
567
                    return true;
568
                } else {
569
                    $this->errors[] = sprintf('%s NOT created', $pathname);
570
571
                    return false;
572
                }
573
            }
574
        }
575
576
        return true;
577
    }