collapse collapse

* User Info

 
 
Welcome, Guest. Please login or register.
Did you miss your activation email?

* Who's Online

  • Dot Guests: 156
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM
  • phantomm: and from what I see only patch is broken, full install package is fine
    October 21, 2016, 03:44:44 PM

* Recent Posts

Re: v 2.3.3 to v2.3.7 by ♦ Ninja ZX-10RR ♦
[December 11, 2018, 04:14:48 PM]


v 2.3.3 to v2.3.7 by rollingrock
[December 11, 2018, 09:36:20 AM]


[Block] Help with editing few lines on Simpleportal by Wallen
[December 09, 2018, 05:10:34 AM]


Re: LinkTree by Chen Zhen
[November 15, 2018, 02:24:51 PM]


Re: blocks showing user avatars by hulapyk
[November 15, 2018, 01:47:11 PM]

If you're interested in helping other members with support requests, consider joining the Community Support Helpers group.

Author Topic: Bring Shoutbox "html" BBCode handling in line with SMF  (Read 9849 times)

0 Members and 1 Guest are viewing this topic.

Offline aegersz

  • Jr. Member
  • **
  • Posts: 58
  • Gender: Male
  • SMF Bulletin Board / Forum Fanatic
    • dopetalk
  • SMF Version: 2.0.15
  • SP Version: 2.3.6
Bring Shoutbox "html" BBCode handling in line with SMF
« on: October 13, 2018, 01:46:58 PM »
Hi, I i like to use the html BBCode facilty in Shoutbox but I noticed that it doesn't turn off for non-Admins despite disabling it in SMF.

This is a potentially dangerous situation as anybody could introduce malicious javascript so i would like SP to honor the SMF setting and strip off the <html></html> markup.

is that too big a task ?

I guess it could be a mod and maybe i can write it too ... just floating the idea to see if you agree with me.

It may also be an option for the SP - Extra Shoutbox Permissions/Options mod but the selection but SMF already supports this flag selection via Admin > Post and Topics > Bulletin Board Code > Enable basic HTML in posts checkbox
« Last Edit: October 13, 2018, 01:52:23 PM by aegersz »
"mods" fan (SMF 2.0.15) with 140+ mods (Full List is at http://forum.drugs-and-users.org/index.php/topic,3301)

Offline ♦ Ninja ZX-10RR ♦

  • Spammer Hammer
  • Support
  • *
  • Posts: 1177
  • Gender: Male
  • Sniper Legends
    • Virtual Interactive Games Entertainment™
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: 1.0.6
Re: Bring Shoutbox "html" BBCode handling in line with SMF
« Reply #1 on: October 14, 2018, 05:49:20 AM »
I guess it's an oversight but you can probably fix it with this: https://simpleportal.net/index.php?topic=11714.0
Have you tried SimplePortal Documentation before asking? ;)
F.A.Q.  English Support  |  Blocks Support
Fancy Feature idea ?!  |  Blocks Requests
Themes & Graphics

▼ My job! ▼

No PMs for support unless it's a paid request. Thank you! :)
#OpIsis

Offline aegersz

  • Jr. Member
  • **
  • Posts: 58
  • Gender: Male
  • SMF Bulletin Board / Forum Fanatic
    • dopetalk
  • SMF Version: 2.0.15
  • SP Version: 2.3.6
Re: Bring Shoutbox "html" BBCode handling in line with SMF
« Reply #2 on: October 14, 2018, 11:48:41 PM »
i have version 1.70 of that mod and i can't see it in Permissions or the SP Config.

where can i find it and I politely ask why didn't you interrogate and conform to SMF's settings (as it is more logical to do so) ?

no matter ... i must be missing something or is this unique to Version 1.71 ?

thanks again, sorry to bother.
"mods" fan (SMF 2.0.15) with 140+ mods (Full List is at http://forum.drugs-and-users.org/index.php/topic,3301)

Offline ♦ Ninja ZX-10RR ♦

  • Spammer Hammer
  • Support
  • *
  • Posts: 1177
  • Gender: Male
  • Sniper Legends
    • Virtual Interactive Games Entertainment™
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: 1.0.6
Re: Bring Shoutbox "html" BBCode handling in line with SMF
« Reply #3 on: October 15, 2018, 01:13:35 AM »
Should be the regex filter itself, and filter <html> tags by stripping the <>. Haven't used it in ages so I'd have to test it :P

As for
where can i find it and I politely ask why didn't you interrogate and conform to SMF's settings (as it is more logical to do so) ?
Like I said probably an oversight... But I'm not a dev so there's that ;D
Have you tried SimplePortal Documentation before asking? ;)
F.A.Q.  English Support  |  Blocks Support
Fancy Feature idea ?!  |  Blocks Requests
Themes & Graphics

▼ My job! ▼

No PMs for support unless it's a paid request. Thank you! :)
#OpIsis

