Code Duplication    Length = 12-12 lines in 2 locations

php/elFinderVolumeFTP.class.php 1 location

@@ 583-594 (lines=12) @@
580
	 * @return string
581
	 * @author Dmitry (dio) Levashov
582
	 **/
583
	protected function _relpath($path) {
584
		if ($path === $this->root) {
585
			return '';
586
		} else {
587
			if (strpos($path, $this->root) === 0) {
588
				return ltrim(substr($path, strlen($this->root)), $this->separator);
589
			} else {
590
				// for link
591
				return $path;
592
			}
593
		}
594
	}
595
	
596
	/**
597
	 * Convert path related to root dir into real path

php/elFinderVolumeLocalFileSystem.class.php 1 location

@@ 247-258 (lines=12) @@
244
	 * @return string
245
	 * @author Dmitry (dio) Levashov
246
	 **/
247
	protected function _relpath($path) {
248
		if ($path === $this->root) {
249
			return '';
250
		} else {
251
			if (strpos($path, $this->root) === 0) {
252
				return ltrim(substr($path, strlen($this->root)), DIRECTORY_SEPARATOR);
253
			} else {
254
				// for link
255
				return $path;
256
			}
257
		}
258
	}
259
	
260
	/**
261
	 * Convert path related to root dir into real path