Code Duplication    Length = 2-2 lines in 3 locations

Sources/Subs.php 3 locations

@@ 2114-2115 (lines=2) @@
2111
				$pos2 = $pos - 1;
2112
2113
				// See the comment at the end of the big loop - just eating whitespace ;).
2114
				if (!empty($tag['block_level']) && substr($message, $pos, 4) == '<br>')
2115
					$message = substr($message, 0, $pos) . substr($message, $pos + 4);
2116
				if (!empty($tag['trim']) && $tag['trim'] != 'inside' && preg_match('~(<br>|&nbsp;|\s)*~', substr($message, $pos), $matches) != 0)
2117
					$message = substr($message, 0, $pos) . substr($message, $pos + strlen($matches[0]));
2118
			}
@@ 2389-2390 (lines=2) @@
2386
				$pos1 += $ot_strlen + 2;
2387
2388
				// Trim or eat trailing stuff... see comment at the end of the big loop.
2389
				if (!empty($open_tags[$i]['block_level']) && substr($message, $pos, 4) == '<br>')
2390
					$message = substr($message, 0, $pos) . substr($message, $pos + 4);
2391
				if (!empty($open_tags[$i]['trim']) && $tag['trim'] != 'inside' && preg_match('~(<br>|&nbsp;|\s)*~', substr($message, $pos), $matches) != 0)
2392
					$message = substr($message, 0, $pos) . substr($message, $pos + strlen($matches[0]));
2393
@@ 2564-2565 (lines=2) @@
2561
		}
2562
2563
		// If this is block level, eat any breaks after it.
2564
		if (!empty($tag['block_level']) && substr($message, $pos + 1, 4) == '<br>')
2565
			$message = substr($message, 0, $pos + 1) . substr($message, $pos + 5);
2566
2567
		// Are we trimming outside this tag?
2568
		if (!empty($tag['trim']) && $tag['trim'] != 'outside' && preg_match('~(<br>|&nbsp;|\s)*~', substr($message, $pos + 1), $matches) != 0)