[theme-reviewers] Functions.php Worm

Simon Prosser pross at pross.org.uk
Wed Oct 13 17:50:56 UTC 2010


On 10/13/10 18:14, Otto wrote:
> Three things:
> 1. That was indeed just a quick example off the top of my head. In fact,
> it's a broken one too (should be $this->error, not $error).
> 
> 2. You can do any kind of checks you want. The way it works is that it
> reads in all the files then runs them through all the checks. If you
> want to loop through the $php_files and look in all of them, that's
> easily doable. They're indexed by filename in case a more specific check
> is needed.
> 
> 3. Ah, hell.. Here's the code. It works, for a certain definition of
> "work". Toss it in a directory on your webserver somewhere. Make sure
> you have a high level of PHP (probably 5.1 or higher). Warning: I
> literally wrote this in about an hour. Don't expect anything
> particularly smart, it's very preliminary.
> 
> http://ottodestruct.com/themecheck.zip
> 
> -Otto

Very nice Otto, thx for sharing!

I notice you are using the internal zip functions too, one thing i
noticed so far, if a file contains ^M or excessive \r\n zip will skip
over it and the file will not appear in the array, i didnt spot it for
ages, im currently coding a wrapper to call 'dos2unix' on the files
before anything gets checked.

-- 
My Blog : http://www.pross.org.uk/
Plugins : http://www.pross.org.uk/plugins/
Themes  : http://wordpress.org/extend/themes/profile/pross


More information about the theme-reviewers mailing list