Code Duplication    Length = 23-23 lines in 2 locations

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)

Sources/ManageSettings.php 1 location

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