Code Duplication    Length = 21-22 lines in 2 locations

htdocs/class/module.textsanitizer.php 2 locations

@@ 823-843 (lines=21) @@
820
     * @param  mixed   $bbcode
821
     * @return mixed|string
822
     */
823
    public function sanitizeForDisplay($text, $allowhtml = 0, $smiley = 1, $bbcode = 1)
824
    {
825
        $GLOBALS['xoopsLogger']->addDeprecated(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated');
826
        if ($allowhtml == 0) {
827
            $text = $this->htmlSpecialChars($text);
828
        } else {
829
            // $config =& $GLOBALS['xoopsConfig'];
830
            // $allowed = $config['allowed_html'];
831
            // $text = strip_tags($text, $allowed);
832
            $text = $this->makeClickable($text);
833
        }
834
        if ($smiley == 1) {
835
            $text = $this->smiley($text);
836
        }
837
        if ($bbcode == 1) {
838
            $text =& $this->xoopsCodeDecode($text);
839
        }
840
        $text = $this->nl2Br($text);
841
842
        return $text;
843
    }
844
845
    /**
846
     * MyTextSanitizer::sanitizeForPreview()
@@ 854-875 (lines=22) @@
851
     * @param  mixed   $bbcode
852
     * @return mixed|string
853
     */
854
    public function sanitizeForPreview($text, $allowhtml = 0, $smiley = 1, $bbcode = 1)
855
    {
856
        $GLOBALS['xoopsLogger']->addDeprecated(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated');
857
        $text = $this->oopsStripSlashesGPC($text);
858
        if ($allowhtml == 0) {
859
            $text = $this->htmlSpecialChars($text);
860
        } else {
861
            // $config =& $GLOBALS['xoopsConfig'];
862
            // $allowed = $config['allowed_html'];
863
            // $text = strip_tags($text, $allowed);
864
            $text = $this->makeClickable($text);
865
        }
866
        if ($smiley == 1) {
867
            $text = $this->smiley($text);
868
        }
869
        if ($bbcode == 1) {
870
            $text =& $this->xoopsCodeDecode($text);
871
        }
872
        $text = $this->nl2Br($text);
873
874
        return $text;
875
    }
876
877
    /**
878
     * MyTextSanitizer::makeTboxData4Save()