newlines in wfDebug() calls
authorAntoine Musso <hashar@free.fr>
Mon, 20 May 2013 18:57:43 +0000 (20:57 +0200)
committerAntoine Musso <hashar@free.fr>
Mon, 20 May 2013 18:57:43 +0000 (20:57 +0200)
Spotted while running unit tests.

Change-Id: Idf863bed71b5f11b41b81d37fb190e6e7a4d0268

includes/job/JobQueueDB.php
includes/media/FormatMetadata.php
includes/media/GIF.php
includes/media/GIFMetadataExtractor.php
includes/media/JpegMetadataExtractor.php
includes/media/PNG.php
includes/media/PNGMetadataExtractor.php

index 0e68355..56da4f3 100644 (file)
@@ -231,7 +231,7 @@ class JobQueueDB extends JobQueue {
                                        $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
                                }
                        }
index 276af4d..1c5136f 100644 (file)
@@ -854,7 +854,7 @@ class FormatMetadata {
                        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
index 6949f94..608fb25 100644 (file)
@@ -119,13 +119,13 @@ class GIFHandler extends BitmapHandler {
                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;
index a4a6753..887afa3 100644 (file)
@@ -182,7 +182,7 @@ class GIFMetadataExtractor {
                                        $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;
index 5165760..c7030eb 100644 (file)
@@ -111,7 +111,7 @@ class JpegMetadataExtractor {
                                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 @@ class JpegMetadataExtractor {
                                        } elseif ( $byteOrderMarker === 'II' ) {
                                                $segments['byteOrder'] = 'LE';
                                        } else {
-                                               wfDebug( __METHOD__ . ' Invalid byte ordering?!' );
+                                               wfDebug( __METHOD__ . " Invalid byte ordering?!\n" );
                                        }
                                }
                        } elseif ( $buffer === "\xED" ) {
index 0afbc6f..98f1386 100644 (file)
@@ -107,13 +107,13 @@ class PNGHandler extends BitmapHandler {
                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;
index d2e2cc9..34e5fa7 100644 (file)
@@ -202,14 +202,14 @@ class PNGMetadataExtractor {
 
                                                        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 @@ class PNGMetadataExtractor {
                                        $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 @@ class PNGMetadataExtractor {
 
                                        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 @@ class PNGMetadataExtractor {
                                        $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' ) {