Code Duplication    Length = 2-2 lines in 5 locations

Sources/Class-Package.php 1 location

@@ 358-359 (lines=2) @@
355
		{
356
			// Find and remove the next tag.
357
			preg_match('/\A<([\w\-:]+)((?:\s+.+?)?)([\s]?\/)?' . '>/', $data, $match);
358
			if (isset($match[0]))
359
				$data = preg_replace('/' . preg_quote($match[0], '/') . '/s', '', $data, 1);
360
361
			// Didn't find a tag?  Keep looping....
362
			if (!isset($match[1]) || $match[1] == '')

Sources/Logging.php 1 location

@@ 305-306 (lines=2) @@
302
				$is_select = true;
303
304
			// Make the filenames look a bit better.
305
			if (isset($qq['f']))
306
				$qq['f'] = preg_replace('~^' . preg_quote($boarddir, '~') . '~', '...', $qq['f']);
307
308
			echo '
309
	<strong>', $is_select ? '<a href="' . $scripturl . '?action=viewquery;qq=' . ($q + 1) . '#qq' . $q . '" target="_blank" class="new_win" style="text-decoration: none;">' : '', nl2br(str_replace("\t", '&nbsp;&nbsp;&nbsp;', $smcFunc['htmlspecialchars'](ltrim($qq['q'], "\n\r")))) . ($is_select ? '</a></strong>' : '</strong>') . '<br>

Sources/QueryString.php 1 location

@@ 657-658 (lines=2) @@
654
	if (empty($_COOKIE) && SID != '' && !isBrowser('possibly_robot'))
655
		$buffer = preg_replace('/(?<!<link rel="canonical" href=)"' . preg_quote($scripturl, '/') . '(?!\?' . preg_quote(SID, '/') . ')\\??/', '"' . $scripturl . '?' . SID . '&amp;', $buffer);
656
	// Debugging templates, are we?
657
	elseif (isset($_GET['debug']))
658
		$buffer = preg_replace('/(?<!<link rel="canonical" href=)"' . preg_quote($scripturl, '/') . '\\??/', '"' . $scripturl . '?debug;', $buffer);
659
660
	// This should work even in 4.2.x, just not CGI without cgi.fix_pathinfo.
661
	if (!empty($modSettings['queryless_urls']) && (!$context['server']['is_cgi'] || ini_get('cgi.fix_pathinfo') == 1 || @get_cfg_var('cgi.fix_pathinfo') == 1) && ($context['server']['is_apache'] || $context['server']['is_lighttpd'] || $context['server']['is_litespeed']))

Sources/Subs.php 1 location

@@ 2766-2767 (lines=2) @@
2763
	if (defined('SID') && SID != '')
2764
		$setLocation = preg_replace('/^' . preg_quote($scripturl, '/') . '(?!\?' . preg_quote(SID, '/') . ')\\??/', $scripturl . '?' . SID . ';', $setLocation);
2765
	// Keep that debug in their for template debugging!
2766
	elseif (isset($_GET['debug']))
2767
		$setLocation = preg_replace('/^' . preg_quote($scripturl, '/') . '\\??/', $scripturl . '?debug;', $setLocation);
2768
2769
	if (!empty($modSettings['queryless_urls']) && (empty($context['server']['is_cgi']) || ini_get('cgi.fix_pathinfo') == 1 || @get_cfg_var('cgi.fix_pathinfo') == 1) && (!empty($context['server']['is_apache']) || !empty($context['server']['is_lighttpd']) || !empty($context['server']['is_litespeed'])))
2770
	{

Sources/ViewQuery.php 1 location

@@ 94-95 (lines=2) @@
91
		$query_data['q'] = implode("\n", $query);
92
93
		// Make the filenames look a bit better.
94
		if (isset($query_data['f']))
95
			$query_data['f'] = preg_replace('~^' . preg_quote($boarddir, '~') . '~', '...', $query_data['f']);
96
97
		$is_select_query = substr(trim($query_data['q']), 0, 6) == 'SELECT';
98
		if ($is_select_query)