Current time: 03-18-2010, 12:31 AM Hello There, Guest! (LoginRegister)


 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[F] <) and >) converted to smilies [R] [C-Michael83]
10-20-2008, 12:38 PM (This post was last modified: 10-27-2008 11:43 PM by Dennis Tsang.)
Post: #1
[F] <) and >) converted to smilies [R] [C-Michael83]
If you use
Code:
<) or >)
inside a post the wink smilie is shown.

Example:
<) >)

Greets,
Michael
-------------
German MyBB-Site
MyBBoard.de
Get the german languagepack here
Visit this user's website Find all posts by this user
10-20-2008, 04:23 PM (This post was last modified: 10-20-2008 04:29 PM by Ryan Gordon.)
Post: #2
RE: <) and >) converted to smilies
Code:
We replace < and > with &lt; and &gt; so when you do that it sees &lt;) and &gt;) and it matches the ";)" part which is causing the problem. I guess we just fix the code to correctly check if there is a preceding html entity before

PHP Code:
if(is_array($this->smilies_cache))
        {
            foreach(
$this->smilies_cache as $find => $replace)
            {
                
$find $this->parse_html($find);
                if(
version_compare(PHP_VERSION"5.1.0"">="))
                {
                    
$message preg_replace("#(?<=[^&;\"])".preg_quote($find,"#")."(?=.\W|\"|\W.|\W$)#si"$replace$message$remaining$replacements);
                    
$remaining -= $replacements;
                    if(
$remaining <= 0)
                    {
                        break; 
// Reached the limit
                    
}
                }
                else
                {
                    
$message preg_replace("#(?<=[^&;\"])".preg_quote($find,"#")."(?=.\W|\"|\W.|\W$)#si"$replace$message$remaining);
                }
            }
        } 

inc/class_parser.php

[Image: ryangordon.png]
My Blog - My Mods
Visit this user's website Find all posts by this user
10-25-2008, 08:54 PM (This post was last modified: 10-25-2008 08:56 PM by Nexus.)
Post: #3
RE: <) and >) converted to smilies
I don't see the problem in this to be honest.......unless u want to show a pizza slice, u wont post < ) and it wont make it <)

[Image: head.jpg]
Find all posts by this user
10-26-2008, 03:29 AM
Post: #4
RE: <) and >) converted to smilies
I could be doing....

Code:
(i.e. </html>)

[Image: ryangordon.png]
My Blog - My Mods
Visit this user's website Find all posts by this user
10-31-2008, 01:56 AM
Post: #5
[F] <) and >) converted to smilies [R]
Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.

With regards,
MyBB Group

[Image: ryangordon.png]
My Blog - My Mods
Visit this user's website Find all posts by this user
10-31-2008, 01:56 AM
Post: #6
RE: [F] <) and >) converted to smilies [R]
Find in inc/class_parser.php

PHP Code:
if(version_compare(PHP_VERSION"5.1.0"">="))
                {
                    
$message preg_replace("#(?<=[^&;\"])".preg_quote($find,"#")."(?=.\W|\"|\W.|\W$)#si"$replace$message$remaining$replacements);
                    
$remaining -= $replacements;
                    if(
$remaining <= 0)
                    {
                        break; 
// Reached the limit
                    
}
                }
                else
                {
                    
$message preg_replace("#(?<=[^&;\"])".preg_quote($find,"#")."(?=.\W|\"|\W.|\W$)#si"$replace$message$remaining);
                } 

and replace with

PHP Code:
$find preg_quote($find"#");
                
// Fix issues for smileys starting with a ";"
                
if($find{0} == ";")
                {
                    
$find "(?<!&gt|&lt|&amp)".$find;
                }
                
                if(
version_compare(PHP_VERSION"5.1.0"">="))
                {
                    
$message preg_replace("#(?<=[^\"])".$find."(?=.\W|\"|\W.|\W$)#si"$replace$message$remaining$replacements);
                    
$remaining -= $replacements;
                    if(
$remaining <= 0)
                    {
                        break; 
// Reached the limit
                    
}
                }
                else
                {
                    
$message preg_replace("#(?<=[^\"])".$find."(?=.\W|\"|\W.|\W$)#si"$replace$message$remaining);
                } 

[Image: ryangordon.png]
My Blog - My Mods
Visit this user's website Find all posts by this user


Forum Jump: