This adds a sanity check to EditPage::doEdit() that throws an exception if the Title's name (sans namespace) is empty. Apparently the API edit module doesn't handle this error correctly at a high level, as evidenced by page
19405691 on enwiki. I didn't try to test whether this extra check stops the particular error, but it doesn't hurt in any case.
function doEdit( $text, $summary, $flags = 0, $baseRevId = false, $user = null ) {
global $wgUser, $wgDBtransactions, $wgUseAutomaticEditSummaries;
- if ($user == null) {
- $user = $wgUser;
+ # Low-level sanity check
+ if( $this->mTitle->getText() == '' ) {
+ throw new MWException( 'Something is trying to edit an article with an empty title' );
}
wfProfileIn( __METHOD__ );
+
+ if ($user == null) {
+ $user = $wgUser;
+ }
$good = true;
if ( !($flags & EDIT_NEW) && !($flags & EDIT_UPDATE) ) {