Index: trunk/extensions/GlobalUsage/GlobalUsageQuery.php |
— | — | @@ -20,6 +20,9 @@ |
21 | 21 | $this->db = wfGetDB( DB_SLAVE, array(), $wgGlobalUsageDatabase ); |
22 | 22 | if ( $target instanceof Title ) { |
23 | 23 | $this->target = $target; |
| 24 | + } elseif ( is_array( $target ) ) { |
| 25 | + // List of files to query |
| 26 | + $this->target = $target; |
24 | 27 | } else { |
25 | 28 | $this->target = Title::makeTitleSafe( NS_FILE, $target ); |
26 | 29 | } |
— | — | @@ -107,7 +110,12 @@ |
108 | 111 | $tables = array( 'globalimagelinks' ); |
109 | 112 | |
110 | 113 | // Add target image(s) |
111 | | - switch ( $this->target->getNamespace() ) { |
| 114 | + if ( is_array( $this->target ) ) { |
| 115 | + $namespace = NS_FILE; |
| 116 | + } else { |
| 117 | + $namespace = $this->target->getNamespace(); |
| 118 | + } |
| 119 | + switch ( $namespace ) { |
112 | 120 | case NS_FILE: |
113 | 121 | $where = array( 'gil_to' => $this->target ); |
114 | 122 | break; |