[ http://jira.magnolia.info/browse/MAGNOLIA-1506?page=comments#action_14225 
] 
            
Oliver Lietz commented on MAGNOLIA-1506:
----------------------------------------

(from dev-list@)
The sanitize function from StringUtils[SU] fixes most of the problems replacing 
illegal characters with an underscore and prefixing the name with mgnl_ (when 
it doesn't start already with mgnl, see comment in StringUtils).

This method is not 100% save. Think we have similar property names:
prÖperty and prÜperty*, both result in mgnl_pr_perty. It might be a rare case 
but I don't want to rely on it. It will break sooner or later.

(*) I know the gui prevents entering/saving special chars. But what's about 
import/export or exchange with other (content management) systems?

A better solution would be to hex-encode the names. It's saver but leads to 
unreadable names which makes it harder to debug.
We could swap implementations of sanitize when debugging - not optimal because 
we also slightly change the system behaviour (another potential cause for 
bugs).

I have to review the JS and check if they make use of the property name to 
construct the id/names of HTML elements for accessing them.
If it's the case, sanitize has also to be implemented in JS.

[SU] 
http://svn.magnolia.info/view/magnolia/branches/custom-experimental/magnolia-core/src/main/java/info/magnolia/util/StringUtils.java


> controlType name (HTML/JavaScript)
> ----------------------------------
>
>                 Key: MAGNOLIA-1506
>                 URL: http://jira.magnolia.info/browse/MAGNOLIA-1506
>             Project: Magnolia
>          Issue Type: Sub-task
>            Reporter: Oliver Lietz
>         Assigned To: Oliver Lietz
>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.magnolia.info/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/docs/en/editor/stayupdated.html
----------------------------------------------------------------

Reply via email to