Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 1 of 1

Thread: BBCode

  1. #1
    Join Date
    Dec 2007
    Posts
    1,683
    Tokens
    0

    Latest Awards:

    Default BBCode

    Never mind, sorted out..

    Code:
    function bbcode($string) {
    
        $string = str_replace('', "<b>", $string);
        
        $string = str_replace("", "</b>", $string);
        
        $string = str_replace("", "<u>", $string);
        
        $string = str_replace("", "</u>", $string);
        
        $string = str_replace("", "<i>", $string);
        
        $string = str_replace("", "</i>", $string);
        
        $string = str_replace("[s]", "<strike>", $string);
        
        $string = str_replace("[/s]", "</strike>", $string);    
        
        return $string;
        
    }
    I grabbed that from powerpanel as I was testing if that works for BBCode, yet it doesn't due to my functions which clean.. but when a person updates their profile Which also uses the clean function they can bypass the > and < which changes it to &gt; and the otherside..

    Code:
    function silence($string) 
    {
            $string = htmlspecialchars( $string, ENT_QUOTES );
    
            if( get_magic_quotes_gpc(   ) ) {
        
                $string = stripslashes( $string );
                        
            }
                    
            $string = str_replace( "\"", "", $string );
            
            $string = str_replace( "<", "&lt;", $string ); 
    
            $string = str_replace( ">", "&gt;", $string ); 
    
            $string = mysql_real_escape_string( $string );
            
        return $string;  
    }
    Any help please? (I want to make my BBCode work

    Never mind, sorted out.
    Last edited by Independent; 20-06-2008 at 08:23 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •