r78250 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78249‎ | r78250 | r78251 >
Date:15:38, 12 December 2010
Author:happy-melon
Status:ok
Tags:
Comment:
Follow-up r78246: clean several integer preferences before saving. It's not dangerous to not do this, here or elsewhere, because it is done implicitly whenever the value is treated as a number; but it keeps the database tidier.
Modified paths:
  • /trunk/phase3/includes/Preferences.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Preferences.php
@@ -29,6 +29,11 @@
3030 static $defaultPreferences = null;
3131 static $saveFilters = array(
3232 'timecorrection' => array( 'Preferences', 'filterTimezoneInput' ),
 33+ 'cols' => array( 'Preferences', 'filterIntval' ),
 34+ 'rows' => array( 'Preferences', 'filterIntval' ),
 35+ 'rclimit' => array( 'Preferences', 'filterIntval' ),
 36+ 'wllimit' => array( 'Preferences', 'filterIntval' ),
 37+ 'searchlimit' => array( 'Preferences', 'filterIntval' ),
3338 );
3439
3540 static function getPreferences( $user ) {
@@ -1214,6 +1219,10 @@
12151220 }
12161221 return $opt;
12171222 }
 1223+
 1224+ static function filterIntval( $value, $alldata ){
 1225+ return intval( $value );
 1226+ }
12181227
12191228 static function filterTimezoneInput( $tz, $alldata ) {
12201229 $data = explode( '|', $tz, 3 );

Follow-up revisions

RevisionCommit summaryAuthorDate
r784371.17: Merge tagged revisions from trunk: r77878, r77981, r77982, r77994, r780...catrope14:14, 15 December 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r78246Follow-up to r64866: follow the HTML5 spec when validating floats and ints, a...happy-melon15:32, 12 December 2010

Status & tagging log