Offline aegersz

  • Jr. Member
  • **
  • Posts: 58
  • Gender: Male
  • SMF Bulletin Board / Forum Fanatic
    • dopetalk
  • SMF Version: 2.0.15
  • SP Version: 2.3.6
Re: Bring Shoutbox "html" BBCode handling in line with SMF
« Reply #4 on: October 15, 2018, 01:32:13 AM »
of course, you did mention that. tbh, regex filters look daunting but i am about to deploy one that i found - it strips the HTML from a URL link and just leaves the link's string but doesn't accommodate spaces in the file name yet.

a work in progress.

i will try that filter or adapt it and delve deeper into Regular Expressions.

stay tuned :P



"mods" fan (SMF 2.0.15) with 140+ mods (Full List is at http://forum.drugs-and-users.org/index.php/topic,3301)

Offline aegersz

  • Jr. Member
  • **
  • Posts: 58
  • Gender: Male
  • SMF Bulletin Board / Forum Fanatic
    • dopetalk
  • SMF Version: 2.0.15
  • SP Version: 2.3.6
Re: Bring Shoutbox "html" BBCode handling in line with SMF
« Reply #5 on: October 15, 2018, 02:10:23 PM »
simple when you find the cheat sheets  :)

1. Exempt Admins [ticked]

2. Regex Filter is (array('#<html>#m','#</html>#m'),array(' ',' ')

thanks for your help, Ninja !

EDIT: added 'm' (for multiple) as I originally omitted from the <html> start tag accidentally.
« Last Edit: October 17, 2018, 12:21:49 PM by aegersz »
"mods" fan (SMF 2.0.15) with 140+ mods (Full List is at http://forum.drugs-and-users.org/index.php/topic,3301)

Offline ♦ Ninja ZX-10RR ♦

  • Spammer Hammer
  • Support
  • *
  • Posts: 1177
  • Gender: Male
  • Sniper Legends
    • Virtual Interactive Games Entertainment™
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: 1.0.6
Re: Bring Shoutbox "html" BBCode handling in line with SMF
« Reply #6 on: October 15, 2018, 05:40:24 PM »
There you go! Glad it worked then :D

We'll definitely need to fix that permission thing in a future release anyway, don't think it's intended.
Have you tried SimplePortal Documentation before asking? ;)
F.A.Q.  English Support  |  Blocks Support
Fancy Feature idea ?!  |  Blocks Requests
Themes & Graphics

▼ My job! ▼

No PMs for support unless it's a paid request. Thank you! :)
#OpIsis

Offline Chen Zhen

  • The Underdog
  • Operations Manager
  • *
  • Posts: 1335
  • Gender: Male
  • Kinesis
    • WebDev
  • SMF Version: 2.1
  • EhPortal Version: 1.22
Re: Bring Shoutbox "html" BBCode handling in line with SMF
« Reply #7 on: October 16, 2018, 11:29:41 PM »

There are settings within each shoutbox to enable/disable specific bbcodes.
You can simply disable the html bbcode that you are talking about by ensuring it is not highlighted from that list.

Unless you want admins to use it in the shoutbox but no one else.

You can try this:

regex filter:
Code: [Select]
<html[^>]+?[^>]+>|</html>

regex callback:
Code: [Select]
preg_replace('/<html[^>]+?[^>]+>|</html>/i','',$m[0])

Offline aegersz

  • Jr. Member
  • **
  • Posts: 58
  • Gender: Male
  • SMF Bulletin Board / Forum Fanatic
    • dopetalk
  • SMF Version: 2.0.15
  • SP Version: 2.3.6
Re: Bring Shoutbox "html" BBCode handling in line with SMF
« Reply #8 on: October 17, 2018, 12:35:46 PM »
thank you and yes, i am aware and use the 'enable/disable specific bbcodes' menu option.

I decided to keep my regex filter and use your regex callback (but had no idea what that was and despite reading up on, still have no clue but i'm certainly going to use yours).

I want my Shoutbox to support all/most bbcodes but haven't added any icons for them as I want keep them hidden.
« Last Edit: October 17, 2018, 12:57:37 PM by aegersz »
"mods" fan (SMF 2.0.15) with 140+ mods (Full List is at http://forum.drugs-and-users.org/index.php/topic,3301)

Offline Chen Zhen

  • The Underdog
  • Operations Manager
  • *
  • Posts: 1335
  • Gender: Male
  • Kinesis
    • WebDev
  • SMF Version: 2.1
  • EhPortal Version: 1.22
Re: Bring Shoutbox "html" BBCode handling in line with SMF
« Reply #9 on: October 17, 2018, 11:58:02 PM »
The filter is the regex condition to trigger the callback function.
The callback function is to change the shout text.. with that example I used preg_replace.
$m is the array containing the data for the callback..
in this case $m[0] is the entire shout line that was entered by the member.