Index: trunk/phase3/includes/api/ApiQueryImageInfo.php |
— | — | @@ -271,16 +271,19 @@ |
272 | 272 | $vals['timestamp'] = wfTimestamp( TS_ISO_8601, $file->getTimestamp() ); |
273 | 273 | } |
274 | 274 | if ( isset( $prop['user'] ) || isset( $prop['userid'] ) ) { |
275 | | - |
276 | | - if ( isset( $prop['user'] ) ) { |
277 | | - $vals['user'] = $file->getUser(); |
| 275 | + if ( $file->isDeleted( File::DELETED_USER ) ) { |
| 276 | + $vals['userhidden'] = ''; |
| 277 | + } else { |
| 278 | + if ( isset( $prop['user'] ) ) { |
| 279 | + $vals['user'] = $file->getUser(); |
| 280 | + } |
| 281 | + if ( isset( $prop['userid'] ) ) { |
| 282 | + $vals['userid'] = $file->getUser( 'id' ); |
| 283 | + } |
| 284 | + if ( !$file->getUser( 'id' ) ) { |
| 285 | + $vals['anon'] = ''; |
| 286 | + } |
278 | 287 | } |
279 | | - if ( isset( $prop['userid'] ) ) { |
280 | | - $vals['userid'] = $file->getUser( 'id' ); |
281 | | - } |
282 | | - if ( !$file->getUser( 'id' ) ) { |
283 | | - $vals['anon'] = ''; |
284 | | - } |
285 | 288 | } |
286 | 289 | if ( isset( $prop['size'] ) || isset( $prop['dimensions'] ) ) { |
287 | 290 | $vals['size'] = intval( $file->getSize() ); |
— | — | @@ -293,58 +296,90 @@ |
294 | 297 | } |
295 | 298 | } |
296 | 299 | if ( isset( $prop['url'] ) ) { |
297 | | - if ( !is_null( $thumbParams ) ) { |
298 | | - $mto = $file->transform( $thumbParams ); |
299 | | - if ( $mto && !$mto->isError() ) { |
300 | | - $vals['thumburl'] = wfExpandUrl( $mto->getUrl() ); |
| 300 | + if ( $file->isDeleted( File::DELETED_FILE ) ) { |
| 301 | + $vals['filehidden'] = ''; |
| 302 | + } else { |
| 303 | + if ( !is_null( $thumbParams ) ) { |
| 304 | + $mto = $file->transform( $thumbParams ); |
| 305 | + if ( $mto && !$mto->isError() ) { |
| 306 | + $vals['thumburl'] = wfExpandUrl( $mto->getUrl() ); |
301 | 307 | |
302 | | - // bug 23834 - If the URL's are the same, we haven't resized it, so shouldn't give the wanted |
303 | | - // thumbnail sizes for the thumbnail actual size |
304 | | - if ( $mto->getUrl() !== $file->getUrl() ) { |
305 | | - $vals['thumbwidth'] = intval( $mto->getWidth() ); |
306 | | - $vals['thumbheight'] = intval( $mto->getHeight() ); |
307 | | - } else { |
308 | | - $vals['thumbwidth'] = intval( $file->getWidth() ); |
309 | | - $vals['thumbheight'] = intval( $file->getHeight() ); |
310 | | - } |
| 308 | + // bug 23834 - If the URL's are the same, we haven't resized it, so shouldn't give the wanted |
| 309 | + // thumbnail sizes for the thumbnail actual size |
| 310 | + if ( $mto->getUrl() !== $file->getUrl() ) { |
| 311 | + $vals['thumbwidth'] = intval( $mto->getWidth() ); |
| 312 | + $vals['thumbheight'] = intval( $mto->getHeight() ); |
| 313 | + } else { |
| 314 | + $vals['thumbwidth'] = intval( $file->getWidth() ); |
| 315 | + $vals['thumbheight'] = intval( $file->getHeight() ); |
| 316 | + } |
311 | 317 | |
312 | | - if ( isset( $prop['thumbmime'] ) ) { |
313 | | - $thumbFile = UnregisteredLocalFile::newFromPath( $mto->getPath(), false ); |
314 | | - $vals['thumbmime'] = $thumbFile->getMimeType(); |
| 318 | + if ( isset( $prop['thumbmime'] ) ) { |
| 319 | + $thumbFile = UnregisteredLocalFile::newFromPath( $mto->getPath(), false ); |
| 320 | + $vals['thumbmime'] = $thumbFile->getMimeType(); |
| 321 | + } |
| 322 | + } else if ( $mto && $mto->isError() ) { |
| 323 | + $vals['thumberror'] = $mto->toText(); |
315 | 324 | } |
316 | | - } else if ( $mto && $mto->isError() ) { |
317 | | - $vals['thumberror'] = $mto->toText(); |
318 | 325 | } |
| 326 | + $vals['url'] = $file->getFullURL(); |
| 327 | + $vals['descriptionurl'] = wfExpandUrl( $file->getDescriptionUrl() ); |
319 | 328 | } |
320 | | - $vals['url'] = $file->getFullURL(); |
321 | | - $vals['descriptionurl'] = wfExpandUrl( $file->getDescriptionUrl() ); |
322 | 329 | } |
323 | 330 | if ( isset( $prop['comment'] ) ) { |
324 | | - $vals['comment'] = $file->getDescription(); |
| 331 | + if ( $file->isDeleted( File::DELETED_COMMENT ) ) { |
| 332 | + $vals['commenthidden'] = ''; |
| 333 | + } else { |
| 334 | + $vals['comment'] = $file->getDescription(); |
| 335 | + } |
325 | 336 | } |
326 | 337 | if ( isset( $prop['parsedcomment'] ) ) { |
327 | | - global $wgUser; |
328 | | - $vals['parsedcomment'] = $wgUser->getSkin()->formatComment( |
| 338 | + if ( $file->isDeleted( File::DELETED_COMMENT ) ) { |
| 339 | + $vals['commenthidden'] = ''; |
| 340 | + } else { |
| 341 | + global $wgUser; |
| 342 | + $vals['parsedcomment'] = $wgUser->getSkin()->formatComment( |
329 | 343 | $file->getDescription(), $file->getTitle() ); |
| 344 | + } |
330 | 345 | } |
331 | 346 | |
332 | 347 | if ( isset( $prop['sha1'] ) ) { |
333 | | - $vals['sha1'] = wfBaseConvert( $file->getSha1(), 36, 16, 40 ); |
| 348 | + if ( $file->isDeleted( File::DELETED_FILE ) ) { |
| 349 | + $vals['filehidden'] = ''; |
| 350 | + } else { |
| 351 | + $vals['sha1'] = wfBaseConvert( $file->getSha1(), 36, 16, 40 ); |
| 352 | + } |
334 | 353 | } |
335 | 354 | if ( isset( $prop['metadata'] ) ) { |
336 | | - $metadata = $file->getMetadata(); |
337 | | - $vals['metadata'] = $metadata ? self::processMetaData( unserialize( $metadata ), $result ) : null; |
| 355 | + if ( $file->isDeleted( File::DELETED_FILE ) ) { |
| 356 | + $vals['filehidden'] = ''; |
| 357 | + } else { |
| 358 | + $metadata = $file->getMetadata(); |
| 359 | + $vals['metadata'] = $metadata ? self::processMetaData( unserialize( $metadata ), $result ) : null; |
| 360 | + } |
338 | 361 | } |
339 | 362 | if ( isset( $prop['mime'] ) ) { |
340 | | - $vals['mime'] = $file->getMimeType(); |
| 363 | + if ( $file->isDeleted( File::DELETED_FILE ) ) { |
| 364 | + $vals['filehidden'] = ''; |
| 365 | + } else { |
| 366 | + $vals['mime'] = $file->getMimeType(); |
| 367 | + } |
341 | 368 | } |
342 | 369 | |
343 | 370 | if ( isset( $prop['archivename'] ) && $file->isOld() ) { |
344 | | - $vals['archivename'] = $file->getArchiveName(); |
| 371 | + if ( $file->isDeleted( File::DELETED_FILE ) ) { |
| 372 | + $vals['filehidden'] = ''; |
| 373 | + } else { |
| 374 | + $vals['archivename'] = $file->getArchiveName(); |
| 375 | + } |
345 | 376 | } |
346 | 377 | |
347 | 378 | if ( isset( $prop['bitdepth'] ) ) { |
348 | | - $vals['bitdepth'] = $file->getBitDepth(); |
| 379 | + if ( $file->isDeleted( File::DELETED_FILE ) ) { |
| 380 | + $vals['filehidden'] = ''; |
| 381 | + } else { |
| 382 | + $vals['bitdepth'] = $file->getBitDepth(); |
| 383 | + } |
349 | 384 | } |
350 | 385 | |
351 | 386 | return $vals; |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -185,6 +185,7 @@ |
186 | 186 | * (bug 27616) Add userid of blocked user and blocker to list=blocks |
187 | 187 | * (bug 27688) Simplify queries to list user block information |
188 | 188 | * (bug 27708) list=users does not have a property to return user id |
| 189 | +* (bug 27715) imageinfo didn't respect revdelete |
189 | 190 | |
190 | 191 | === Languages updated in 1.18 === |
191 | 192 | |