From: umherirrender Date: Mon, 5 May 2014 19:28:32 +0000 (+0200) Subject: Avoid raw sql in LocalFileDeleteBatch::doDBInserts X-Git-Tag: 1.31.0-rc.0~15882^2 X-Git-Url: http://git.cyclocoop.org/%22.%28%24lien.?a=commitdiff_plain;h=3cca294d755b38ed3f7cc7264d59cf26ea0cd199;p=lhc%2Fweb%2Fwiklou.git Avoid raw sql in LocalFileDeleteBatch::doDBInserts Use Database::conditional instead of raw sql. Change-Id: Ic00146e9ec582a263b9dec117b12532fdc24789e --- diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index 9b9f0a9ac1..4b8e590d0f 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -2114,7 +2114,7 @@ class LocalFileDeleteBatch { $dbw->insertSelect( 'filearchive', 'image', array( 'fa_storage_group' => $encGroup, - 'fa_storage_key' => "CASE WHEN img_sha1='' THEN '' ELSE $concat END", + 'fa_storage_key' => $dbw->conditional( array( 'img_sha1' => '' ), $dbw->addQuotes( '' ), $concat ), 'fa_deleted_user' => $encUserId, 'fa_deleted_timestamp' => $encTimestamp, 'fa_deleted_reason' => $encReason, @@ -2146,7 +2146,7 @@ class LocalFileDeleteBatch { $dbw->insertSelect( 'filearchive', 'oldimage', array( 'fa_storage_group' => $encGroup, - 'fa_storage_key' => "CASE WHEN oi_sha1='' THEN '' ELSE $concat END", + 'fa_storage_key' => $dbw->conditional( array( 'oi_sha1' => '' ), $dbw->addQuotes( '' ), $concat ), 'fa_deleted_user' => $encUserId, 'fa_deleted_timestamp' => $encTimestamp, 'fa_deleted_reason' => $encReason,