update pci fix
Showing
1 changed file
with
12 additions
and
1 deletions
| ... | @@ -153,10 +153,21 @@ class FlagManager { | ... | @@ -153,10 +153,21 @@ 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 | ); | ||
| 156 | if(!$flags) return []; | 162 | if(!$flags) return []; |
| 157 | foreach($flags as $flag){ | 163 | foreach($flags as $flag){ |
| 158 | $value = $this->checkFlag($flag, !empty($flag['default']) ? $flag['default'] : null); | 164 | $value = $this->checkFlag($flag, !empty($flag['default']) ? $flag['default'] : null); |
| 159 | if(isset($_GET[$flag['name']])){ | 165 | if(in_array($flag['name'], $cookies)){ |
| 166 | if(isset($_GET[$flag['name']])) { | ||
| 167 | setcookie($flag['name'], null, time() + (86400 * 30), "/"); | ||
| 168 | setcookie($flag['encrypted_name'], $value['cookie_value'], time() + (86400 * 30), "/"); | ||
| 169 | } | ||
| 170 | } else { | ||
| 160 | setcookie($flag['name'], null, time() + (86400 * 30), "/"); | 171 | setcookie($flag['name'], null, time() + (86400 * 30), "/"); |
| 161 | setcookie($flag['encrypted_name'], $value['cookie_value'], time() + (86400 * 30), "/"); | 172 | setcookie($flag['encrypted_name'], $value['cookie_value'], time() + (86400 * 30), "/"); |
| 162 | } | 173 | } | ... | ... |
-
Please register or sign in to post a comment