-
- // ... and finally cookies
- foreach ($_COOKIE as $seckey=>$secvalue)
- {
- if (is_array($secvalue))
- {
- // Throw arrays away...
- unset($_COOKIE[$seckey]);
- }
- else
- {
- // Only variables are allowed (non-array) but we secure them all!
- foreach ($SEC_CHARS['from'] as $key=>$char)
- {
- // Pass all through
- $_COOKIE[$seckey] = str_replace($char , $SEC_CHARS['to'][$key], $_COOKIE[$seckey]);
- }
-
- // Strip all other out
- $_COOKIE[$seckey] = strip_tags($_COOKIE[$seckey]);
- }
- }