Code Duplication    Length = 7-7 lines in 2 locations

php/elFinderVolumeDriver.class.php 2 locations

@@ 2652-2658 (lines=7) @@
2649
2650
		$path = '/'.$path;
2651
2652
		for ($i = 0, $c = count($this->attributes); $i < $c; $i++) {
2653
			$attrs = $this->attributes[$i];
2654
			
2655
			if (isset($attrs[$name]) && isset($attrs['pattern']) && preg_match($attrs['pattern'], $path)) {
2656
				$perm = $attrs[$name];
2657
			} 
2658
		}
2659
		
2660
		return $perm === null ? (is_null($val)? $this->defaults[$name] : $val) : !!$perm;
2661
	}
@@ 2684-2690 (lines=7) @@
2681
		
2682
		$testPath = $this->separator.$this->relpathCE($path);
2683
		
2684
		for ($i = 0, $c = count($this->attributes); $i < $c; $i++) {
2685
			$attrs = $this->attributes[$i];
2686
			
2687
			if (isset($attrs['write']) && isset($attrs['pattern']) && preg_match($attrs['pattern'], $testPath)) {
2688
				$perm = $attrs['write'];
2689
			} 
2690
		}
2691
		
2692
		return $perm === null ? true : $perm;
2693
	}