r24584 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24583‎ | r24584 | r24585 >
Date:14:42, 4 August 2007
Author:robchurch
Status:old
Tags:
Comment:
Fix up regression in box width validation ;)
Modified paths:
  • /trunk/extensions/inputbox/inputbox.php (modified) (history)

Diff [purge]

Index: trunk/extensions/inputbox/inputbox.php
@@ -210,10 +210,11 @@
211211 }
212212
213213 /**
214 - * If the width is not supplied, set it to 50
 214+ * Validate the width; make sure it's a valid, positive integer
215215 */
216216 function checkWidth() {
217 - if( !$this->width || trim( $this->width ) == '' )
 217+ $this->width = intval( $this->width );
 218+ if( $this->width <= 0 )
218219 $this->width = 50;
219220 }
220221

Status & tagging log