Skip to content

Commit

Permalink
[REF] dev/drupal#169 Replace other usages of session_id with CRM_Core…
Browse files Browse the repository at this point in the history
…_Config::singleton()->userSystem->getSessionId
  • Loading branch information
seamuslee001 committed Nov 15, 2021
1 parent 113e3f9 commit 0bb4077
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions kcfinder/core/class/browser.php
Expand Up @@ -526,7 +526,7 @@ protected function act_downloadDir() {
$this->errorMsg("Unknown error.");
$filename = basename($dir) . ".zip";
do {
$file = md5(time() . session_id());
$file = md5(time() . CRM_Core_Config::singleton()->userSystem->getSessionId());
$file = "{$this->config['uploadDir']}/$file.zip";
} while (file_exists($file));
new zipFolder($file, $dir);
Expand Down Expand Up @@ -559,7 +559,7 @@ protected function act_downloadSelected() {
}

do {
$file = md5(time() . session_id());
$file = md5(time() . CRM_Core_Config::singleton()->userSystem->getSessionId());
$file = "{$this->config['uploadDir']}/$file.zip";
} while (file_exists($file));

Expand Down Expand Up @@ -601,7 +601,7 @@ protected function act_downloadClipboard() {
}

do {
$file = md5(time() . session_id());
$file = md5(time() . CRM_Core_Config::singleton()->userSystem->getSessionId());
$file = "{$this->config['uploadDir']}/$file.zip";
} while (file_exists($file));

Expand Down Expand Up @@ -919,4 +919,4 @@ protected function htmlData($str) {
}
}

?>
?>
2 changes: 1 addition & 1 deletion kcfinder/core/class/uploader.php
Expand Up @@ -115,7 +115,7 @@ public function __construct() {
require "conf/config.php";

// SETTING UP SESSION
if (!session_id()) {
if (!CRM_Core_Config::singleton()->userSystem->getSessionId()) {
if (isset($_CONFIG['_sessionLifetime']))
ini_set('session.gc_maxlifetime', $_CONFIG['_sessionLifetime'] * 60);
if (isset($_CONFIG['_sessionDir']))
Expand Down

3 comments on commit 0bb4077

@tapashdatta
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit is causing issue uploading images or browse the server on CKEditor @seamuslee001
Related post https://civicrm.stackexchange.com/questions/41023/cannot-upload-images-using-ckeditor-on-message-template-after-5-45-upgrade
Reverted the changes and all worked fine again.

@demeritcowboy
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, is it just missing the backslash on "CRM"?

@tapashdatta
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not a programmer, not sure. Sorry.

Please sign in to comment.