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
- Install Site and Enable Better Social Sharing Buttons
- Create node with special characters in the title
- Click on a share button
Proposed resolution
Replace Html::escape with UrlHelper::encodePath to properly encode the URL.
See patch.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | better_social_sharing_buttons-url-encoding-3276056-2.patch | 1.17 KB | eregeur |
| better_social_sharing_buttons-fix-url-encoding.patch | 2.39 KB | glassb |
Comments
Comment #2
eregeur commentedFixed typo in UrlHelper class, encodings and line endings. Patch otherwise works well, thanks @glassb.
Comment #5
shelaneThanks