ApiCoreThank: support subtypes in AllowedLogTypes

Bug: T191599
Bug: T316860
Change-Id: I0e21b3da5888bd5323bda6b59c5edddcb6ae14f1
(cherry picked from commit 62810454f3)
This commit is contained in:
Taavi Väänänen 2022-09-18 14:15:03 +03:00 committed by Zabe
parent 4b9b385bfa
commit cbe682d279

View file

@ -140,7 +140,8 @@ class ApiCoreThank extends ApiThank {
// Make sure this log type is allowed.
$allowedLogTypes = $this->getConfig()->get( 'ThanksAllowedLogTypes' );
if ( !in_array( $logEntry->getType(), $allowedLogTypes ) ) {
if ( !in_array( $logEntry->getType(), $allowedLogTypes )
&& !in_array( $logEntry->getType() . '/' . $logEntry->getSubtype(), $allowedLogTypes ) ) {
$err = $this->msg( 'thanks-error-invalid-log-type', $logEntry->getType() );
$this->dieWithError( $err, 'thanks-error-invalid-log-type' );
}