Page MenuHomePhabricator

Fix invalid access of missing $right_langcode in DoubleWiki_body.php:220
Closed, DeclinedPublicPRODUCTION ERROR

Description

Notice: Undefined variable: right_langcode in
/srv/mediawiki/php-1.25wmf11/extensions/DoubleWiki/DoubleWiki_body.php on line 220

Notice: Undefined variable: left_langcode in
/srv/mediawiki/php-1.25wmf11/extensions/DoubleWiki/DoubleWiki_body.php on line 220

https://github.com/wikimedia/mediawiki-extensions-DoubleWiki/blob/c0e12643a20dfb2026cd7a29c0245d8b60572dd8/DoubleWiki_body.php#L213-L220

The variable is conditionally set inside a block above it, and then unconditionally accessed when concatenating it inside of html.

Event Timeline

Krinkle raised the priority of this task from to Needs Triage.
Krinkle updated the task description. (Show Details)
Krinkle changed Security from none to None.
Krinkle updated the task description. (Show Details)
Krinkle added subscribers: Addshore, SPQRobin, Tpt, siebrand.
Aklapper triaged this task as Medium priority.Dec 15 2014, 12:09 AM
gerritbot subscribed.

Change 187005 had a related patch set uploaded (by 01tonythomas):
Fix "PHP Notice: Undefined variable: right_langcode" in DoubleWiki_body.php

https://gerrit.wikimedia.org/r/187005

Patch-For-Review

Change 187005 abandoned by Krinkle:
Fix "PHP Notice: Undefined variable: right_langcode" in DoubleWiki_body.php

Reason:
Superseded by Chad with I7e76d4def570bfcfafa3e.

https://gerrit.wikimedia.org/r/187005

Krinkle renamed this task from Fix "PHP Notice: Undefined variable: right_langcode" in DoubleWiki_body.php on line 220 to Fix invalid access of missing $right_langcode in DoubleWiki_body.php:220.Jun 8 2015, 7:53 PM
Krinkle edited subscribers, added: demon, Legoktm; removed: gerritbot.
Krinkle subscribed.

rEDWI4aec51628bc6: Fix undefined variable warnings fixed the PHP Notice by initialising the variable to empty string. However that doesn't change the fact that the variable is accessed outside the for-loop unconditionally and assumed to have a value.

Instead of outputting an invalid lang="" attribute and emitting a notice, it now omits the notice. The code is still invalid. The notice was genuine.

Not seen in 30 days on logstash/mediawiki-errors.

mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:12 PM