From 77b92347661c464a2889f8e7a48bc81c338acc25 Mon Sep 17 00:00:00 2001 From: Happy-melon Date: Sun, 12 Dec 2010 15:38:54 +0000 Subject: [PATCH] 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. --- includes/Preferences.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/includes/Preferences.php b/includes/Preferences.php index 9bd5adda4b..3d68fa90e1 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -29,6 +29,11 @@ class Preferences { static $defaultPreferences = null; static $saveFilters = array( 'timecorrection' => array( 'Preferences', 'filterTimezoneInput' ), + 'cols' => array( 'Preferences', 'filterIntval' ), + 'rows' => array( 'Preferences', 'filterIntval' ), + 'rclimit' => array( 'Preferences', 'filterIntval' ), + 'wllimit' => array( 'Preferences', 'filterIntval' ), + 'searchlimit' => array( 'Preferences', 'filterIntval' ), ); static function getPreferences( $user ) { @@ -1214,6 +1219,10 @@ class Preferences { } return $opt; } + + static function filterIntval( $value, $alldata ){ + return intval( $value ); + } static function filterTimezoneInput( $tz, $alldata ) { $data = explode( '|', $tz, 3 ); -- 2.20.1