Do not ignore `.gitignore` and `.htaccess` files in DevtoolsPip
authorMatthias Schmidt <gravatronics@live.com>
Tue, 5 Feb 2019 18:00:39 +0000 (19:00 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Tue, 5 Feb 2019 18:00:39 +0000 (19:00 +0100)
When syncing files, ignoring these files can cause directories not be created even though the code expects them to exist.

wcfsetup/install/files/lib/system/devtools/pip/DevtoolsPip.class.php

index 3b72a871ab6e078bba20ccea2a5660dbadcb2e57..b9b7be43229b3a9178fce71c4ead4c4388ee7dbe 100644 (file)
@@ -206,7 +206,7 @@ class DevtoolsPip extends DatabaseObjectDecorator {
                                                $filter = new \RecursiveCallbackFilterIterator($directory, function ($current) {
                                                        /** @var \SplFileInfo $current */
                                                        $filename = $current->getFilename();
-                                                       if ($filename[0] === '.') {
+                                                       if ($filename[0] === '.' && $filename !== '.gitignore' && $filename !== '.htaccess') {
                                                                // ignore dot files and files/directories starting with a dot
                                                                return false;
                                                        }
@@ -298,7 +298,7 @@ class DevtoolsPip extends DatabaseObjectDecorator {
                                                $filter = new \RecursiveCallbackFilterIterator($directory, function ($current) {
                                                        /** @var \SplFileInfo $current */
                                                        $filename = $current->getFilename();
-                                                       if ($filename[0] === '.') {
+                                                       if ($filename[0] === '.' && $filename !== '.gitignore' && $filename !== '.htaccess') {
                                                                // ignore dot files and files/directories starting with a dot
                                                                return false;
                                                        }