* (bug 8535) Allow certain vertical alignment attributes to be used as image
keywords
* (bug 6987) Allow perrow, widths, and heights attributes for <gallery>
+* (bug 8858) Safer handling when $wgImageLimits is changed. Added a note
+ in DefaultSettings to make it clear.
== Languages updated ==
/**
* Limit images on image description pages to a user-selectable limit. In order
- * to reduce disk usage, limits can only be selected from a list. This is the
- * list of settings the user can choose from:
+ * to reduce disk usage, limits can only be selected from a list.
+ * The user preference is saved as an array offset in the database, by default
+ * the offset is set with $wgDefaultUserOptions['imagesize']. Make sure you
+ * change it if you alter the array (see bug 8858).
+ * This is the list of settings the user can choose from:
*/
$wgImageLimits = array (
array(320,240),
$anchoropen = '';
$anchorclose = '';
$sizeSel = intval( $wgUser->getOption( 'imagesize') );
-
if( !isset( $wgImageLimits[$sizeSel] ) ) {
$sizeSel = User::getDefaultOption( 'imagesize' );
+
+ // The user offset might still be incorrect, specially if
+ // $wgImageLimits got changed (see bug #8858).
+ if( !isset( $wgImageLimits[$sizeSel] ) ) {
+ // Default to the first offset in $wgImageLimits
+ $sizeSel = 0;
+ }
}
$max = $wgImageLimits[$sizeSel];
$maxWidth = $max[0];