Loading...
 
Skip to main content

smarty template cache path exceeding maximum lenght

Status
Pending
Subject
smarty template cache path exceeding maximum lenght
Version
1.9.x
Category
  • Error
Feature
Menu
Performance / Speed / Load / Compression / Cache
Templates (Smarty)
User Administration (Registration, Login & Banning)
Resolution status
Please retest
Submitted by
CAPSLOCK2000
Lastmod by
Marc Laporte
Rating
(0)
Description

The ID generated by get_user_cache_id is used to create a new directory in templates_c/ . This ID is generated by concatenating all the groups a user is in.
When a user is in many groups the ID exceeds the maximum filename length of my system (FreeBSD 4.11).

Solution

I fixed it by hashing the ID down with md5 before returning.
I don't know if md5 is the optimal hash function in this place. I chose it mostly because it is stanard and reasonably fast. Perhaps crc32 or sha1 or better, but I don't know enough about hashes to make an informed decission.


tikilib.php.old Mon Oct 17 14:40:17 2005 +++ tikilib.php Wed Nov 9 11:37:16 2005

@@ -1270,7 +1270,7 @@
// in this case user get permissions from no group
$cacheId = 'ADMIN:'.$cacheId;
}
- return $cacheId;

+ return md5($cacheId);

}

Importance
2
Priority
10
Demonstrate Bug on Tiki 19+
Please demonstrate your bug on show2.tiki.org
Demonstrate Bug (older Tiki versions)
Ticket ID
408
Created
Wednesday 09 November, 2005 10:47:38 UTC
by Unknown
LastModif
Thursday 30 September, 2021 13:24:32 UTC


Collapse/expand modules below
Show PHP error messages