Code Duplication    Length = 7-7 lines in 2 locations

php/elFinderVolumeDriver.class.php 2 locations

@@ 2684-2690 (lines=7) @@
2681
2682
		$path = '/'.$path;
2683
2684
		for ($i = 0, $c = count($this->attributes); $i < $c; $i++) {
2685
			$attrs = $this->attributes[$i];
2686
			
2687
			if (isset($attrs[$name]) && isset($attrs['pattern']) && preg_match($attrs['pattern'], $path)) {
2688
				$perm = $attrs[$name];
2689
			} 
2690
		}
2691
		
2692
		return $perm === null ? (is_null($val)? $this->defaults[$name] : $val) : !!$perm;
2693
	}
@@ 2716-2722 (lines=7) @@
2713
		
2714
		$testPath = $this->separator.$this->relpathCE($path);
2715
		
2716
		for ($i = 0, $c = count($this->attributes); $i < $c; $i++) {
2717
			$attrs = $this->attributes[$i];
2718
			
2719
			if (isset($attrs['write']) && isset($attrs['pattern']) && preg_match($attrs['pattern'], $testPath)) {
2720
				$perm = $attrs['write'];
2721
			} 
2722
		}
2723
		
2724
		return $perm === null ? true : $perm;
2725
	}