Code Duplication    Length = 5-7 lines in 2 locations

Sources/ShowAttachments.php 1 location

@@ 218-224 (lines=7) @@
215
216
	// Check whether the ETag was sent back, and cache based on that...
217
	$eTag = '"' . substr($_REQUEST['attach'] . $file['filePath'] . filemtime($file['filePath']), 0, 64) . '"';
218
	if (!empty($_SERVER['HTTP_IF_NONE_MATCH']) && strpos($_SERVER['HTTP_IF_NONE_MATCH'], $eTag) !== false)
219
	{
220
		ob_end_clean();
221
222
		header('HTTP/1.1 304 Not Modified');
223
		exit;
224
	}
225
226
	// If this is a partial download, we need to determine what data range to send
227
	$range = 0;

proxy.php 1 location

@@ 137-141 (lines=5) @@
134
		}
135
136
		$eTag = '"' . substr(sha1($request) . $cached['time'], 0, 64) . '"';
137
		if (!empty($_SERVER['HTTP_IF_NONE_MATCH']) && strpos($_SERVER['HTTP_IF_NONE_MATCH'], $eTag) !== false)
138
		{
139
			header('HTTP/1.1 304 Not Modified');
140
			exit;
141
		}
142
143
		// Make sure we're serving an image
144
		$contentParts = explode('/', !empty($cached['content_type']) ? $cached['content_type'] : '');