Reviewed & tested by the community
Project:
Pathauto
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
2 Nov 2023 at 07:05 UTC
Updated:
18 Feb 2026 at 07:11 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
rik wijnen commentedPatch added which could fix this.
Comment #3
sijumpk commentedTried creating a node (without applying patch) with title "A.Foo" and the resulted url is /afoo, as expected. "a" is there in the "strings to remove" list while doing this. It seems like all dots are getting replaced irrespective of its position. Its done inside AliasCleaner::cleanString method. Is it just me who cannot reproduce this problem?
Comment #4
meeni_dhobale commentedI also tried to reproduce this issue without applying the patch with title "A.Foo" and my URL is "/afoo". I didn't see any kind of 403 HTTP code. I am also not able to reproduce this issue.
Comment #5
rik wijnen commentedI'm sorry, I realize that I was forgotten one setting;
In step 2, you have to select "no action (do not replace)" for "period (.)" in the "punctuation" section of /admin/config/search/path/settings too to make it break.
If you make sure "a" is in the list AND dots must not be replaced, a node with title "A.Foo" will result in url ".foo".
And yes, I'm telling the system to not replace dots but this is a special case because this one will break your site with widely used server configurations. Maybe it should be a setting in the module to prevent urls being starting with a dot, so it can be enabled if your webserver does not allow files and directories to begin with a dot.
Comment #6
mably commentedCould we have an MR please?
Comment #8
mably commentedLeading dot removal in path aliases
Problem
When the period punctuation setting is set to "Do nothing", path aliases could start with a dot (e.g.
.hidden-page). Leading dots in URL paths create hidden paths that may be blocked by web servers (Apache/Nginx) or cause unexpected behavior.Changes
ltrim($output, '.')to strip leading dots from cleaned strings, after all other processing (transliteration, punctuation handling,lowercasing) is complete.
.hidden→hidden)..hidden→hidden).hidden.file→hidden.file)normal.file→normal.file)Design decision
No configuration setting was added. This is an unconditional sanitization step, consistent with other non-configurable cleanups (whitespace replacement, duplicate separator trimming, length truncation).
Comment #9
mably commentedComment #10
mably commentedComment #12
anybodyNice fix, totally makes sense to me in addition to #2728725: Special characters like tab or spaces in pattern can break alias generation.
Still all green after rebase and code LGTM! RTBC