Page MenuHomePhorge

Tab panel sometimes displays the content of two tabs
Open, Needs TriagePublic

Description

Example: W32

Seems to be a type juggling issue due to the loose comparison here: https://we.phorge.it/source/phorge/browse/master/src/applications/dashboard/paneltype/PhabricatorDashboardTabsPanelType.php$289.

	      $content[] = phutil_tag(
	        'div',
	        array(
	          'id' => $content_id,
	          'style' => ($idx == $selected) ? null : 'display: none',
	        ),
	        $panel_content);

In W32 the last tab has an ID of "kq3p37awi2n5" (it seems Phabricator uses an alphanumeric ID after the second tab). In PHP before 8.0 'kq3p37awi2n5' == 0 is true. In PHP 8.0 and above, the comparison does actually work properly because the int gets type casted to string before being compared (https://www.php.net/manual/en/migration80.incompatible.php). The bug isn't always reproduce-able because if the alphanumeric ID begins with an integer, then the comparison actually works properly.