From b62a1322c9f89a6811167e14743ee1c89de3e143 Mon Sep 17 00:00:00 2001 From: Min-Soo Kim Date: Sun, 29 Jul 2018 11:54:14 +0900 Subject: [PATCH] Revert "Merge branch 'develop' into develop" This reverts commit ec54bbd41506b52c417e45598040140c38596e21, reversing changes made to 9b12e0a71c4ec4751b769c7bb3a2b9254092e3e3. --- classes/context/Context.class.php | 23 +++---------------- classes/mobile/Mobile.class.php | 2 +- common/framework/session.php | 2 +- common/js/common.js | 3 +-- common/tpl/common_layout.html | 8 +++---- .../editor/skins/ckeditor/file_upload.html | 2 +- modules/member/member.view.php | 2 +- .../skins/ncenter_login/js/ncenter.js | 2 +- 8 files changed, 13 insertions(+), 31 deletions(-) diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php index ea03d55fb..e05eb5e42 100644 --- a/classes/context/Context.class.php +++ b/classes/context/Context.class.php @@ -306,7 +306,7 @@ class Context { if($_COOKIE['lang_type'] !== $lang_type) { - setcookie('lang_type', $lang_type, time() + 86400 * 365, '/', null, self::isAlwaysSSL()); + setcookie('lang_type', $lang_type, $_SERVER['REQUEST_TIME'] + 3600 * 24 * 1000, '/'); } } elseif($_COOKIE['lang_type']) @@ -322,7 +322,7 @@ class Context if(!strncasecmp($lang_code, $_SERVER['HTTP_ACCEPT_LANGUAGE'], strlen($lang_code))) { $lang_type = $lang_code; - setcookie('lang_type', $lang_type, time() + 86400 * 365, '/', null, self::isAlwaysSSL()); + setcookie('lang_type', $lang_type, $_SERVER['REQUEST_TIME'] + 3600 * 24 * 1000, '/'); } } } @@ -623,23 +623,6 @@ class Context return self::get('_use_ssl'); } - - /** - * Return ssl status - * - * @param boolen $purge_cache Set true to get uncached SSL_enforce value. - * @return boolean (true|false) - */ - public static function isAlwaysSSL($purge_cache = false) - { - static $ssl_only = null; - if(is_null($ssl_only) || $purge_cache === true) - { - $ssl_only = (self::get('site_module_info')->security === 'always' ? true : false); - } - return $ssl_only; - } - /** * Return default URL * @@ -1792,7 +1775,7 @@ class Context return; } - if(self::isAlwaysSSL()) + if(self::get('_use_ssl') == 'always') { $ssl_mode = ENFORCE_SSL; } diff --git a/classes/mobile/Mobile.class.php b/classes/mobile/Mobile.class.php index ef69cef99..4bb976cd4 100644 --- a/classes/mobile/Mobile.class.php +++ b/classes/mobile/Mobile.class.php @@ -73,7 +73,7 @@ class Mobile $uatype = $uahash . ':' . (self::$_ismobile ? '1' : '0'); if ($cookie !== $uatype) { - setcookie('rx_uatype', $uatype, 0, null, null, Context::isAlwaysSSL()); + setcookie('rx_uatype', $uatype, 0); $_COOKIE['rx_uatype'] = $uatype; } diff --git a/common/framework/session.php b/common/framework/session.php index 75aa66b85..d7c659b4e 100644 --- a/common/framework/session.php +++ b/common/framework/session.php @@ -295,7 +295,7 @@ class Session if(!$is_default_domain && !\Context::get('sso_response') && $_COOKIE['sso'] !== md5($current_domain)) { // Set sso cookie to prevent multiple simultaneous SSO validation requests. - setcookie('sso', md5($current_domain), 0, '/', null, \Context::isAlwaysSSL()); + setcookie('sso', md5($current_domain), 0, '/'); // Redirect to the default site. $sso_request = Security::encrypt($current_url); diff --git a/common/js/common.js b/common/js/common.js index 391a49d4e..14243dce4 100644 --- a/common/js/common.js +++ b/common/js/common.js @@ -1055,8 +1055,7 @@ function getOuterHTML(obj) { function setCookie(name, value, expire, path) { var s_cookie = name + "=" + escape(value) + ((!expire) ? "" : ("; expires=" + expire.toGMTString())) + - "; path=" + ((!path) ? "/" : path) + - ((enforce_ssl) ? ";secure" : ""); + "; path=" + ((!path) ? "/" : path); document.cookie = s_cookie; } diff --git a/common/tpl/common_layout.html b/common/tpl/common_layout.html index 66988e85d..a047c8958 100644 --- a/common/tpl/common_layout.html +++ b/common/tpl/common_layout.html @@ -48,14 +48,14 @@ diff --git a/modules/editor/skins/ckeditor/file_upload.html b/modules/editor/skins/ckeditor/file_upload.html index f62561f56..4e80dc0e8 100644 --- a/modules/editor/skins/ckeditor/file_upload.html +++ b/modules/editor/skins/ckeditor/file_upload.html @@ -7,7 +7,7 @@
{$lang->edit->upload_file} - +

{$lang->ckeditor_about_file_drop_area}

diff --git a/modules/member/member.view.php b/modules/member/member.view.php index 65974fa00..d6057bd33 100644 --- a/modules/member/member.view.php +++ b/modules/member/member.view.php @@ -192,7 +192,7 @@ class memberView extends member function dispMemberSignUpForm() { //setcookie for redirect url in case of going to member sign up - setcookie("XE_REDIRECT_URL", $_SERVER['HTTP_REFERER'], 0, '/', null, Context::isAlwaysSSL()); + setcookie("XE_REDIRECT_URL", $_SERVER['HTTP_REFERER']); $member_config = $this->member_config; diff --git a/widgets/login_info/skins/ncenter_login/js/ncenter.js b/widgets/login_info/skins/ncenter_login/js/ncenter.js index 92b073686..b7f3fddf0 100644 --- a/widgets/login_info/skins/ncenter_login/js/ncenter.js +++ b/widgets/login_info/skins/ncenter_login/js/ncenter.js @@ -8,7 +8,7 @@ dt.setTime(dt.getTime() + (d * 24 * 60 * 60000)); e = "; expires=" + dt.toGMTString(); } - document.cookie = n + "=" + v + e + "; path=/" + ((enforce_ssl) ? ";secure" : ""); + document.cookie = n + "=" + v + e + "; path=/"; } var n = $('#nc_container');