php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42471 locale_set_default returns true on invalid locales
Submitted: 2007-08-29 16:00 UTC Modified: 2010-06-20 20:09 UTC
From: tokul at users dot sourceforge dot net Assigned:
Status: Wont fix Package: I18N and L10N related
PHP Version: 6CVS-2007-08-29 (snap) OS: Linux Debian Etch
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
30 + 30 = ?
Subscribe to this entry?

 
 [2007-08-29 16:00 UTC] tokul at users dot sourceforge dot net
Description:
------------
locale_set_default() function returns true on invalid locale names. I know that you have UTODO tag there, but this tag is there for 2 years and link to mailing list refers to some unrelated spam message


One more comment.
I strongly recommend removing php_error(E_WARNING,....) call in PHP locale_set_default() function. It will cause debugging issues. If application cares about locale_set_default() results, it will check return code and will be forced to suppress all locale_set_default() errors in order to avoid E_WARNING error notice. If application does not care about it, it still has to suppress this warning. Increased level of noise prevents normal use of interpreter. Scripts have to choose between turning off all notices or adding @ in front of any over-noisy php function.

Reproduce code:
---------------
var_dump(locale_set_default('bogus'));

Expected result:
----------------
bool(false)

Actual result:
--------------
bool(true)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-06-20 20:09 UTC] felipe@php.net
-Status: Open +Status: Wont fix
 [2010-06-20 20:09 UTC] felipe@php.net
This just occurred in the old trunk.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 05:01:29 2024 UTC