Ludwig found a bug in CMSimple_XH, where a missing template can "randomly" cause a white screen (no 500 Internal Server Error, though). The bug was introduced with XH 1.6 where locking of the template during reading was implemented. The relevant code (cmsimple/cms.php) is:
Code: Select all
$temp = fopen($pth['file']['template'], 'r');
if ($temp) {
if (XH_lockFile($temp, LOCK_SH)) {
$i = include $pth['file']['template'];
XH_lockFile($temp, LOCK_UN);
}
fclose($temp);
}
if (!$i) {// the template could not be included
The bugfix is straight forward: just initialize $i = false right before the code (done: r1501/r1502) .
BTW: it would be nice if we could put the code in a function/method (say, renderTemplate()), but that would be somewhat ugly, because the template usually accesses global variables so these would have to be "imported" in the function/method. It's possible with PHP, as can be seen in evaluate_cmsimple_scripting(), but it's a hack. Not sure, if we should do it.