X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FimportImages.php;h=172869506b62d2e43a0cce0d0b17e3f68cfc22f5;hb=a38af7ba26579bb3004f673e44d39710887763aa;hp=7a2e0f405f8d76cde7d45af3d2a5351ea4cbc986;hpb=1194189297da6d18aa66ab954b4af5f5f6099755;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/importImages.php b/maintenance/importImages.php index 7a2e0f405f..172869506b 100644 --- a/maintenance/importImages.php +++ b/maintenance/importImages.php @@ -418,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; } @@ -436,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