Follow-up r78246: clean several integer preferences before saving. It's not dangerou...
authorHappy-melon <happy-melon@users.mediawiki.org>
Sun, 12 Dec 2010 15:38:54 +0000 (15:38 +0000)
committerHappy-melon <happy-melon@users.mediawiki.org>
Sun, 12 Dec 2010 15:38:54 +0000 (15:38 +0000)
includes/Preferences.php

index 9bd5add..3d68fa9 100644 (file)
@@ -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 );