[dokuwiki] Problem with _template.txt in dokuwiki-rc2008-03-31

Hi,

First - I am not sure if I am writing to proper forum - if there is another forum/address I can report problems/suggestions let me know, please.


I found out that when a larger _template.txt file is used no template is loaded into new page edit box at all. The reason (IMHO) is that the strftime() PHP routine (used to format the whole content of _template.txt as one string) accepts only 1023 chars as format specifier string (according to PHP doc - in the fact I was able to use somewhat larger template).

I solved the problem for myself by splitting the _template.txt into lines and calling strftime() per line. In file inc/common.php I replaced one line in pageTemplate() function

//old code:
$tpl = strftime($tpl);


with

//new code
 $lines = explode("\n",$tpl);
 $res = array();
 foreach ($lines as $line) {
   $res[]=strftime($line);
 };
 $tpl = implode("\n",$res);


Since I am not full time PHP programmer the code is surely not the best one, but it seems i's working fine. Of course the code works only on platforms which use single char (\n) line termination...


Regards
Dalibor Toman

--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: