Bug #53251 [NEW]: bindtextdomain with null directory doesn't return the previously set
| From: | jeanseb at au-fil-du dot net | Date: | Sun, 07 Nov 2010 11:10:00 +0000 |
| Subject: | Bug #53251 [NEW]: bindtextdomain with null directory doesn't return the previously set | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-155817@lists.php.net to get a copy of this message | ||
From:
Operating system: Debian 5.0.6
PHP version: 5.3.3
Package: Gettext related
Bug Type: Bug
Bug description:bindtextdomain with null directory doesn't return the previously set
Description:
------------
man bindtextdomain :
If dirname is NULL, the function returns the previously set base directory
for domain domainname.
In PHP we are returning the CWD.
I have attached a patch with 2 tests.
ext/gettext/tests/gettext_bindtextdomain-nulldir-alreadyset.phpt
=> PASS with my patch
ext/gettext/tests/gettext_bindtextdomain-nulldir.phpt
=> Fail, my patch introduce a BC. I'm not sure we want this but I don't see
any workarround.
Test script:
---------------
<?php
echo 'getcwd() : ' . getcwd() . PHP_EOL;
echo 'bindtextdomain("messages", "./locale") : ' .
bindtextdomain("messages", "./locale") . PHP_EOL;
echo 'bindtextdomain("messages",NULL) : ' .
bindtextdomain("messages",NULL)
. PHP_EOL;
Expected result:
----------------
getcwd() : /home/jeanseb
bindtextdomain("messages", "./locale") : /home/jeanseb/locale
bindtextdomain("messages",NULL) : /home/jeanseb/locale
Actual result:
--------------
getcwd() : /home/jeanseb
bindtextdomain("messages", "./locale") : /home/jeanseb/locale
bindtextdomain("messages",NULL) : /home/jeanseb
--
Edit bug report at http://bugs.php.net/bug.php?id=53251&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53251&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53251&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53251&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=53251&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53251&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=53251&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=53251&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=53251&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=53251&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=53251&r=support
Expected behavior: http://bugs.php.net/fix.php?id=53251&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=53251&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=53251&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=53251&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53251&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=53251&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=53251&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=53251&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=53251&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=53251&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=53251&r=mysqlcfg