Opened 10 years ago

Closed 10 years ago

#13233 closed Bug (fixed)

HTMLDataProcessor cannot process foo:href attributes

Reported by: Piotrek Koszuliński Owned by: Piotrek Koszuliński
Priority: Normal Milestone: CKEditor 4.4.8
Component: General Version:
Keywords: Cc:

Description

Try loading the following source into editor with ACF disabled:

    <svg preserveaspectratio="xMinYMin meet" version="1.1" viewbox="0 0 778 873" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> 
    <image height="100%" width="100%" xlink:href="map.png"></image> 
        <g class="hover_group" opacity="1"> 
            <a xlink:href="http://www.google.com">
                <rect fill="red" height="100" opacity="0.0" width="160" x="110" y="240"></rect> 
            </a> 
        </g> 
    </svg>

The xlink:href attribute will be broken.

It seems that this regexp is a problem: https://github.com/ckeditor/ckeditor-dev/blob/2fbdbad72248e4b87826319c5e4a5a8e4b86f518/core/htmldataprocessor.js#L771

It allows only hyphens in attributes while colons should be accepted as well:

protectAttributeRegex = /([\w-:]+)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,

With this regexp the xlink:href attribute is correctly preserved.

Change History (5)

comment:1 Changed 10 years ago by Piotrek Koszuliński

Status: newconfirmed

comment:3 Changed 10 years ago by Piotrek Koszuliński

Owner: set to Piotrek Koszuliński
Status: confirmedassigned

comment:4 Changed 10 years ago by Piotrek Koszuliński

Status: assignedreview

comment:5 Changed 10 years ago by Artur Delura

Resolution: fixed
Status: reviewclosed

Merged with commit.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy