diff options
Diffstat (limited to 'core/Settings/Setting.php')
-rw-r--r-- | core/Settings/Setting.php | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/core/Settings/Setting.php b/core/Settings/Setting.php index 43bbd49149..00efc9d876 100644 --- a/core/Settings/Setting.php +++ b/core/Settings/Setting.php @@ -128,26 +128,14 @@ abstract class Setting protected $name; protected $displayedForCurrentUser = false; - public function canBeDisplayedForCurrentUser() - { - return $this->displayedForCurrentUser; - } - /** * Creates a new setting. * * @param string $name The name of the setting, only alnum characters are allowed. For instance `refreshInterval` * @param string $title The title of the setting which will be visible to the user. For instance `Refresh Interval` - * - * @throws \Exception In case the name contains invalid characters. */ public function __construct($name, $title) { - if (!ctype_alnum($name)) { - $msg = sprintf('The setting name %s is not valid. Only alpha and numerical characters are allowed', $name); - throw new \Exception($msg); - } - $this->key = $name; $this->name = $name; $this->title = $title; @@ -158,6 +146,11 @@ abstract class Setting return $this->name; } + public function canBeDisplayedForCurrentUser() + { + return $this->displayedForCurrentUser; + } + /** * Returns the key under which property name the setting will be stored. * |