Last modified: 2008-11-02 22:40:54 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 T18120, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 16120 - Spam Blacklist blows up API edits
Spam Blacklist blows up API edits
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Spam Blacklist (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-10-25 23:18 UTC by Brad Jorsch
Modified: 2008-11-02 22:40 UTC (History)
3 users (show)

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


Attachments
Patch to add API support to Spam Blacklist (3.33 KB, patch)
2008-10-25 23:18 UTC, Brad Jorsch
Details

Description Brad Jorsch 2008-10-25 23:18:11 UTC
Created attachment 5470 [details]
Patch to add API support to Spam Blacklist

Regarding revision r42580.

When the spam blacklist triggers on an API edit, MediaWiki simply dies with a 500 Internal Server Error instead of returning any sort of proper error code. If php is configured not to output errors to the browser, the body of the error is an empty page; if it does output errors, the following is produced: (with php 5.2.6)

<br />
<b>Catchable fatal error</b>:  Argument 2 passed to Parser::parse() must be an instance of Title, null given, called in /usr/local/src/MediaWiki/phase3/includes/OutputPage.php on line 633 and defined in <b>/usr/local/src/MediaWiki/phase3/includes/parser/Parser.php</b> on line <b>300</b><br />

The attached patch adds API support to Spam Blacklist, although I'm sure there is more than one way to do it. With this patch, an API edit attempt will now output something useful instead of crashing:

<?xml version="1.0"?><api><edit spamblacklist="http://blacklistme.example.com" result="Failure" /></api>
Comment 1 Roan Kattouw 2008-10-26 10:37:10 UTC
(In reply to comment #0)
> Created an attachment (id=5470) [details]
> Patch to add API support to Spam Blacklist
> 
> Regarding revision r42580.
That revision is totally unrelated. Sure you didn't get the number wrong?


> When the spam blacklist triggers on an API edit, MediaWiki simply dies with a
> 500 Internal Server Error instead of returning any sort of proper error code.
> If php is configured not to output errors to the browser, the body of the error
> is an empty page; if it does output errors, the following is produced: (with
> php 5.2.6)
> 
> <br />
> <b>Catchable fatal error</b>:  Argument 2 passed to Parser::parse() must be an
> instance of Title, null given, called in
> /usr/local/src/MediaWiki/phase3/includes/OutputPage.php on line 633 and defined
> in <b>/usr/local/src/MediaWiki/phase3/includes/parser/Parser.php</b> on line
> <b>300</b><br />
> 
> The attached patch adds API support to Spam Blacklist, although I'm sure there
> is more than one way to do it. With this patch, an API edit attempt will now
> output something useful instead of crashing:
> 
> <?xml version="1.0"?><api><edit spamblacklist="http://blacklistme.example.com"
> result="Failure" /></api>
> 
Looks good. is_null($wgTitle) is maybe not ideal to check for API edit mode, but it's the best we have right now.
Comment 2 Brad Jorsch 2008-10-27 00:45:42 UTC
(In reply to comment #1)
> (In reply to comment #0)
> > Regarding revision r42580.
> That revision is totally unrelated. Sure you didn't get the number wrong?

It was the revision reported by "svn info" on my local copy of the tree when I tested this and created the patch. Sorry for the confusion.
Comment 3 Siebrand Mazeland 2008-11-02 22:40:54 UTC
Applied in r43098.

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


Navigation
Links