Hashar has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/64614


Change subject: newlines in wfDebug() calls
......................................................................

newlines in wfDebug() calls

Spotted while running unit tests.

Change-Id: Idf863bed71b5f11b41b81d37fb190e6e7a4d0268
---
M includes/job/JobQueueDB.php
M includes/media/FormatMetadata.php
M includes/media/GIF.php
M includes/media/GIFMetadataExtractor.php
M includes/media/JpegMetadataExtractor.php
M includes/media/PNG.php
M includes/media/PNGMetadataExtractor.php
7 files changed, 14 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/14/64614/1

diff --git a/includes/job/JobQueueDB.php b/includes/job/JobQueueDB.php
index 0e68355..56da4f3 100644
--- a/includes/job/JobQueueDB.php
+++ b/includes/job/JobQueueDB.php
@@ -231,7 +231,7 @@
                                        $method
                                );
                                foreach ( $res as $row ) {
-                                       wfDebug( "Job with hash 
'{$row->job_sha1}' is a duplicate." );
+                                       wfDebug( "Job with hash 
'{$row->job_sha1}' is a duplicate.\n" );
                                        unset( $rowSet[$row->job_sha1] ); // 
already enqueued
                                }
                        }
diff --git a/includes/media/FormatMetadata.php 
b/includes/media/FormatMetadata.php
index 276af4d..1c5136f 100644
--- a/includes/media/FormatMetadata.php
+++ b/includes/media/FormatMetadata.php
@@ -854,7 +854,7 @@
                        return $vals[0];
                }
                elseif ( count( $vals ) === 0 ) {
-                       wfDebug( __METHOD__ . ' metadata array with 0 
elements!' );
+                       wfDebug( __METHOD__ . " metadata array with 0 
elements!\n" );
                        return ""; // paranoia. This should never happen
                }
                /* @todo FIXME: This should hide some of the list entries if 
there are
diff --git a/includes/media/GIF.php b/includes/media/GIF.php
index 6949f94..608fb25 100644
--- a/includes/media/GIF.php
+++ b/includes/media/GIF.php
@@ -119,13 +119,13 @@
                wfRestoreWarnings();
 
                if ( !$data || !is_array( $data ) ) {
-                       wfDebug( __METHOD__ . ' invalid GIF metadata' );
+                       wfDebug( __METHOD__ . " invalid GIF metadata\n" );
                        return self::METADATA_BAD;
                }
 
                if ( !isset( $data['metadata']['_MW_GIF_VERSION'] )
                        || $data['metadata']['_MW_GIF_VERSION'] != 
GIFMetadataExtractor::VERSION ) {
-                       wfDebug( __METHOD__ . ' old but compatible GIF 
metadata' );
+                       wfDebug( __METHOD__ . " old but compatible GIF 
metadata\n" );
                        return self::METADATA_COMPATIBLE;
                }
                return self::METADATA_GOOD;
diff --git a/includes/media/GIFMetadataExtractor.php 
b/includes/media/GIFMetadataExtractor.php
index a4a6753..887afa3 100644
--- a/includes/media/GIFMetadataExtractor.php
+++ b/includes/media/GIFMetadataExtractor.php
@@ -182,7 +182,7 @@
                                        $data = fread( $fh, $blockLength );
 
                                        if ( $blockLength != 11 ) {
-                                               wfDebug( __METHOD__ . ' GIF 
application block with wrong length' );
+                                               wfDebug( __METHOD__ . " GIF 
application block with wrong length\n" );
                                                fseek( $fh, -( $blockLength + 1 
), SEEK_CUR );
                                                self::skipBlock( $fh );
                                                continue;
diff --git a/includes/media/JpegMetadataExtractor.php 
b/includes/media/JpegMetadataExtractor.php
index 5165760..c7030eb 100644
--- a/includes/media/JpegMetadataExtractor.php
+++ b/includes/media/JpegMetadataExtractor.php
@@ -111,7 +111,7 @@
                                if ( $com === $oldCom ) {
                                        $segments["COM"][] = $oldCom;
                                } else {
-                                       wfDebug( __METHOD__ . ' Ignoring JPEG 
comment as is garbage.' );
+                                       wfDebug( __METHOD__ . " Ignoring JPEG 
comment as is garbage.\n" );
                                }
 
                        } elseif ( $buffer === "\xE1" ) {
@@ -140,7 +140,7 @@
                                        } elseif ( $byteOrderMarker === 'II' ) {
                                                $segments['byteOrder'] = 'LE';
                                        } else {
-                                               wfDebug( __METHOD__ . ' Invalid 
byte ordering?!' );
+                                               wfDebug( __METHOD__ . " Invalid 
byte ordering?!\n" );
                                        }
                                }
                        } elseif ( $buffer === "\xED" ) {
diff --git a/includes/media/PNG.php b/includes/media/PNG.php
index 0afbc6f..98f1386 100644
--- a/includes/media/PNG.php
+++ b/includes/media/PNG.php
@@ -107,13 +107,13 @@
                wfRestoreWarnings();
 
                if ( !$data || !is_array( $data ) ) {
-                       wfDebug( __METHOD__ . ' invalid png metadata' );
+                       wfDebug( __METHOD__ . " invalid png metadata\n" );
                        return self::METADATA_BAD;
                }
 
                if ( !isset( $data['metadata']['_MW_PNG_VERSION'] )
                        || $data['metadata']['_MW_PNG_VERSION'] != 
PNGMetadataExtractor::VERSION ) {
-                       wfDebug( __METHOD__ . ' old but compatible png 
metadata' );
+                       wfDebug( __METHOD__ . " old but compatible png 
metadata\n" );
                        return self::METADATA_COMPATIBLE;
                }
                return self::METADATA_GOOD;
diff --git a/includes/media/PNGMetadataExtractor.php 
b/includes/media/PNGMetadataExtractor.php
index d2e2cc9..34e5fa7 100644
--- a/includes/media/PNGMetadataExtractor.php
+++ b/includes/media/PNGMetadataExtractor.php
@@ -202,14 +202,14 @@
 
                                                        if ( $items[5] === 
false ) {
                                                                // 
decompression failed
-                                                               wfDebug( 
__METHOD__ . ' Error decompressing iTxt chunk - ' . $items[1] );
+                                                               wfDebug( 
__METHOD__ . ' Error decompressing iTxt chunk - ' . $items[1] . "\n");
                                                                fseek( $fh, 
self::$CRC_size, SEEK_CUR );
                                                                continue;
                                                        }
 
                                                } else {
                                                        wfDebug( __METHOD__ . ' 
Skipping compressed png iTXt chunk due to lack of zlib,'
-                                                               . ' or 
potentially invalid compression method' );
+                                                               . " or 
potentially invalid compression method\n" );
                                                        fseek( $fh, 
self::$CRC_size, SEEK_CUR );
                                                        continue;
                                                }
@@ -279,7 +279,7 @@
                                        $compression = substr( $postKeyword, 0, 
1 );
                                        $content = substr( $postKeyword, 1 );
                                        if ( $compression !== "\x00" ) {
-                                               wfDebug( __METHOD__ . " 
Unrecognized compression method in zTXt ($keyword). Skipping." );
+                                               wfDebug( __METHOD__ . " 
Unrecognized compression method in zTXt ($keyword). Skipping.\n" );
                                                fseek( $fh, self::$CRC_size, 
SEEK_CUR );
                                                continue;
                                        }
@@ -290,7 +290,7 @@
 
                                        if ( $content === false ) {
                                                // decompression failed
-                                               wfDebug( __METHOD__ . ' Error 
decompressing zTXt chunk - ' . $keyword );
+                                               wfDebug( __METHOD__ . ' Error 
decompressing zTXt chunk - ' . $keyword . "\n");
                                                fseek( $fh, self::$CRC_size, 
SEEK_CUR );
                                                continue;
                                        }
@@ -308,7 +308,7 @@
                                        $text[$finalKeyword]['_type'] = 'lang';
 
                                } else {
-                                       wfDebug( __METHOD__ . " Cannot 
decompress zTXt chunk due to lack of zlib. Skipping." );
+                                       wfDebug( __METHOD__ . " Cannot 
decompress zTXt chunk due to lack of zlib. Skipping.\n" );
                                        fseek( $fh, $chunk_size, SEEK_CUR );
                                }
                        } elseif ( $chunk_type == 'tIME' ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/64614
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idf863bed71b5f11b41b81d37fb190e6e7a4d0268
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Hashar <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to