Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
If a pattern ends with whitespace (eg. by an incorrect copy-paste including a TAB character), it's accepted – but the generated alias will not work.
Proposed resolution
Don't allow the patterns ending with whitespace.
Comments
Comment #2
rahul.nahar001 CreditAttribution: rahul.nahar001 at TATA Consultancy Services for Pfizer, Inc. commentedHi @Boobaa,
Yes, you are right for strong URL we need to validate patterns not ending with whitespace.
I have created a patch for fixed this bug.
Thanks
Rahul Nahar
Comment #3
BoobaaTrailing space.
Coding standards says
if (
– ie. there should be a space between if and the parenthesis.Trailing space.
And some tests would be more than welcome.
Comment #4
rahul.nahar001 CreditAttribution: rahul.nahar001 at TATA Consultancy Services for Pfizer, Inc. commentedPlease find updated patch file.
Comment #5
Boobaaereg()
is deprecated as of PHP 5.3.0. Please usepreg_match()
instead.Too much indentation. Use "doesn't" instead of "don't".
Some automated tests would be needed, too.
Comment #6
BerdirComment #7
rahul.nahar001 CreditAttribution: rahul.nahar001 at TATA Consultancy Services for Pfizer, Inc. commentedHi,
Please find updated patch file.
I am working on to create automated test case.
Thanks
Comment #8
Dinesh18 CreditAttribution: Dinesh18 as a volunteer and at TATA Consultancy Services for Pfizer, Inc. commentedI have applied the patch and it is working as expected. It is throwing an error if there is a trailing white space.
Comment #9
Dinesh18 CreditAttribution: Dinesh18 as a volunteer and at TATA Consultancy Services for Pfizer, Inc. commentedChanged status to Needs Review
Comment #14
naiduharish CreditAttribution: naiduharish as a volunteer and at TATA Consultancy Services for Pfizer, Inc. commentedThis Patch Works as expected !!
Comment #15
rahul.nahar001 CreditAttribution: rahul.nahar001 at TATA Consultancy Services for Pfizer, Inc. commentedHi @Boobaa,
Please find updated patch file with the automated test case.
Comment #16
BerdirThanks, committed.
Comment #18
LpSolit CreditAttribution: LpSolit as a volunteer commentedWouldn't it be better to silently remove extra whitespaces instead of throwing an error?
Comment #19
BerdirNot sure, whould have been possible as well. You could provide a patch for that in a follow-up issue.