Page MenuHomePhabricator

D17008.id40922.diff
No OneTemporary

D17008.id40922.diff

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
@@ -5,7 +5,7 @@
const CACHETYPE = 'preferences';
- const KEY_PREFERENCES = 'user.preferences.v1';
+ const KEY_PREFERENCES = 'user.preferences.v2';
public function getAutoloadKeys() {
return array(
@@ -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

Mime Type
text/plain
Expires
Sun, Mar 9, 10:24 AM (4 d, 22 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7388247
Default Alt Text
D17008.id40922.diff (1 KB)

Event Timeline