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

@@ 257-268 (lines=12) @@
254
	 * @return string
255
	 * @author Dmitry (dio) Levashov
256
	 **/
257
	protected function _relpath($path) {
258
		if ($path === $this->root) {
259
			return '';
260
		} else {
261
			if (strpos($path, $this->root) === 0) {
262
				return ltrim(substr($path, strlen($this->root)), DIRECTORY_SEPARATOR);
263
			} else {
264
				// for link
265
				return $path;
266
			}
267
		}
268
	}
269
	
270
	/**
271
	 * Convert path related to root dir into real path