Code Duplication    Length = 5-6 lines in 2 locations

Sources/QueryString.php 1 location

@@ 669-673 (lines=5) @@
666
			{
667
				global $scripturl; return '"' . $scripturl . "/" . strtr("$m[1]", '&;=', '//,') . ".html?" . SID . (isset($m[2]) ? $m[2] : "") . '"';
668
			}, $buffer);
669
		else
670
			$buffer = preg_replace_callback('~"' . preg_quote($scripturl, '/') . '\?((?:board|topic)=[^#"]+?)(#[^"]*?)?"~', function($m)
671
			{
672
				global $scripturl; return '"' . $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html' . (isset($m[2]) ? $m[2] : "") . '"';
673
			}, $buffer);
674
	}
675
676
	// Return the changed buffer.

Sources/Subs.php 1 location

@@ 2803-2808 (lines=6) @@
2800
				{
2801
					return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html?' . SID. (isset($m[2]) ? "$m[2]" : "");
2802
				}, $setLocation);
2803
		else
2804
			$setLocation = preg_replace_callback('~^' . preg_quote($scripturl, '/') . '\?((?:board|topic)=[^#"]+?)(#[^"]*?)?$~',
2805
				function ($m) use ($scripturl)
2806
				{
2807
					return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html' . (isset($m[2]) ? "$m[2]" : "");
2808
				}, $setLocation);
2809
	}
2810
2811
	// Maybe integrations want to change where we are heading?