r57432 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57431‎ | r57432 | r57433 >
Date:19:46, 6 October 2009
Author:catrope
Status:deferred
Tags:
Comment:
EditToolbar: (bug 20869) Validate numbers in table dialog a bit better
Modified paths:
  • /trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.js
@@ -1100,10 +1100,12 @@
11011101 dialog: {
11021102 buttons: {
11031103 'edittoolbar-tool-table-insert': function() {
1104 - var rows = parseInt( $j( '#edittoolbar-table-dimensions-rows' ).val() );
1105 - var cols = parseInt( $j( '#edittoolbar-table-dimensions-columns' ).val() );
 1104+ var rowsVal = $j( '#edittoolbar-table-dimensions-rows' ).val();
 1105+ var colsVal = $j( '#edittoolbar-table-dimensions-columns' ).val();
 1106+ var rows = parseInt( rowsVal );
 1107+ var cols = parseInt( colsVal );
11061108 var header = Math.min( 1, $j( '#edittoolbar-table-dimensions-header:checked' ).size() );
1107 - if ( isNaN( rows ) || isNaN( cols ) ) {
 1109+ if ( isNaN( rows ) || isNaN( cols ) || rows != rowsVal || cols != colsVal ) {
11081110 alert( gM( 'edittoolbar-tool-table-invalidnumber' ) );
11091111 return;
11101112 }
Index: trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.php
@@ -19,7 +19,7 @@
2020 /* Configuration */
2121
2222 // Bump the version number every time you change any of the .css/.js files
23 -$wgEditToolbarStyleVersion = 54;
 23+$wgEditToolbarStyleVersion = 55;
2424
2525 // Set this to true to simply override the stock toolbar for everyone
2626 $wgEditToolbarGlobalEnable = false;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r57046EditToolbar: (bug 20869) Validate input in table dialog (rows and columns mus...catrope09:46, 29 September 2009

Status & tagging log