Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-20150

Provide helpers to easily perform escaping with wiki syntax

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • None
    • 13.10.9
    • Security
    • None
    • Unknown

    Description

      It's currently very tedious to perform a proper syntax of some elements in XWiki, and so we should provide helpers to ease life of developers and avoid vulnerabilities in our code.

      Some helpers that are needed:

      • capability to escape labels of wiki links (double escape)
      • capability to escape wiki syntax used with a translation:
        ## Example of creating a link from a translation like "translation=my {0}link label{1}
        #set ($myLink = $services.localization.render('translation', ["__BEGINLINK__", "__ENDLINK__"]))
        #set ($myLink = $services.rendering.escape($myLink, "xwiki/2.1"))
        #set ($myLink = $myLink.replace($services.rendering.escape("__BEGINLINK__", "xwiki/2.1"), "[["))
        #set ($myLink = $myLink.replace($services.rendering.escape("__ENDLINK__", "xwiki/2.1"), ">>$linkTarget]]"))
        $myLink
        

      Attachments

        Activity

          People

            Unassigned Unassigned
            surli Simon Urli
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: