Skip to content

Commit

Permalink
Fixed issue #17790: KCFinder Image Browse Server not working due to i…
Browse files Browse the repository at this point in the history
…ncorrect cookieDomain (#2212)

Dev: this need to set it in config.
Dev: but take config to fix KCFINDER cookieDomain
  • Loading branch information
Shnoulle committed Feb 2, 2022
1 parent 6ff6175 commit 8fa2388
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions application/helpers/admin/htmleditor_helper.php
Expand Up @@ -25,8 +25,11 @@ function initKcfinder()
'flash' => $sAllowedExtensions,
'images' => $sAllowedExtensions
);
if (Yii::app()->getRequest()->enableCsrfValidation && !empty(Yii::app()->getRequest()->csrfCookie->domain)) {
$_SESSION['KCFINDER']['cookieDomain'] = Yii::app()->getRequest()->csrfCookie->domain;
if (!empty(App()->getSession()->cookieParams['domain'])) {
$_SESSION['KCFINDER']['cookieDomain'] = App()->getSession()->cookieParams['domain'];
}
if (App()->getRequest()->enableCsrfValidation && !empty(App()->getRequest()->csrfCookie['domain'])) {
$_SESSION['KCFINDER']['cookieDomain'] = Yii::app()->getRequest()->csrfCookie['domain'];
}

if (Yii::app()->getConfig('demoMode') === false &&
Expand Down

0 comments on commit 8fa2388

Please sign in to comment.