Code Duplication    Length = 24-24 lines in 3 locations

class/class.sfiles.php 3 locations

@@ 291-314 (lines=24) @@
288
     *
289
     * @return mixed
290
     */
291
    public function getFileRealName($format = 'S')
292
    {
293
        $myts = MyTextSanitizer::getInstance();
294
        switch ($format) {
295
            case 'S':
296
            case 'Show':
297
                $filerealname = $myts->htmlSpecialChars($this->filerealname);
298
                break;
299
            case 'E':
300
            case 'Edit':
301
                $filerealname = $myts->htmlSpecialChars($this->filerealname);
302
                break;
303
            case 'P':
304
            case 'Preview':
305
                $filerealname = $myts->htmlSpecialChars($myts->stripSlashesGPC($this->filerealname));
306
                break;
307
            case 'F':
308
            case 'InForm':
309
                $filerealname = $myts->htmlSpecialChars($myts->stripSlashesGPC($this->filerealname));
310
                break;
311
        }
312
313
        return $filerealname;
314
    }
315
316
    /**
317
     * @param string $format
@@ 321-344 (lines=24) @@
318
     *
319
     * @return mixed
320
     */
321
    public function getMimetype($format = 'S')
322
    {
323
        $myts = MyTextSanitizer::getInstance();
324
        switch ($format) {
325
            case 'S':
326
            case 'Show':
327
                $filemimetype = $myts->htmlSpecialChars($this->mimetype);
328
                break;
329
            case 'E':
330
            case 'Edit':
331
                $filemimetype = $myts->htmlSpecialChars($this->mimetype);
332
                break;
333
            case 'P':
334
            case 'Preview':
335
                $filemimetype = $myts->htmlSpecialChars($myts->stripSlashesGPC($this->mimetype));
336
                break;
337
            case 'F':
338
            case 'InForm':
339
                $filemimetype = $myts->htmlSpecialChars($myts->stripSlashesGPC($this->mimetype));
340
                break;
341
        }
342
343
        return $filemimetype;
344
    }
345
346
    /**
347
     * @param string $format
@@ 351-374 (lines=24) @@
348
     *
349
     * @return mixed
350
     */
351
    public function getDownloadname($format = 'S')
352
    {
353
        $myts = MyTextSanitizer::getInstance();
354
        switch ($format) {
355
            case 'S':
356
            case 'Show':
357
                $filedownname = $myts->htmlSpecialChars($this->downloadname);
358
                break;
359
            case 'E':
360
            case 'Edit':
361
                $filedownname = $myts->htmlSpecialChars($this->downloadname);
362
                break;
363
            case 'P':
364
            case 'Preview':
365
                $filedownname = $myts->htmlSpecialChars($myts->stripSlashesGPC($this->downloadname));
366
                break;
367
            case 'F':
368
            case 'InForm':
369
                $filedownname = $myts->htmlSpecialChars($myts->stripSlashesGPC($this->downloadname));
370
                break;
371
        }
372
373
        return $filedownname;
374
    }
375
376
    // Deprecated
377
    /**