Suppress phan false positives in LuaSandboxEngine::formatLimitData()

Most of this function deals with values for the single
scribunto-limitreport-profile key, where $value is an array of
strings.  Phan's security check plugin was getting confused because
*in general* the $value passed to a ParserLimitReportFormat hook can
be almost anything.

Change-Id: I0ef5ef71f00a92bd5db0df340725c88595fcb0c6
This commit is contained in:
C. Scott Ananian 2020-10-23 11:46:02 -04:00 committed by jenkins-bot
parent 664c866980
commit 0cd8904842

View file

@ -127,7 +127,10 @@ class Scribunto_LuaSandboxEngine extends Scribunto_LuaEngine {
}
}
/** @inheritDoc */
/**
* @inheritDoc
* @suppress SecurityCheck-DoubleEscaped phan false positive
*/
public function formatLimitData( $key, &$value, &$report, $isHTML, $localize ) {
global $wgLang;
$lang = $localize ? $wgLang : Language::factory( 'en' );
@ -146,6 +149,7 @@ class Scribunto_LuaSandboxEngine extends Scribunto_LuaEngine {
if ( $key !== 'scribunto-limitreport-profile' ) {
return true;
}
'@phan-var string[] $value';
$keyMsg = wfMessage( 'scribunto-limitreport-profile' );
$msMsg = wfMessage( 'scribunto-limitreport-profile-ms' );