??,?: [opencms-dev] 5.0.1 escapes all < and > into entities when editing

??? shiys at langhua.cn
Mon Jan 31 19:31:24 CET 2005


hi claus,

You can find the reason in com.opencms.workplace.CmsXmlTemplateEditor.java, around line 580: 
            // save file contents to our temporary file.
            content = Encoder.unescape(content, Encoder.C_URI_ENCODING);
            if (! Encoder.C_URI_ENCODING.equalsIgnoreCase(cms.getRequestContext().getEncoding())) {			
                content = Encoder.escapeNonAscii(content);
            }

If your encoding is not UTF-8, the content will be escapedNonAscii. You can change this if you want.

Regards,

Shi Yusen/Beijing Langhua

-----????-----
???: Claus Priisholm [mailto:cpr at codedroids.com]
????: 2005?1?30? 22:05
???: The OpenCms mailing list
??: [opencms-dev] 5.0.1 escapes all < and > into entities when editing


Hi

Got a problem on a machine that had to be rebuild from a backup - 
according to the ISP it has been restored from the backup, so 
everything should be as it was.

Unfortunately this is not the case - when an existing page is edited 
all the HTML tags are "escaped" into entities.
E.g. typing the following into the source code editor:

<![CDATA[<p>test</p>]]>

becomes, once saved and revisited looks like:

<p>test</p>

The problem is at that point evident in the bodies file as well.

Pages that hasn't been altered since the restoration of the system, do 
look okay in the bodies file (i.e. has the CDATA stuff and < > where 
one would expect) - but once opened in the editor (source and/or 
WYSIWYG) shows up as "escaped". When displayed on the site they look 
okay so the "escaping" only happens when opening the page in one of the 
editors.

I seem to recall someone reporting something similar, just haven't 
found the key to look it up in the mailing list archive, so maybe the 
collective memory of the list members can point me in the direction

System 5.0.1 running Mac OS X 10.3.6, Java 1.4.2-38, Tomcat 5.0.19, 
MySQL 4.0.18.

Upon start up OpenCms reports "OpenCms encoding", "System 
file.encoding" and "Encoding set to" as ISO-8859-1, so that much seems 
ok. And the it has been patched to work with Tomcat 5x version of 
Xerces.

Thanks
Claus
--
Claus Priisholm, CodeDroids ApS
+45 48 22 46 46
email: cpr (you-know-what) interlet.dk - cpr (you-know-what) 
codedroids.com
skype: claus_priisholm
http://www.interlet.dk - http://www.codedroids.com



More information about the opencms-dev mailing list