Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15379593
D16047.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1014 B
Referenced Files
None
Subscribers
None
D16047.id.diff
View Options
diff --git a/src/applications/settings/setting/PhabricatorSelectSetting.php b/src/applications/settings/setting/PhabricatorSelectSetting.php
--- a/src/applications/settings/setting/PhabricatorSelectSetting.php
+++ b/src/applications/settings/setting/PhabricatorSelectSetting.php
@@ -27,6 +27,25 @@
->setOptions($options);
}
+ public function assertValidValue($value) {
+ // This is a slightly stricter check than the transaction check. It's
+ // OK for empty string to go through transactions because it gets converted
+ // to null later, but we shouldn't be reading the empty string from
+ // storage.
+ if ($value === null) {
+ return;
+ }
+
+ if (!strlen($value)) {
+ throw new Exception(
+ pht(
+ 'Empty string is not a valid setting for "%s".',
+ $this->getSettingName()));
+ }
+
+ $this->validateTransactionValue($value);
+ }
+
final public function validateTransactionValue($value) {
if (!strlen($value)) {
return;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 14, 10:08 PM (1 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7673268
Default Alt Text
D16047.id.diff (1014 B)
Attached To
Mode
D16047: Validate select/option settings more strictly when reading them
Attached
Detach File
Event Timeline
Log In to Comment