Skip to content

Commit

Permalink
Merge branch 'master-1.3.x'
Browse files Browse the repository at this point in the history
Conflicts:
	README.md
	MantisSourceBase.class.php
  • Loading branch information
dregad committed Mar 16, 2017
2 parents b014da5 + cb804f2 commit b1e82cf
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 15 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ The Source Integration framework's version numbering follows
change in the minimum required MantisBT version.

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

MantisBT version | Tags | Branch | Notes
:---:|---|---|---
2.x | v2.* | [master](https://github.com/mantisbt-plugins/source-integration/archive/master.zip) | **Current release**
1.3.x | v1.* | [master-1.3.x](https://github.com/mantisbt-plugins/source-integration/archive/master-1.3.x.zip) | Legacy
1.2.x | v0.* | [master-1.2.x](https://github.com/mantisbt-plugins/source-integration/archive/master-1.2.x.zip) | Legacy
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)
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)


### Setup instructions
Expand Down
35 changes: 24 additions & 11 deletions Source/Source.FilterAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,21 +282,22 @@ function Source_Process_FilterOption( $key, $option ) {
function Source_Generate_Filter() {
# Get form inputs
$f_repo_type = Source_FilterOption_Permalink( 'repo_type', true );
$f_repo_id = Source_FilterOption_Permalink( 'repo_id', true );
$f_repo_id = Source_FilterOption_Permalink( 'repo_id', true, 'int' );
$f_branch = Source_FilterOption_Permalink( 'branch', true );
$f_file_action = Source_FilterOption_Permalink( 'file_action', true );
$f_ported = Source_FilterOption_Permalink( 'ported', true );

$f_revision = Source_FilterOption_Permalink( 'revision' );
$f_author = Source_FilterOption_Permalink( 'author' );
$f_user_id = Source_FilterOption_Permalink( 'user_id' );
$f_bug_id = Source_FilterOption_Permalink( 'bug_id' );
$f_user_id = Source_FilterOption_Permalink( 'user_id', false, 'int' );
$f_bug_id = Source_FilterOption_Permalink( 'bug_id', false, 'int' );


$f_filename = Source_FilterOption_Permalink( 'filename' );
$f_message = Source_FilterOption_Permalink( 'message' );

$f_date_start = Source_FilterOption_Permalink( 'date_start' );
$f_date_end = Source_FilterOption_Permalink( 'date_end' );
$f_date_start = Source_FilterOption_Permalink( 'date_start', false, 'date' );
$f_date_end = Source_FilterOption_Permalink( 'date_end', false, 'date' );

# Get permalink
$t_permalink = Source_FilterOption_Permalink();
Expand Down Expand Up @@ -361,7 +362,7 @@ function Source_Date_Validate( $p_string, $p_end_of_day=false ) {
}
}

function Source_FilterOption_Permalink( $p_string=null, $p_array=false ) {
function Source_FilterOption_Permalink( $p_string=null, $p_array=false, $p_type='string' ) {
static $s_permalink = '';

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

if ( $p_array ) {
$t_input = gpc_get_string_array( $p_string, array() );
if( $p_type == 'int') {
$t_input = gpc_get_int_array( $p_string, array() );
} else {
$t_input = gpc_get_string_array( $p_string, array() );
}
$t_input_clean = array();

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

} else {
$t_input_clean = gpc_get_string( $p_string, null );

if ( $p_string == 'date_start' || $p_string == 'date_end' ) {
$t_input_clean = Source_Date_Validate( $p_string, $p_string == 'date_end' );
switch( $p_type ) {
case 'int':
$t_input_clean = gpc_get_int( $p_string, 0 );
if( $t_input_clean == 0) {
$t_input_clean = null;
}
break;
case 'date':
$t_input_clean = Source_Date_Validate( $p_string, $p_string == 'date_end' );
break;
default:
$t_input_clean = gpc_get_string( $p_string, null );
}

if ( !is_blank( $t_input_clean ) ) {
Expand Down

0 comments on commit b1e82cf

Please sign in to comment.