Skip to content

Commit

Permalink
remove support for _cautionList
Browse files Browse the repository at this point in the history
  • Loading branch information
splitbrain committed Jun 1, 2018
1 parent b71f246 commit f74addc
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions lib/plugins/config/core/Setting/Setting.php
Expand Up @@ -282,23 +282,13 @@ public function hasError() {
* @return false|string caution string, otherwise false for invalid caution
*/
public function caution() {
if(!empty($this->caution)) {
if(!in_array($this->caution, Setting::$validCautions)) {
throw new \RuntimeException(
'Invalid caution string (' . $this->caution . ') in metadata for setting "' . $this->key . '"'
);
}
return $this->caution;
}
// compatibility with previous cautionList
// TODO: check if any plugins use; remove
if(!empty($this->cautionList[$this->key])) {
$this->caution = $this->cautionList[$this->key];
unset($this->cautionList);

return $this->caution();
if(empty($this->caution)) return false;
if(!in_array($this->caution, Setting::$validCautions)) {
throw new \RuntimeException(
'Invalid caution string (' . $this->caution . ') in metadata for setting "' . $this->key . '"'
);
}
return false;
return $this->caution;
}

}

0 comments on commit f74addc

Please sign in to comment.