From cba16059491f68a9896dad3b4e439f462bb6a0f9 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Mon, 2 Jul 2018 15:56:07 +0000 Subject: [PATCH] Add http_only argument to rcube_utils::setcookie() --- program/lib/Roundcube/rcube_utils.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/program/lib/Roundcube/rcube_utils.php b/program/lib/Roundcube/rcube_utils.php index f010ff117..c8272eb67 100644 --- a/program/lib/Roundcube/rcube_utils.php +++ b/program/lib/Roundcube/rcube_utils.php @@ -37,11 +37,12 @@ class rcube_utils /** * Helper method to set a cookie with the current path and host settings * - * @param string Cookie name - * @param string Cookie value - * @param string Expiration time + * @param string $name Cookie name + * @param string $value Cookie value + * @param int $exp Expiration time + * @param bool $http_only HTTP Only */ - public static function setcookie($name, $value, $exp = 0) + public static function setcookie($name, $value, $exp = 0, $http_only = true) { if (headers_sent()) { return; @@ -50,13 +51,13 @@ class rcube_utils $cookie = session_get_cookie_params(); $secure = $cookie['secure'] || self::https_check(); - setcookie($name, $value, $exp, $cookie['path'], $cookie['domain'], $secure, true); + setcookie($name, $value, $exp, $cookie['path'], $cookie['domain'], $secure, $http_only); } /** * E-mail address validation. * - * @param string $email Email address + * @param string $email Email address * @param boolean $dns_check True to check dns * * @return boolean True on success, False if address is invalid