From: umherirrender Date: Sun, 29 Apr 2012 18:14:40 +0000 (+0200) Subject: (bug 30975) API import of pages with invalid characters in this wiki X-Git-Tag: 1.31.0-rc.0~23762^2 X-Git-Url: http://git.cyclocoop.org//%27%40script%40/%27?a=commitdiff_plain;h=7d205e888a94f1a39efbb1ec8b55b1185a0db755;p=lhc%2Fweb%2Fwiklou.git (bug 30975) API import of pages with invalid characters in this wiki leads to Fatal Error Change-Id: Ifc3ba51efe19bded51460749a1cb980a9c5244c7 --- diff --git a/RELEASE-NOTES-1.20 b/RELEASE-NOTES-1.20 index bd8f775511..d35fa79ff3 100644 --- a/RELEASE-NOTES-1.20 +++ b/RELEASE-NOTES-1.20 @@ -101,6 +101,7 @@ production. * (bug 32492) API now allows editing using pageid * (bug 32497) API now allows changing of protection level using pageid * (bug 32498) API now allows comparing pages using pageids +* (bug 30975) API import of pages with invalid characters in this wiki leads to Fatal Error === Languages updated in 1.20 === diff --git a/includes/api/ApiImport.php b/includes/api/ApiImport.php index ade9f1f3fd..5093b6b63f 100644 --- a/includes/api/ApiImport.php +++ b/includes/api/ApiImport.php @@ -186,8 +186,16 @@ class ApiImportReporter extends ImportReporter { function reportPage( $title, $origTitle, $revisionCount, $successCount, $pageInfo ) { // Add a result entry $r = array(); - ApiQueryBase::addTitleInfo( $r, $title ); - $r['revisions'] = intval( $successCount ); + + if ( $title === null ) { + # Invalid or non-importable title + $r['title'] = $pageInfo['title']; + $r['invalid'] = ''; + } else { + ApiQueryBase::addTitleInfo( $r, $title ); + $r['revisions'] = intval( $successCount ); + } + $this->mResultArr[] = $r; // Piggyback on the parent to do the logging