Code Duplication    Length = 7-7 lines in 2 locations

php/elFinderVolumeDriver.class.php 2 locations

@@ 2642-2648 (lines=7) @@
2639
2640
		$path = '/'.$path;
2641
2642
		for ($i = 0, $c = count($this->attributes); $i < $c; $i++) {
2643
			$attrs = $this->attributes[$i];
2644
			
2645
			if (isset($attrs[$name]) && isset($attrs['pattern']) && preg_match($attrs['pattern'], $path)) {
2646
				$perm = $attrs[$name];
2647
			} 
2648
		}
2649
		
2650
		return $perm === null ? (is_null($val)? $this->defaults[$name] : $val) : !!$perm;
2651
	}
@@ 2674-2680 (lines=7) @@
2671
		
2672
		$testPath = $this->separator.$this->relpathCE($path);
2673
		
2674
		for ($i = 0, $c = count($this->attributes); $i < $c; $i++) {
2675
			$attrs = $this->attributes[$i];
2676
			
2677
			if (isset($attrs['write']) && isset($attrs['pattern']) && preg_match($attrs['pattern'], $testPath)) {
2678
				$perm = $attrs['write'];
2679
			} 
2680
		}
2681
		
2682
		return $perm === null ? true : $perm;
2683
	}