There is 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-65ef5406-02b4-4304-99d1-c0d6b0ce0c94 XWIKI-24010 Open

Inconsistent escapes in the $services.localization.render method

 
View issue   ยท   Add comment
 

1 comment

 
cid:jira-generated-image-avatar-76e84f5b-4ac2-4adf-bb8b-4ecc64bc49ab Thomas Mortagne on 12/Feb/26 14:56
 

I'm not sure if that was a good assumption.

It was not smile.png

Those are two different things. The point of $services.localization.render is to serialize the blocks representing the translation (which might contain other stuff than plain text in theory) into the passed syntax. As such, it's escaping only what is supposed to be escaped, exactly like when the content of the WYSIWYG is serialized.

$services.rendering.escape's goal is different: the point is to make sure that nothing is interpreted in a String passed to it, no matter what. And the fastest and safest way to do that is to not try to be clever and escape every character, even if most of them to need to be.