From: Happy-melon Date: Sun, 12 Dec 2010 15:38:54 +0000 (+0000) Subject: Follow-up r78246: clean several integer preferences before saving. It's not dangerou... X-Git-Tag: 1.31.0-rc.0~33363 X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=77b92347661c464a2889f8e7a48bc81c338acc25;p=lhc%2Fweb%2Fwiklou.git 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. --- 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 );