Skip to content

Commit

Permalink
Fix issue Call to undefined method Joomla\Filesystem\File::getExt() i…
Browse files Browse the repository at this point in the history
…n Joomla 4
  • Loading branch information
sonvnn committed Sep 27, 2024
1 parent e0973ba commit e7cf6d6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion framework/library/astroid/Helper/Media.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public static function getList($folder): array
$tmp->path_relative = str_replace($mediaBase, '', $tmp->path);
$tmp->size = filesize($tmp->path);

$ext = strtolower(File::getExt($file));
$ext = strtolower(self::getExt($file));

switch ($ext) {
// Image
Expand Down Expand Up @@ -376,4 +376,13 @@ public static function rename(): array

return ['message' => $type . " `$name` successfully rename.", 'item' => $item];
}

public static function getExt($filename): string
{
if (ASTROID_JOOMLA_VERSION > 4) {
return File::getExt($filename);
} else {
return \Joomla\CMS\Filesystem\File::getExt($filename);
}
}
}

0 comments on commit e7cf6d6

Please sign in to comment.