Code Duplication    Length = 11-12 lines in 2 locations

Sources/Subs-Attachments.php 1 location

@@ 1169-1180 (lines=12) @@
1166
					if (createThumbnail($filename, $modSettings['attachmentThumbWidth'], $modSettings['attachmentThumbHeight']))
1167
					{
1168
						// So what folder are we putting this image in?
1169
						if (!empty($modSettings['currentAttachmentUploadDir']))
1170
						{
1171
							if (!is_array($modSettings['attachmentUploadDir']))
1172
								$modSettings['attachmentUploadDir'] = smf_json_decode($modSettings['attachmentUploadDir'], true);
1173
							$path = $modSettings['attachmentUploadDir'][$modSettings['currentAttachmentUploadDir']];
1174
							$id_folder_thumb = $modSettings['currentAttachmentUploadDir'];
1175
						}
1176
						else
1177
						{
1178
							$path = $modSettings['attachmentUploadDir'];
1179
							$id_folder_thumb = 1;
1180
						}
1181
1182
						// Calculate the size of the created thumbnail.
1183
						$size = @getimagesize($filename . '_thumb');

Sources/Subs.php 1 location

@@ 3107-3117 (lines=11) @@
3104
			}
3105
3106
			// We are already checking so many files...just few more doesn't make any difference! :P
3107
			if (!empty($modSettings['currentAttachmentUploadDir']))
3108
			{
3109
				if (!is_array($modSettings['attachmentUploadDir']))
3110
					$modSettings['attachmentUploadDir'] = smf_json_decode($modSettings['attachmentUploadDir'], true);
3111
				$path = $modSettings['attachmentUploadDir'][$modSettings['currentAttachmentUploadDir']];
3112
			}
3113
			else
3114
			{
3115
				$path = $modSettings['attachmentUploadDir'];
3116
				$id_folder_thumb = 1;
3117
			}
3118
			secureDirectory($path, true);
3119
			secureDirectory($cachedir);
3120