Code Duplication    Length = 23-23 lines in 2 locations

Sources/ManageSettings.php 1 location

@@ 1083-1105 (lines=23) @@
1080
								$height = $matches[4][$key];
1081
1082
							// If the dimensions are still not fixed - we need to check the actual image.
1083
							if (($width == -1 && $sig_limits[5]) || ($height == -1 && $sig_limits[6]))
1084
							{
1085
								$sizes = url_image_size($matches[7][$key]);
1086
								if (is_array($sizes))
1087
								{
1088
									// Too wide?
1089
									if ($sizes[0] > $sig_limits[5] && $sig_limits[5])
1090
									{
1091
										$width = $sig_limits[5];
1092
										$sizes[1] = $sizes[1] * ($width / $sizes[0]);
1093
									}
1094
									// Too high?
1095
									if ($sizes[1] > $sig_limits[6] && $sig_limits[6])
1096
									{
1097
										$height = $sig_limits[6];
1098
										if ($width == -1)
1099
											$width = $sizes[0];
1100
										$width = $width * ($height / $sizes[1]);
1101
									}
1102
									elseif ($width != -1)
1103
										$height = $sizes[1];
1104
								}
1105
							}
1106
1107
							// Did we come up with some changes? If so remake the string.
1108
							if ($width != -1 || $height != -1)

Sources/Profile-Modify.php 1 location

@@ 3628-3650 (lines=23) @@
3625
						$height = $matches[4][$key];
3626
3627
					// If the dimensions are still not fixed - we need to check the actual image.
3628
					if (($width == -1 && $sig_limits[5]) || ($height == -1 && $sig_limits[6]))
3629
					{
3630
						$sizes = url_image_size($matches[7][$key]);
3631
						if (is_array($sizes))
3632
						{
3633
							// Too wide?
3634
							if ($sizes[0] > $sig_limits[5] && $sig_limits[5])
3635
							{
3636
								$width = $sig_limits[5];
3637
								$sizes[1] = $sizes[1] * ($width / $sizes[0]);
3638
							}
3639
							// Too high?
3640
							if ($sizes[1] > $sig_limits[6] && $sig_limits[6])
3641
							{
3642
								$height = $sig_limits[6];
3643
								if ($width == -1)
3644
									$width = $sizes[0];
3645
								$width = $width * ($height / $sizes[1]);
3646
							}
3647
							elseif ($width != -1)
3648
								$height = $sizes[1];
3649
						}
3650
					}
3651
3652
					// Did we come up with some changes? If so remake the string.
3653
					if ($width != -1 || $height != -1)