This commit is contained in:
Elliott Eggleston 2025-03-29 07:00:30 +01:00 committed by GitHub
commit 2b41f806e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -72,7 +72,8 @@ class plugins
private static function build_maintain_class($plugin_id)
{
$file_to_include = PHPWG_PLUGINS_PATH . $plugin_id . '/maintain';
$classname = $plugin_id.'_maintain';
$sanitized = preg_replace('[^a-zA-Z0-9_\x7f-\xff]','_',$plugin_id);
$classname = $sanitized.'_maintain';
// piwigo-videojs and piwigo-openstreetmap unfortunately have a "-" in their folder
// name (=plugin_id) and a class name can't have a "-". So we have to replace with a "_"