Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.3.0

Bug #4896 Error if template file is empty
Submitted: 2005-07-22 23:58 UTC Modified: 2006-12-24 14:53 UTC
From: mfonda Assigned: avb
Status: Closed Package: HTML_Template_Sigma
PHP Version: 5.1.0 OS: Linux
Roadmaps: (Not assigned)    
Subscription  


 [2005-07-22 23:58 UTC] mfonda
Description: ------------ If an empty template file gets loaded, the following error will be produced: Warning: fread() [function.fread]: Length parameter must be greater than 0 in /usr/local/lib/php/HTML/Template/Sigma.php on line 1190 Should be a simple fix :-) Test script: --------------- <?php $template = new HTML_Template_Sigma(); $template->loadTemplateFile('some_empty.tpl'); ?> Expected result: ---------------- No error, template file loads fine Actual result: -------------- Warning: fread() [function.fread]: Length parameter must be greater than 0 in /usr/local/lib/php/HTML/Template/Sigma.php on line 1190

Comments

 [2005-07-23 15:30 UTC] avb
While this is indeed trivial to fix, what exactly is the point of loading a zero-length "template"?
 [2005-07-23 20:26 UTC] mfonda
There is no real point in loading a zero-length template, I just encounter the problem while setting up stuff, I had just not added any body to my template yet. Although it may not happen often, sometimes for one reason or another there is no body in a template, and there shouldn't be an error if there is. This would be a one line fix, I don't see the harm in fixing something that causes a warning. -- Matthew
 [2005-08-09 10:05 UTC] avb
Fixed in release 1.1.3