Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14381984
D14998.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D14998.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D14998: Fix excessively harsh validation of certain complex configuration
Attached
Detach File
Event Timeline
Log In to Comment