Manuel Lemos - 2007-02-11 13:31:13 -
In reply to message 1 from Chirs
There is no security problem using $PHP_SELF with the forms class because it correctly encodes the ACTION attribute. Even if somebody tries to spoof a malicious value into $PHP_SELF, the forms class uses HTMLSpecialChars or HtmlEntities to encode the ACTION value, and so any CSS attack attempt does not have any harmful effect.
Anyway, I am glad you brought that quote of the documentation to my attention. I was written in the days when register_globals was on by default, so $PHP_SELF is often not set in many PHP installations.
Other than that, there is a much simpler way to make the form be submitted to the same script, which is by setting the ACTION to an empty string, or to ? in case you want to get rid of any GET request parameters passed in the script URL. I have now updated the documentation to explain that.