Code Duplication    Length = 5-6 lines in 2 locations

php/elFinder.class.php 2 locations

@@ 1417-1421 (lines=5) @@
1414
	protected function parse_data_scheme( $str, $extTable ) {
1415
		$data = $name = '';
1416
		if ($fp = fopen('data://'.substr($str, 5), 'rb')) {
1417
			if ($data = stream_get_contents($fp)) {
1418
				$meta = stream_get_meta_data($fp);
1419
				$ext = isset($extTable[$meta['mediatype']])? '.' . $extTable[$meta['mediatype']] : '';
1420
				$name = substr(md5($data), 0, 8) . $ext;
1421
			}
1422
			fclose($fp);
1423
		}
1424
		return array($data, $name);
@@ 1889-1894 (lines=6) @@
1886
						$this->uploadDebug = 'Upload error: unable open tmp file';
1887
					}
1888
					return $result;
1889
				} else {
1890
					// for form clipboard with Google Chrome
1891
					$type = $files['type'][$i];
1892
					$ext = isset($extTable[$type])? '.' . $extTable[$type] : '';
1893
					$name = substr(md5(basename($tmpname)), 0, 8) . $ext;
1894
				}
1895
			}
1896
			
1897
			// do hook function 'upload.presave'