Code Duplication    Length = 16-18 lines in 4 locations

class/xoopstopic.php 2 locations

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

class/class.newstopic.php 2 locations

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