Bartosz Dziewoński has uploaded a new change for review.

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

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(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/15/279315/1

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: newchange
Gerrit-Change-Id: I56c4826759390bdbf6af04da28e2d9ed07781bca
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>

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

Reply via email to