[TYPO3-core] RFC #10759: RemoveXSS is incompatible with PHP 5.2.9 in TYPO3 4.2

Xavier Perseguers typo3 at perseguers.ch
Sat Mar 21 10:24:20 CET 2009


This is a SVN patch request.

Type: Bugfix

Bugtracker references:
http://bugs.typo3.org/view.php?id=10759

Branches: 4.2

Problem:
RemoveXSS cannot be used with PHP 5.2.9 as it is defined as this:

class RemoveXSS {

     function RemoveXSS($val) {
         // code snipped
     }

}

with the intent to use it like this:

$foo = RemoveXSS::RemoveXSS($some_input);

In PHP 5.2.9 this call issues a warning as a non-static method is used 
as a static method (I wonder if other /more-critical/ core will be 
affected too):

---------
Fatal error: Non-static method RemoveXSS::RemoveXSS() cannot be called 
statically, assuming $this from incompatible context
---------

Problem: it is not possible to make it static either:

---------
Fatal error: Constructor RemoveXSS::RemoveXSS() cannot be static
---------

Solution:
make non-static method RemoveXSS a wrapper for static method process() - 
same name as in trunk - and mark the former as deprecated.

-- 
Xavier Perseguers
http://xavier.perseguers.ch/en

One contribution a day keeps the fork away
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: removexss.diff
Url: http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20090321/1c7e1c07/attachment-0001.txt 


More information about the TYPO3-team-core mailing list