Code Duplication    Length = 10-10 lines in 2 locations

sources/upload/upload.attachments.php 1 location

@@ 185-194 (lines=10) @@
182
183
// Validate file extension
184
$ext = strtolower(getFileExtension($_REQUEST["name"]));
185
if (!in_array(
186
    $ext,
187
    explode(
188
        ',',
189
        $_SESSION['settings']['upload_docext'].','.$_SESSION['settings']['upload_imagesext'].
190
        ','.$_SESSION['settings']['upload_pkgext'].','.$_SESSION['settings']['upload_otherext']
191
    )
192
)) {
193
    handleAttachmentError('Invalid file extension.', 115);
194
}
195
196
// 5 minutes execution time
197
set_time_limit(5 * 60);

sources/upload/upload.files.php 1 location

@@ 143-152 (lines=10) @@
140
141
// Validate file extension
142
$ext = strtolower(getFileExtension($_REQUEST["name"]));
143
if (!in_array(
144
    $ext,
145
    explode(
146
        ',',
147
        $_SESSION['settings']['upload_docext'].','.$_SESSION['settings']['upload_imagesext'].
148
        ','.$_SESSION['settings']['upload_pkgext'].','.$_SESSION['settings']['upload_otherext']
149
    )
150
)) {
151
    handleUploadError('Invalid file extension.');
152
}
153
154
// is destination folder writable
155
if (!is_writable($_SESSION['settings']['path_to_files_folder'])) {