[FORWARD-PORT] LPS-52167 fix double escaping

This is a forward port of https://github.com/brianchandotcom/liferay-plugins-ee/pull/10293