Index: branches/querypage-work2/phase3/includes/specials/SpecialFileDuplicateSearch.php |
— | — | @@ -44,19 +44,18 @@ |
45 | 45 | return array( 'filename' => $this->filename ); |
46 | 46 | } |
47 | 47 | |
48 | | - function getSQL() { |
49 | | - $dbr = wfGetDB( DB_SLAVE ); |
50 | | - $image = $dbr->tableName( 'image' ); |
51 | | - $hash = $dbr->addQuotes( $this->hash ); |
52 | | - |
53 | | - return "SELECT 'FileDuplicateSearch' AS type, |
54 | | - img_name AS title, |
55 | | - img_sha1 AS value, |
56 | | - img_user_text, |
57 | | - img_timestamp |
58 | | - FROM $image |
59 | | - WHERE img_sha1 = $hash |
60 | | - "; |
| 48 | + function getQueryInfo() { |
| 49 | + return array( |
| 50 | + 'tables' => array( 'image' ), |
| 51 | + 'fields' => array( |
| 52 | + "'FileDuplicateSearch' AS type", |
| 53 | + 'img_name AS title', |
| 54 | + 'img_sha1 AS value', |
| 55 | + 'img_user_text', |
| 56 | + 'img_timestamp' |
| 57 | + ), |
| 58 | + 'conds' => array( 'img_sha1' => $this->hash ) |
| 59 | + ); |
61 | 60 | } |
62 | 61 | |
63 | 62 | function formatResult( $skin, $result ) { |