Bug #93105
closedPersistedPatternMapper / PersistedAliasMapper: URL generation with arguments with leading numbers can lead to exceptions or wrong URLs
100%
Description
What I will describe can happen with both PersistedPatternMapper and PersistedAliasMapper.
How can it happen?
We can take the examples of the API docs as a base. Let us set the parameter news_title
to /30-pigs-are-in-the-house
. If I try to generate an url with this, the generation process will call the method findByIdentifier
. See here.
The value will be 30-pigs-are-in-the-house
. A row with uid=30
exists in table tx_news_domain_model_news. So this method will find this row and take the path_segment
of this row as the new value of news_title
. This can't be expected behavior.
The same can happen in PersistedPatternMapper. See here.
How can it be fixed?
In both findByIdentifier
methods we should check if the value is numeric to migigate the effects of arguments starting with numbers.