X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=maintenance%2FimportImages.php;h=172869506b62d2e43a0cce0d0b17e3f68cfc22f5;hp=5db1fa89c4910fa77be84b9891813273a11a6ade;hb=a38af7ba26579bb3004f673e44d39710887763aa;hpb=ee56f00ddf0609082f8ae9a4dc3e6e1b6f54ddfd diff --git a/maintenance/importImages.php b/maintenance/importImages.php index 5db1fa89c4..172869506b 100644 --- a/maintenance/importImages.php +++ b/maintenance/importImages.php @@ -335,7 +335,6 @@ class ImportImages extends Maintenance { $props, $timestamp )->isOK() ) { - # We're done! $this->output( "done.\n" ); $doProtect = false; @@ -419,7 +418,7 @@ class ImportImages extends Maintenance { $files = []; while ( ( $file = readdir( $dhl ) ) !== false ) { if ( is_file( $dir . '/' . $file ) ) { - list( /* $name */, $ext ) = $this->splitFilename( $dir . '/' . $file ); + $ext = pathinfo( $file, PATHINFO_EXTENSION ); if ( array_search( strtolower( $ext ), $exts ) !== false ) { $files[] = $dir . '/' . $file; } @@ -437,21 +436,6 @@ class ImportImages extends Maintenance { } } - /** - * Split a filename into filename and extension - * - * @param string $filename - * @return array - */ - private function splitFilename( $filename ) { - $parts = explode( '.', $filename ); - $ext = $parts[count( $parts ) - 1]; - unset( $parts[count( $parts ) - 1] ); - $fname = implode( '.', $parts ); - - return [ $fname, $ext ]; - } - /** * Find an auxilliary file with the given extension, matching * the give base file path. $maxStrip determines how many extensions