Code Duplication    Length = 18-20 lines in 2 locations

class/class.newstopic.php 1 location

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

class/xoopsstory.php 1 location

@@ 367-386 (lines=20) @@
364
     *
365
     * @return mixed
366
     */
367
    public function title($format = 'Show')
368
    {
369
        $myts   = MyTextSanitizer::getInstance();
370
        $smiley = 1;
371
        if ($this->nosmiley()) {
372
            $smiley = 0;
373
        }
374
        switch ($format) {
375
            case 'Show':
376
            case 'Edit':
377
                $title = $myts->htmlSpecialChars($this->title);
378
                break;
379
            case 'Preview':
380
            case 'InForm':
381
                $title = $myts->htmlSpecialChars($myts->stripSlashesGPC($this->title));
382
                break;
383
        }
384
385
        return $title;
386
    }
387
388
    /**
389
     * @param string $format