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

Claus Priisholm cpr at codedroids.com
Tue Feb 1 10:22:15 CET 2005


Hi

Actually the problem only affected "unsafe" XML-characters such as "<",  
">" and "&". Special danish characters such as ÆØÅ were not affected.
So the methods that could be causing it would be escapeXml() or  
escapeHtml() in the Encoder-class. But then they would have to behave  
differently when used with Tomcat 5.0.19 (which exhibited the problem)  
compared to 5.0.25 (which works with the exact same setup).
Since my primary suspect was the Java version I didn't check the  
Tomcat-logs until I've as a "routine" updated it to 5.0.25. And since  
that fixed the issue I am happy (as is the customer, who started seeing  
HTML-codes in the WYSIWYG-editor much to her - and my - surprise).

On 31/1-2005, at 19.31, ??? wrote:

> 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().getEnco 
> ding())) {			
>                 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
>
>
>
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please  
> visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev
--
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