Uploaded image for project: '{RETIRED} CKEditor Integration'
  1. {RETIRED} CKEditor Integration
  2. CKEDITOR-398

It is possible to create invalid url links from the CKEditor

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 1.55
    • 1.53.1
    • None
    • None
    • Unknown

    Description

      Note:
      There is an aspect of the links syntax that is not fully and completely described in
      https://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/XWikiSyntax/?syntax=2.1&section=Links :

      • the type particle of a link (the "type:") may not be honored if the resource that follows that type cannot be correctly parsed for that type
        • in the case of the "url:" links, if what follows doesn't start with a protocol:// , the "external url" type is not honored.
      • in that case, the type of the link is considered "unknown" and the parsing for unkown is done, for the whole reference (including the "type:" prefix)
      • according to a chat discussion with vmassol , this is the normal and intended behaviour.

      How to reproduce the CKEditor issue:

      • create a link, from the editor
      • choose external link type
      • type an address without the protocol
        • this situation will happen in real-life because of the lasting confusion of users that www. is the relevant part in an URL and not the http:// part. Also, typing such an "url" works in the browser's address bar and takes to the proper website, so the confusion is nowhere close to getting fixed for the lambda users.
      • save

      Actual result:

      • the generated wiki syntax will not be a valid external URL link:
      • in logs, for versions impacted by XWIKI-18593, we'll see that the wiki is trying to access the 'url' subwiki, because url:www.xwiki.com is parsed as a page reference:
        WARN  o.h.e.j.s.SqlExceptionHelper   - SQL Error: 1049, SQLState: 42000 
        ERROR o.h.e.j.s.SqlExceptionHelper   - (conn=486277) Could not select database 'url' : Unknown database 'url' 
        
      • on UI a broken link is displayed:

        and the link takes to the create form for a page in the current wiki :
        /xwiki/bin/create/www/xwiki/com/WebHome?parent=Sandbox.TestURL2.WebHome
        

      Expected result:

      • CKEditor should keep the promise of creating an external link, by helping/enforcing the user to create a proper external URL, that will be valid as an external URL in the subsequently generated syntax. Options include (one of the 2):
        • automatically prefixing all the texts that are not valid URLs with https:// upon submit of the create link dialog
        • displaying an error if the URL is not valid and not allowing to submit the external link until the text is a valid external link.

      Attachments

        Activity

          People

            mflorea Marius Dumitru Florea
            lucaa Anca Luca
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: