PDA

View Full Version : msgfield mystery script


Joe[y]
04-28-2005, 03:57 PM
I recently noticed that internet explorer is displaying a broken template. I looked at the source and a mystery script is running :

<script language="JavaScript" type="text/javascript">
function insert_text(open, close)
{
msgfield = (document.commentform) ? document.commentform.message : document.forms[''][''];

// IE support
if (document.selection && document.selection.createRange)
{
msgfield.focus();
sel = document.selection.createRange();
sel.text = open + sel.text + close;
msgfield.focus();
}

// Moz support
else if (msgfield.selectionStart || msgfield.selectionStart == '0')
{
var startPos = msgfield.selectionStart;
var endPos = msgfield.selectionEnd;

msgfield.value = msgfield.value.substring(0, startPos) + open + msgfield.value.substring(startPos, endPos) + close + msgfield.value.substring(endPos, msgfield.value.length);
msgfield.selectionStart = msgfield.selectionEnd = endPos + open.length + close.length;
msgfield.focus();
}

// Fallback support for other browsers
else
{
msgfield.value += open + close;
msgfield.focus();
}

return;
}
-->

function lien() {
i = document.getElementById('page').liste.selectedInde x;
if (i == 0) return;
url = document.getElementById('page').liste.options[i].v alue;
parent.location.href = url;
}
</script>

This is not in any of my template files... so I have no idea what it is but the line '-->' breaks the template in IE. Is this something new to 1.4?

thanks!

raminia
04-28-2005, 04:33 PM
in which file?

GeoS
04-28-2005, 04:46 PM
That isn't PP JS code.

Joe[y]
04-28-2005, 05:21 PM
i removed all JS scripts from my templates and it was still there. I'm so confused.

Could my server be doing this?

GeoS
04-28-2005, 05:43 PM
Yes it can. It can almoust everything.

Rob
04-28-2005, 05:46 PM
It doesn't look like server code, it looks too specific to your template. Are you sure you've removed all javascript includes?

Joe[y]
04-28-2005, 06:01 PM
removed every bit of JS from the template (even the PP JS) but to no avail. the mystery script was still there - on EVERY page. and it's still breaking IE.

Rob
04-28-2005, 06:03 PM
Do you have a header.html in your template directory? Can you telnet or ssh in and use grep to find the offending code?

Joe[y]
04-28-2005, 07:02 PM
apologies... the problem was a mixture of me adding a comment in my html doc before the doc-type and forgetting i had installed the 'smilies' addon a while back.



thanks for your time everybody! but it was just my stupidity, not PP. (although the smilies addon shows up an error in IE6)

GeoS
04-28-2005, 07:55 PM
Current CVS version of PP is almost clear and 100% compatible with XHTML. So next release should to be in all browsers (working with w3c.org specifications) correct.

PS We can't guarantee addons compatibility with XHTML.