(bug 30975) API import of pages with invalid characters in this wiki
authorumherirrender <umherirrender_de.wp@web.de>
Sun, 29 Apr 2012 18:14:40 +0000 (20:14 +0200)
committerumherirrender <umherirrender_de.wp@web.de>
Sun, 29 Apr 2012 18:14:40 +0000 (20:14 +0200)
leads to Fatal Error

Change-Id: Ifc3ba51efe19bded51460749a1cb980a9c5244c7

RELEASE-NOTES-1.20
includes/api/ApiImport.php

index bd8f775..d35fa79 100644 (file)
@@ -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 ===
 
index ade9f1f..5093b6b 100644 (file)
@@ -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 ) {\r
+                       # Invalid or non-importable title
+                       $r['title'] = $pageInfo['title'];
+                       $r['invalid'] = '';\r
+               } else {\r
+                       ApiQueryBase::addTitleInfo( $r, $title );
+                       $r['revisions'] = intval( $successCount );
+               }
+
                $this->mResultArr[] = $r;
 
                // Piggyback on the parent to do the logging