From 58cd18d6b3239ca4b35380aba702d9da420493da Mon Sep 17 00:00:00 2001
From: Max Kellermann <mk@cm4all.com>
Date: Fri, 4 Feb 2022 16:43:57 +0100
Subject: [PATCH 5/5] media.php: use file_get_contents() in wp_get_webp_info()
---
src/wp-includes/media.php | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php
index 6e7f66760f..e5e0623eb5 100644
a
|
b
|
function wp_get_webp_info( $filename ) { |
5133 | 5133 | } |
5134 | 5134 | |
5135 | 5135 | try { |
5136 | | $handle = fopen( $filename, 'rb' ); |
5137 | | if ( $handle ) { |
5138 | | $magic = fread( $handle, 40 ); |
5139 | | fclose( $handle ); |
5140 | | |
| 5136 | $magic = file_get_contents( $filename, false, null, 0, 40 ); |
| 5137 | if ( false !== $magic ) { |
5141 | 5138 | // Make sure we got enough bytes. |
5142 | 5139 | if ( strlen( $magic ) < 40 ) { |
5143 | 5140 | return compact( 'width', 'height', 'type' ); |