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:
@@ -330,7 +330,7 @@ final class PhabricatorConfigEditController
|
||||
case 'list<string>':
|
||||
return implode("\n", nonempty($value, array()));
|
||||
default:
|
||||
return $this->prettyPrintJSON($value);
|
||||
return PhabricatorConfigJSON::prettyPrintJSON($value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -462,7 +462,8 @@ final class PhabricatorConfigEditController
|
||||
if (!array_key_exists($option->getKey(), $value)) {
|
||||
$value = '<em>'.pht('(empty)').'</em>';
|
||||
} else {
|
||||
$value = $this->prettyPrintJSON($value[$option->getKey()]);
|
||||
$value = PhabricatorConfigJSON::prettyPrintJSON(
|
||||
$value[$option->getKey()]);
|
||||
}
|
||||
|
||||
$table[] = '<tr>';
|
||||
|
||||
Reference in New Issue
Block a user