# HG changeset patch # User Dan # Date 1182552146 14400 # Node ID ce6053bb48d8038ee219a07988c79937f8c48b2f # Parent fdd6b9dd42c3d5d6d723a302aed88497aa3fb257 Security: NUL characters are now stripped from GPC; several code readability standards changes diff -r fdd6b9dd42c3 -r ce6053bb48d8 TODO --- a/TODO Fri Jun 22 10:31:59 2007 -0400 +++ b/TODO Fri Jun 22 18:42:26 2007 -0400 @@ -24,6 +24,10 @@ [x] Change the string shown on a successful re-auth into elevated privileges [x] ...and write a function that converts a numeric userlevel to a string [x] Make Special:Login remember parameters (target level, target page) even on auth fail +[ ] Register users_extra table in system tables list (already done?) +[x] Trigger form submit on press of enter in Dynano login form +[ ] Rewrite the change theme dialog - it's archaic code that hasn't changed since beta 1! + [ ] This should be the next-to-last step in phasing out the JWS code, which should be removed in the first 1.1 alpha Enano Clurichaun - TODO diff -r fdd6b9dd42c3 -r ce6053bb48d8 includes/clientside/static/windows.js --- a/includes/clientside/static/windows.js Fri Jun 22 10:31:59 2007 -0400 +++ b/includes/clientside/static/windows.js Fri Jun 22 18:42:26 2007 -0400 @@ -158,18 +158,27 @@ // Source: http://www.aspandjavascript.co.uk/javascript/javascript_api/get_element_width_height.asp function getElementHeight(Elem) { - if (ns4) { + if (ns4) + { var elem = getObjNN4(document, Elem); return elem.clip.height; - } else { - if(document.getElementById) { + } + else + { + if(document.getElementById) + { var elem = document.getElementById(Elem); - } else if (document.all){ + } + else if (document.all) + { var elem = document.all[Elem]; } - if (op5) { + if (op5) + { xPos = elem.style.pixelHeight; - } else { + } + else + { xPos = elem.offsetHeight; } return xPos; diff -r fdd6b9dd42c3 -r ce6053bb48d8 includes/functions.php --- a/includes/functions.php Fri Jun 22 10:31:59 2007 -0400 +++ b/includes/functions.php Fri Jun 22 18:42:26 2007 -0400 @@ -863,11 +863,17 @@ function enano_str_split($text, $inc = 1) { - if($inc < 1) return false; - if($inc >= strlen($text)) return Array($text); + if($inc < 1) + { + return false; + } + if($inc >= strlen($text)) + { + return Array($text); + } $len = ceil(strlen($text) / $inc); $ret = Array(); - for($i=0;$i $xxxx_unused) + { + $val =& $arr[$k]; + if(is_string($val)) + $val = str_replace("\000", '', $val); + elseif(is_array($val)) + $val = strip_nul_chars($val); + } + return $arr; +} + +/** * If magic_quotes_gpc is on, calls stripslashes() on everything in $_GET/$_POST/$_COOKIE - * @ignore - this doesn't work + * @ignore - this doesn't work too well in my tests * @todo port version from the PHP manual * @return void */ @@ -980,6 +1005,9 @@ $_GET = stripslashes_recurse($_GET); $_COOKIE = stripslashes_recurse($_COOKIE); } + $_POST = strip_nul_chars($_POST); + $_GET = strip_nul_chars($_GET); + $_COOKIE = strip_nul_chars($_COOKIE); } /**