Code Duplication    Length = 23-23 lines in 2 locations

Sources/ManageSettings.php 1 location

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

Sources/Profile-Modify.php 1 location

@@ 3546-3568 (lines=23) @@
3543
						$height = $matches[4][$key];
3544
3545
					// If the dimensions are still not fixed - we need to check the actual image.
3546
					if (($width == -1 && $sig_limits[5]) || ($height == -1 && $sig_limits[6]))
3547
					{
3548
						$sizes = url_image_size($matches[7][$key]);
3549
						if (is_array($sizes))
3550
						{
3551
							// Too wide?
3552
							if ($sizes[0] > $sig_limits[5] && $sig_limits[5])
3553
							{
3554
								$width = $sig_limits[5];
3555
								$sizes[1] = $sizes[1] * ($width / $sizes[0]);
3556
							}
3557
							// Too high?
3558
							if ($sizes[1] > $sig_limits[6] && $sig_limits[6])
3559
							{
3560
								$height = $sig_limits[6];
3561
								if ($width == -1)
3562
									$width = $sizes[0];
3563
								$width = $width * ($height / $sizes[1]);
3564
							}
3565
							elseif ($width != -1)
3566
								$height = $sizes[1];
3567
						}
3568
					}
3569
3570
					// Did we come up with some changes? If so remake the string.
3571
					if ($width != -1 || $height != -1)