Code Duplication    Length = 29-29 lines in 2 locations

class/xoopsstory.php 2 locations

@@ 386-414 (lines=29) @@
383
     *
384
     * @return string
385
     */
386
    public function hometext($format = 'Show')
387
    {
388
        $myts   = MyTextSanitizer::getInstance();
389
        $html   = 1;
390
        $smiley = 1;
391
        $xcodes = 1;
392
        if ($this->nohtml()) {
393
            $html = 0;
394
        }
395
        if ($this->nosmiley()) {
396
            $smiley = 0;
397
        }
398
        switch ($format) {
399
            case 'Show':
400
                $hometext = $myts->displayTarea($this->hometext, $html, $smiley, $xcodes);
401
                break;
402
            case 'Edit':
403
                $hometext = htmlspecialchars($this->hometext, ENT_QUOTES);
404
                break;
405
            case 'Preview':
406
                $hometext = $myts->previewTarea($this->hometext, $html, $smiley, $xcodes);
407
                break;
408
            case 'InForm':
409
                $hometext = htmlspecialchars($myts->stripSlashesGPC($this->hometext), ENT_QUOTES);
410
                break;
411
        }
412
413
        return $hometext;
414
    }
415
416
    /**
417
     * @param string $format
@@ 421-449 (lines=29) @@
418
     *
419
     * @return string
420
     */
421
    public function bodytext($format = 'Show')
422
    {
423
        $myts   = MyTextSanitizer::getInstance();
424
        $html   = 1;
425
        $smiley = 1;
426
        $xcodes = 1;
427
        if ($this->nohtml()) {
428
            $html = 0;
429
        }
430
        if ($this->nosmiley()) {
431
            $smiley = 0;
432
        }
433
        switch ($format) {
434
            case 'Show':
435
                $bodytext = $myts->displayTarea($this->bodytext, $html, $smiley, $xcodes);
436
                break;
437
            case 'Edit':
438
                $bodytext = htmlspecialchars($this->bodytext, ENT_QUOTES);
439
                break;
440
            case 'Preview':
441
                $bodytext = $myts->previewTarea($this->bodytext, $html, $smiley, $xcodes);
442
                break;
443
            case 'InForm':
444
                $bodytext = htmlspecialchars($myts->stripSlashesGPC($this->bodytext), ENT_QUOTES);
445
                break;
446
        }
447
448
        return $bodytext;
449
    }
450
451
    public function counter()
452
    {