Menu

#33 Stop cleanArray from index.php from spamming with NOPHP

Core Class
closed-out-of-date
Display (31)
5
2004-08-26
2004-06-03
rck
No

I had a nasty bug in my phpWSBB. Everytime, someone
entered a some text followed by a questionmark, it would
remove the last letter and the questionmark to replace it
with worNOPHP.

So I fired up grep and came to the conclusion, that there
must be a bug in the cleanArray() method. Nice
codelayout, bzw ;-)

here's the corrected version, that works for me:

/* prevent scripting tags from being passed via http get
*/
function cleanArray (&$Value) {
if(is_array($Value)) {
array_walk ($Value, 'cleanArray');
} else {
$Value = eregi_replace("['<'|'%3C'|'&lt;'|'&#60;']
+script", "NOSCRIPT", $Value);

/* $Value = eregi_replace("['<'|'%3C'|'&lt;'|'&#60;']+\?
", "NOPHP", $Value); */

$Value = eregi_replace("'&(lt|#60);\?'", "[NOPHP.1]
", $Value);
$Value = eregi_replace("'<\?'", "[NOPHP.2]", $Value)
;
$Value = eregi_replace("'%3C\?'", "[NOPHP.3]",
$Value);

}
return;
}

...see also http://www.kiesler.at/index.php?
module=phpwsbb&PHPWSBB_MAN_OP=view&PHPWS_MAN
_ITEMS[]=33 (german thread)

Discussion

  • Steven Levin

    Steven Levin - 2004-08-26

    Logged In: YES
    user_id=225888

    This has been fixed in the current version of phpwebsite.

     
  • Steven Levin

    Steven Levin - 2004-08-26
    • assigned_to: nobody --> jydallstar
    • status: open --> closed-out-of-date
     

Log in to post a comment.

MongoDB Logo MongoDB