From 9cce7e85a20d18a207158a65dcca41caf573bcd8 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Fri, 19 Apr 2019 15:30:41 +0000 Subject: Raise an exception if the plugin directory name differs from the plugin id (#31110). Patch by Mizuki ISHIKAWA. git-svn-id: http://svn.redmine.org/redmine/trunk@18064 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/plugin.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/redmine') diff --git a/lib/redmine/plugin.rb b/lib/redmine/plugin.rb index a8e523bfe..b5fa3d209 100644 --- a/lib/redmine/plugin.rb +++ b/lib/redmine/plugin.rb @@ -98,6 +98,10 @@ module Redmine # Set a default directory if it was not provided during registration p.directory(File.join(self.directory, id.to_s)) if p.directory.nil? + unless File.directory?(p.directory) + raise PluginNotFound, "Plugin not found. The directory for plugin #{p.id} should be #{p.directory}." + end + # Adds plugin locales if any # YAML translation files should be found under /config/locales/ Rails.application.config.i18n.load_path += Dir.glob(File.join(p.directory, 'config', 'locales', '*.yml')) -- cgit v1.2.3