summaryrefslogtreecommitdiffstats
path: root/lib/redmine
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2019-04-19 15:30:41 +0000
committerGo MAEDA <maeda@farend.jp>2019-04-19 15:30:41 +0000
commit9cce7e85a20d18a207158a65dcca41caf573bcd8 (patch)
tree793ea585b2069af6abe7f7e50f4ad88490101b18 /lib/redmine
parent18a4f64547488db9973551ce54329699299b2d8a (diff)
downloadredmine-9cce7e85a20d18a207158a65dcca41caf573bcd8.tar.gz
redmine-9cce7e85a20d18a207158a65dcca41caf573bcd8.zip
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
Diffstat (limited to 'lib/redmine')
-rw-r--r--lib/redmine/plugin.rb4
1 files changed, 4 insertions, 0 deletions
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 <plugin>/config/locales/
Rails.application.config.i18n.load_path += Dir.glob(File.join(p.directory, 'config', 'locales', '*.yml'))