Couldn't figure out what that line's code is trying to do so sorry, no patch.
Oh and btw: of all the developers, am i the only one with verbose PHP output enabled?? Simply don't get it how flaws like this manage to survive for more than a while.. ^^

Comments

steven jones’s picture

Assigned: Unassigned » steven jones
Status: Active » Needs work

I think I pinched this code from: http://www.ultrashock.com/forums/server-side/checking-if-a-file-is-binar...
Probably should change that.

gaëlg’s picture

substr_count() expects parameter 3 to be long, string given in hacked.module on line 203.

gaëlg’s picture

This seems to work...

 return (
      //hacked cf drupal.org/node/760362
      0 or substr_count($blk, "^\r\n")/512 > 0.3
        or substr_count($blk, "^ -~")/512 > 0.3
        or substr_count($blk, "\x00") > 0
    );
steven jones’s picture

Status: Needs work » Fixed

Cool! Fixed in all branches, thanks very much.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.