Re: Bug #4896 [Opn->Fbk]: Error if template file is empty

From: Date: Sat, 23 Jul 2005 21:52:25 +0000
Subject: Re: Bug #4896 [Opn->Fbk]: Error if template file is empty
References: 1  Groups: php.pear.qa 
Request: Send a blank email to pear-qa+get-2824@lists.php.net to get a copy of this message
PEAR Bug Database wrote:
ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://pear.php.net/bugs/bug.php?id=4896&edit=2
ID:               4896
Updated by:       borz_off@cs.msu.su
Reported By:      mfonda at php dot net
-Status:           Open
+Status:           Feedback
Type:             Bug
Package:          HTML_Template_Sigma
Operating System: Linux
PHP Version:      5.1.0
New Comment: While this is indeed trivial to fix, what exactly is the point of loading a zero-length "template"? 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
Previous Comments: ------------------------------------------------------------------------ [2005-07-23 00:58:21] mfonda at php dot net 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 ------------------------------------------------------------------------


« previous php.pear.qa (#2824) next »