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 (#2176)

Dev: this need to set it in config.
  • Loading branch information
Shnoulle committed Dec 29, 2021
1 parent f4d4c1b commit c23fbfd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions application/helpers/admin/htmleditor_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,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 (
Expand Down

0 comments on commit c23fbfd

Please sign in to comment.