From: Aaron Schulz Date: Mon, 13 Apr 2015 21:21:30 +0000 (-0700) Subject: Made job factory() callers use Title::makeTitle X-Git-Tag: 1.31.0-rc.0~11726^2 X-Git-Url: http://git.cyclocoop.org/%22%20%20.%20generer_url_ecrire%28%22mots_tous%22%29%20.%20%22?a=commitdiff_plain;h=f7f49dfb004a2ac02eb5f397d516a8261bd208ce;p=lhc%2Fweb%2Fwiklou.git Made job factory() callers use Title::makeTitle * The titles are not from user input and this simplifies the code Change-Id: I067049cca5661b387076f0c28bc0b71d22162a0f --- diff --git a/includes/jobqueue/JobQueueDB.php b/includes/jobqueue/JobQueueDB.php index d5f47ffda0..9e85e40ad4 100644 --- a/includes/jobqueue/JobQueueDB.php +++ b/includes/jobqueue/JobQueueDB.php @@ -314,12 +314,7 @@ class JobQueueDB extends JobQueue { } JobQueue::incrStats( 'job-pop', $this->type, 1, $this->wiki ); // Get the job object from the row... - $title = Title::makeTitleSafe( $row->job_namespace, $row->job_title ); - if ( !$title ) { - $dbw->delete( 'job', array( 'job_id' => $row->job_id ), __METHOD__ ); - wfDebug( "Row has invalid title '{$row->job_title}'.\n" ); - continue; // try again - } + $title = Title::makeTitle( $row->job_namespace, $row->job_title ); $job = Job::factory( $row->job_cmd, $title, self::extractBlob( $row->job_params ), $row->job_id ); $job->metadata['id'] = $row->job_id; diff --git a/includes/jobqueue/JobQueueRedis.php b/includes/jobqueue/JobQueueRedis.php index 6c823fb9f8..82537f49f1 100644 --- a/includes/jobqueue/JobQueueRedis.php +++ b/includes/jobqueue/JobQueueRedis.php @@ -631,15 +631,11 @@ LUA; * @return Job|bool */ protected function getJobFromFields( array $fields ) { - $title = Title::makeTitleSafe( $fields['namespace'], $fields['title'] ); - if ( $title ) { - $job = Job::factory( $fields['type'], $title, $fields['params'] ); - $job->metadata['uuid'] = $fields['uuid']; + $title = Title::makeTitle( $fields['namespace'], $fields['title'] ); + $job = Job::factory( $fields['type'], $title, $fields['params'] ); + $job->metadata['uuid'] = $fields['uuid']; - return $job; - } - - return false; + return $job; } /**