2
2
/**
3
3
* An abstract filter class for checking files and folders against exact matches.
4
4
*
5
- * Supports both allowed files and blocked files.
5
+ * Supports both allowed files and disallowed files.
6
6
*
7
7
* @author Greg Sherwood <[email protected] >
8
8
* @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600)
@@ -21,12 +21,12 @@ abstract class ExactMatch extends Filter
21
21
*
22
22
* @var array
23
23
*/
24
- private $ blockedFiles = null ;
24
+ private $ disallowedFiles = null ;
25
25
26
26
/**
27
27
* A list of files to include.
28
28
*
29
- * If the allowed files list is empty, only files in the blocked files list will be excluded.
29
+ * If the allowed files list is empty, only files in the disallowed files list will be excluded.
30
30
*
31
31
* @var array
32
32
*/
@@ -36,7 +36,7 @@ abstract class ExactMatch extends Filter
36
36
/**
37
37
* Check whether the current element of the iterator is acceptable.
38
38
*
39
- * If a file is both blocked and allowed, it will be deemed unacceptable.
39
+ * If a file is both disallowed and allowed, it will be deemed unacceptable.
40
40
*
41
41
* @return bool
42
42
*/
@@ -46,8 +46,8 @@ public function accept()
46
46
return false ;
47
47
}
48
48
49
- if ($ this ->blockedFiles === null ) {
50
- $ this ->blockedFiles = $ this ->getblacklist ();
49
+ if ($ this ->disallowedFiles === null ) {
50
+ $ this ->disallowedFiles = $ this ->getblacklist ();
51
51
}
52
52
53
53
if ($ this ->allowedFiles === null ) {
@@ -56,13 +56,13 @@ public function accept()
56
56
57
57
$ filePath = Util \Common::realpath ($ this ->current ());
58
58
59
- // If file is both blocked and allowed, the blocked files list takes precedence.
60
- if (isset ($ this ->blockedFiles [$ filePath ]) === true ) {
59
+ // If file is both disallowed and allowed, the disallowed files list takes precedence.
60
+ if (isset ($ this ->disallowedFiles [$ filePath ]) === true ) {
61
61
return false ;
62
62
}
63
63
64
- if (empty ($ this ->allowedFiles ) === true && empty ($ this ->blockedFiles ) === false ) {
65
- // We are only checking a blocked files list, so everything else should be allowed.
64
+ if (empty ($ this ->allowedFiles ) === true && empty ($ this ->disallowedFiles ) === false ) {
65
+ // We are only checking a disallowed files list, so everything else should be allowed.
66
66
return true ;
67
67
}
68
68
@@ -74,16 +74,16 @@ public function accept()
74
74
/**
75
75
* Returns an iterator for the current entry.
76
76
*
77
- * Ensures that the blocked files list and the allowed files list are preserved so they don't have
77
+ * Ensures that the disallowed files list and the allowed files list are preserved so they don't have
78
78
* to be generated each time.
79
79
*
80
80
* @return \RecursiveIterator
81
81
*/
82
82
public function getChildren ()
83
83
{
84
84
$ children = parent ::getChildren ();
85
- $ children ->blockedFiles = $ this ->blockedFiles ;
86
- $ children ->allowedFiles = $ this ->allowedFiles ;
85
+ $ children ->disallowedFiles = $ this ->disallowedFiles ;
86
+ $ children ->allowedFiles = $ this ->allowedFiles ;
87
87
return $ children ;
88
88
89
89
}//end getChildren()
0 commit comments