I'm using phplib template library
http://www.sanisoft.com/phplib/manual/template.php
When a take a html file I'm using as a template copy the file rename it and use it it works. If a make trivial changes in the file such as placing a carriage return then deleting that carriage return it crashes. If I try to make changes even trivial to the original file it crashes! wtf is going on!
I modified the template library to narrow down right where it fails the following is my modification in function set_block:
$str = $this->get_var($parent);
$reg = "/<!--\s+BEGIN $handle\s+-->(.*)\n\s*<!--\s+END $handle\s+-->/sm";
echo "debug <br/><br/>\n\n";
echo "str <br/><br/>\n\n";
print_r($str);
echo "<br/><br/>\n\nreg<br/><br/>\n\n";
print_r($reg);
preg_match_all($reg, $str, $m);
echo "<br/><br/>\n\nm<br/><br/>\n\n";
print_r($m);
die("");
A working file returns
str equal to
<table cellspacing="4" cellpadding="2">
<tr>
<th>When</th>
<th>Home</th>
<th>Away</th>
<th>Score</th>
<th>Where</th>
</tr>
<!-- BEGIN schedule -->
<tr>
<td>{when}</td>
<td>{home}</td>
<td>{away}</td>
<td>{score}</td>
<td>{where}</td>
</tr>
<!-- END schedule -->
</table>
reg equal to
/<!--\s+BEGIN schedule\s+-->(.*)\s*<!--\s+END schedule\s+-->/sm
and m equal to
Array
(
[0] => Array
(
[0] => <!-- BEGIN schedule -->
<tr>
<td>{when}</td>
<td>{home}</td>
<td>{away}</td>
<td>{score}</td>
<td>{where}</td>
</tr>
<!-- END schedule -->
)
[1] => Array
(
[0] =>
<tr>
<td>{when}</td>
<td>{home}</td>
<td>{away}</td>
<td>{score}</td>
<td>{where}</td>
</tr>
)
)
a non-working example:
str equal to
<table cellspacing="4" cellpadding="2">
<tr>
<th>When</th>
<th>Home</th>
<th>Away</th>
<th>Score</th>
<th>Where</th>
</tr>
<!-- BEGIN schedule -->
<tr>
<td>{when}</td>
<td>{home}</td>
<td>{away}</td>
<td>{score}</td>
<td>{where}</td>
</tr>
<!-- END schedule -->
</table>
reg equal to
/<!--\s+BEGIN schedule\s+-->(.*)\s*<!--\s+END schedule\s+-->/sm
and m equal to
Array
(
[0] => Array
(
)
[1] => Array
(
)
)
The permissions on the files are the same the encoding is correct..... I don't understand why it doesn't work please help me!