1
Shine
WF-Snippets: Javascript window-open link ?
  • 2003/10/27 10:12

  • Shine

  • Just can't stay away

  • Posts: 822

  • Since: 2002/7/22


Unfortunately it isn't possible to use the XOOPS javascript window open script within this module.

I've tried to change the line, index.php, 117:
Quote:
$body = $myts->makeTareaData4Show($body, $html, $smiley, $xcodes);
into
&body = &body;


Now the java window open linkscript works but then another major problem is turning up. Linebreaks aren't working anymore. It put all the sentences behind eachother.

Does anybody know how to get this java-windowopen-linkscript work properly without running into other problems as mentioned above within this module?
Which line(s) need to be changed into what code?

Grtz., Shine

2
Herko
Re: WF-Snippets: Javascript window-open link ?
  • 2003/10/27 12:05

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


the only thing I can think of is editing the texsanitizer and remove the change from javascript to java script (let it drop the added space...). This does make your site vulnerable for malicious code tho...

Herko

3
Shine
Re: WF-Snippets: Javascript window-open link ?
  • 2003/10/27 15:05

  • Shine

  • Just can't stay away

  • Posts: 822

  • Since: 2002/7/22


In this case you are adjusting the texsanitizer, which is a corecode itself. This will affect all other installed modules. I'd prefer to leave this corefile as is......

Isn't there a way to adjust something within this particulairy WF-Snippets module itself to get it 'fixed'?
After all, this javalink script also could be realised within the WF-Sections module by adjusting a specific line within this module.
If the admin is the only person who submits content, this way of module adjustment wouldn't make your whole site vulnerable.

Grtz., Shine

4
ackbarr
Re: WF-Snippets: Javascript window-open link ?

how about using the sanitizer to format the content - then fixing the javascript code with regular expressions, something like this:
// Code goes after the $myts call
$pattern "/java script:/si";
$replacement "javascript:";

$body preg_replace($pattern$replacement$body);


* Note - in the $replacement line above "javascript" should not have a space

5
Shine
Re: WF-Snippets: Javascript window-open link ?
  • 2003/10/27 22:47

  • Shine

  • Just can't stay away

  • Posts: 822

  • Since: 2002/7/22


Hmz,......at this point you are talking to a nitwit......Ackbarr sorry, I don't understand you.

Where should I place your code exactly?
Wfsnippets module=>Index.php line:17, right after line 16?
Quote:
$myts =& MyTextSanitizer::getInstance();


Or somewhere else?

What do you mean by "then fixing the javascript code with regular expressions" ?

It would be great if you could point me out a little more specific.


Grtz., Shine

6
Catzwolf
Re: WF-Snippets: Javascript window-open link ?
  • 2003/10/27 23:34

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


Shine,

Just use the code that Brain has given you and place it directly underneath $myts =& MyTextSanitizer::getInstance(); line.

That should solve your problem.

But remember there is no space part.

Hope that helps.

7
ackbarr
Re: WF-Snippets: Javascript window-open link ?

actually, I was going to recommend adding the lines I listed above directly after
$body $myts->makeTareaData4Show($body$html$smiley$xcodes);

The idea is that we don't want to modify how the text sanitizer works, so we will undo the change it makes that keeps javascript links from working.

8
Shine
Re: WF-Snippets: Javascript window-open link ?
  • 2003/10/28 9:34

  • Shine

  • Just can't stay away

  • Posts: 822

  • Since: 2002/7/22


Great guys,.........this works wonderfull!

I've put the code right after:
wfsnippets=>index.php, line 117. All looks and works smoothly now.
Thanks!

Grtz., Shine

Login

Who's Online

140 user(s) are online (83 user(s) are browsing Support Forums)


Members: 0


Guests: 140


more...

Donat-O-Meter

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

Latest GitHub Commits