Page MenuHomePhabricator

D14998.diff
No OneTemporary

D14998.diff

diff --git a/src/applications/config/option/PhabricatorApplicationConfigOptions.php b/src/applications/config/option/PhabricatorApplicationConfigOptions.php
--- a/src/applications/config/option/PhabricatorApplicationConfigOptions.php
+++ b/src/applications/config/option/PhabricatorApplicationConfigOptions.php
@@ -21,7 +21,14 @@
}
if ($option->isCustomType()) {
- return $option->getCustomObject()->validateOption($option, $value);
+ try {
+ return $option->getCustomObject()->validateOption($option, $value);
+ } catch (Exception $ex) {
+ // If custom validators threw exceptions, convert them to configuation
+ // validation exceptions so we repair the configuration and raise
+ // an error.
+ throw new PhabricatorConfigValidationException($ex->getMessage());
+ }
}
switch ($option->getType()) {
diff --git a/src/applications/maniphest/constants/ManiphestTaskPriority.php b/src/applications/maniphest/constants/ManiphestTaskPriority.php
--- a/src/applications/maniphest/constants/ManiphestTaskPriority.php
+++ b/src/applications/maniphest/constants/ManiphestTaskPriority.php
@@ -116,7 +116,15 @@
return $config;
}
- public static function validateConfiguration(array $config) {
+ public static function validateConfiguration($config) {
+ if (!is_array($config)) {
+ throw new Exception(
+ pht(
+ 'Configuration is not valid. Maniphest priority configurations '.
+ 'must be dictionaries.',
+ $config));
+ }
+
foreach ($config as $key => $value) {
if (!ctype_digit((string)$key)) {
throw new Exception(

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 22, 5:43 AM (20 h, 49 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6915205
Default Alt Text
D14998.diff (1 KB)

Event Timeline