mirror of
https://github.com/php/php-src.git
synced 2026-04-14 11:32:11 +02:00
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0: Fixed bug #73730 (textdomain(null) throws in strict mode)
This commit is contained in:
3
NEWS
3
NEWS
@@ -21,6 +21,9 @@ PHP NEWS
|
||||
. Fixed bug #75124 (gdImageGrayScale() may produce colors). (cmb)
|
||||
. Fixed bug #75139 (libgd/gd_interpolation.c:1786: suspicious if ?). (cmb)
|
||||
|
||||
- Gettext:
|
||||
. Fixed bug #73730 (textdomain(null) throws in strict mode). (cmb)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #75090 (IntlGregorianCalendar doesn't have constants from parent
|
||||
class). (tpunt)
|
||||
|
||||
@@ -161,16 +161,16 @@ PHP_MINFO_FUNCTION(php_gettext)
|
||||
Set the textdomain to "domain". Returns the current domain */
|
||||
PHP_NAMED_FUNCTION(zif_textdomain)
|
||||
{
|
||||
char *domain, *domain_name, *retval;
|
||||
size_t domain_len;
|
||||
char *domain = NULL, *domain_name, *retval;
|
||||
size_t domain_len = 0;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &domain, &domain_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!", &domain, &domain_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
PHP_GETTEXT_DOMAIN_LENGTH_CHECK
|
||||
|
||||
if (strcmp(domain, "") && strcmp(domain, "0")) {
|
||||
if (domain != NULL && strcmp(domain, "") && strcmp(domain, "0")) {
|
||||
domain_name = domain;
|
||||
} else {
|
||||
domain_name = NULL;
|
||||
|
||||
16
ext/gettext/tests/bug73730.phpt
Normal file
16
ext/gettext/tests/bug73730.phpt
Normal file
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #73730 (textdomain(null) throws in strict mode)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gettext')) die('skip gettext extension is not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
var_dump(textdomain(null));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
string(8) "messages"
|
||||
===DONE===
|
||||
Reference in New Issue
Block a user