XWIKI-9679: Apostrophe in user name generates invalid profile title
* Merge the fix into the stable-5.2.x branch.