Code Duplication    Length = 18-20 lines in 2 locations

class/class.newstopic.php 1 location

@@ 545-562 (lines=18) @@
542
     *
543
     * @return mixed
544
     */
545
    public function topic_description($format = 'S')
546
    {
547
        $myts = MyTextSanitizer::getInstance();
548
        switch ($format) {
549
            case 'S':
550
                $topic_description = $myts->displayTarea($this->topic_description, 1);
551
                break;
552
            case 'P':
553
                $topic_description = $myts->previewTarea($this->topic_description);
554
                break;
555
            case 'F':
556
            case 'E':
557
                $topic_description = $myts->htmlSpecialChars($myts->stripSlashesGPC($this->topic_description));
558
                break;
559
        }
560
561
        return $topic_description;
562
    }
563
564
    /**
565
     * @param string $format

class/xoopsstory.php 1 location

@@ 413-432 (lines=20) @@
410
     *
411
     * @return mixed
412
     */
413
    public function title($format = 'Show')
414
    {
415
        $myts   = MyTextSanitizer::getInstance();
416
        $smiley = 1;
417
        if ($this->nosmiley()) {
418
            $smiley = 0;
419
        }
420
        switch ($format) {
421
            case 'Show':
422
            case 'Edit':
423
                $title = $myts->htmlSpecialChars($this->title);
424
                break;
425
            case 'Preview':
426
            case 'InForm':
427
                $title = $myts->htmlSpecialChars($myts->stripSlashesGPC($this->title));
428
                break;
429
        }
430
431
        return $title;
432
    }
433
434
    /**
435
     * @param string $format