From 625bdfe7e135d3c4c817c6a9c49e79015b4a7fd7 Mon Sep 17 00:00:00 2001 From: Paladox Date: Sat, 2 Nov 2024 16:21:14 +0000 Subject: FileBackend: PHP Deprecated: strrpos(): Passing null to parameter #1 ($haystack) ``` PHP Deprecated: strrpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /srv/mediawiki/1.42/includes/libs/filebackend/FileBackend.php on line 1588 ``` Bug: T384851 Change-Id: I36c401587d94e7c1ab444d355b03ea88da8fb6e8 (cherry picked from commit 1a4d7d410c527f6a9f57b5c3e6f733a4a64f41c1) --- includes/libs/filebackend/FileBackend.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/libs/filebackend/FileBackend.php b/includes/libs/filebackend/FileBackend.php index be8dd15f4787..89c5b0c44ffb 100644 --- a/includes/libs/filebackend/FileBackend.php +++ b/includes/libs/filebackend/FileBackend.php @@ -1630,7 +1630,7 @@ abstract class FileBackend implements LoggerAwareInterface { final public static function extensionFromPath( $path, $case = 'lowercase' ) { // This will treat a string starting with . as not having an extension, but store paths have // to start with 'mwstore://', so "garbage in, garbage out". - $i = strrpos( $path, '.' ); + $i = strrpos( $path ?? '', '.' ); $ext = $i ? substr( $path, $i + 1 ) : ''; if ( $case === 'lowercase' ) { -- cgit v1.2.3