/** * Return a sanitized version of the given variable from the _SERVER superglobal. * @param string $key the key in the _SERVER superglobal * @return string the value */ public static function getServerVar($key) { if (!isset($_SERVER[$key])) { return null; } $value = $_SERVER[$key]; MyOOS_Utilities::sanitizeInputValues($value); return $value; }
/** * Return a sanitized version of the given variable from the _COOKIE superglobal. * @param string $key the key in the _COOKIE superglobal * @return string the value */ function getCookieVar($key) { if (!isset($_COOKIE[$key])) { return null; } $value = $_COOKIE[$key]; MyOOS_Utilities::sanitizeInputValues($value); return $value; }