@@ -282,21 +282,22 @@ function Source_Process_FilterOption( $key, $option ) {
282
282
function Source_Generate_Filter () {
283
283
# Get form inputs
284
284
$ f_repo_type = Source_FilterOption_Permalink ( 'repo_type ' , true );
285
- $ f_repo_id = Source_FilterOption_Permalink ( 'repo_id ' , true );
285
+ $ f_repo_id = Source_FilterOption_Permalink ( 'repo_id ' , true , ' int ' );
286
286
$ f_branch = Source_FilterOption_Permalink ( 'branch ' , true );
287
287
$ f_file_action = Source_FilterOption_Permalink ( 'file_action ' , true );
288
288
$ f_ported = Source_FilterOption_Permalink ( 'ported ' , true );
289
289
290
290
$ f_revision = Source_FilterOption_Permalink ( 'revision ' );
291
291
$ f_author = Source_FilterOption_Permalink ( 'author ' );
292
- $ f_user_id = Source_FilterOption_Permalink ( 'user_id ' );
293
- $ f_bug_id = Source_FilterOption_Permalink ( 'bug_id ' );
292
+ $ f_user_id = Source_FilterOption_Permalink ( 'user_id ' , false , 'int ' );
293
+ $ f_bug_id = Source_FilterOption_Permalink ( 'bug_id ' , false , 'int ' );
294
+
294
295
295
296
$ f_filename = Source_FilterOption_Permalink ( 'filename ' );
296
297
$ f_message = Source_FilterOption_Permalink ( 'message ' );
297
298
298
- $ f_date_start = Source_FilterOption_Permalink ( 'date_start ' );
299
- $ f_date_end = Source_FilterOption_Permalink ( 'date_end ' );
299
+ $ f_date_start = Source_FilterOption_Permalink ( 'date_start ' , false , ' date ' );
300
+ $ f_date_end = Source_FilterOption_Permalink ( 'date_end ' , false , ' date ' );
300
301
301
302
# Get permalink
302
303
$ t_permalink = Source_FilterOption_Permalink ();
@@ -361,7 +362,7 @@ function Source_Date_Validate( $p_string, $p_end_of_day=false ) {
361
362
}
362
363
}
363
364
364
- function Source_FilterOption_Permalink ( $ p_string =null , $ p_array =false ) {
365
+ function Source_FilterOption_Permalink ( $ p_string =null , $ p_array =false , $ p_type = ' string ' ) {
365
366
static $ s_permalink = '' ;
366
367
367
368
if ( is_null ( $ p_string ) ) {
@@ -371,7 +372,11 @@ function Source_FilterOption_Permalink( $p_string=null, $p_array=false ) {
371
372
}
372
373
373
374
if ( $ p_array ) {
374
- $ t_input = gpc_get_string_array ( $ p_string , array () );
375
+ if ( $ p_type == 'int ' ) {
376
+ $ t_input = gpc_get_int_array ( $ p_string , array () );
377
+ } else {
378
+ $ t_input = gpc_get_string_array ( $ p_string , array () );
379
+ }
375
380
$ t_input_clean = array ();
376
381
377
382
if ( is_array ( $ t_input ) && count ( $ t_input ) > 0 ) {
@@ -384,10 +389,18 @@ function Source_FilterOption_Permalink( $p_string=null, $p_array=false ) {
384
389
}
385
390
386
391
} else {
387
- $ t_input_clean = gpc_get_string ( $ p_string , null );
388
-
389
- if ( $ p_string == 'date_start ' || $ p_string == 'date_end ' ) {
390
- $ t_input_clean = Source_Date_Validate ( $ p_string , $ p_string == 'date_end ' );
392
+ switch ( $ p_type ) {
393
+ case 'int ' :
394
+ $ t_input_clean = gpc_get_int ( $ p_string , 0 );
395
+ if ( $ t_input_clean == 0 ) {
396
+ $ t_input_clean = null ;
397
+ }
398
+ break ;
399
+ case 'date ' :
400
+ $ t_input_clean = Source_Date_Validate ( $ p_string , $ p_string == 'date_end ' );
401
+ break ;
402
+ default :
403
+ $ t_input_clean = gpc_get_string ( $ p_string , null );
391
404
}
392
405
393
406
if ( !is_blank ( $ t_input_clean ) ) {
0 commit comments