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