@@ -151,12 +151,12 @@ public static function renderPostProcessedSitePaths() : void {
151
151
$ paths = ProcessedSite::getPaths ();
152
152
153
153
// Apply search
154
- if ( ! empty ( $ _GET [ 's ' ] ) ) {
155
- $ s = $ _GET [ ' s ' ];
154
+ $ search_term = strval ( filter_input ( INPUT_GET , 's ' ) );
155
+ if ( $ search_term !== '' ) {
156
156
$ paths = array_filter (
157
157
$ paths ,
158
- function ( $ path ) use ( $ s ) {
159
- return stripos ( $ path , $ s ) !== false ;
158
+ function ( $ path ) use ( $ search_term ) {
159
+ return stripos ( $ path , $ search_term ) !== false ;
160
160
}
161
161
);
162
162
}
@@ -184,12 +184,12 @@ public static function renderStaticSitePaths() : void {
184
184
$ paths = StaticSite::getPaths ();
185
185
186
186
// Apply search
187
- if ( ! empty ( $ _GET [ 's ' ] ) ) {
188
- $ s = $ _GET [ ' s ' ];
187
+ $ search_term = strval ( filter_input ( INPUT_GET , 's ' ) );
188
+ if ( $ search_term !== '' ) {
189
189
$ paths = array_filter (
190
190
$ paths ,
191
- function ( $ path ) use ( $ s ) {
192
- return stripos ( $ path , $ s ) !== false ;
191
+ function ( $ path ) use ( $ search_term ) {
192
+ return stripos ( $ path , $ search_term ) !== false ;
193
193
}
194
194
);
195
195
}
@@ -214,17 +214,18 @@ public static function renderDeployCache() : void {
214
214
die ( 'Forbidden ' );
215
215
}
216
216
217
- $ paths = isset ( $ _GET ['deploy_namespace ' ] )
218
- ? DeployCache::getPaths ( $ _GET ['deploy_namespace ' ] )
217
+ $ deploy_namespace = strval ( filter_input ( INPUT_GET , 'deploy_namespace ' ) );
218
+ $ paths = $ deploy_namespace !== ''
219
+ ? DeployCache::getPaths ( $ deploy_namespace )
219
220
: DeployCache::getPaths ();
220
221
221
222
// Apply search
222
- if ( ! empty ( $ _GET [ 's ' ] ) ) {
223
- $ s = $ _GET [ ' s ' ];
223
+ $ search_term = strval ( filter_input ( INPUT_GET , 's ' ) );
224
+ if ( $ search_term !== '' ) {
224
225
$ paths = array_filter (
225
226
$ paths ,
226
- function ( $ path ) use ( $ s ) {
227
- return stripos ( $ path , $ s ) !== false ;
227
+ function ( $ path ) use ( $ search_term ) {
228
+ return stripos ( $ path , $ search_term ) !== false ;
228
229
}
229
230
);
230
231
}
0 commit comments