From 328d3f833be601fd392405c69764411acf208c15 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Tue, 22 Oct 2013 21:56:19 +0200 Subject: [PATCH] Fixed default user settings regarding safety --- src/Models/Model_User.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Models/Model_User.php b/src/Models/Model_User.php index 1aa93c27..dc5477a1 100644 --- a/src/Models/Model_User.php +++ b/src/Models/Model_User.php @@ -48,7 +48,10 @@ class Model_User extends RedBean_SimpleModel public function hasEnabledSafety($safety) { - return $this->getSetting(self::SETTING_SAFETY) & PostSafety::toFlag($safety); + $all = $this->getSetting(self::SETTING_SAFETY); + if (!$all) + return true; + return $all & PostSafety::toFlag($safety); } public function enableSafety($safety, $enabled)