Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix crash when report_bug_threshold=array in access_has_bug_level
When displaying a bug for which the user is not the reporter, $g_limit_reporters=ON and the workflow is set so report_bug_threshold is an array, MantisBT crashes with "PHP Fatal error: Unsupported operand types". This is due to use of '+ 1' to indicate that user should have the next higher access level to view the issue. We now use the same logic but within a foreach loop to check against each array element. Fixes #15538
- Loading branch information
957b3c0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Proposal for better performance in standard configuration ($g_limit_reporters = OFF;)
The following code must not always be executed:
Placing the code after line
should work
957b3c0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I was actually thinking about optimizing this on the way back home yesterday, and also a way to avoid looping on all array elements which is not always necessary if we know the access level. I'll do a follow-up commit later on.