Code Duplication    Length = 5-6 lines in 4 locations

app/Functions/FunctionsRtl.php 4 locations

@@ 849-853 (lines=5) @@
846
				// Look for " - " or blank preceding the ID number and remove it for inclusion in a separate LTR span
847
				if ($trailingID != '') {
848
					while ($textSpan != '') {
849
						if (substr($textSpan, -1) == ' ') {
850
							$trailingSeparator = ' ' . $trailingSeparator;
851
							$textSpan          = substr($textSpan, 0, -1);
852
							continue;
853
						}
854
						if (substr($textSpan, -6) == ' ') {
855
							$trailingSeparator = ' ' . $trailingSeparator;
856
							$textSpan          = substr($textSpan, 0, -6);
@@ 854-858 (lines=5) @@
851
							$textSpan          = substr($textSpan, 0, -1);
852
							continue;
853
						}
854
						if (substr($textSpan, -6) == ' ') {
855
							$trailingSeparator = ' ' . $trailingSeparator;
856
							$textSpan          = substr($textSpan, 0, -6);
857
							continue;
858
						}
859
						if (substr($textSpan, -1) == '-') {
860
							$trailingSeparator = '-' . $trailingSeparator;
861
							$textSpan          = substr($textSpan, 0, -1);
@@ 859-863 (lines=5) @@
856
							$textSpan          = substr($textSpan, 0, -6);
857
							continue;
858
						}
859
						if (substr($textSpan, -1) == '-') {
860
							$trailingSeparator = '-' . $trailingSeparator;
861
							$textSpan          = substr($textSpan, 0, -1);
862
							continue;
863
						}
864
						break;
865
					}
866
				}
@@ 882-887 (lines=6) @@
879
						$textSpan         = substr($textSpan, 6);
880
						continue;
881
					}
882
					if (substr($textSpan, 0, 1) == '-') {
883
						$leadingSeparator = '-' . $leadingSeparator;
884
						$textSpan         = substr($textSpan, 1);
885
						$foundSeparator   = true;
886
						continue;
887
					}
888
					break;
889
				}
890
				if (!$foundSeparator) {