[SECURITY] Fixing XSS in PHP_SELF

Fixes #1364 once merged.
Merge pull request #1365 from TheSerapher/issue-1364

[SECURITY] Fixing XSS in PHP_SELF