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/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)

Sources/QueryString.php 1 location

@@ 687-688 (lines=2) @@
684
	if (empty($_COOKIE) && SID != '' && !isBrowser('possibly_robot'))
685
		$buffer = preg_replace('/(?<!<link rel="canonical" href=)"' . preg_quote($scripturl, '/') . '(?!\?' . preg_quote(SID, '/') . ')\\??/', '"' . $scripturl . '?' . SID . '&amp;', $buffer);
686
	// Debugging templates, are we?
687
	elseif (isset($_GET['debug']))
688
		$buffer = preg_replace('/(?<!<link rel="canonical" href=)"' . preg_quote($scripturl, '/') . '\\??/', '"' . $scripturl . '?debug;', $buffer);
689
690
	// This should work even in 4.2.x, just not CGI without cgi.fix_pathinfo.
691
	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/Logging.php 1 location

@@ 338-339 (lines=2) @@
335
				$is_select = true;
336
337
			// Make the filenames look a bit better.
338
			if (isset($query_data['f']))
339
				$query_data['f'] = preg_replace('~^' . preg_quote($boarddir, '~') . '~', '...', $query_data['f']);
340
341
			echo '
342
	<strong>', $is_select ? '<a href="' . $scripturl . '?action=viewquery;qq=' . ($q + 1) . '#qq' . $q . '" target="_blank" rel="noopener" style="text-decoration: none;">' : '', nl2br(str_replace("\t", '&nbsp;&nbsp;&nbsp;', $smcFunc['htmlspecialchars'](ltrim($query_data['q'], "\n\r")))) . ($is_select ? '</a></strong>' : '</strong>') . '<br>

Sources/Subs.php 1 location

@@ 2923-2924 (lines=2) @@
2920
	if (defined('SID') && SID != '')
2921
		$setLocation = preg_replace('/^' . preg_quote($scripturl, '/') . '(?!\?' . preg_quote(SID, '/') . ')\\??/', $scripturl . '?' . SID . ';', $setLocation);
2922
	// Keep that debug in their for template debugging!
2923
	elseif (isset($_GET['debug']))
2924
		$setLocation = preg_replace('/^' . preg_quote($scripturl, '/') . '\\??/', $scripturl . '?debug;', $setLocation);
2925
2926
	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'])))
2927
	{