SimplePortal

Support => English Support => Topic started by: PokemonS on September 25, 2015, 07:37:29 AM

Title: Disable HTML ASCII in Shoutbox
Post by: PokemonS on September 25, 2015, 07:37:29 AM
SP 2.3.6

Hi.

I have manage regex so users can't abuse caps lock.
But some users abuse it using HTML ASCII like this.

(http://puu.sh/knxCf.png)

The result will be

(http://puu.sh/knxEd.png)

How can I disable HTML ASCII in shoutbox?

Thanks
Title: Re: Disable HTML ASCII in Shoutbox
Post by: ccbtimewiz on September 25, 2015, 01:27:01 PM
Can you show me the edits you made for the regex?
Title: Re: Disable HTML ASCII in Shoutbox
Post by: PokemonS on September 25, 2015, 04:18:11 PM
Can you show me the edits you made for the regex?

Sure, I use mod created by Chen Zhen
http://simpleportal.net/index.php?topic=11714.0

And this is my regex
(http://puu.sh/knZ9n.png)
Title: Re: Disable HTML ASCII in Shoutbox
Post by: ccbtimewiz on September 25, 2015, 07:45:48 PM
Open /Sources/PortalBlocks.php

Find:
Code: [Select]
function sportal_checkaddslashes($str)
{
$str = htmlspecialchars_decode($str, ENT_QUOTES | ENT_XHTML);

if(strpos(str_replace("\'", "", " $str"), "'") != false)
return str_replace("'", "\'", $str);
else
return $str;
}

Replace with:
Code: [Select]
function sportal_checkaddslashes($str)
{
global $smcFunc;

$str = $smcFunc['htmlspecialchars']($str);

if(strpos(str_replace("\'", "", " $str"), "'") != false)
return str_replace("'", "\'", $str);
else
return $str;
}
Title: Re: Disable HTML ASCII in Shoutbox
Post by: PokemonS on September 25, 2015, 08:39:24 PM
Thanks for your answer!
Anyway the file is Subs-Portal.php.

But it's doesn't work:

(http://puu.sh/koeRj.jpg)
Title: Re: Disable HTML ASCII in Shoutbox
Post by: Chen Zhen on September 26, 2015, 03:03:13 AM
PokemonS,

  It would have been more prudent to post your report in the plug-in's thread.
An updated version has been posted which includes a fix pertaining to your report and an added permission setting for whispering as you had previously requested. Whispering will be disabled by default unless opted for each membergroup.

Regards.
Title: Re: Disable HTML ASCII in Shoutbox
Post by: PokemonS on September 28, 2015, 05:47:28 AM
PokemonS,

  It would have been more prudent to post your report in the plug-in's thread.
An updated version has been posted which includes a fix pertaining to your report and an added permission setting for whispering as you had previously requested. Whispering will be disabled by default unless opted for each membergroup.

Regards.

Thanks for your answer and sorry about that!

I'll update the mod, but since I have edited some code line of the mod (the Test Failed thing while uninstalling), I'll try to revert it to original, uninstall, and finally I can install the new version.
SimplePortal 2.3.8 © 2008-2024, SimplePortal