Found something interesting in handling of atttrue.
First, the code:
include( 'tbs_class.php' );
$TBS = new clsTinyButStrong();
$TBS->Source = '<input> [fld.0; att=input#value; atttrue] <input> [fld.1; att=input#value; atttrue] <input> [fld.2; att=input#value; atttrue]';
$TBS->MergeField( 'fld', [false, 0, '0'] );
$TBS->Show(); |
As title stated, what is interesting is that (int) 0 will be rendered as true when atttrue is used.
Problem is the Boolean field of MySQL and Bit field of MS-SQL both returns 1 or 0, instead of true or false.
So regardless of actual value, that field is always true as far as atttrue is concerned, unless we do condition/formatting on either TBS or SQL.
This happens because 0 is casted to '0' at line #1390 after ope processing, before if.then.else processing, but also before att processing.
False is as expected, because it is converted to empty string. However att sees that '0' is non-empty and think it is true.
If this is not by design, would it be tricky to fix?