jenkins-bot has submitted this change and it was merged.

Change subject: MimeMagic: Prevent PHP warning when trying to read zero bytes
......................................................................


MimeMagic: Prevent PHP warning when trying to read zero bytes

Honestly, there's no reason why fread() should warn when asked to read
zero bytes. It should just return zero bytes of content. Eh, PHP.

Bug: T130813
Change-Id: I56c4826759390bdbf6af04da28e2d9ed07781bca
---
M includes/MimeMagic.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Aaron Schulz: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/MimeMagic.php b/includes/MimeMagic.php
index aedfd8f..a432d44 100644
--- a/includes/MimeMagic.php
+++ b/includes/MimeMagic.php
@@ -645,7 +645,7 @@
                        throw new MWException(
                                "Seeking $tailLength bytes from EOF failed in " 
. __METHOD__ );
                }
-               $tail = fread( $f, $tailLength );
+               $tail = $tailLength ? fread( $f, $tailLength ) : '';
                fclose( $f );
 
                wfDebug( __METHOD__ . ": analyzing head and tail of $file for 
magic numbers.\n" );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I56c4826759390bdbf6af04da28e2d9ed07781bca
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bartosz DziewoƄski <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to