I just noticed while testing a client site that some HTML they had pasted in (taken from MailChimp) was giving rise to an error in the browser console because a link to a stylesheet with a valid protocol-relative URL starting "//cdn-images.mailchimp.com/embedcode/..." was being altered to "/cdn-images.mailchimp.com/embedcode/...", making it an invalid local relative URL.

I traced it to your filter function ckeditor_link_filter_process() and I think the issue is that if the base path is "/" the regular expression '`\bhref="'. preg_quote(base_path(), '`') .'([^?#"]+)`' matches this type of URL.

A simple fix would be to check for this type of URL early in _ckeditor_link_filter_process() and simply return the text as-is if it matches. If I have time I'll create a patch.

Comments

alfaguru created an issue.