Hi,
I've just been testing Tiki to see if it will suit my needs. Came across the following bug in tiki-edit_templates.php whenever I tried to edit any templates or CCS.
Whenever I tried to click on the Edit Button for templates I got the following error:
PHP Fatal error: Allowed memory size of XXX bytes exhausted (tried to allocate XX bytes) in tiki-5.1/lib/init/initlib.php on line 185
System setup
System: FreeBSD 8.1
Web Server: Apache 2.2.16
Php: 5.3.3
Key issue was when looking for templates to list - around line 112 in tiki-edit_templates.php. The code would get stuck in an endless loop trying to get the files a directory that failed to open, exhausting stack size. The following directories would attempt to be opened:
tiki-5.1/templates - opened OK
tiki-5.1/templatesmodules - failed to open causing loop to get stuck.
The templatesmodules directory would fail to open.
Key fix is to encase the opendir when listing templates in an if statement. I found that for some reason on FreeBSD if a directory failed to open the readdir loop ran infinitely.
diff on tiki-edit_templates.php
112,115c112,116 < $h = opendir($smarty->template_dir.$w); < while (($file = readdir($h)) !== false) { < if (substr($file,-4,4) == '.tpl' && ($w != $local || !in_array($file, $files))) { < $files[] = $w.$file; --- > if( $h = opendir($smarty->template_dir.$w) ) { > while (($file = readdir($h)) !== false) { > if (substr($file,-4,4) == '.tpl' && ($w != $local || !in_array($file, $files))) { > $files[] = $w.$file; > } 116a118 > closedir ($h); 118d119 < closedir ($h);
To help developers solve the bug, we kindly request that you demonstrate your bug on a show2.tiki.org instance. To start, simply select a version and click on "Create show2.tiki.org instance". Once the instance is ready (in a minute or two), as indicated in the status window below, you can then access that instance, login (the initial admin username/password is "admin") and configure the Tiki to demonstrate your bug. Priority will be given to bugs that have been demonstrated on show2.tiki.org.
To help developers solve the bug, we kindly request that you demonstrate your bug on a show.tikiwiki.org instance. To start, simply select a version and click on "Create show.tikiwiki.org instance". Once the instance is ready (in a minute or two), as indicated in the status window below, you can then access that instance, login (the initial admin username/password is "admin") and configure the Tiki to demonstrate your bug. Priority will be given to bugs that have been demonstrated on show.tikiwiki.org.
filename | created | hits | comment | version | filetype | ||
---|---|---|---|---|---|---|---|
No attachments for this item |