Merge "setSquidMaxage() globally if we can purge it, instead of in actions."
[lhc/web/wiklou.git] / includes / Import.php
index d53810b..9ebc34c 100644 (file)
@@ -301,7 +301,7 @@ class WikiImporter {
 
        /**
         * Notify the callback function of a revision
-        * @param $revision |WikiRevision object
+        * @param $revision WikiRevision object
         * @return bool|mixed
         */
        private function revisionCallback( $revision ) {
@@ -396,6 +396,7 @@ class WikiImporter {
 
        /**
         * Primary entry point
+        * @return bool
         */
        public function doImport() {
                $this->reader->read();
@@ -785,7 +786,9 @@ class WikiImporter {
                $origTitle = Title::newFromText( $workTitle );
 
                if( !is_null( $this->mTargetNamespace ) && !is_null( $origTitle ) ) {
-                       $title = Title::makeTitle( $this->mTargetNamespace,
+                       # makeTitleSafe, because $origTitle can have a interwiki (different setting of interwiki map)
+                       # and than dbKey can begin with a lowercase char
+                       $title = Title::makeTitleSafe( $this->mTargetNamespace,
                                $origTitle->getDBkey() );
                } else {
                        $title = Title::newFromText( $workTitle );
@@ -828,7 +831,7 @@ class UploadSourceAdapter {
         * @return string
         */
        static function registerSource( $source ) {
-               $id = wfGenerateToken();
+               $id = wfRandomString();
 
                self::$sourceRegistrations[$id] = $source;