summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.txt1
-rw-r--r--fckeditor.module5
2 files changed, 4 insertions, 2 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index e3587ae..f0735bf 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -2,6 +2,7 @@ $Id$
-- 2009-07-25 version 6.x-2.x-dev
* #366431 Don't process textareas with #access = false
+* #409038 %u wild card does not work in private folders
-- 2009-07-24 version 6.x-2.x-dev
* #461234 Add notice that both profile and global profile rules apply
diff --git a/fckeditor.module b/fckeditor.module
index 5a4d6c4..02610e1 100644
--- a/fckeditor.module
+++ b/fckeditor.module
@@ -671,8 +671,9 @@ function fckeditor_process_textarea($element) {
if (!empty($profile->settings['UserFilesPath'])) $_SESSION['FCKeditor']['UserFilesPath'] = strtr($profile->settings['UserFilesPath'], array("%f" => file_directory_path(), "%u" => $user->uid, "%b" => $host, "%n" => $user->name));
if (!empty($profile->settings['UserFilesAbsolutePath'])) $_SESSION['FCKeditor']['UserFilesAbsolutePath'] = strtr($profile->settings['UserFilesAbsolutePath'], array("%f" => file_directory_path(), "%u" => $user->uid, "%b" => base_path(), "%d" => $_SERVER['DOCUMENT_ROOT'], "%n" => $user->name));
if (variable_get('file_downloads', '') == FILE_DOWNLOADS_PRIVATE) {
- $private_dir = trim(isset($global_profile->settings['private_dir']) ? $global_profile->settings['private_dir'] : "", "/\\");
- if (strlen($private_dir)) {
+ $private_dir = isset($global_profile->settings['private_dir']) ? trim($global_profile->settings['private_dir'], '\/') : '';
+ if (!empty($private_dir)) {
+ $private_dir = strtr($private_dir, array('%u' => $user->uid));
$_SESSION['FCKeditor']['UserFilesPath'] = url('system/files') .'/'. $private_dir .'/';
$_SESSION['FCKeditor']['UserFilesAbsolutePath'] = realpath(file_directory_path()) . DIRECTORY_SEPARATOR . $private_dir . DIRECTORY_SEPARATOR;
}