Skip to content

Commit b1e82cf

Browse files
committed
Merge branch 'master-1.3.x'
Conflicts: README.md MantisSourceBase.class.php
2 parents b014da5 + cb804f2 commit b1e82cf

File tree

2 files changed

+28
-15
lines changed

2 files changed

+28
-15
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ The Source Integration framework's version numbering follows
6060
change in the minimum required MantisBT version.
6161

6262
Depending on which version of MantisBT you are using, please make sure to
63-
get the appropriate version of the source code.
64-
Use [release tags](https://github.com/mantisbt-plugins/source-integration/releases),
63+
get the appropriate version of the source code.
64+
Use [release tags](https://github.com/mantisbt-plugins/source-integration/releases),
6565
or the relevant branch in the Plugin's GitHub repository, as per the table below:
6666

6767
MantisBT version | Tags | Branch | Notes
6868
:---:|---|---|---
6969
2.x | v2.* | [master](https://github.com/mantisbt-plugins/source-integration/archive/master.zip) | **Current release**
70-
1.3.x | v1.* | [master-1.3.x](https://github.com/mantisbt-plugins/source-integration/archive/master-1.3.x.zip) | Legacy
71-
1.2.x | v0.* | [master-1.2.x](https://github.com/mantisbt-plugins/source-integration/archive/master-1.2.x.zip) | Legacy
70+
1.3.x | v1.* | [master-1.3.x](https://github.com/mantisbt-plugins/source-integration/archive/master-1.3.x.zip) | Old stable (bug fixes only)
71+
1.2.x | v0.* | [master-1.2.x](https://github.com/mantisbt-plugins/source-integration/archive/master-1.2.x.zip) | Legacy (no longer supported)
7272

7373

7474
### Setup instructions

Source/Source.FilterAPI.php

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -282,21 +282,22 @@ function Source_Process_FilterOption( $key, $option ) {
282282
function Source_Generate_Filter() {
283283
# Get form inputs
284284
$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' );
286286
$f_branch = Source_FilterOption_Permalink( 'branch', true );
287287
$f_file_action = Source_FilterOption_Permalink( 'file_action', true );
288288
$f_ported = Source_FilterOption_Permalink( 'ported', true );
289289

290290
$f_revision = Source_FilterOption_Permalink( 'revision' );
291291
$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+
294295

295296
$f_filename = Source_FilterOption_Permalink( 'filename' );
296297
$f_message = Source_FilterOption_Permalink( 'message' );
297298

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' );
300301

301302
# Get permalink
302303
$t_permalink = Source_FilterOption_Permalink();
@@ -361,7 +362,7 @@ function Source_Date_Validate( $p_string, $p_end_of_day=false ) {
361362
}
362363
}
363364

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' ) {
365366
static $s_permalink = '';
366367

367368
if ( is_null( $p_string ) ) {
@@ -371,7 +372,11 @@ function Source_FilterOption_Permalink( $p_string=null, $p_array=false ) {
371372
}
372373

373374
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+
}
375380
$t_input_clean = array();
376381

377382
if ( is_array( $t_input ) && count( $t_input ) > 0 ) {
@@ -384,10 +389,18 @@ function Source_FilterOption_Permalink( $p_string=null, $p_array=false ) {
384389
}
385390

386391
} 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 );
391404
}
392405

393406
if ( !is_blank( $t_input_clean ) ) {

0 commit comments

Comments
 (0)