[Phplib-trackers] [ phplib-Bugs-593846 ] value of a variable can't be '0'
Brought to you by:
nhruby,
richardarcher
|
From: <no...@so...> - 2002-08-12 00:29:03
|
Bugs item #593846, was opened at 2002-08-12 02:29 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=403611&aid=593846&group_id=31885 Category: Template Group: 7.2.x Status: Open Resolution: None Priority: 5 Submitted By: Mickael Bailly (dready) Assigned to: Nobody/Anonymous (nobody) Summary: value of a variable can't be '0' Initial Comment: I got a template variable FILE_NB which can be equal to the string 0 . But template function evaluate 0 as null and so gives me an error: <b>Template Error:</b> loadfile: FILE_NB is not a valid handle.<br> Test with this script to see the problem: require 'template.inc'; $t = new template('/tmp'); //no matter what page.tpl contains $t->set_file('page','page.tpl'); $t->set_var('FILE_NB','0'); $t->parse('out',array('FILE_NB','page')); Suggested modification: on the first line of the loadfile function, replace the test: !empty($this->varvals[$handle]) with strlen($this->varvals[$handle]) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=403611&aid=593846&group_id=31885 |