Code Duplication    Length = 19-19 lines in 2 locations

htdocs/modules/system/class/thumbs/phpthumb.functions.php 2 locations

@@ 534-552 (lines=19) @@
531
	}
532
533
534
	static function filesize_remote($remotefile, $timeout=10) {
535
		$size = false;
536
		$url = phpthumb_functions::ParseURLbetter($remotefile);
537
		if ($fp = @fsockopen($url['host'], ($url['port'] ? $url['port'] : 80), $errno, $errstr, $timeout)) {
538
			fwrite($fp, 'HEAD '.@$url['path'].@$url['query'].' HTTP/1.0'."\r\n".'Host: '.@$url['host']."\r\n\r\n");
539
			if (phpthumb_functions::version_compare_replacement(phpversion(), '4.3.0', '>=')) {
540
				stream_set_timeout($fp, $timeout);
541
			}
542
			while (!feof($fp)) {
543
				$headerline = fgets($fp, 4096);
544
				if (preg_match('#^Content-Length: (.*)#i', $headerline, $matches)) {
545
					$size = intval($matches[1]);
546
					break;
547
				}
548
			}
549
			fclose ($fp);
550
		}
551
		return $size;
552
	}
553
554
555
	static function filedate_remote($remotefile, $timeout=10) {
@@ 555-573 (lines=19) @@
552
	}
553
554
555
	static function filedate_remote($remotefile, $timeout=10) {
556
		$date = false;
557
		$url = phpthumb_functions::ParseURLbetter($remotefile);
558
		if ($fp = @fsockopen($url['host'], ($url['port'] ? $url['port'] : 80), $errno, $errstr, $timeout)) {
559
			fwrite($fp, 'HEAD '.@$url['path'].@$url['query'].' HTTP/1.0'."\r\n".'Host: '.@$url['host']."\r\n\r\n");
560
			if (phpthumb_functions::version_compare_replacement(phpversion(), '4.3.0', '>=')) {
561
				stream_set_timeout($fp, $timeout);
562
			}
563
			while (!feof($fp)) {
564
				$headerline = fgets($fp, 4096);
565
				if (preg_match('#^Last-Modified: (.*)#i', $headerline, $matches)) {
566
					$date = strtotime($matches[1]) - date('Z');
567
					break;
568
				}
569
			}
570
			fclose ($fp);
571
		}
572
		return $date;
573
	}
574
575
576
	static function md5_file_safe($filename) {