Code Duplication    Length = 29-29 lines in 2 locations

lib/elFinderVolumeBox.class.php 1 location

@@ 1007-1035 (lines=29) @@
1004
     * @author Dmitry (dio) Levashov
1005
     * @author Naoki Sawada
1006
     **/
1007
    protected function remove($path, $force = false)
1008
    {
1009
        $stat = $this->stat($path);
1010
        $stat['realpath'] = $path;
1011
        $this->rmTmb($stat);
1012
        $this->clearcache();
1013
1014
        if (empty($stat)) {
1015
            return $this->setError(elFinder::ERROR_RM, $this->_path($path), elFinder::ERROR_FILE_NOT_FOUND);
1016
        }
1017
1018
        if (! $force && ! empty($stat['locked'])) {
1019
            return $this->setError(elFinder::ERROR_LOCKED, $this->_path($path));
1020
        }
1021
1022
        if ($stat['mime'] == 'directory') {
1023
            if (! $this->_rmdir($path)) {
1024
                return $this->setError(elFinder::ERROR_RM, $this->_path($path));
1025
            }
1026
        } else {
1027
            if (! $this->_unlink($path)) {
1028
                return $this->setError(elFinder::ERROR_RM, $this->_path($path));
1029
            }
1030
        }
1031
1032
        $this->removed[] = $stat;
1033
1034
        return true;
1035
    }
1036
1037
    /**
1038
     * Create thumnbnail and return it's URL on success.

lib/elFinderVolumeOneDrive.class.php 1 location

@@ 943-971 (lines=29) @@
940
     * @author Dmitry (dio) Levashov
941
     * @author Naoki Sawada
942
     **/
943
    protected function remove($path, $force = false)
944
    {
945
        $stat = $this->stat($path);
946
        $stat['realpath'] = $path;
947
        $this->rmTmb($stat);
948
        $this->clearcache();
949
950
        if (empty($stat)) {
951
            return $this->setError(elFinder::ERROR_RM, $this->_path($path), elFinder::ERROR_FILE_NOT_FOUND);
952
        }
953
954
        if (! $force && ! empty($stat['locked'])) {
955
            return $this->setError(elFinder::ERROR_LOCKED, $this->_path($path));
956
        }
957
958
        if ($stat['mime'] == 'directory') {
959
            if (! $this->_rmdir($path)) {
960
                return $this->setError(elFinder::ERROR_RM, $this->_path($path));
961
            }
962
        } else {
963
            if (! $this->_unlink($path)) {
964
                return $this->setError(elFinder::ERROR_RM, $this->_path($path));
965
            }
966
        }
967
968
        $this->removed[] = $stat;
969
970
        return true;
971
    }
972
973
    /**
974
     * Create thumnbnail and return it's URL on success.