X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FGlobalFunctions.php;h=6fbc11d0d84f4759909850e48abe31eda3e346fe;hb=ddbba62d03e8d5d586d73a20cbc6544b41c574a6;hp=8f70120833eb9d63e51608963d358b5d0d86cb25;hpb=41eebe6709d3fb519d1ed3a380bb18926c67b9f8;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 8f70120833..6fbc11d0d8 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -2542,7 +2542,7 @@ function wfMkdirParents( $dir, $mode = null, $caller = null ) { MediaWiki\restoreWarnings(); if ( !$ok ) { - //directory may have been created on another request since we last checked + // directory may have been created on another request since we last checked if ( is_dir( $dir ) ) { return true; } @@ -4072,11 +4072,10 @@ function wfUnpack( $format, $data, $length = false ) { * @return bool */ function wfIsBadImage( $name, $contextTitle = false, $blacklist = null ) { - # Handle redirects - $redirectTitle = RepoGroup::singleton()->checkRedirect( Title::makeTitle( NS_FILE, $name ) ); - if ( $redirectTitle ) { - $name = $redirectTitle->getDBkey(); - } + # Handle redirects; callers almost always hit wfFindFile() anyway, + # so just use that method because it has a fast process cache. + $file = wfFindFile( $name ); // get the final name + $name = $file ? $file->getTitle()->getDBkey() : $name; # Run the extension hook $bad = false;