page: skip directory handlers in search
[minimedit.git] / article.inc.php
index 3e67d6f1a457d59a9646babcbe83f2aa242821eb..2396f2be6e078e12af9d1ea2933ca25cafe6d49e 100644 (file)
@@ -231,6 +231,8 @@ class ArchiveArticle
 
 class PageSearch
 {
+       public $handlers = [];
+
        function __construct($path = '.')
        {
                $this->iterator = new RecursiveCallbackFilterIterator(
@@ -240,6 +242,11 @@ class PageSearch
                                        # skip hidden files and directories
                                        return FALSE;
                                }
+                               if (file_exists($current->getFilename() . '/index.php')) {
+                                       # contents better provided by handler code
+                                       $this->handlers[ $current->getPathname() ] = $current;
+                                       return FALSE;
+                               }
                                if ($current->isLink()) {
                                        # ignore symlinks, original contents only
                                        return FALSE;