Backported the fix for the potential XSS vulnerability from 2.10.2.