Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15363956
D17008.id40917.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
912 B
Referenced Files
None
Subscribers
None
D17008.id40917.diff
View Options
diff --git a/src/applications/people/cache/PhabricatorUserPreferencesCacheType.php b/src/applications/people/cache/PhabricatorUserPreferencesCacheType.php
--- a/src/applications/people/cache/PhabricatorUserPreferencesCacheType.php
+++ b/src/applications/people/cache/PhabricatorUserPreferencesCacheType.php
@@ -47,6 +47,16 @@
foreach ($all_settings as $key => $setting) {
$value = $preference->getSettingValue($key);
+ try {
+ id(clone $setting)
+ ->setViewer($viewer)
+ ->assertValidValue($value);
+ } catch (Exception $ex) {
+ // If the saved value isn't valid, don't cache it: we'll use the
+ // default value instead.
+ continue;
+ }
+
// As an optimization, we omit the value from the cache if it is
// exactly the same as the hardcoded default.
$default_value = id(clone $setting)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 12, 12:54 PM (1 d, 19 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7388250
Default Alt Text
D17008.id40917.diff (912 B)
Attached To
Mode
D17008: Validate settings before writing them to the user cache
Attached
Detach File
Event Timeline
Log In to Comment