I use a node title as a part of node alias.

Current pattern is:

catalog/[node:content-type:machine-name]/[node:title]

When node title contain the single quote symbol, the alias of node build on catalog/[node:content-type:machine-name] pattern, and does not contain node title.

How to fix this bug?

Files: 
CommentFileSizeAuthor
#7 pathauto-fix-htmlchars-1626990-7.patch464 byteschadedge
FAILED: [[SimpleTest]]: [MySQL] 315 pass(es), 1 fail(s), and 0 exception(s).
[ View ]

Comments

sun-fire’s picture

UPD:

How to reproduce this bug: node title must have < > symbols and quote.

For example (cyrillic text):

<М'ЯТА УПАКОВКА> Роутер D-Link DIR-100 1port WAN

Transliteration return:

Router D-Link DIR-100 1port WAN

When i removed < > and ' all works as designed.

When i removed < it also works as designed

When string contain ' and > it does not working.

emclaughlin’s picture

So, if I understand what you're saying correctly, when you create a node titled "МЯТА УПАКОВКА Роутер D-Link DIR-100 1port WAN" the alias that gets assigned to it is "node/МЯТА УПАКОВКА Роутер D-Link DIR-100 1port WAN" and when you create a node titled "<М'ЯТА УПАКОВКА> Роутер D-Link DIR-100 1port WAN" the alias that gets assigned to it is "node/"?

Or does it not get an alias assigned to it at all? I'm attempting to reproduce the problem and finding that "<М'ЯТА УПАКОВКА> Роутер D-Link DIR-100 1port WAN" doesn't get an alias assigned to it at all through pathauto.

chadedge’s picture

Title:Single quote breaks an alias» Single quote breaks an alias (strip html)
Issue summary:View changes
StatusFileSize
new483 bytes

I was having a similar issue where users were adding <3 (emoticon for a "heart") into the title of their posts. This caused the strip_tags to eliminate the entire title string (returning an empty string) so the path auto could not generate a URL alias.
By swapping decode_entities() and strip_tags() I was able to eliminate this issue.

-- This patch is now outdated. #4 is the correct patch (trying to delete this commit) --

chadedge’s picture

Version:7.x-1.1» 7.x-1.x-dev
Status:Active» Needs review
StatusFileSize
new482 bytes
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch pathauto-fix-htmlchars-1626990-3_0.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
chadedge’s picture

Status:Needs review» Needs work

The last submitted patch, 4: pathauto-fix-htmlchars-1626990-3.patch, failed testing.

chadedge’s picture

StatusFileSize
new464 bytes
FAILED: [[SimpleTest]]: [MySQL] 315 pass(es), 1 fail(s), and 0 exception(s).
[ View ]

Attempting to resubmit patch using more updated branch of 7.x-1.x pathauto.

chadedge’s picture

Version:7.x-1.x-dev» 7.x-1.1
Status:Needs work» Needs review

Status:Needs review» Needs work

The last submitted patch, 7: pathauto-fix-htmlchars-1626990-7.patch, failed testing.