Problem/Motivation

Special characters are not being encoded properly for URLs. For example, using a percentage sign (%) in the title of the node will break the link and cause the page not to load correctly. Other characters (&, ", ', <, >) are escaped to HTML entities which will cause the text query parameter to break after the ampersand (&) since it's expecting a new parameter.

Steps to reproduce

  1. Install Site and Enable Better Social Sharing Buttons
  2. Create node with special characters in the title
  3. Click on a share button

Proposed resolution

Replace Html::escape with UrlHelper::encodePath to properly encode the URL.

See patch.

Comments

glassb created an issue. See original summary.

eregeur’s picture

Fixed typo in UrlHelper class, encodings and line endings. Patch otherwise works well, thanks @glassb.

  • shelane committed 8cc2a72 on 8.x-3.x authored by glassb
    Issue #3276056 by glassb, eregeur: Fix URL encoding for special...

  • shelane committed 28f5abe on 4.x authored by glassb
    Issue #3276056 by glassb, eregeur: Fix URL encoding for special...
shelane’s picture

Status: Needs review » Fixed

Thanks

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.