Opened 7 years ago

Closed 7 years ago

#5855 closed Bug (fixed)

Inserting link using Browser creates incorrect links

Reported by: Chris Tingley Owned by: Alfonso Martínez de Lizarrondo
Priority: Normal Milestone: CKEditor 3.5.1
Component: General Version: 3.1
Keywords: Cc: cksource@…

Description

See http://cksource.com/forums/viewtopic.php?f=11&t=19136

Using version 3.3.1 (but has been a problem since at least 3.1)

Steps to reproduce:

  1. Set up the insert link to have a custom server browser
  2. Click insert link
  3. Choose a link from the browser (the link should include the URL protocol).
  4. Click OK - link should appear in the editor as you would expect
  5. Insert a line and repeat steps 2-4. This time the second link has the protocol part of the URL duplicated.

See the screen shot on the forums for an idea of what this looks like.

I have ensured that the url I am returning from my custom browser is exactly the same each time (i.e. it is not that which is at fault).

Attachments (1)

5855.patch (794 bytes) - added by Alfonso Martínez de Lizarrondo 7 years ago.
Proposed patch

Download all attachments as: .zip

Change History (8)

comment:1 Changed 7 years ago by Workbooks Development

Cc: cksource@… added
Priority: NormalHigh

Hello,

Our customers keep bumping into this issue - The links withing emails they send often have a double http:// at the start e.g. http://http://www.website.com

The less IT literate people get a "broken link" message and complain the links don't work.

Many thanks, Keith (Workbooks)

comment:2 Changed 7 years ago by Frederico Caldeira Knabben

Priority: HighNormal

comment:3 Changed 7 years ago by Alfonso Martínez de Lizarrondo

Keywords: Pending added

Are you using the API to integrate correctly your file browser?

comment:4 Changed 7 years ago by Workbooks Development

Yes, we are using the API as defined in teh documentation.

I have had a look back through the code and the filebrowserBrowseUrl property is being set correctly and we are using the defined approach for setting the resulting URL.

The URL we pass back through window.opener.CKEDITOR.tools.callFunction contains a full path including the protocol.

comment:5 Changed 7 years ago by Alfonso Martínez de Lizarrondo

Keywords: Confirmed added; Pending removed
Version: 3.1

It fails only half of the time, even testing with the same file.

  • First: OK
  • Second: fails
  • Third: OK
  • Fourth: fails
  • etc...

Changed 7 years ago by Alfonso Martínez de Lizarrondo

Attachment: 5855.patch added

Proposed patch

comment:6 Changed 7 years ago by Alfonso Martínez de Lizarrondo

Owner: set to Alfonso Martínez de Lizarrondo
Status: confirmedreview

The problem is that the regexp were using the Global modifier, so they try to continue from the previous position.

comment:7 Changed 7 years ago by Alfonso Martínez de Lizarrondo

Milestone: CKEditor 3.5.1
Resolution: fixed
Status: reviewclosed

Now that the 3.5 has been released I've applied it as a microchange [6249]

Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy