I'm using Wysiwyg with CKEditor 3.2.0.5205 .

This bug was first raised for Linkchecker http://drupal.org/node/832388 however while there seems to be one issue with that module there must be another issue with ckeditor or Wysiwyg that triggers it (please advise if this tracker is not the appropriate place)

My internal links are in the form

/node/{nid} or
/{articletype}/{articlename}.

Image URLs are in the form

/sites/default/files/images/{dir}/{imagename}.

However when using Ctrl-C/Ctrl-V to copy an existing link or image within a CKEditor window the pasted link gets preceeded by one or multiple ../ sequences. In other words, the copied link suddenly looks like:

../../node/{nid} or
../../../sites/default/files/images/Botanikus/Vitis_vinifera9.jpg

Sometimes there are enough ../ added to go above the root of my website! Graciously the browser strips out the surplus ../ sequences and puts my sitename into the right position so those links actually do work. However Linkchecker gets thrown off and reports the links as broken. I haven't yet found out whether search engines cope.

I have tried setting $base_url but the issue persists.

What needs to happen so internal links do not get tinkered with upon copy/paste?

Comments

twod’s picture

Status: Active » Postponed (maintainer needs more info)

Do you have the "Teaser Break" plugin enabled (or any other plugins provided by other modules)? If so, and the issue disappears when turning it off, this issue is likely a duplicate of #510552: Invalid XHTML: missing trailing slashes, absolute urls and uppercase tags. If not, it could be a bug in CKEditor itself, but I was unable to reproduce it on http://ckeditor.com/demo.
Does this also happen if you use CKEditor's link dialog to insert the same links?
When testing this to see if it's a problem with the plugins or Wysiwyg, just click the "Disable rich text" link to see exactly what will be stored in the database. If those links look ok but they are malformed when the page is rendered, it's most likely an input filter issue instead. The chances for that seem small though, unless LinkChecker also applies filters to the content before parsing out links.

dhope’s picture

Thanks TwoD.

I just switched off the plugins for IMCE and LinkIt. EDIT: I don't use any other plugins.

I then used the built-in Link button and entered

/node/1

as link, then saved the node. I recalled it, selected the link and copy/ pasted it into the same ckeditor window. The copy now links to

../../node/1

Without the node save in between the issue doesn't seem to appear, so I can't replicate on the demo either.

If I switch to HTML the edit window reads

<p>&nbsp;</p><p>&nbsp;</p><p><a href="/node/1">/node/1</a></p><p><a href="../../node/1">/node/1</a></p>

and this is also the HTML which will be rendered.

dhope’s picture

Status: Postponed (maintainer needs more info) » Active
hass’s picture

Thread monitoring enabled :-)

sun’s picture

Component: Editor - CKeditor » Code
Status: Active » Closed (cannot reproduce)

Sorry, but this bug must be caused either by a third-party module or editor plugin.