Conditions | 4 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
22 | 8 | function init_cookie ($cookie = []) { |
|
23 | 8 | $this->cookie = $cookie; |
|
24 | /** |
||
25 | * Fill un-prefixed keys according to system configuration |
||
26 | */ |
||
27 | 8 | $prefix = Config::instance()->core['cookie_prefix']; |
|
28 | 8 | $prefix_length = strlen($prefix); |
|
29 | 8 | if ($prefix_length) { |
|
30 | foreach ($cookie as $key => $value) { |
||
31 | if (strpos($key, $prefix) === 0) { |
||
32 | $this->cookie[substr($key, $prefix_length)] = $value; |
||
33 | } |
||
34 | } |
||
35 | } |
||
36 | 8 | } |
|
37 | /** |
||
48 |