ZEN-11640: fixes open redirect vulnerability

port of:
https://jira.zenoss.com/browse/ZEN-11998
https://github.com/Zenoss/4.2.5-RPS/commit/c64acf072b07a1d6d8f4aa1f7eab7a224729a1dd#diff-0