Open osnard opened 2 years ago
DynamicPageList3 version: 3.4.5 MediaWiki version: 1.35.6 PHP version: 7.4.28
List of steps to reproduce TBH, not sure about how to produce. It was reported to me and I just wanted to share my findings here.
What happens?: In some cases (sorry, I don't have more info right now) an exception is thrown:
I have investigated the code and came across https://github.com/Universal-Omega/DynamicPageList3/blob/3.4.5/includes/Query.php#L366-L367
Apparently a new Parser object is being created using MediaWikiServices::getParser. ParserFactory::create is invoked, which does not set a Title object. In such cases Parser::getTitle can actually return null (https://github.com/wikimedia/mediawiki/blob/1.35.6/includes/parser/Parser.php#L1006-L1008)
Parser
MediaWikiServices::getParser
ParserFactory::create
Title
Parser::getTitle
null
But the code does not check for null.
It looks like these actions are only performed to create some marker for DB profiling. Should I provide a patch that removes/alters the code?
Should I provide a patch that removes/alters the code?
Definitely welcome, if not I can in a little bit also.
DynamicPageList3 version: 3.4.5 MediaWiki version: 1.35.6 PHP version: 7.4.28
List of steps to reproduce TBH, not sure about how to produce. It was reported to me and I just wanted to share my findings here.
What happens?: In some cases (sorry, I don't have more info right now) an exception is thrown:
I have investigated the code and came across https://github.com/Universal-Omega/DynamicPageList3/blob/3.4.5/includes/Query.php#L366-L367
Apparently a new
Parser
object is being created usingMediaWikiServices::getParser
.ParserFactory::create
is invoked, which does not set aTitle
object. In such casesParser::getTitle
can actually returnnull
(https://github.com/wikimedia/mediawiki/blob/1.35.6/includes/parser/Parser.php#L1006-L1008)But the code does not check for
null
.It looks like these actions are only performed to create some marker for DB profiling. Should I provide a patch that removes/alters the code?