-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #53251: bindtextdomain with null dir doesn't return old value
Apparently, users expect `bindtextdomain` and `bind_textdomain_codeset` with `null` as second argument to work like their C counterparts, namely to return the previously set value. Thus, we support that. Closes GH-6631.
- Loading branch information
Showing
5 changed files
with
40 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--TEST-- | ||
Bug #53251 (bindtextdomain with null dir doesn't return old value) | ||
--SKIPIF-- | ||
<?php | ||
if (!extension_loaded('gettext')) die('skip gettext extension not available'); | ||
?> | ||
--FILE-- | ||
<?php | ||
var_dump(is_string(bindtextdomain('foo', null))); | ||
$dir = bindtextdomain('foo', '.'); | ||
var_dump(bindtextdomain('foo', null) === $dir); | ||
|
||
var_dump(bind_textdomain_codeset('foo', null)); | ||
var_dump(bind_textdomain_codeset('foo', 'UTF-8')); | ||
var_dump(bind_textdomain_codeset('foo', null)); | ||
|
||
?> | ||
--EXPECT-- | ||
bool(true) | ||
bool(true) | ||
bool(false) | ||
string(5) "UTF-8" | ||
string(5) "UTF-8" |