I've encountered a following problem - Pathauto removes all characters from username which contained punctuation characters only.
E.g. the user registers with username "..---" (a weird username, I know - but anyways). Pathauto is set up so that all punctuation chars are replaces with a separator ("-" in my case). I've assumed that "..---" will be converted into "-----" but it was converted to empty string leading to various issues - like blog feed alias which was "blog/feed" instead of "blog/-----/feed" for that particular user. As a result - the RSS feed for all blog entries was displaying blog entries from "..---" blog only.
I've made some debugging and found out that the problem was with the pathauto_cleanstring function - it trims leading and trailing separator characters thus producing empty string if the original string contained only punctuation characters. I've implemented a simple workaround for this - it is in the attached patch.
| Comment | File | Size | Author |
|---|---|---|---|
| pathauto_cleanstring_trimming_separators.patch | 940 bytes | Ilmar |
Comments
Comment #1
gregglesInteresting idea. I've restated it a bit to make it more clear what the patch does. Thanks for contributing it.
We'll want to start with 6.x and move it back, though I imagine the patch applies fairly well across all branches.
Comment #2
dave reidDuplicate of #631460: Prevent pathauto_cleanstring() from creating empty components (newer issue has a patch, so that why I'm merging this older issue into the newer issue).