Homec4science

Preserve array keys in PhutilReadableSerializer::printShallowRecursive()

Authored by epriestley <git@epriestley.com> on Oct 21 2011, 21:23.

Description

Preserve array keys in PhutilReadableSerializer::printShallowRecursive()

Summary: See T582. When a user phlog()'s a value into DarkConsole and then
clicks it for details, printShallow() incorrectly rekeys arrays because PHP
subtly discards keys in array_slice(). Instead, explicitly preserve keys.

Test Plan:

  • Added a phlog() for an array with keys 1, 2.
  • Clicked it in DarkConsole for details, saw keys 0, 1.
  • Applied patch, saw keys 1, 2.

Reviewers: Girish, tuomaspelkonen, edward

Reviewed By: tuomaspelkonen

CC: aran, tuomaspelkonen

Differential Revision: 1029

Details

Committed
epriestley <git@epriestley.com>Oct 21 2011, 21:58
Pushed
aubortMar 17 2017, 12:03
Parents
rPHU5871d33461bc: Factor out the rendering of hyperlinks in PhutilRemarkupRuleHyperlink
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHUae5b4c4b4fdd: Preserve array keys in PhutilReadableSerializer::printShallowRecursive() (authored by epriestley <git@epriestley.com>).Oct 21 2011, 21:58