Code Duplication    Length = 23-23 lines in 2 locations

Sources/ManageSettings.php 1 location

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

Sources/Profile-Modify.php 1 location

@@ 3521-3543 (lines=23) @@
3518
						$height = $matches[4][$key];
3519
3520
					// If the dimensions are still not fixed - we need to check the actual image.
3521
					if (($width == -1 && $sig_limits[5]) || ($height == -1 && $sig_limits[6]))
3522
					{
3523
						$sizes = url_image_size($matches[7][$key]);
3524
						if (is_array($sizes))
3525
						{
3526
							// Too wide?
3527
							if ($sizes[0] > $sig_limits[5] && $sig_limits[5])
3528
							{
3529
								$width = $sig_limits[5];
3530
								$sizes[1] = $sizes[1] * ($width / $sizes[0]);
3531
							}
3532
							// Too high?
3533
							if ($sizes[1] > $sig_limits[6] && $sig_limits[6])
3534
							{
3535
								$height = $sig_limits[6];
3536
								if ($width == -1)
3537
									$width = $sizes[0];
3538
								$width = $width * ($height / $sizes[1]);
3539
							}
3540
							elseif ($width != -1)
3541
								$height = $sizes[1];
3542
						}
3543
					}
3544
3545
					// Did we come up with some changes? If so remake the string.
3546
					if ($width != -1 || $height != -1)