Welcome to Geeklog, Anonymous Sunday, March 16 2025 @ 04:04 pm EDT
Geeklog Forums
lib-common.php -- COM_killJS
jhoke
Anonymous
I understand fully why this should be utilized for user entered information, but what I would like is to have StoryAdmins be able to enter onMouseOver events for pithy comments in the status bar...
Is there any way to modify this code not to fire if the person entering the code is eiter a member of root group or story admins?
22
21
Quote
Status: offline
Dirk
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Well, you almost answered your own question :-)
You could simply add a check if the current user is in the Root group and make the function return the code unaltered:
Text Formatted Code
function COM_killJS( $Message ){
if( SEC_inGroup( 'Root' )))
{
return( $Message );
}
else
{
return( preg_replace( '/(\s)+[oO][nN](\w*) ?=/', '\1in\2=', $Message ));
}
}
bye, Dirk
15
31
Quote
jhoke
Anonymous
Thanks Dirk!
I thought I could... but wasnt sure if it would fly
One thing... you have one too many ")" in your snippet... should read:
function COM_killJS( $Message )
{
if( SEC_inGroup( 'Root' )) //extra ')' was here ...
{
return( $Message );
}
else
{
return( preg_replace( '/(\s)+[oO][nN](\w*) ?=/', '\1in\2=', $Message ));
}
}
Thanks again!
I thought I could... but wasnt sure if it would fly

One thing... you have one too many ")" in your snippet... should read:
Text Formatted Code
function COM_killJS( $Message )
{
if( SEC_inGroup( 'Root' )) //extra ')' was here ...
{
return( $Message );
}
else
{
return( preg_replace( '/(\s)+[oO][nN](\w*) ?=/', '\1in\2=', $Message ));
}
}
---
--John
http://www.slapd.net
http://john.hoke.org
17
16
Quote
All times are EDT. The time is now 04:04 pm.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content