Update uses of ParserOutput::getPageProperty() to handle new return value

The return value of ParserOutput::getPageProperty() will transition to
returning `null` instead of `false` when the page property is missing.

Bug: T301915
Change-Id: Id95dbdd427310e4e1cf40330b149adfe2b68f848
This commit is contained in:
C. Scott Ananian 2022-02-16 19:31:35 -05:00
parent adc340542c
commit 84276905bc

View file

@ -29,7 +29,8 @@ class Description2 {
$parserOutput = $parser->getOutput();
if ( method_exists( $parserOutput, 'getPageProperty' ) ) {
// MW 1.38+
if ( $parserOutput->getPageProperty( 'description' ) !== false ) {
// T301915
if ( ( $parserOutput->getPageProperty( 'description' ) ?? false ) !== false ) {
return;
}
$parserOutput->setPageProperty( 'description', $desc );
@ -112,7 +113,8 @@ class Description2 {
// Export the description from the main parser output into the OutputPage
if ( method_exists( $parserOutput, 'getPageProperty' ) ) {
// MW 1.38+
$description = $parserOutput->getPageProperty( 'description' );
// T301915
$description = $parserOutput->getPageProperty( 'description' ) ?? false;
} else {
$description = $parserOutput->getProperty( 'description' );
}