9e5a5873 by Janis

Merge branch '17459_pci' into 'master'

17459_pci

See merge request !7
2 parents b55e394c 1cd3a823
......@@ -153,12 +153,26 @@ class FlagManager {
public function register(){
$this->checkDir();
$flags = $this->all();
$cookies = array(
'theme',
'cta',
'source',
'feedback',
'main_question'
);
if(!$flags) return [];
foreach($flags as $flag){
$value = $this->checkFlag($flag, !empty($flag['default']) ? $flag['default'] : null);
if(in_array($flag['name'], $cookies)){
if(isset($_GET[$flag['name']])) {
setcookie($flag['name'], null, time() + (86400 * 30), "/");
setcookie($flag['encrypted_name'], $value['cookie_value'], time() + (86400 * 30), "/");
}
} else {
setcookie($flag['name'], null, time() + (86400 * 30), "/");
setcookie($flag['encrypted_name'], $value['cookie_value'], time() + (86400 * 30), "/");
}
}
}
private function filterFlag($flag, $needle, $defaultValue){
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!