Skip to content

Commit b68c451

Browse files
committed
Undo changes to restricted functions sniff
1 parent 0e7420a commit b68c451

File tree

2 files changed

+19
-21
lines changed

2 files changed

+19
-21
lines changed

WordPressVIPMinimum/Sniffs/Functions/RestrictedFunctionsSniff.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,18 +219,16 @@ public function getGroups() {
219219
'session_write_close',
220220
],
221221
],
222-
// @link VIP Go: https://vip.wordpress.com/documentation/using-wp_filesystem-instead-of-direct-file-access-functions/
223222
'file_ops' => [
224-
'type' => 'warning',
225-
'message' => 'Filesystem functions like %s() must be used with the VIP stream. Make sure you are getting the proper stream base directory using wp_upload_dir()',
223+
'type' => 'error',
224+
'message' => 'Filesystem writes are forbidden, please do not use %s().',
226225
'functions' => [
227226
'delete',
228227
'file_put_contents',
229228
'flock',
230229
'fputcsv',
231230
'fputs',
232231
'fwrite',
233-
'fclose',
234232
'ftruncate',
235233
'is_writable',
236234
'is_writeable',

WordPressVIPMinimum/Tests/Functions/RestrictedFunctionsUnitTest.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,23 @@ public function getErrorList() {
8383
164 => 1,
8484
165 => 1,
8585
166 => 1,
86+
168 => 1,
87+
174 => 1,
88+
175 => 1,
89+
177 => 1,
90+
180 => 1,
91+
182 => 1,
92+
183 => 1,
93+
184 => 1,
94+
185 => 1,
95+
186 => 1,
96+
187 => 1,
97+
188 => 1,
98+
189 => 1,
99+
190 => 1,
100+
191 => 1,
101+
192 => 1,
102+
193 => 1,
86103
194 => 1,
87104
195 => 1,
88105
196 => 1,
@@ -116,23 +133,6 @@ public function getWarningList() {
116133
137 => 1,
117134
138 => 1,
118135
139 => 1,
119-
168 => 1,
120-
174 => 1,
121-
175 => 1,
122-
177 => 1,
123-
180 => 1,
124-
182 => 1,
125-
183 => 1,
126-
184 => 1,
127-
185 => 1,
128-
186 => 1,
129-
187 => 1,
130-
188 => 1,
131-
189 => 1,
132-
190 => 1,
133-
191 => 1,
134-
192 => 1,
135-
193 => 1,
136136
208 => 1,
137137
];
138138
}

0 commit comments

Comments
 (0)