X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/modifier.php?a=blobdiff_plain;f=thumb.php;h=8307b488bfc59dd58416a84176932c1a377e45c0;hb=1f9e1b733c9967a849c5d478567b3af54c8b6972;hp=9cfdae4d3469b907e5d74da9c4d0e090216cc920;hpb=8122488aece256d89c550d7c5a3834cdc41173b6;p=lhc%2Fweb%2Fwiklou.git diff --git a/thumb.php b/thumb.php index 9cfdae4d34..8307b488bf 100644 --- a/thumb.php +++ b/thumb.php @@ -25,7 +25,7 @@ define( 'MW_NO_OUTPUT_COMPRESSION', 1 ); if ( isset( $_SERVER['MW_COMPILED'] ) ) { require( 'core/includes/WebStart.php' ); } else { - require( dirname( __FILE__ ) . '/includes/WebStart.php' ); + require( __DIR__ . '/includes/WebStart.php' ); } // Don't use fancy mime detection, just check the file extension for jpg/gif/png @@ -129,13 +129,13 @@ function wfStreamThumb( array $params ) { // Format is ! $bits = explode( '!', $fileName, 2 ); if ( count( $bits ) != 2 ) { - wfThumbError( 404, wfMsg( 'badtitletext' ) ); + wfThumbError( 404, wfMessage( 'badtitletext' )->text() ); wfProfileOut( __METHOD__ ); return; } $title = Title::makeTitleSafe( NS_FILE, $bits[1] ); if ( !$title ) { - wfThumbError( 404, wfMsg( 'badtitletext' ) ); + wfThumbError( 404, wfMessage( 'badtitletext' )->text() ); wfProfileOut( __METHOD__ ); return; } @@ -147,7 +147,7 @@ function wfStreamThumb( array $params ) { // Get the name without the timestamp so hash paths are correctly computed $title = Title::makeTitleSafe( NS_FILE, isset( $bits[1] ) ? $bits[1] : $fileName ); if ( !$title ) { - wfThumbError( 404, wfMsg( 'badtitletext' ) ); + wfThumbError( 404, wfMessage( 'badtitletext' )->text() ); wfProfileOut( __METHOD__ ); return; } @@ -172,7 +172,7 @@ function wfStreamThumb( array $params ) { // Check the source file storage path if ( !$img ) { - wfThumbError( 404, wfMsg( 'badtitletext' ) ); + wfThumbError( 404, wfMessage( 'badtitletext' )->text() ); wfProfileOut( __METHOD__ ); return; } @@ -243,15 +243,16 @@ function wfStreamThumb( array $params ) { // Check for thumbnail generation errors... $errorMsg = false; + $msg = wfMessage( 'thumbnail_error' ); if ( !$thumb ) { - $errorMsg = wfMsgHtml( 'thumbnail_error', 'File::transform() returned false' ); + $errorMsg = $msg->rawParams( 'File::transform() returned false' )->escaped(); } elseif ( $thumb->isError() ) { $errorMsg = $thumb->getHtmlMsg(); } elseif ( !$thumb->hasFile() ) { - $errorMsg = wfMsgHtml( 'thumbnail_error', 'No path supplied in thumbnail object' ); + $errorMsg = $msg->rawParams( 'No path supplied in thumbnail object' )->escaped(); } elseif ( $thumb->fileIsSource() ) { - $errorMsg = wfMsgHtml( 'thumbnail_error', - 'Image was not scaled, is the requested width bigger than the source?' ); + $errorMsg = $msg-> + rawParams( 'Image was not scaled, is the requested width bigger than the source?' )->escaped(); } if ( $errorMsg !== false ) {