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 { ...@@ -153,12 +153,26 @@ class FlagManager {
153 public function register(){ 153 public function register(){
154 $this->checkDir(); 154 $this->checkDir();
155 $flags = $this->all(); 155 $flags = $this->all();
156 $cookies = array(
157 'theme',
158 'cta',
159 'source',
160 'feedback',
161 'main_question'
162 );
156 if(!$flags) return []; 163 if(!$flags) return [];
157 foreach($flags as $flag){ 164 foreach($flags as $flag){
158 $value = $this->checkFlag($flag, !empty($flag['default']) ? $flag['default'] : null); 165 $value = $this->checkFlag($flag, !empty($flag['default']) ? $flag['default'] : null);
166 if(in_array($flag['name'], $cookies)){
167 if(isset($_GET[$flag['name']])) {
159 setcookie($flag['name'], null, time() + (86400 * 30), "/"); 168 setcookie($flag['name'], null, time() + (86400 * 30), "/");
160 setcookie($flag['encrypted_name'], $value['cookie_value'], time() + (86400 * 30), "/"); 169 setcookie($flag['encrypted_name'], $value['cookie_value'], time() + (86400 * 30), "/");
161 } 170 }
171 } else {
172 setcookie($flag['name'], null, time() + (86400 * 30), "/");
173 setcookie($flag['encrypted_name'], $value['cookie_value'], time() + (86400 * 30), "/");
174 }
175 }
162 } 176 }
163 177
164 private function filterFlag($flag, $needle, $defaultValue){ 178 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!