diff --git a/SourceGithub/SourceGithub.php b/SourceGithub/SourceGithub.php index c77145e..04b86e3 100755 --- a/SourceGithub/SourceGithub.php +++ b/SourceGithub/SourceGithub.php @@ -171,7 +171,7 @@ $f_hub_app_secret = gpc_get_string( 'hub_app_secret' ); $f_master_branch = gpc_get_string( 'master_branch' ); - if ( !preg_match( '/\*|^[a-zA-Z0-9_\., -]*$/', $f_master_branch ) ) { + if ( !preg_match( '/^(\*|[a-zA-Z0-9_\., -]*)$/', $f_master_branch ) ) { plugin_error( self::ERROR_INVALID_PRIMARY_BRANCH ); } diff --git a/SourceGitlab/SourceGitlab.php b/SourceGitlab/SourceGitlab.php index 0a3e662..0a5ed25 100644 --- a/SourceGitlab/SourceGitlab.php +++ b/SourceGitlab/SourceGitlab.php @@ -94,7 +94,7 @@ $t_ref = $p_changeset->revision; $t_filename = $p_file->filename; - return "$t_root/$t_reponame/commit/$t_ref?view=parallel"; + return "t_root/$t_reponame/commit/$t_ref?view=parallel"; } public function update_repo_form( $p_repo ) { @@ -171,7 +171,7 @@ $f_hub_app_secret = gpc_get_string( 'hub_app_secret' ); $f_master_branch = gpc_get_string( 'master_branch' ); - if ( !preg_match( '/\*|^[a-zA-Z0-9_\., -]*$/', $f_master_branch ) ) { + if ( !preg_match( '/^(\*|[a-zA-Z0-9_\., -]*)$/', $f_master_branch ) ) { plugin_error( self::ERROR_INVALID_PRIMARY_BRANCH ); }