Code Duplication    Length = 7-7 lines in 2 locations

php/elFinderVolumeDriver.class.php 2 locations

@@ 2666-2672 (lines=7) @@
2663
2664
		$path = '/'.$path;
2665
2666
		for ($i = 0, $c = count($this->attributes); $i < $c; $i++) {
2667
			$attrs = $this->attributes[$i];
2668
			
2669
			if (isset($attrs[$name]) && isset($attrs['pattern']) && preg_match($attrs['pattern'], $path)) {
2670
				$perm = $attrs[$name];
2671
			} 
2672
		}
2673
		
2674
		return $perm === null ? (is_null($val)? $this->defaults[$name] : $val) : !!$perm;
2675
	}
@@ 2698-2704 (lines=7) @@
2695
		
2696
		$testPath = $this->separator.$this->relpathCE($path);
2697
		
2698
		for ($i = 0, $c = count($this->attributes); $i < $c; $i++) {
2699
			$attrs = $this->attributes[$i];
2700
			
2701
			if (isset($attrs['write']) && isset($attrs['pattern']) && preg_match($attrs['pattern'], $testPath)) {
2702
				$perm = $attrs['write'];
2703
			} 
2704
		}
2705
		
2706
		return $perm === null ? true : $perm;
2707
	}