Code Duplication    Length = 2-2 lines in 10 locations

Sources/Recent.php 2 locations

@@ 1261-1262 (lines=2) @@
1258
		if (!empty($modSettings['messageIconChecks_enable']))
1259
		{
1260
			// First icon first... as you'd expect.
1261
			if (!isset($context['icon_sources'][$row['first_icon']]))
1262
				$context['icon_sources'][$row['first_icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['first_icon'] . '.png') ? 'images_url' : 'default_images_url';
1263
			// Last icon... last... duh.
1264
			if (!isset($context['icon_sources'][$row['last_icon']]))
1265
				$context['icon_sources'][$row['last_icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['last_icon'] . '.png') ? 'images_url' : 'default_images_url';
@@ 1264-1265 (lines=2) @@
1261
			if (!isset($context['icon_sources'][$row['first_icon']]))
1262
				$context['icon_sources'][$row['first_icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['first_icon'] . '.png') ? 'images_url' : 'default_images_url';
1263
			// Last icon... last... duh.
1264
			if (!isset($context['icon_sources'][$row['last_icon']]))
1265
				$context['icon_sources'][$row['last_icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['last_icon'] . '.png') ? 'images_url' : 'default_images_url';
1266
		}
1267
1268
		// Force the recycling icon if appropriate

SSI.php 2 locations

@@ 570-571 (lines=2) @@
567
		if (!empty($recycle_board) && $topics[$row['id_topic']]['id_board'])
568
			$row['icon'] = 'recycled';
569
570
		if (!empty($modSettings['messageIconChecks_enable']) && !isset($icon_sources[$row['icon']]))
571
			$icon_sources[$row['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['icon'] . '.png') ? 'images_url' : 'default_images_url';
572
573
		// Build the array.
574
		$posts[] = array(
@@ 1996-1997 (lines=2) @@
1993
			$row['icon'] = 'recycled';
1994
1995
		// Check that this message icon is there...
1996
		if (!empty($modSettings['messageIconChecks_enable']) && !isset($icon_sources[$row['icon']]))
1997
			$icon_sources[$row['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['icon'] . '.png') ? 'images_url' : 'default_images_url';
1998
1999
		censorText($row['subject']);
2000
		censorText($row['body']);

Sources/Search.php 3 locations

@@ 1993-1994 (lines=2) @@
1990
	// Sadly, we need to check the icon ain't broke.
1991
	if (!empty($modSettings['messageIconChecks_enable']))
1992
	{
1993
		if (!isset($context['icon_sources'][$message['first_icon']]))
1994
			$context['icon_sources'][$message['first_icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $message['first_icon'] . '.png') ? 'images_url' : 'default_images_url';
1995
		if (!isset($context['icon_sources'][$message['last_icon']]))
1996
			$context['icon_sources'][$message['last_icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $message['last_icon'] . '.png') ? 'images_url' : 'default_images_url';
1997
		if (!isset($context['icon_sources'][$message['icon']]))
@@ 1995-1996 (lines=2) @@
1992
	{
1993
		if (!isset($context['icon_sources'][$message['first_icon']]))
1994
			$context['icon_sources'][$message['first_icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $message['first_icon'] . '.png') ? 'images_url' : 'default_images_url';
1995
		if (!isset($context['icon_sources'][$message['last_icon']]))
1996
			$context['icon_sources'][$message['last_icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $message['last_icon'] . '.png') ? 'images_url' : 'default_images_url';
1997
		if (!isset($context['icon_sources'][$message['icon']]))
1998
			$context['icon_sources'][$message['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $message['icon'] . '.png') ? 'images_url' : 'default_images_url';
1999
	}
@@ 1997-1998 (lines=2) @@
1994
			$context['icon_sources'][$message['first_icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $message['first_icon'] . '.png') ? 'images_url' : 'default_images_url';
1995
		if (!isset($context['icon_sources'][$message['last_icon']]))
1996
			$context['icon_sources'][$message['last_icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $message['last_icon'] . '.png') ? 'images_url' : 'default_images_url';
1997
		if (!isset($context['icon_sources'][$message['icon']]))
1998
			$context['icon_sources'][$message['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $message['icon'] . '.png') ? 'images_url' : 'default_images_url';
1999
	}
2000
	else
2001
	{

Sources/Display.php 1 location

@@ 1530-1531 (lines=2) @@
1527
	if (empty($modSettings['messageIconChecks_disable']))
1528
	{
1529
		// If the current icon isn't known, then we need to do something...
1530
		if (!isset($context['icon_sources'][$message['icon']]))
1531
			$context['icon_sources'][$message['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $message['icon'] . '.png') ? 'images_url' : 'default_images_url';
1532
	}
1533
	elseif (!isset($context['icon_sources'][$message['icon']]))
1534
		$context['icon_sources'][$message['icon']] = 'images_url';

Sources/MessageIndex.php 2 locations

@@ 444-445 (lines=2) @@
441
			// We need to check the topic icons exist...
442
			if (!empty($modSettings['messageIconChecks_enable']))
443
			{
444
				if (!isset($context['icon_sources'][$row['first_icon']]))
445
					$context['icon_sources'][$row['first_icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['first_icon'] . '.png') ? 'images_url' : 'default_images_url';
446
				if (!isset($context['icon_sources'][$row['last_icon']]))
447
					$context['icon_sources'][$row['last_icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['last_icon'] . '.png') ? 'images_url' : 'default_images_url';
448
			}
@@ 446-447 (lines=2) @@
443
			{
444
				if (!isset($context['icon_sources'][$row['first_icon']]))
445
					$context['icon_sources'][$row['first_icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['first_icon'] . '.png') ? 'images_url' : 'default_images_url';
446
				if (!isset($context['icon_sources'][$row['last_icon']]))
447
					$context['icon_sources'][$row['last_icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['last_icon'] . '.png') ? 'images_url' : 'default_images_url';
448
			}
449
			else
450
			{