Code Duplication    Length = 29-29 lines in 2 locations

class/xoopsstory.php 2 locations

@@ 439-467 (lines=29) @@
436
     *
437
     * @return string
438
     */
439
    public function hometext($format = 'Show')
440
    {
441
        $myts   = MyTextSanitizer::getInstance();
442
        $html   = 1;
443
        $smiley = 1;
444
        $xcodes = 1;
445
        if ($this->nohtml()) {
446
            $html = 0;
447
        }
448
        if ($this->nosmiley()) {
449
            $smiley = 0;
450
        }
451
        switch ($format) {
452
            case 'Show':
453
                $hometext = $myts->displayTarea($this->hometext, $html, $smiley, $xcodes);
454
                break;
455
            case 'Edit':
456
                $hometext = htmlspecialchars($this->hometext, ENT_QUOTES);
457
                break;
458
            case 'Preview':
459
                $hometext = $myts->previewTarea($this->hometext, $html, $smiley, $xcodes);
460
                break;
461
            case 'InForm':
462
                $hometext = htmlspecialchars($myts->stripSlashesGPC($this->hometext), ENT_QUOTES);
463
                break;
464
        }
465
466
        return $hometext;
467
    }
468
469
    /**
470
     * @param string $format
@@ 474-502 (lines=29) @@
471
     *
472
     * @return string
473
     */
474
    public function bodytext($format = 'Show')
475
    {
476
        $myts   = MyTextSanitizer::getInstance();
477
        $html   = 1;
478
        $smiley = 1;
479
        $xcodes = 1;
480
        if ($this->nohtml()) {
481
            $html = 0;
482
        }
483
        if ($this->nosmiley()) {
484
            $smiley = 0;
485
        }
486
        switch ($format) {
487
            case 'Show':
488
                $bodytext = $myts->displayTarea($this->bodytext, $html, $smiley, $xcodes);
489
                break;
490
            case 'Edit':
491
                $bodytext = htmlspecialchars($this->bodytext, ENT_QUOTES);
492
                break;
493
            case 'Preview':
494
                $bodytext = $myts->previewTarea($this->bodytext, $html, $smiley, $xcodes);
495
                break;
496
            case 'InForm':
497
                $bodytext = htmlspecialchars($myts->stripSlashesGPC($this->bodytext), ENT_QUOTES);
498
                break;
499
        }
500
501
        return $bodytext;
502
    }
503
504
    public function counter()
505
    {