From 6a1f579c6e6f93579a9269acf58e7109072b943f Mon Sep 17 00:00:00 2001
From: Sam <sam.saffron@gmail.com>
Date: Tue, 16 May 2017 17:28:45 -0400
Subject: [PATCH] FIX: don't search for plugins in nested subdirectories

---
 lib/plugin/instance.rb                           | 2 +-
 spec/fixtures/plugins/my_plugin/nested/plugin.rb | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
 create mode 100644 spec/fixtures/plugins/my_plugin/nested/plugin.rb

diff --git a/lib/plugin/instance.rb b/lib/plugin/instance.rb
index 9fbeb8ef830..ca749901078 100644
--- a/lib/plugin/instance.rb
+++ b/lib/plugin/instance.rb
@@ -46,7 +46,7 @@ class Plugin::Instance
   def self.find_all(parent_path)
     [].tap { |plugins|
       # also follows symlinks - http://stackoverflow.com/q/357754
-      Dir["#{parent_path}/**/*/**/plugin.rb"].sort.each do |path|
+      Dir["#{parent_path}/*/plugin.rb"].sort.each do |path|
 
         # tagging is included in core, so don't load it
         next if path =~ /discourse-tagging/
diff --git a/spec/fixtures/plugins/my_plugin/nested/plugin.rb b/spec/fixtures/plugins/my_plugin/nested/plugin.rb
new file mode 100644
index 00000000000..e69de29bb2d