From: Derk-Jan Hartman Date: Sat, 2 Jul 2011 08:32:19 +0000 (+0000) Subject: Patch to replace for-in with for(;;) X-Git-Tag: 1.31.0-rc.0~29110 X-Git-Url: http://git.cyclocoop.org/%24dirpuce/puce%24spip_lang_rtl.gif?a=commitdiff_plain;h=ed7d6a6509e640cc22432e7e7952796ac7e57ae3;p=lhc%2Fweb%2Fwiklou.git Patch to replace for-in with for(;;) This breaks when strange things are added to Array.prototype (and you never know what users do in their user scripts), so use for (var i = 0; i < ...length; i++ ) instead. Fixes 29676. Patch courtesy of Micheal M. --- diff --git a/resources/jquery/jquery.client.js b/resources/jquery/jquery.client.js index c6edff53b5..74a2e52311 100644 --- a/resources/jquery/jquery.client.js +++ b/resources/jquery/jquery.client.js @@ -183,10 +183,10 @@ // Unknown, so we assume it's working return true; } - var name = map[dir][profile.name]; - for ( var condition in name ) { - var op = name[condition][0]; - var val = name[condition][1]; + var conditions = map[dir][profile.name]; + for ( var i = 0; i < conditions.length; i++ ) { + var op = conditions[i][0]; + var val = conditions[i][1]; if ( val === false ) { return false; } else if ( typeof val == 'string' ) {