Skip to content

Commit f583a45

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 910546d commit f583a45

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
@@ -427,15 +427,15 @@ function access_has_bug_level( $p_access_level, $p_bug_id, $p_user_id = null ) {
427427
if( !isset( $s_thresholds[$t_project_id] ) ) {
428428
$t_report_bug_threshold = config_get( 'report_bug_threshold', null, $p_user_id, $t_project_id );
429429
if( !is_array( $t_report_bug_threshold ) ) {
430-
$s_thresholds[$t_project_id] = $t_report_bug_threshold;
430+
$s_thresholds[$t_project_id] = $t_report_bug_threshold + 1;
431431
} else if ( empty( $t_report_bug_threshold ) ) {
432432
$s_thresholds[$t_project_id] = NOBODY;
433433
} else {
434434
sort( $t_report_bug_threshold );
435-
$s_thresholds[$t_project_id] = $t_report_bug_threshold[0];
435+
$s_thresholds[$t_project_id] = $t_report_bug_threshold[0] + 1;
436436
}
437437
}
438-
if( !access_compare_level( $s_thresholds[$t_project_id], $t_access_level ) ) {
438+
if( !access_compare_level( $t_access_level, $s_thresholds[$t_project_id] ) ) {
439439
return false;
440440
}
441441
}

0 commit comments

Comments
 (0)
Please sign in to comment.