Code Duplication    Length = 23-23 lines in 2 locations

Sources/ManageSettings.php 1 location

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