LPS-40527 XSS

The changes look good to me, can you confirm? thanks!