Last modified: 2010-05-15 15:48:16 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T10858, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 8858 - If $wgImageLimits is less than three it crashes
If $wgImageLimits is less than three it crashes
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.9.x
PC Windows 98
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-02-02 06:48 UTC by Invalid Account
Modified: 2010-05-15 15:48 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Invalid Account 2007-02-02 06:48:30 UTC
This works fine:
$wgImageLimits = array (
	array(800,600),
	array(800,600),
	array(800,600) );

But less than two options crashes

This crashes:
$wgImageLimits = array (
	array(800,600),
	array(800,600) );

So does this:
$wgImageLimits = array ( array(800,600) );

The error happens when one views an "Image:" page (image namespace)

"Division by zero" in "ImagePage.php on line 205"

Then two "Warning: Cannot modify header information - headers already sent by " on "WebResponse.php on 
line 9"

Also the image in the Image: namespace doesn't show, but clicking on the link will view it.
Comment 1 Antoine "hashar" Musso (WMF) 2007-02-02 16:04:40 UTC
The user preference save an offset in the array, in your case the
offset is out of the array. We should save the (x,y) couple instead.
Comment 2 Antoine "hashar" Musso (WMF) 2007-02-02 16:22:42 UTC
When tweaking $wgImageLimits, the default preference should be changed too.

Example:

$wgImageLimits = array(
    array(320,240),
);
$wgDefaultUserOptions['imagesize'] = 0;

Anyway, I added a check in image page to make sure the offset actually exist
and default to the last offset if not. I also added some documentation in
DefaultSettings.php

Fixed in r19725
Comment 3 Invalid Account 2007-02-02 16:39:00 UTC
Ah, you know that would be nice if I removed as skin as a selectable skin that it would get it out of 
user preferences, too.
Comment 4 Antoine "hashar" Musso (WMF) 2007-02-03 13:03:30 UTC
Open a new bug.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links