Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2009-08-05 09:50:45

mcgiant
New member
Registered: 2009-07-29
Posts: 7

PreserveScripts and php

Hi all,

I find a ticket from Adamj which concerns PreserveScripts plugin :

php can appear in html tags like this:

<input value="<?php print $foo;?>">

if u paste this into code view and then toggle html/ code - it comes back as:

<input src="/xinha-nightly/plugins/PreserveScripts/php.png" id="PreserveScripts?_1" value="<img title=" />">

I would like to know if someone find a solution, because i've the same problem.

Thanks all !

Offline

#2 2009-09-02 09:58:26

docnetsnap
New member
Registered: 2009-09-02
Posts: 1

Re: PreserveScripts and php

I've fond a solution, edit the file PreserveScripts.js located in plugins directory and change this line:

html = html.replace(/\n?<\?(php)?(\s|[^\s])*?\?>\n?/ig,

with this:

html = html.replace(/\n?<\?(=)|(php)?(\s|[^\s])*?\?>\n?/ig,

the problem was that the original code doesn't consider the tag <?= 
that works for me!
ciao

Offline

#3 2009-09-07 11:00:12

mcgiant
New member
Registered: 2009-07-29
Posts: 7

Re: PreserveScripts and php

Hi DocnetSnap,

Thanks for your answer !
Well, i tested your code and i've "another" problem. I type this in source :

<input value="<?php print $foo;?>">

And it returns me this

<input value="<?php print $foo;?>">

I think your code is close to the key, but not yet.

Thank you !

Offline

#4 2009-12-01 08:19:34

mcgiant
New member
Registered: 2009-07-29
Posts: 7

Re: PreserveScripts and php

Up.. ? smile

Offline

#5 2009-12-23 16:58:25

cafevino
New member
Registered: 2009-12-23
Posts: 2

Re: PreserveScripts and php

I've got the same problem with characters being rewritten, but usually it's the carrots that are rewritten, quotes too. Any ideas? Escape characters... config change?

Offline

Board footer

Powered by FluxBB