Code Duplication    Length = 16-18 lines in 4 locations

class/class.newstopic.php 2 locations

@@ 484-501 (lines=18) @@
481
     *
482
     * @return mixed
483
     */
484
    public function topic_rssurl($format = 'S')
485
    {
486
        $myts = MyTextSanitizer::getInstance();
487
        switch ($format) {
488
            case 'S':
489
                $topic_rssurl = $myts->displayTarea($this->topic_rssurl);
490
                break;
491
            case 'P':
492
                $topic_rssurl = $myts->previewTarea($this->topic_rssurl);
493
                break;
494
            case 'F':
495
            case 'E':
496
                $topic_rssurl = $myts->htmlSpecialChars($this->topic_rssurl);
497
                break;
498
        }
499
500
        return $topic_rssurl;
501
    }
502
503
    /**
504
     * @param string $format
@@ 508-525 (lines=18) @@
505
     *
506
     * @return mixed
507
     */
508
    public function topic_color($format = 'S')
509
    {
510
        $myts = MyTextSanitizer::getInstance();
511
        switch ($format) {
512
            case 'S':
513
                $topic_color = $myts->displayTarea($this->topic_color);
514
                break;
515
            case 'P':
516
                $topic_color = $myts->previewTarea($this->topic_color);
517
                break;
518
            case 'F':
519
            case 'E':
520
                $topic_color = $myts->htmlSpecialChars($this->topic_color);
521
                break;
522
        }
523
524
        return $topic_color;
525
    }
526
527
    /**
528
     * @return mixed

class/xoopstopic.php 2 locations

@@ 234-249 (lines=16) @@
231
     *
232
     * @return mixed
233
     */
234
    public function topic_title($format = 'S')
235
    {
236
        $myts = MyTextSanitizer::getInstance();
237
        switch ($format) {
238
            case 'S':
239
            case 'E':
240
                $title = $myts->htmlSpecialChars($this->topic_title);
241
                break;
242
            case 'P':
243
            case 'F':
244
                $title = $myts->htmlSpecialChars($myts->stripSlashesGPC($this->topic_title));
245
                break;
246
        }
247
248
        return $title;
249
    }
250
251
    /**
252
     * @param string $format
@@ 256-271 (lines=16) @@
253
     *
254
     * @return mixed
255
     */
256
    public function topic_imgurl($format = 'S')
257
    {
258
        $myts = MyTextSanitizer::getInstance();
259
        switch ($format) {
260
            case 'S':
261
            case 'E':
262
                $imgurl = $myts->htmlSpecialChars($this->topic_imgurl);
263
                break;
264
            case 'P':
265
            case 'F':
266
                $imgurl = $myts->htmlSpecialChars($myts->stripSlashesGPC($this->topic_imgurl));
267
                break;
268
        }
269
270
        return $imgurl;
271
    }
272
273
    /**
274
     * @return null