Index: trunk/phase3/includes/User.php |
— | — | @@ -1730,9 +1730,16 @@ |
1731 | 1731 | } |
1732 | 1732 | // Filter out any newlines that may have passed through input validation. |
1733 | 1733 | // Newlines are used to separate items in the options blob. |
1734 | | - $val = str_replace( "\r\n", "\n", $val ); |
1735 | | - $val = str_replace( "\r", "\n", $val ); |
1736 | | - $val = str_replace( "\n", " ", $val ); |
| 1734 | + if( $val ) { |
| 1735 | + $val = str_replace( "\r\n", "\n", $val ); |
| 1736 | + $val = str_replace( "\r", "\n", $val ); |
| 1737 | + $val = str_replace( "\n", " ", $val ); |
| 1738 | + } |
| 1739 | + // Explicitly NULL values should refer to defaults |
| 1740 | + global $wgDefaultUserOptions; |
| 1741 | + if( is_null($val) && isset($wgDefaultUserOptions[$oname]) ) { |
| 1742 | + $val = $wgDefaultUserOptions[$oname]; |
| 1743 | + } |
1737 | 1744 | $this->mOptions[$oname] = $val; |
1738 | 1745 | } |
1739 | 1746 | |
Index: trunk/phase3/includes/SpecialPreferences.php |
— | — | @@ -151,7 +151,7 @@ |
152 | 152 | function validateIntOrNull( &$val, $min=0, $max=0x7fffffff ) { |
153 | 153 | $val = trim($val); |
154 | 154 | if($val === '') { |
155 | | - return $val; |
| 155 | + return null; |
156 | 156 | } else { |
157 | 157 | return $this->validateInt( $val, $min, $max ); |
158 | 158 | } |