feulf / raintpl3

The easiest Template Engine for PHP
https://feulf.github.io/raintpl
258 stars 57 forks source link

Fixed fread error if template is empty. #175

Closed Blackskyliner closed 1 year ago

Blackskyliner commented 9 years ago

If an template was empty it threw an error, as fread expects $length to be greater than 0. Patched it with an additional check for actual filesize and fallback to an empty string if file is empty, also skip the processing if $code is empty.

Blackskyliner commented 9 years ago

Argh, duplicates https://github.com/rainphp/raintpl3/pull/152 - I should look better before creating Pull requests. But I will leave this open for now, as I don't see the need for the check added by https://github.com/rainphp/raintpl3/pull/152. As the file is already empty, why execute PHP safeguard which also only results in an empty page?