@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix an issue where PhabricatorHandleList could fail to completely iterate

Fixes T8140. If a HandleList contained a null (because some caller sloppily added `null` as a handle), iteration (e.g., via `iterator_to_array()`) would abort prematurely.

In T8140, some of the project transactions add a `null` for an old file PHID when there's no old profile image.

Auditors: btrahan

+4 -2
+4 -2
src/applications/phid/handle/pool/PhabricatorHandleList.php
··· 24 24 25 25 private $handlePool; 26 26 private $phids; 27 + private $count; 27 28 private $handles; 28 29 private $cursor; 29 30 private $map; ··· 35 36 36 37 public function setPHIDs(array $phids) { 37 38 $this->phids = $phids; 39 + $this->count = count($phids); 38 40 return $this; 39 41 } 40 42 ··· 119 121 } 120 122 121 123 public function valid() { 122 - return isset($this->phids[$this->cursor]); 124 + return ($this->cursor < $this->count); 123 125 } 124 126 125 127 ··· 165 167 166 168 167 169 public function count() { 168 - return count($this->phids); 170 + return $this->count; 169 171 } 170 172 171 173 }