Sanitize field value from PersistedPatternMapper.routeFieldResult if it
is declared as {fieldName|sanitized}
Example config:
routeFieldPattern: '-(?P<uid>\d+)$'
routeFieldResult: '{title|sanitized}-{uid}'
Just a proof-of-concept so far.
Open questions:
* |sanitized is just the simplest modifier one can think of. Maybe it
should be extendable where any "|..." would be just a "modifier" that
one could register in the PersistedPatternMapper config? Might be
beneficial to make it more abstract code-wise, too to not overload the
current PersistedPatternMapper code too much. "FieldResultModifiers"
could be a nice API for any on-the-fly transformation of URL parts.
* The current "modifier" (SlugHelper->sanitize) is not even configurable
right now but just uses its standard config. It would be easy to allow
configuring it for each field via PersistedPatternMapper config.
* Maybe the sanitized field should be checked for correctness during
URL-resolving. Due to the awesomeness of EXT:seo a correct canonical tag
is generated, but maybe redirects or 404 are desired in some
circumstances. I don't know if EXT:seo might have a feature "redirect
to canonical" already (?).
* I think cache flooding is not possible but please verify my thinking
here.
TODO:
* Evaluate if at all and how to implement
* .rst
* tests