Fix error in PhabricatorSetupIssueView

Summary:
- Move `prettyPrintJSON()` and make it static.
- Use it from `PhabricatorSetupIssueView`
- Update other `config/` places that use it to call it from the new class.

This fixes a bug in `PhabricatorSetupIssueView` which showed up if the value
was an array and couldn't be rendered by `phutil_escape_html()`.

Test Plan:
- Rendered some config options.
- Went to /config/issue/config.unknown.phame.skins/ without error.

Reviewers: epriestley, btrahan, chad

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4411
This commit is contained in:
Ricky Elrod
2013-01-11 15:28:33 -08:00
committed by epriestley
parent 08687c0b17
commit 76c10f497f
6 changed files with 27 additions and 20 deletions

View File

@@ -74,7 +74,8 @@ final class PhabricatorConfigGroupController
if (!$option->getHidden()) {
$current_value = PhabricatorEnv::getEnvConfig($option->getKey());
$current_value = $this->prettyPrintJSON($current_value);
$current_value = PhabricatorConfigJSON::prettyPrintJSON(
$current_value);
$current_value = phutil_render_tag(
'div',
array(