@@ -47,22 +47,32 @@ public function accept()
4747 }
4848
4949 if ($ this ->disallowedFiles === null ) {
50- $ this ->disallowedFiles = $ this ->getblacklist ();
50+ $ this ->disallowedFiles = $ this ->getDisallowedFiles ();
51+
52+ // BC-layer.
53+ if ($ this ->disallowedFiles === null ) {
54+ $ this ->disallowedFiles = $ this ->getBlacklist ();
55+ }
5156 }
5257
5358 if ($ this ->allowedFiles === null ) {
54- $ this ->allowedFiles = $ this ->getwhitelist ();
59+ $ this ->allowedFiles = $ this ->getAllowedFiles ();
60+
61+ // BC-layer.
62+ if ($ this ->allowedFiles === null ) {
63+ $ this ->allowedFiles = $ this ->getWhitelist ();
64+ }
5565 }
5666
5767 $ filePath = Util \Common::realpath ($ this ->current ());
5868
59- // If file is both disallowed and allowed, the disallowed files list takes precedence.
69+ // If a file is both disallowed and allowed, the disallowed files list takes precedence.
6070 if (isset ($ this ->disallowedFiles [$ filePath ]) === true ) {
6171 return false ;
6272 }
6373
6474 if (empty ($ this ->allowedFiles ) === true && empty ($ this ->disallowedFiles ) === false ) {
65- // We are only checking a disallowed files list, so everything else should be allowed.
75+ // We are only checking the disallowed files list, so everything else should be allowed.
6676 return true ;
6777 }
6878
@@ -92,6 +102,11 @@ public function getChildren()
92102 /**
93103 * Get a list of file paths to exclude.
94104 *
105+ * @deprecated 3.9.0 Overload the `getDisallowedFiles()` method instead.
106+ * The `getDisallowedFiles()` method will be made abstract and therefore required
107+ * in v4.0 and this method will be removed.
108+ * If both methods are implemented, the new `getDisallowedFiles()` method will take precedence.
109+ *
95110 * @return array
96111 */
97112 abstract protected function getBlacklist ();
@@ -100,9 +115,42 @@ abstract protected function getBlacklist();
100115 /**
101116 * Get a list of file paths to include.
102117 *
118+ * @deprecated 3.9.0 Overload the `getAllowedFiles()` method instead.
119+ * The `getAllowedFiles()` method will be made abstract and therefore required
120+ * in v4.0 and this method will be removed.
121+ * If both methods are implemented, the new `getAllowedFiles()` method will take precedence.
122+ *
103123 * @return array
104124 */
105125 abstract protected function getWhitelist ();
106126
107127
128+ /**
129+ * Get a list of file paths to exclude.
130+ *
131+ * @since 3.9.0 Replaces the deprecated `getBlacklist()` method.
132+ *
133+ * @return array|null
134+ */
135+ protected function getDisallowedFiles ()
136+ {
137+ return null ;
138+
139+ }//end getDisallowedFiles()
140+
141+
142+ /**
143+ * Get a list of file paths to include.
144+ *
145+ * @since 3.9.0 Replaces the deprecated `getWhitelist()` method.
146+ *
147+ * @return array|null
148+ */
149+ protected function getAllowedFiles ()
150+ {
151+ return null ;
152+
153+ }//end getAllowedFiles()
154+
155+
108156}//end class
0 commit comments