Notice: Undefined index: lower-roman in /srv/mediawiki/php-1.27.0-wmf.4/extensions/Cite/Cite_body.php on line 654
Description
Details
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Add isset() check before accessing $this->mRefs[$group] | mediawiki/extensions/Cite | master | +1 -1 |
Revisions and Commits
rECIT extension-Cite | |||
rECITc00cf4a20495 Avoid counting arrays if not needed |
Related Objects
Event Timeline
Fatal logs during wmf.4 being on wikipedias: https://logstash.wikimedia.org/#dashboard/temp/AVC1I9wyptxhN1Xaf0VE
I guess it happens because "!$this->mRefs[$group]" is used instead of "!isset( $this->mRefs[$group] )"?
The gerrit code review comments are amusing: https://gerrit.wikimedia.org/r/#/c/223250/
This task is about a PHP notice though, those shouldn't end up on fatalmonitor?
They are amusing and related to array counting, not array index existence. In fact, this regression supports the view that empty() has a negative impact on code quality and maintainability due to the inability to understand what code intends to do because empty() does it all.
Fortunately the rest of the Cite extension (before the above commit) already used isset() for this particular purpose. Only one place in the code used empty() instead of isset(). It was an outlier that had to be replaced with one of two things: boolean cast or isset (depending on why empty() is there). We picked the wrong one.
Change 249889 had a related patch set uploaded (by Krinkle):
Add isset() check before accessing $this->mRefs[$group]
Change 249889 merged by jenkins-bot:
Add isset() check before accessing $this->mRefs[$group]