aboutsummaryrefslogtreecommitdiffstats
path: root/includes/media/PNGHandler.php
diff options
context:
space:
mode:
authorTim Starling <tstarling@wikimedia.org>2020-06-01 15:00:39 +1000
committerTim Starling <tstarling@wikimedia.org>2020-06-03 12:01:16 +1000
commit47a16190279b14bd0ccc434421ccefd1d0cc79ee (patch)
tree6b5ab1e880852a48f73cf0a1fc60da2da8ba5055 /includes/media/PNGHandler.php
parent1fd6b9aee4091d7a54f26f273d6adcdb12d85d4d (diff)
downloadmediawikicore-47a16190279b14bd0ccc434421ccefd1d0cc79ee.tar.gz
mediawikicore-47a16190279b14bd0ccc434421ccefd1d0cc79ee.zip
Remove terminating line breaks from debug messages
A terminating line break has not been required in wfDebug() since 2014, however no migration was done. Some of these line breaks found their way into LoggerInterface::debug() calls, where they mess up the formatting of the debug log. So, remove terminating line breaks from wfDebug() and LoggerInterface::debug() calls. Also: * Fix the stripping of leading line breaks from the log header emitted by Setup.php. This feature, accidentally broken in 2014, allows requests to be distinguished in the log file. * Avoid using the global variable $self. * Move the logging of the client IP back to Setup.php. It was moved to WebRequest in the hopes that it would not always be needed, however $wgRequest->getIP() is now called unconditionally a few lines up in Setup.php. This means that it is put in its proper place after the "start request" message. * Wrap the log header code in a closure so that variables like $name do not leak into global scope. * In Linker.php, remove a few instances of an unnecessary second parameter to wfDebug(). Change-Id: I96651d3044a95b9d210b51cb8368edc76bebbb9e
Diffstat (limited to 'includes/media/PNGHandler.php')
-rw-r--r--includes/media/PNGHandler.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/includes/media/PNGHandler.php b/includes/media/PNGHandler.php
index 71d92a795c21..aed89788fdee 100644
--- a/includes/media/PNGHandler.php
+++ b/includes/media/PNGHandler.php
@@ -39,7 +39,7 @@ class PNGHandler extends BitmapHandler {
$metadata = BitmapMetadataHandler::PNG( $filename );
} catch ( Exception $e ) {
// Broken file?
- wfDebug( __METHOD__ . ': ' . $e->getMessage() . "\n" );
+ wfDebug( __METHOD__ . ': ' . $e->getMessage() );
return self::BROKEN_FILE;
}
@@ -122,7 +122,7 @@ class PNGHandler extends BitmapHandler {
Wikimedia\restoreWarnings();
if ( !$data || !is_array( $data ) ) {
- wfDebug( __METHOD__ . " invalid png metadata\n" );
+ wfDebug( __METHOD__ . " invalid png metadata" );
return self::METADATA_BAD;
}
@@ -130,7 +130,7 @@ class PNGHandler extends BitmapHandler {
if ( !isset( $data['metadata']['_MW_PNG_VERSION'] )
|| $data['metadata']['_MW_PNG_VERSION'] != PNGMetadataExtractor::VERSION
) {
- wfDebug( __METHOD__ . " old but compatible png metadata\n" );
+ wfDebug( __METHOD__ . " old but compatible png metadata" );
return self::METADATA_COMPATIBLE;
}