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)
This commit is contained in:
Paladox 2024-11-02 16:21:14 +00:00 committed by Reedy
parent 0d70488f4c
commit 625bdfe7e1

View file

@ -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' ) {