From 1e64c2d0c935a5852be69a20ce3c00fbe30c9fd4 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Wed, 9 Apr 2014 17:35:20 +0200 Subject: [PATCH] Avoid using raw sql in LocalFile.php Now the IN-List is created by the database abstraction layer. Change-Id: I08d309eb4aad830ad6141cbfbe16447eb2674f52 --- includes/filerepo/file/LocalFile.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index 267dbd526e..eb55e82095 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -1990,7 +1990,7 @@ class LocalFileDeleteBatch { $res = $dbw->select( 'oldimage', array( 'oi_archive_name', 'oi_sha1' ), - 'oi_archive_name IN (' . $dbw->makeList( array_keys( $oldRels ) ) . ')', + array( 'oi_archive_name' => array_keys( $oldRels ) ), __METHOD__ ); @@ -2091,7 +2091,7 @@ class LocalFileDeleteBatch { $concat = $dbw->buildConcat( array( "oi_sha1", $encExt ) ); $where = array( 'oi_name' => $this->file->getName(), - 'oi_archive_name IN (' . $dbw->makeList( array_keys( $oldRels ) ) . ')' ); + 'oi_archive_name' => array_keys( $oldRels ) ); $dbw->insertSelect( 'filearchive', 'oldimage', array( 'fa_storage_group' => $encGroup, @@ -2154,7 +2154,7 @@ class LocalFileDeleteBatch { $res = $dbw->select( 'oldimage', array( 'oi_archive_name' ), array( 'oi_name' => $this->file->getName(), - 'oi_archive_name IN (' . $dbw->makeList( array_keys( $oldRels ) ) . ')', + 'oi_archive_name' => array_keys( $oldRels ), $dbw->bitAnd( 'oi_deleted', File::DELETED_FILE ) => File::DELETED_FILE ), __METHOD__ ); @@ -2321,7 +2321,7 @@ class LocalFileRestoreBatch { $conditions = array( 'fa_name' => $this->file->getName() ); if ( !$this->all ) { - $conditions[] = 'fa_id IN (' . $dbw->makeList( $this->ids ) . ')'; + $conditions['fa_id'] = $this->ids; } $result = $dbw->select( @@ -2506,7 +2506,7 @@ class LocalFileRestoreBatch { if ( $deleteIds ) { $dbw->delete( 'filearchive', - array( 'fa_id IN (' . $dbw->makeList( $deleteIds ) . ')' ), + array( 'fa_id' => $deleteIds ), __METHOD__ ); } -- 2.20.1