Code Duplication    Length = 23-23 lines in 2 locations

Sources/Profile-Modify.php 1 location

@@ 3562-3584 (lines=23) @@
3559
						$height = $matches[4][$key];
3560
3561
					// If the dimensions are still not fixed - we need to check the actual image.
3562
					if (($width == -1 && $sig_limits[5]) || ($height == -1 && $sig_limits[6]))
3563
					{
3564
						$sizes = url_image_size($matches[7][$key]);
3565
						if (is_array($sizes))
3566
						{
3567
							// Too wide?
3568
							if ($sizes[0] > $sig_limits[5] && $sig_limits[5])
3569
							{
3570
								$width = $sig_limits[5];
3571
								$sizes[1] = $sizes[1] * ($width / $sizes[0]);
3572
							}
3573
							// Too high?
3574
							if ($sizes[1] > $sig_limits[6] && $sig_limits[6])
3575
							{
3576
								$height = $sig_limits[6];
3577
								if ($width == -1)
3578
									$width = $sizes[0];
3579
								$width = $width * ($height / $sizes[1]);
3580
							}
3581
							elseif ($width != -1)
3582
								$height = $sizes[1];
3583
						}
3584
					}
3585
3586
					// Did we come up with some changes? If so remake the string.
3587
					if ($width != -1 || $height != -1)

Sources/ManageSettings.php 1 location

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