Page 1 of 1

Javascript errors with Special Characters in User entered field names

Posted: Sat Mar 08, 2008 4:34 am
by deepster
Hi, I have justed encountered some javascript errors when I have used Page names containing single quotes (').

On checking the code I found that the the names were being drawn from the Database without being formatted for special characters.

My case in particular concerned using a single quote (') in a page name. When this name was then listed by the 'listcontent.php' the page name containing it's single quote was echoed inside a javascript call delimited itself, by single quotes ( so causing the error ).

I have just used a Php addslashes( ) call for the references in that file as that was all that was affecting myself, but I think there are more cases where user entered field names are used without being formatted for special characters.

Cheers

Re: Javascript errors with Special Characters in User entered field names

Posted: Wed Nov 26, 2008 1:57 am
by joecannes
I just encountered that same problem...As I was entering my page names in French, I would get the same javascript error.

Problem is, because the french language uses the apostrophe ('), I cant tell editors not to use it in their menu text field.

Re: Javascript errors with Special Characters in User entered field names

Posted: Wed Nov 26, 2008 2:06 am
by Dee
This problem doesn't seem to occur here (CMS Made Simple 1.4.1 "Spring Garden").
Tested with a new page with "Title" and "Menu Text": Test 'a gogo

Regards,
D

Re: Javascript errors with Special Characters in User entered field names

Posted: Wed Nov 26, 2008 2:08 am
by joecannes
I am using 1.4.1 as well, but converted to the MLE version...forgot to mention in IE 7..firefox 2 is fine

Re: Javascript errors with Special Characters in User entered field names

Posted: Wed Nov 26, 2008 2:28 am
by joecannes
Just figured it out what is going on.

The word I was having trouble with is: l'emplacement

If i typed in l'emplacement by hand, i was getting an error...but if I copied and pasted that word from a word document, the apostrophe comes out formatted as below:

l’emplacement

and it works then, no errors.