summaryrefslogtreecommitdiff
path: root/inc/subscription.php
diff options
context:
space:
mode:
authorMichael Hamann <michael@content-space.de>2011-01-10 19:22:37 +0100
committerMichael Hamann <michael@content-space.de>2011-01-10 19:39:27 +0100
commitd6a4a040ca66d247bb4c3fc3e67c4ee683c920b2 (patch)
tree85dd852c11fe2aa3ff9b6eefb3fa8f59df6a9858 /inc/subscription.php
parent6e0b4b67444b8434ed2c351ea0e36008667251d5 (diff)
downloadrpg-d6a4a040ca66d247bb4c3fc3e67c4ee683c920b2.tar.gz
rpg-d6a4a040ca66d247bb4c3fc3e67c4ee683c920b2.tar.bz2
Use md5 of the id in the subscription lockdir. FS#2112
Filenames can't contain ":" on windows and the lock directory contained the unescaped page id. The lock function tries in an endless loop to create the lock directory when it fails and the directory doesn't exist. Just escaping the directory name won't work as then the filename length limit will be quickly hit when using deep namespace structures with utf8 names. Thus using the md5sum seems to be the best solution. Perhaps the lock function could also be changed to create a file with that name that contains the id so the id can be retrieved for debugging purposes.
Diffstat (limited to 'inc/subscription.php')
-rw-r--r--inc/subscription.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/inc/subscription.php b/inc/subscription.php
index 08d4cb241..1b5476553 100644
--- a/inc/subscription.php
+++ b/inc/subscription.php
@@ -46,7 +46,7 @@ function subscription_filename($id) {
*/
function subscription_lock_filename ($id){
global $conf;
- return $conf['lockdir'].'/_subscr_' . $id . '.lock';
+ return $conf['lockdir'].'/_subscr_' . md5($id) . '.lock';
}
function subscription_lock($id) {