Code Duplication    Length = 6-11 lines in 5 locations

Sources/Display.php 1 location

@@ 44-49 (lines=6) @@
41
	loadTemplate('Display');
42
43
	// Not only does a prefetch make things slower for the server, but it makes it impossible to know if they read it.
44
	if (isset($_SERVER['HTTP_X_MOZ']) && $_SERVER['HTTP_X_MOZ'] == 'prefetch')
45
	{
46
		ob_end_clean();
47
		header('HTTP/1.1 403 Prefetch Forbidden');
48
		die;
49
	}
50
51
	// How much are we sticking on each page?
52
	$context['messages_per_page'] = empty($modSettings['disableCustomPerPage']) && !empty($options['messages_per_page']) ? $options['messages_per_page'] : $modSettings['defaultMaxMessages'];

Sources/MessageIndex.php 1 location

@@ 45-55 (lines=11) @@
42
43
	loadTemplate('MessageIndex');
44
45
	if (!$user_info['is_guest'])
46
	{
47
		// We can't know they read it if we allow prefetches.
48
		// But we'll actually mark it read later after we've done everything else.
49
		if (isset($_SERVER['HTTP_X_MOZ']) && $_SERVER['HTTP_X_MOZ'] == 'prefetch')
50
		{
51
			ob_end_clean();
52
			header('HTTP/1.1 403 Prefetch Forbidden');
53
			die;
54
		}
55
	}
56
57
	$context['name'] = $board_info['name'];
58
	$context['description'] = $board_info['description'];

Sources/Search.php 1 location

@@ 266-271 (lines=6) @@
263
		fatal_lang_error('loadavg_search_disabled', false);
264
265
	// No, no, no... this is a bit hard on the server, so don't you go prefetching it!
266
	if (isset($_SERVER['HTTP_X_MOZ']) && $_SERVER['HTTP_X_MOZ'] == 'prefetch')
267
	{
268
		ob_end_clean();
269
		header('HTTP/1.1 403 Forbidden');
270
		die;
271
	}
272
273
	$weight_factors = array(
274
		'frequency' => array(

Sources/Security.php 1 location

@@ 636-641 (lines=6) @@
633
		$error = 'session_verify_fail';
634
635
	// Make sure a page with session check requirement is not being prefetched.
636
	if (isset($_SERVER['HTTP_X_MOZ']) && $_SERVER['HTTP_X_MOZ'] == 'prefetch')
637
	{
638
		ob_end_clean();
639
		header('HTTP/1.1 403 Forbidden');
640
		die;
641
	}
642
643
	// Check the referring site - it should be the same server at least!
644
	if (isset($_SESSION['request_referer']))

Sources/Recent.php 1 location

@@ 473-478 (lines=6) @@
470
	is_not_guest();
471
472
	// Prefetching + lots of MySQL work = bad mojo.
473
	if (isset($_SERVER['HTTP_X_MOZ']) && $_SERVER['HTTP_X_MOZ'] == 'prefetch')
474
	{
475
		ob_end_clean();
476
		header('HTTP/1.1 403 Forbidden');
477
		die;
478
	}
479
480
	$context['showCheckboxes'] = !empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1;
481