Merge "add type check and bail out when title could not be created"
authorAaron Schulz <aschulz@wikimedia.org>
Mon, 7 May 2012 23:03:02 +0000 (23:03 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 7 May 2012 23:03:03 +0000 (23:03 +0000)
includes/job/JobQueue.php

index 0ec1a52..a53905f 100644 (file)
@@ -201,6 +201,11 @@ abstract class Job {
                $namespace = $row->job_namespace;
                $dbkey = $row->job_title;
                $title = Title::makeTitleSafe( $namespace, $dbkey );
+
+               if ( is_null( $title ) ) {
+                       return false;
+               }
+
                $job = Job::factory( $row->job_cmd, $title, Job::extractBlob( $row->job_params ), $row->job_id );
 
                // Remove any duplicates it may have later in the queue
@@ -219,7 +224,7 @@ abstract class Job {
         * @param $id Int: Job identifier
         * @return Job
         */
-       static function factory( $command, $title, $params = false, $id = 0 ) {
+       static function factory( $command, Title $title, $params = false, $id = 0 ) {
                global $wgJobClasses;
                if( isset( $wgJobClasses[$command] ) ) {
                        $class = $wgJobClasses[$command];