PHP warning if $string is false in translate() function
Bug #773255 reported by
Nick Freear
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
php-gettext |
New
|
Undecided
|
Unassigned |
Bug Description
I suggest its better if the function quietly returns when $string is false, as opposed to outputting a warning - v1.0.11 of php-gettext - gettext.php: line 258:
ERROR - 2011-04-29 13:06:06 --> Severity: Warning --> array_key_exists() [<a href='function.
Github Gist to follow.
Related branches
To post a comment you must log in.
Nick, thanks for the bug report and provided fix. The fix, though, seems weird. Wouldn't PHP evaluate empty string to false, and thus !$string to true as well? (Empty string is a special string in gettext world indicating the PO file header)
Just so I understand the reasons, why would you want to pass false to a translate() function? I am not opposed to accepting it, but I need to understand more of the reasons before I do that (i.e. what about true, or integers, or...).
Please set the bug state back to 'new' after you respond. Thanks!