From a65582f4e8b092f17c1e87debdd8a37983cb4bad Mon Sep 17 00:00:00 2001 From: Bryan Tong Minh Date: Sun, 13 Feb 2011 20:38:05 +0000 Subject: [PATCH] Follow-up r82049: Fix strict comparison because MediaHandler::parseParamString() is not guaranteed to use intval() on the width and height parameters. Add __METHOD__ to wfDebug() call. --- includes/api/ApiQueryImageInfo.php | 2 +- includes/filerepo/ForeignAPIRepo.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/api/ApiQueryImageInfo.php b/includes/api/ApiQueryImageInfo.php index 628319265d..d95836e8a8 100644 --- a/includes/api/ApiQueryImageInfo.php +++ b/includes/api/ApiQueryImageInfo.php @@ -242,7 +242,7 @@ class ApiQueryImageInfo extends ApiQueryBase { } if ( isset( $paramList['width'] ) ) { - if ( $paramList['width'] !== $thumbParams['width'] ) { + if ( intval( $paramList['width'] ) != intval( $thumbParams['width'] ) ) { $this->dieUsage( "{$p}urlparam had width of {$paramList['width']} but " . "{$p}urlwidth was {$thumbParams['width']}", "urlparam_urlwidth_mismatch" ); } diff --git a/includes/filerepo/ForeignAPIRepo.php b/includes/filerepo/ForeignAPIRepo.php index f37859cea2..35a0ffd898 100644 --- a/includes/filerepo/ForeignAPIRepo.php +++ b/includes/filerepo/ForeignAPIRepo.php @@ -243,7 +243,8 @@ class ForeignAPIRepo extends FileRepo { $knownThumbUrls = array(); } else { if( isset( $knownThumbUrls[$sizekey] ) ) { - wfDebug("Got thumburl from local cache. {$knownThumbUrls[$sizekey]} \n"); + wfDebug( __METHOD__ . ': Got thumburl from local cache: ' . + "{$knownThumbUrls[$sizekey]} \n"); return $knownThumbUrls[$sizekey]; } /* This size is not yet known */ -- 2.20.1