Description

When adding a link by pasting the full url into the search field, the result will be double encoded if the subject contains quotes or other related characters.

Steps to repoduce

create a new article, make the title something like "this is a title with quotes"

  • create a new article, make the title something like "this is a title with quotes"
  • create another article, and now try adding the previous article into a linkit field
  • the autocomplete widget will display the quotation marks as `"`
  • and the final rendered result of the markdown will also be displayed as `"this is a title with quotes&quot`

Situatie before:

Situatie after:

Comments

granholm created an issue. See original summary.

ishani.addweb’s picture

StatusFileSize
new48.87 KB

@granholm, Thanks for providing the steps for the easy way of identifying an issue. I tried with the same steps, but not being able to reach with an issue. Please review my attached screenshot. Can you please elaborate more so that we are on the same page.

Thanks again!.

ishani.addweb’s picture

Status: Active » Needs review
idebr’s picture

Issue summary: View changes
StatusFileSize
new164.73 KB
idebr’s picture

Issue summary: View changes
idebr’s picture

Issue summary: View changes
StatusFileSize
new187.26 KB
new1.47 KB

Attached patch implements HTML entity decoding for the title when added to a Link field.

idebr’s picture

Issue summary: View changes
StatusFileSize
new192.43 KB
granholm’s picture

Status: Needs review » Reviewed & tested by the community

See next comment.

granholm’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new22.32 KB

Tested patch linkit-fields_title_double_encoded-2980959-6.patch, and the problem persists when you don't search for an internal article, but paste the url into the search field. If there are quotes (or any other special characters) in the headline, they will be double encoded, like this:

Screenshot.

granholm’s picture

This patch to Better Autocomplete should fix the double encoding when pasting an internal url to the search field.

anon’s picture

Status: Needs work » Needs review
StatusFileSize
new2.6 KB

I wont update BAC as its actually a lib included the wrong way into linkit.

However, it turns out that we are "check_plain-ing" alot more then we need.

If we use filter_xss instead we still provides the security we need and can have the same results for both a search and a url paste.