[dev] [patches] displaying zeroes
    Chuck Hagenbuch 
    chuck at horde.org
       
    Sun Aug  1 19:50:18 PDT 2004
    
    
  
Quoting Francois Marier <francois at nit.ca>:
> Here's a few patches fixing a small problem that I noticed while
> adding a user called "User 0" to the address book.
>
> Basically, in a lot of the fields we display, if the contents of the
> field is just '0', it's not displayed.  The reason is that the "empty()"
> PHP function will return true in these cases.
>
> The work-around is to check for (!empty($field) || ($field == '0'))
> instead of just !empty($field).  That way, it still returns true for
> empty strings but false for a variable containing only 0.
>
> I fixed this small annoyance in Turba, Nag, Mnemo and the
> framework.
Committed, thanks.
-chuck
--
"Regard my poor demoralized mule!" - Juan Valdez
    
    
More information about the dev
mailing list