Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit df411e2

Browse files
committedMar 5, 2013
Fix invalid access denied error caused by access_has_bug_level()
Commit d42e80c changed the code in access_has_bug_level() function, and introduced a bug in the call to access_compare_level() when access is limited to issue reporter (inverted parameters caused an incorrect access denied error). See also 9ec47a0. Issue #15538
1 parent 31829a3 commit df411e2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎core/access_api.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -432,15 +432,15 @@ function access_has_bug_level( $p_access_level, $p_bug_id, $p_user_id = null ) {
432432
if( !isset( $s_thresholds[$t_project_id] ) ) {
433433
$t_report_bug_threshold = config_get( 'report_bug_threshold', null, $p_user_id, $t_project_id );
434434
if( !is_array( $t_report_bug_threshold ) ) {
435-
$s_thresholds[$t_project_id] = $t_report_bug_threshold;
435+
$s_thresholds[$t_project_id] = $t_report_bug_threshold + 1;
436436
} else if ( empty( $t_report_bug_threshold ) ) {
437437
$s_thresholds[$t_project_id] = NOBODY;
438438
} else {
439439
sort( $t_report_bug_threshold );
440-
$s_thresholds[$t_project_id] = $t_report_bug_threshold[0];
440+
$s_thresholds[$t_project_id] = $t_report_bug_threshold[0] + 1;
441441
}
442442
}
443-
if( !access_compare_level( $s_thresholds[$t_project_id], $t_access_level ) ) {
443+
if( !access_compare_level( $t_access_level, $s_thresholds[$t_project_id] ) ) {
444444
return false;
445445
}
446446
}

0 commit comments

Comments
 (0)
Please sign in to comment.