}
if ( isset( $params['width'] ) && substr( $params['width'], -2 ) == 'px' ) {
// strip the px (pixel) suffix, if found
- $params['width'] = substr( $width, 0, strlen( $width ) - 2 );
+ $params['width'] = substr( $params['width'], 0, -2 );
}
if ( isset( $params['p'] ) ) {
$params['page'] = $params['p'];
global $wgMemc, $wgAttemptFailureEpoch;
$key = wfMemcKey( 'attempt-failures', $wgAttemptFailureEpoch,
- $file->getRepo()->getName(), md5( $file->getName() ), md5( $thumbName ) );
+ $file->getRepo()->getName(), $file->getSha1(), md5( $thumbName ) );
// Check if this file keeps failing to render
if ( $wgMemc->get( $key ) >= 4 ) {