Code Duplication    Length = 8-8 lines in 2 locations

Sources/ShowAttachments.php 1 location

@@ 188-195 (lines=8) @@
185
		$file = $thumbFile;
186
187
	// No point in a nicer message, because this is supposed to be an attachment anyway...
188
	if (!file_exists($file['filePath']))
189
	{
190
		header((preg_match('~HTTP/1\.[01]~i', $_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0') . ' 404 Not Found');
191
		header('Content-Type: text/plain; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));
192
193
		// We need to die like this *before* we send any anti-caching headers as below.
194
		die('File not found.');
195
	}
196
197
	// If it hasn't been modified since the last time this attachment was retrieved, there's no need to display it again.
198
	if (!empty($_SERVER['HTTP_IF_MODIFIED_SINCE']))

Sources/Display.php 1 location

@@ 1624-1631 (lines=8) @@
1621
	}
1622
1623
	// No point in a nicer message, because this is supposed to be an attachment anyway...
1624
	if (!file_exists($filename))
1625
	{
1626
		header((preg_match('~HTTP/1\.[01]~i', $_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0') . ' 404 Not Found');
1627
		header('Content-Type: text/plain; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));
1628
1629
		// We need to die like this *before* we send any anti-caching headers as below.
1630
		die('File not found.');
1631
	}
1632
1633
	// If it hasn't been modified since the last time this attachment was retrieved, there's no need to display it again.
1634
	if (!empty($_SERVER['HTTP_IF_MODIFIED_SINCE']))