home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / CMS / xoops-2.0.18.1.exe / xoops-2.0.18.1 / htdocs / class / module.textsanitizer.php < prev    next >
Encoding:
PHP Script  |  2008-01-26  |  17.7 KB  |  582 lines

  1. <?php
  2. // $Id: module.textsanitizer.php 1276 2008-01-26 06:31:31Z phppp $
  3. //  ------------------------------------------------------------------------ //
  4. //                XOOPS - PHP Content Management System                      //
  5. //                    Copyright (c) 2000 XOOPS.org                           //
  6. //                       <http://www.xoops.org/>                             //
  7. //  ------------------------------------------------------------------------ //
  8. //  This program is free software; you can redistribute it and/or modify     //
  9. //  it under the terms of the GNU General Public License as published by     //
  10. //  the Free Software Foundation; either version 2 of the License, or        //
  11. //  (at your option) any later version.                                      //
  12. //                                                                           //
  13. //  You may not change or alter any portion of this comment or credits       //
  14. //  of supporting developers from this source code or any supporting         //
  15. //  source code which is considered copyrighted (c) material of the          //
  16. //  original comment or credit authors.                                      //
  17. //                                                                           //
  18. //  This program is distributed in the hope that it will be useful,          //
  19. //  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
  20. //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
  21. //  GNU General Public License for more details.                             //
  22. //                                                                           //
  23. //  You should have received a copy of the GNU General Public License        //
  24. //  along with this program; if not, write to the Free Software              //
  25. //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
  26. //  ------------------------------------------------------------------------ //
  27. // Author: Kazumi Ono (http://www.myweb.ne.jp/, http://jp.xoops.org/)        //
  28. //         Goghs Cheng (http://www.eqiao.com, http://www.devbeez.com/)       //
  29. // Project: The XOOPS Project (http://www.xoops.org/)                        //
  30. // ------------------------------------------------------------------------- //
  31.  
  32. /**
  33.  * Class to "clean up" text for various uses
  34.  *
  35.  * <b>Singleton</b>
  36.  *
  37.  * @package        kernel
  38.  * @subpackage    core
  39.  *
  40.  * @author        Kazumi Ono     <onokazu@xoops.org>
  41.  * @author      Goghs Cheng
  42.  * @copyright    (c) 2000-2003 The Xoops Project - www.xoops.org
  43.  */
  44. class MyTextSanitizer
  45. {
  46.     /**
  47.      * @var    array
  48.      */
  49.     var $smileys = array();
  50.  
  51.     /**
  52.      *
  53.      */
  54.     var $censorConf;
  55.  
  56.     /*
  57.     * Constructor of this class
  58.     *
  59.     * Gets allowed html tags from admin config settings
  60.     * <br> should not be allowed since nl2br will be used
  61.     * when storing data.
  62.     *
  63.     * @access    private
  64.     *
  65.     * @todo Sofar, this does nuttin' ;-)
  66.     */
  67.     function MyTextSanitizer()
  68.     {
  69.  
  70.     }
  71.  
  72.     /**
  73.      * Access the only instance of this class
  74.      *
  75.      * @return    object
  76.      *
  77.      * @static
  78.      * @staticvar   object
  79.      */
  80.     function &getInstance()
  81.     {
  82.         static $instance;
  83.         if (!isset($instance)) {
  84.             $instance = new MyTextSanitizer();
  85.         }
  86.         return $instance;
  87.     }
  88.  
  89.     /**
  90.      * Get the smileys
  91.      *
  92.      * @param    boole  $isAll TRUE for all smileys, FALSE for smileys with display = 1
  93.      * @return    array
  94.      */
  95.     function getSmileys( $isAll = TRUE )
  96.     {
  97.         if (count($this->smileys) == 0) {
  98.             if ($getsmiles = $GLOBALS["xoopsDB"]->query("SELECT * FROM ".$GLOBALS["xoopsDB"]->prefix("smiles"))) {
  99.                 while ($smiles = $GLOBALS["xoopsDB"]->fetchArray($getsmiles)) {
  100.                     array_push($this->smileys, $smiles);
  101.                 }
  102.             }
  103.         }
  104.         if ($isAll) {
  105.             return $this->smileys;
  106.         }
  107.         
  108.         $smileys = array();
  109.         foreach ($this->smileys as $smile) {
  110.             if (empty($smile['display'])) continue;
  111.             $smileys[] = $smile;
  112.         }
  113.         return $smileys;
  114.     }
  115.  
  116.     /**
  117.      * Replace emoticons in the message with smiley images
  118.      *
  119.      * @param    string  $message
  120.      *
  121.      * @return    string
  122.      */
  123.     function smiley($message)
  124.     {
  125.         $smileys = $this->getSmileys();
  126.         foreach ($smileys as $smile) {
  127.             $message = str_replace($smile['code'], '<img src="'.XOOPS_UPLOAD_URL.'/'.htmlspecialchars($smile['smile_url']).'" alt="" />', $message);
  128.         }
  129.         return $message;
  130.     }
  131.  
  132.     /**
  133.      * Make links in the text clickable
  134.      *
  135.      * @param   string  $text
  136.      * @return  string
  137.      **/
  138.     function makeClickable(&$text)
  139.     {
  140.         $patterns = array("/(^|[^]_a-z0-9-=\"'\/])([a-z]+?):\/\/([^, \r\n\"\(\)'<>]+)/i", "/(^|[^]_a-z0-9-=\"'\/])www\.([a-z0-9\-]+)\.([^, \r\n\"\(\)'<>]+)/i", "/(^|[^]_a-z0-9-=\"'\/])ftp\.([a-z0-9\-]+)\.([^, \r\n\"\(\)'<>]+)/i", "/(^|[^]_a-z0-9-=\"'\/:\.])([a-z0-9\-_\.]+?)@([^, \r\n\"\(\)'<>\[\]]+)/i");
  141.         $replacements = array("\\1<a href=\"\\2://\\3\" target=\"_blank\">\\2://\\3</a>", "\\1<a href=\"http://www.\\2.\\3\" target=\"_blank\">www.\\2.\\3</a>", "\\1<a href=\"ftp://ftp.\\2.\\3\" target=\"_blank\">ftp.\\2.\\3</a>", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>");
  142.         return preg_replace($patterns, $replacements, $text);
  143.     }
  144.  
  145.     /**
  146.      * Replace XoopsCodes with their equivalent HTML formatting
  147.      *
  148.      * @param   string  $text
  149.      * @param   bool    $allowimage Allow images in the text?
  150.      *                              On FALSE, uses links to images.
  151.      * @return  string
  152.      **/
  153.     function &xoopsCodeDecode(&$text, $allowimage = 1)
  154.     {
  155.         $patterns = array();
  156.         $replacements = array();
  157.         //$patterns[] = "/\[code](.*)\[\/code\]/esU";
  158.         //$replacements[] = "'<div class=\"xoopsCode\"><code><pre>'.wordwrap(MyTextSanitizer::htmlSpecialChars('\\1'), 100).'</pre></code></div>'";
  159.         // RMV: added new markup for intrasite url (allows easier site moves)
  160.         // TODO: automatically convert other URLs to this format if XOOPS_URL matches??
  161.         $patterns[] = "/\[siteurl=(['\"]?)([^\"'<>]*)\\1](.*)\[\/siteurl\]/sU";
  162.         $replacements[] = '<a href="'.XOOPS_URL.'/\\2">\\3</a>';
  163.         $patterns[] = "/\[url=(['\"]?)(http[s]?:\/\/[^\"'<>]*)\\1](.*)\[\/url\]/sU";
  164.         $replacements[] = '<a href="\\2" target="_blank">\\3</a>';
  165.         $patterns[] = "/\[url=(['\"]?)(ftp?:\/\/[^\"'<>]*)\\1](.*)\[\/url\]/sU";
  166.         $replacements[] = '<a href="\\2" target="_blank">\\3</a>';
  167.         $patterns[] = "/\[url=(['\"]?)([^\"'<>]*)\\1](.*)\[\/url\]/sU";
  168.         $replacements[] = '<a href="http://\\2" target="_blank">\\3</a>';
  169.         $patterns[] = "/\[color=(['\"]?)([a-zA-Z0-9]*)\\1](.*)\[\/color\]/sU";
  170.         $replacements[] = '<span style="color: #\\2;">\\3</span>';
  171.         $patterns[] = "/\[size=(['\"]?)([a-z0-9-]*)\\1](.*)\[\/size\]/sU";
  172.         $replacements[] = '<span style="font-size: \\2;">\\3</span>';
  173.         $patterns[] = "/\[font=(['\"]?)([^;<>\*\(\)\"']*)\\1](.*)\[\/font\]/sU";
  174.         $replacements[] = '<span style="font-family: \\2;">\\3</span>';
  175.         $patterns[] = "/\[email]([^;<>\*\(\)\"']*)\[\/email\]/sU";
  176.         $replacements[] = '<a href="mailto:\\1">\\1</a>';
  177.         $patterns[] = "/\[b](.*)\[\/b\]/sU";
  178.         $replacements[] = '<b>\\1</b>';
  179.         $patterns[] = "/\[i](.*)\[\/i\]/sU";
  180.         $replacements[] = '<i>\\1</i>';
  181.         $patterns[] = "/\[u](.*)\[\/u\]/sU";
  182.         $replacements[] = '<u>\\1</u>';
  183.         $patterns[] = "/\[d](.*)\[\/d\]/sU";
  184.         $replacements[] = '<del>\\1</del>';
  185.         //$patterns[] = "/\[li](.*)\[\/li\]/sU";
  186.         //$replacements[] = '<li>\\1</li>';
  187.         $patterns[] = "/\[img align=(['\"]?)(left|center|right)\\1]([^\"\(\)\?\&'<>]*)\[\/img\]/sU";
  188.         $patterns[] = "/\[img]([^\"\(\)\?\&'<>]*)\[\/img\]/sU";
  189.         $patterns[] = "/\[img align=(['\"]?)(left|center|right)\\1 id=(['\"]?)([0-9]*)\\3]([^\"\(\)\?\&'<>]*)\[\/img\]/sU";
  190.         $patterns[] = "/\[img id=(['\"]?)([0-9]*)\\1]([^\"\(\)\?\&'<>]*)\[\/img\]/sU";
  191.         if ($allowimage != 1) {
  192.             $replacements[] = '<a href="\\3" target="_blank">\\3</a>';
  193.             $replacements[] = '<a href="\\1" target="_blank">\\1</a>';
  194.             $replacements[] = '<a href="'.XOOPS_URL.'/image.php?id=\\4" target="_blank">\\5</a>';
  195.             $replacements[] = '<a href="'.XOOPS_URL.'/image.php?id=\\2" target="_blank">\\3</a>';
  196.         } else {
  197.             $replacements[] = '<img src="\\3" align="\\2" alt="" />';
  198.             $replacements[] = '<img src="\\1" alt="" />';
  199.             $replacements[] = '<img src="'.XOOPS_URL.'/image.php?id=\\4" align="\\2" alt="\\5" />';
  200.             $replacements[] = '<img src="'.XOOPS_URL.'/image.php?id=\\2" alt="\\3" />';
  201.         }
  202.         $patterns[] = "/\[quote]/sU";
  203.         $replacements[] = _QUOTEC.'<div class="xoopsQuote"><blockquote>';
  204.         //$replacements[] = 'Quote: <div class="xoopsQuote"><blockquote>';
  205.         $patterns[] = "/\[\/quote]/sU";
  206.         $replacements[] = '</blockquote></div>';
  207.         $text = str_replace( "\x00", "", $text );
  208.         $c = "[\x01-\x1f]*";
  209.         $patterns[] = "/j{$c}a{$c}v{$c}a{$c}s{$c}c{$c}r{$c}i{$c}p{$c}t{$c}:/si";
  210.         $replacements[] = "(script removed)";
  211.         $patterns[] = "/a{$c}b{$c}o{$c}u{$c}t{$c}:/si";
  212.         $replacements[] = "about :";
  213.         $text = preg_replace($patterns, $replacements, $text);
  214.         return $text;
  215.     }
  216.  
  217.     /**
  218.      * Convert linebreaks to <br /> tags
  219.      *
  220.      * @param    string  $text
  221.      *
  222.      * @return    string
  223.      */
  224.     function nl2Br($text)
  225.     {
  226.         return preg_replace("/(\015\012)|(\015)|(\012)/","<br />",$text);
  227.     }
  228.  
  229.     /**
  230.      * Add slashes to the text if magic_quotes_gpc is turned off.
  231.      *
  232.      * @param   string  $text
  233.      * @return  string
  234.      **/
  235.     function addSlashes($text)
  236.     {
  237.         if (!get_magic_quotes_gpc()) {
  238.             $text = addslashes($text);
  239.         }
  240.         return $text;
  241.     }
  242.     /*
  243.     * if magic_quotes_gpc is on, stirip back slashes
  244.     *
  245.     * @param    string  $text
  246.     *
  247.     * @return    string
  248.     */
  249.     function stripSlashesGPC($text)
  250.     {
  251.         if (get_magic_quotes_gpc()) {
  252.             $text = stripslashes($text);
  253.         }
  254.         return $text;
  255.     }
  256.  
  257.     /*
  258.     *  for displaying data in html textbox forms
  259.     *
  260.     * @param    string  $text
  261.     *
  262.     * @return    string
  263.     */
  264.     function htmlSpecialChars($text)
  265.     {
  266.         //return preg_replace("/&/i", '&', htmlspecialchars($text, ENT_QUOTES));
  267.         return preg_replace(array("/&/i", "/ /i"), array('&', '&nbsp;'), htmlspecialchars($text, ENT_QUOTES));
  268.     }
  269.  
  270.     /**
  271.      * Reverses {@link htmlSpecialChars()}
  272.      *
  273.      * @param   string  $text
  274.      * @return  string
  275.      **/
  276.     function undoHtmlSpecialChars( $text )
  277.     {
  278.         return preg_replace(array("/>/i", "/</i", "/"/i", "/'/i", '/&nbsp;/i'), array(">", "<", "\"", "'", " "), $text);
  279.     }
  280.  
  281.     /**
  282.      * Filters textarea form data in DB for display
  283.      *
  284.      * @param   string  $text
  285.      * @param   bool    $html   allow html?
  286.      * @param   bool    $smiley allow smileys?
  287.      * @param   bool    $xcode  allow xoopscode?
  288.      * @param   bool    $image  allow inline images?
  289.      * @param   bool    $br     convert linebreaks?
  290.      * @return  string
  291.      **/
  292.     function &displayTarea( $text, $html = 0, $smiley = 1, $xcode = 1, $image = 1, $br = 1)
  293.     {
  294.         if ($html != 1) {
  295.             // html not allowed
  296.             $text = $this->htmlSpecialChars($text);
  297.         }
  298.         $text = $this->codePreConv($text, $xcode); // Ryuji_edit(2003-11-18)
  299.         $text = $this->makeClickable($text);
  300.         if ($smiley != 0) {
  301.             // process smiley
  302.             $text = $this->smiley($text);
  303.         }
  304.         if ($xcode != 0) {
  305.             // decode xcode
  306.             if ($image != 0) {
  307.                 // image allowed
  308.                 $text = $this->xoopsCodeDecode($text);
  309.             } else {
  310.                 // image not allowed
  311.                 $text = $this->xoopsCodeDecode($text, 0);
  312.             }
  313.         }
  314.         if ($br != 0) {
  315.             $text = $this->nl2Br($text);
  316.         }
  317.         $text = $this->codeConv($text, $xcode, $image);    // Ryuji_edit(2003-11-18)
  318.         return $text;
  319.     }
  320.  
  321.     /**
  322.      * Filters textarea form data submitted for preview
  323.      *
  324.      * @param   string  $text
  325.      * @param   bool    $html   allow html?
  326.      * @param   bool    $smiley allow smileys?
  327.      * @param   bool    $xcode  allow xoopscode?
  328.      * @param   bool    $image  allow inline images?
  329.      * @param   bool    $br     convert linebreaks?
  330.      * @return  string
  331.      **/
  332.     function &previewTarea( $text, $html = 0, $smiley = 1, $xcode = 1, $image = 1, $br = 1)
  333.     {
  334.         $text = $this->stripSlashesGPC($text);
  335.         if ($html != 1) {
  336.             // html not allowed
  337.             $text = $this->htmlSpecialChars($text);
  338.         }
  339.         $text = $this->codePreConv($text, $xcode); // Ryuji_edit(2003-11-18)
  340.         $text = $this->makeClickable($text);
  341.         if ($smiley != 0) {
  342.             // process smiley
  343.             $text = $this->smiley($text);
  344.         }
  345.         if ($xcode != 0) {
  346.             // decode xcode
  347.             if ($image != 0) {
  348.                 // image allowed
  349.                 $text = $this->xoopsCodeDecode($text);
  350.             } else {
  351.                 // image not allowed
  352.                 $text = $this->xoopsCodeDecode($text, 0);
  353.             }
  354.         }
  355.         if ($br != 0) {
  356.             $text = $this->nl2Br($text);
  357.         }
  358.         $text = $this->codeConv($text, $xcode, $image);    // Ryuji_edit(2003-11-18)
  359.         return $text;
  360.     }
  361.  
  362.     /**
  363.      * Replaces banned words in a string with their replacements
  364.      *
  365.      * @param   string $text
  366.      * @return  string
  367.      *
  368.      * @deprecated
  369.      **/
  370.     function &censorString(&$text)
  371.     {
  372.         if (!isset($this->censorConf)) {
  373.             $config_handler =& xoops_gethandler('config');
  374.             $this->censorConf =& $config_handler->getConfigsByCat(XOOPS_CONF_CENSOR);
  375.         }
  376.         if ($this->censorConf['censor_enable'] == 1) {
  377.             $replacement = $this->censorConf['censor_replace'];
  378.             foreach ($this->censorConf['censor_words'] as $bad) {
  379.                 if ( !empty($bad) ) {
  380.                      $bad = quotemeta($bad);
  381.                     $patterns[] = "/(\s)".$bad."/siU";
  382.                     $replacements[] = "\\1".$replacement;
  383.                     $patterns[] = "/^".$bad."/siU";
  384.                     $replacements[] = $replacement;
  385.                     $patterns[] = "/(\n)".$bad."/siU";
  386.                     $replacements[] = "\\1".$replacement;
  387.                     $patterns[] = "/]".$bad."/siU";
  388.                     $replacements[] = "]".$replacement;
  389.                     $text = preg_replace($patterns, $replacements, $text);
  390.                 }
  391.                }
  392.         }
  393.            return $text;
  394.     }
  395.  
  396.  
  397.     /**#@+
  398.      * Sanitizing of [code] tag
  399.      */
  400.     function codePreConv($text, $xcode = 1) {
  401.         if($xcode != 0){
  402.             $patterns = "/\[code](.*)\[\/code\]/esU";
  403.             $replacements = "'[code]'.base64_encode('$1').'[/code]'";
  404.             $text =  preg_replace($patterns, $replacements, $text);
  405.         }
  406.         return $text;
  407.     }
  408.  
  409.     function codeConv($text, $xcode = 1, $image = 1){
  410.         if($xcode != 0){
  411.             $patterns = "/\[code](.*)\[\/code\]/esU";
  412.             if ($image != 0) {
  413.                 // image allowed
  414.                 $replacements = "'<div class=\"xoopsCode\"><code><pre>'.MyTextSanitizer::codeSanitizer('$1').'</pre></code></div>'";
  415.                 //$text =& $this->xoopsCodeDecode($text);
  416.             } else {
  417.                 // image not allowed
  418.                 $replacements = "'<div class=\"xoopsCode\"><code><pre>'.MyTextSanitizer::codeSanitizer('$1', 0).'</pre></code></div>'";
  419.                 //$text =& $this->xoopsCodeDecode($text, 0);
  420.             }
  421.             $text =  preg_replace($patterns, $replacements, $text);
  422.         }
  423.         return $text;
  424.     }
  425.  
  426.     function codeSanitizer($str, $image = 1){
  427.         if($image != 0){
  428.             $str = $this->xoopsCodeDecode(
  429.                 $this->htmlSpecialChars(str_replace('\"', '"', base64_decode($str)))
  430.                 );
  431.         }else{
  432.             $str = $this->xoopsCodeDecode(
  433.                 $this->htmlSpecialChars(str_replace('\"', '"', base64_decode($str))),0
  434.                 );
  435.         }
  436.         return $str;
  437.     }
  438.  
  439.  
  440.     /**#@-*/
  441.  
  442.  
  443. ##################### Deprecated Methods ######################
  444.  
  445.     /**#@+
  446.      * @deprecated
  447.      */
  448.     function sanitizeForDisplay($text, $allowhtml = 0, $smiley = 1, $bbcode = 1)
  449.     {
  450.         if ( $allowhtml == 0 ) {
  451.             $text = $this->htmlSpecialChars($text);
  452.         } else {
  453.             //$config =& $GLOBALS['xoopsConfig'];
  454.             //$allowed = $config['allowed_html'];
  455.             //$text = strip_tags($text, $allowed);
  456.             $text = $this->makeClickable($text);
  457.         }
  458.         if ( $smiley == 1 ) {
  459.             $text = $this->smiley($text);
  460.         }
  461.         if ( $bbcode == 1 ) {
  462.             $text = $this->xoopsCodeDecode($text);
  463.         }
  464.         $text = $this->nl2Br($text);
  465.         return $text;
  466.     }
  467.  
  468.     function sanitizeForPreview($text, $allowhtml = 0, $smiley = 1, $bbcode = 1)
  469.     {
  470.         $text = $this->oopsStripSlashesGPC($text);
  471.         if ( $allowhtml == 0 ) {
  472.             $text = $this->htmlSpecialChars($text);
  473.         } else {
  474.             //$config =& $GLOBALS['xoopsConfig'];
  475.             //$allowed = $config['allowed_html'];
  476.             //$text = strip_tags($text, $allowed);
  477.             $text = $this->makeClickable($text);
  478.         }
  479.         if ( $smiley == 1 ) {
  480.             $text = $this->smiley($text);
  481.         }
  482.         if ( $bbcode == 1 ) {
  483.             $text = $this->xoopsCodeDecode($text);
  484.         }
  485.         $text = $this->nl2Br($text);
  486.         return $text;
  487.     }
  488.  
  489.     function makeTboxData4Save($text)
  490.     {
  491.         //$text = $this->undoHtmlSpecialChars($text);
  492.         return $this->addSlashes($text);
  493.     }
  494.  
  495.     function makeTboxData4Show($text, $smiley=0)
  496.     {
  497.         $text = $this->htmlSpecialChars($text);
  498.         return $text;
  499.     }
  500.  
  501.     function makeTboxData4Edit($text)
  502.     {
  503.         return $this->htmlSpecialChars($text);
  504.     }
  505.  
  506.     function makeTboxData4Preview($text, $smiley=0)
  507.     {
  508.         $text = $this->stripSlashesGPC($text);
  509.         $text = $this->htmlSpecialChars($text);
  510.         return $text;
  511.     }
  512.  
  513.     function makeTboxData4PreviewInForm($text)
  514.     {
  515.         $text = $this->stripSlashesGPC($text);
  516.         return $this->htmlSpecialChars($text);
  517.     }
  518.  
  519.     function makeTareaData4Save($text)
  520.     {
  521.         return $this->addSlashes($text);
  522.     }
  523.  
  524.     function &makeTareaData4Show(&$text, $html=1, $smiley=1, $xcode=1)
  525.     {
  526.         $text = $this->displayTarea($text, $html, $smiley, $xcode);
  527.         return $text;
  528.     }
  529.  
  530.     function makeTareaData4Edit($text)
  531.     {
  532.         return $this->htmlSpecialChars($text);
  533.     }
  534.  
  535.     function &makeTareaData4Preview(&$text, $html=1, $smiley=1, $xcode=1)
  536.     {
  537.         $text = $this->previewTarea($text, $html, $smiley, $xcode);
  538.         return $text;
  539.     }
  540.  
  541.     function makeTareaData4PreviewInForm($text)
  542.     {
  543.         //if magic_quotes_gpc is on, do stipslashes
  544.         $text = $this->stripSlashesGPC($text);
  545.         return $this->htmlSpecialChars($text);
  546.     }
  547.  
  548.     function makeTareaData4InsideQuotes($text)
  549.     {
  550.         return $this->htmlSpecialChars($text);
  551.     }
  552.  
  553.     function oopsStripSlashesGPC($text)
  554.     {
  555.         return $this->stripSlashesGPC($text);
  556.     }
  557.  
  558.     function oopsStripSlashesRT($text)
  559.     {
  560.         if (get_magic_quotes_runtime()) {
  561.             $text = stripslashes($text);
  562.         }
  563.         return $text;
  564.     }
  565.  
  566.     function oopsAddSlashes($text)
  567.     {
  568.         return $this->addSlashes($text);
  569.     }
  570.  
  571.     function oopsHtmlSpecialChars($text)
  572.     {
  573.         return $this->htmlSpecialChars($text);
  574.     }
  575.  
  576.     function oopsNl2Br($text)
  577.     {
  578.         return $this->nl2br($text);
  579.     }
  580.     /**#@-*/
  581. }
  582. ?>