Merge branch '17459_pci' into 'master'
17459_pci See merge request !7
Showing
1 changed file
with
14 additions
and
0 deletions
| ... | @@ -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){ | ... | ... |
-
Please register or sign in to post a comment