Code Duplication    Length = 16-18 lines in 4 locations

class/class.newstopic.php 2 locations

@@ 451-468 (lines=18) @@
448
     *
449
     * @return mixed
450
     */
451
    public function topic_rssurl($format = 'S')
452
    {
453
        $myts = MyTextSanitizer::getInstance();
454
        switch ($format) {
455
            case 'S':
456
                $topic_rssurl = $myts->displayTarea($this->topic_rssurl);
457
                break;
458
            case 'P':
459
                $topic_rssurl = $myts->previewTarea($this->topic_rssurl);
460
                break;
461
            case 'F':
462
            case 'E':
463
                $topic_rssurl = $myts->htmlSpecialChars($this->topic_rssurl);
464
                break;
465
        }
466
467
        return $topic_rssurl;
468
    }
469
470
    /**
471
     * @param string $format
@@ 475-492 (lines=18) @@
472
     *
473
     * @return mixed
474
     */
475
    public function topic_color($format = 'S')
476
    {
477
        $myts = MyTextSanitizer::getInstance();
478
        switch ($format) {
479
            case 'S':
480
                $topic_color = $myts->displayTarea($this->topic_color);
481
                break;
482
            case 'P':
483
                $topic_color = $myts->previewTarea($this->topic_color);
484
                break;
485
            case 'F':
486
            case 'E':
487
                $topic_color = $myts->htmlSpecialChars($this->topic_color);
488
                break;
489
        }
490
491
        return $topic_color;
492
    }
493
494
    /**
495
     * @return mixed

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