1
Goober
Javascript
  • 2005/11/24 14:49

  • Goober

  • Not too shy to talk

  • Posts: 101

  • Since: 2003/3/30


Yip, did a search :)

I'm trying to find where XOOPS strips javascript, specifically in the news module. (Xoops 2.0.13.2 and news 1.4x)

Search indicated (from 2003 year period posts) this was in the textsanitizer - but my blinders must be on as I cannot find it.

If there was a way to limit Javascript to those who have admin status, that would be great - but not necessary. The checkbox to disable html should be suffient to thwart nasties when previewing news submissions.

Thanks
Dispelling the Mystical belief of Web Standards and tableless CSS.
Nobody gets excited about the tools used to build a house, people get excited about how the house looks and performs

2
frankblack
Re: Javascript
  • 2005/11/24 16:15

  • frankblack

  • Just can't stay away

  • Posts: 830

  • Since: 2005/6/13


module.textsanitizer.php:

$patterns[] = "/[b][color=ff0000]j[/color][/b]{$c}[b][color=ff0000]a[/color][/b]{$c}[b][color=ff0000]v[/color][/b]{$c}[b][color=ff0000]a[/color][/b]{$c}[b][color=ff0000]s[/color][/b]{$c}[b][color=ff0000]c[/color][/b]{$c}[b][color=ff0000]r[/color][/b]{$c}[b][color=ff0000]i[/color][/b]{$c}[b][color=ff0000]p[/color][/b]{$c}[b][color=ff0000]t[/color][/b]{$c}:/si";
$replacements[] = "(tammairanslip)";


You can make an if-statement in order to exclude admins from that replacement.

3
Goober
Re: Javascript
  • 2005/11/24 18:29

  • Goober

  • Not too shy to talk

  • Posts: 101

  • Since: 2003/3/30


Quote:

frankblack wrote:
module.textsanitizer.php:

$patterns[] = "/[b][color=ff0000]j[/color][/b]{$c}[b][color=ff0000]a[/color][/b]{$c}[b][color=ff0000]v[/color][/b]{$c}[b][color=ff0000]a[/color][/b]{$c}[b][color=ff0000]s[/color][/b]{$c}[b][color=ff0000]c[/color][/b]{$c}[b][color=ff0000]r[/color][/b]{$c}[b][color=ff0000]i[/color][/b]{$c}[b][color=ff0000]p[/color][/b]{$c}[b][color=ff0000]t[/color][/b]{$c}:/si";
$replacements[] = "(tammairanslip)";


You can make an if-statement in order to exclude admins from that replacement.


frankblack, u da man!

Thanks so much!
Dispelling the Mystical belief of Web Standards and tableless CSS.
Nobody gets excited about the tools used to build a house, people get excited about how the house looks and performs

4
Goober
Re: Javascript
  • 2005/11/26 12:49

  • Goober

  • Not too shy to talk

  • Posts: 101

  • Since: 2003/3/30


Ok, this is what I came up with to allow Javascript. Please feel free to improve

$patterns[] = "/j{$c}a{$c}v{$c}a{$c}s{$c}c{$c}r{$c}i{$c}p{$c}t{$c}:/si";
if (
$html != 1
{
$replacements[] = "(tammairanslip)";
} else {
$replacements[] = "(javascript)";
}


The other thing I found to get this to work is you'll need to turn off the nl2Br (coverting line breaks). Sucks, cuz you have to go in and edit all your news items and add br's.
Dispelling the Mystical belief of Web Standards and tableless CSS.
Nobody gets excited about the tools used to build a house, people get excited about how the house looks and performs

Login

Who's Online

256 user(s) are online (209 user(s) are browsing Support Forums)


Members: 0


Guests: 256


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits