From: Antoine Musso Date: Mon, 20 May 2013 18:57:43 +0000 (+0200) Subject: newlines in wfDebug() calls X-Git-Tag: 1.31.0-rc.0~19614^2 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=15f68b16d0b72a7d3eef8fcaebd821898aaab943;p=lhc%2Fweb%2Fwiklou.git newlines in wfDebug() calls Spotted while running unit tests. Change-Id: Idf863bed71b5f11b41b81d37fb190e6e7a4d0268 --- diff --git a/includes/job/JobQueueDB.php b/includes/job/JobQueueDB.php index 0e6835528a..56da4f3d8d 100644 --- a/includes/job/JobQueueDB.php +++ b/includes/job/JobQueueDB.php @@ -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 } } diff --git a/includes/media/FormatMetadata.php b/includes/media/FormatMetadata.php index 276af4d780..1c5136f5a8 100644 --- a/includes/media/FormatMetadata.php +++ b/includes/media/FormatMetadata.php @@ -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 diff --git a/includes/media/GIF.php b/includes/media/GIF.php index 6949f94028..608fb257f2 100644 --- a/includes/media/GIF.php +++ b/includes/media/GIF.php @@ -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; diff --git a/includes/media/GIFMetadataExtractor.php b/includes/media/GIFMetadataExtractor.php index a4a67534f6..887afa3f13 100644 --- a/includes/media/GIFMetadataExtractor.php +++ b/includes/media/GIFMetadataExtractor.php @@ -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; diff --git a/includes/media/JpegMetadataExtractor.php b/includes/media/JpegMetadataExtractor.php index 5165760ef9..c7030ebaca 100644 --- a/includes/media/JpegMetadataExtractor.php +++ b/includes/media/JpegMetadataExtractor.php @@ -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" ) { diff --git a/includes/media/PNG.php b/includes/media/PNG.php index 0afbc6fcf5..98f138616d 100644 --- a/includes/media/PNG.php +++ b/includes/media/PNG.php @@ -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; diff --git a/includes/media/PNGMetadataExtractor.php b/includes/media/PNGMetadataExtractor.php index d2e2cc9e28..34e5fa722a 100644 --- a/includes/media/PNGMetadataExtractor.php +++ b/includes/media/PNGMetadataExtractor.php @@ -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' ) {