Commit Graph

1393 Commits

Author SHA1 Message Date
Ilija Tovilo
e706d024b2
Fix IntlPartsIterator key off-by-one error
Closes GH-7734
Closes GH-8172
2022-03-25 13:10:55 +01:00
Christoph M. Becker
4b90eef9cf
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8142: Compilation error on cygwin
2022-03-04 16:21:39 +01:00
David Carlier
8b15858c58
Fix GH-8142: Compilation error on cygwin
* pcntl: SIGPOLL/si_band is unsupported
* intl: enable the signal apis with `_POSIX_C_SOURCE`

Closes GH-8146.
2022-03-04 16:20:39 +01:00
Ilija Tovilo
925a30979c
Allowing catching arg type deprecations in intl classes
Closes GH-8115
Closes GH-8117
2022-03-03 11:26:35 +01:00
Nikita Popov
40e0bdb19d Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Initialize int_codepoint in parse_code_point_param()
2022-02-16 19:03:33 +01:00
Nikita Popov
bfe9531dc1 Initialize int_codepoint in parse_code_point_param()
This is being passed to convert_cp(), and passing an uninitialized
value to a function is undefined behavior. Clang 14 makes use of
noundef facts aggressively and miscompiles this code if not
initialized.
2022-02-16 19:01:44 +01:00
Máté Kocsis
20fb26e55c
Add more specific array return type hints for various extensions - part 2
ext/ftp, ext/gmp, ext/intl

Closes GH-7433
2021-11-17 10:56:27 +01:00
Nikita Popov
2654c3449f Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  CLDR 40a0 uses a lowercase "temp" instead of "Temp" in ICU >= 70.1
  Accommodate changes to canonicalized forms in ICU >= 70.1
  Change UBool to bool for equality operators in ICU >= 70.1
2021-11-02 16:17:16 +01:00
Nikita Popov
a6d14f1143 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  CLDR 40a0 uses a lowercase "temp" instead of "Temp" in ICU >= 70.1
  Accommodate changes to canonicalized forms in ICU >= 70.1
  Change UBool to bool for equality operators in ICU >= 70.1
2021-11-02 16:15:25 +01:00
Ben Ramsey
c7a2441e93 CLDR 40a0 uses a lowercase "temp" instead of "Temp" in ICU >= 70.1
Refer to:
49dda34fb1
2021-11-02 16:15:19 +01:00
Ben Ramsey
52cda6fc43 Accommodate changes to canonicalized forms in ICU >= 70.1
Refer to:
01e1adc9e4
2021-11-02 16:11:29 +01:00
Ben Ramsey
81b3f95622 Change UBool to bool for equality operators in ICU >= 70.1
Refer to:
- 633438f8da
- f6325d49ba
2021-11-02 16:07:51 +01:00
Tim Starling
c96be7b8f2 Use ASCII lower case for misc case folding
Use ASCII case conversion instead of locale-dependent case conversion in
the following places:

* grapheme_stripos() and grapheme_strripos() in the "fast" path
* ldap_get_entries()
* oci_pconnect() for case folding of parameters when constructing a key
  into the connection or session pool
* SoapClient: case folding of function names
* get_meta_tags(): case conversion of property names
* http stream wrapper: header names
* phpinfo(): anchor names
* php_verror(): docref URLs
* rfc1867.c: Content-Type boundary parameter name
* streams.c: stream protocol names

Using locale-dependent case folding for these cases is either
unnecessary or actively incorrect. These functions could have
misbehaved when used with certain locales (e.g. Turkish).

Closes GH-7511.
2021-09-24 09:20:08 +02:00
Nikita Popov
4fcca032e1 Make IntlCalendar::roll() return type tentative
This method did not have a type in PHP 8.0 and is not final, so
the new return type should be tentative.
2021-09-22 15:00:29 +02:00
Nikita Popov
410bdaba3f Fix compiler warnings in ext/intl
I don't really get why these didn't show up before.
2021-09-16 11:18:38 +02:00
Nikita Popov
d5ee081cfd Add missing field initializer
To fix -Wmissing-field-initializers warning.
2021-09-16 10:42:52 +02:00
Máté Kocsis
d670d9335c
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix default value of $flags in idn_to_ascii() and idn_to_utf8()
2021-09-04 17:57:23 +02:00
Máté Kocsis
d5aed7b0e3
Fix default value of $flags in idn_to_ascii() and idn_to_utf8() 2021-09-04 16:42:28 +02:00
Máté Kocsis
b4b980e6ad
Merge branch 'PHP-8.0'
* PHP-8.0:
  Declare a few missing function return types
2021-08-24 11:43:31 +02:00
Máté Kocsis
c58a9f2a57
Declare a few missing function return types
Closes GH-7395
2021-08-24 11:38:50 +02:00
Joe Watkins
05ef6334cd
Fix bug #81303 improve match errors 2021-08-02 17:31:26 +02:00
Nikita Popov
a5ad9eeefa Add explicit IntlPartsIterator::getRuleStatus() method
Rather than doing a magic forward, explicitly add a forwarding
method. This must be the most frivolous use of get_method I've
ever seen.
2021-07-22 10:33:49 +02:00
Nikita Popov
9e787d51b5 Fix typo
Did not have intl enabled in this build...
2021-07-22 09:47:45 +02:00
Nikita Popov
6d505d4445 Add RETURN/RETVAL_COPY_DEREF() macros
These were missing from the set...

I think quite a few of these usages don't actually need the DEREF,
but I've just kept things as is for now.
2021-07-22 09:44:19 +02:00
Máté Kocsis
2378f35787
Use single line phpdoc in stubs where possible 2021-07-20 13:16:56 +02:00
Joe Watkins
570d9b63e9
Not serializable flag permeation 2021-07-20 12:28:35 +02:00
Nikita Popov
9fe4966811 Remove null return type from msgfmt_parse_message()
This doesn't seem to possible. Only false is returned on failure.
2021-07-14 12:00:18 +02:00
Nikita Popov
2afbacc16d Backport some intl stub changes from master
While we're not sure under what circumstances they would fail,
they're fallible on the implementation level.
2021-07-14 11:55:12 +02:00
Nikita Popov
5dc995df37 Eliminate null return value for Normalizer::normalize()
One error condition was returning null instead of false. Adjust
the implementation to look the same way as the exact same check
a few lines below.
2021-07-14 11:43:22 +02:00
Nikita Popov
1c50784ae7 Deprecate IntlCalendar::roll() with bool argument
Pass 1 instead of true and -1 instead of false.

Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-08 15:34:51 +02:00
Máté Kocsis
65b96397b3
Declare tentative return types for ext/intl (#6986) 2021-07-06 10:55:43 +02:00
Christoph M. Becker
097cae9d90
Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #74264: grapheme_strrpos() broken for negative offsets
2021-07-05 18:21:29 +02:00
Christoph M. Becker
8071bd2faf
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #74264: grapheme_strrpos() broken for negative offsets
2021-07-05 18:15:24 +02:00
Christoph M. Becker
28c9376306
Fix #74264: grapheme_strrpos() broken for negative offsets
We must not assume that `usearch_last()` gives the proper result for
negative offsets.  Instead we'd need to continue to search backwards
(`usearch_previous`) until we find a proper match.  However, apparently
searching backwards is broken, so we work around by searching forward
from the start of the string until we pass the `offset_pos`, and then
use the previous result.

Closes GH-7189.
2021-07-05 18:11:30 +02:00
Patrick Allaert
ac18dd0dc7 Prefer EXPECT over EXPECTF 2021-06-29 17:13:02 +02:00
Patrick Allaert
aff365871a Fixed some spaces used instead of tabs 2021-06-29 11:30:26 +02:00
Christoph M. Becker
1ae34385e1
Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #68471: IntlDateFormatter fails for "GMT+00:00" timezone
2021-06-28 13:57:31 +02:00
Christoph M. Becker
1bf2b04b26
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #68471: IntlDateFormatter fails for "GMT+00:00" timezone
2021-06-28 13:55:56 +02:00
Christoph M. Becker
1a01f7816c
Fix #68471: IntlDateFormatter fails for "GMT+00:00" timezone
GMT+00:00 is recognized by ICU, and is normalized to GMT.  There are no
issues when GMT+00:00 is passed to `IntlTimeZone::createTimeZone()`,
but passing it to IntlDateFormatter::__construct() causes a failure,
since there is an additional check regarding the validity.  While
checking the validity of the result of `TimeZone::createTimeZone()`[1]
is a good idea, comparing the IDs is overly restrictive.  Instead we
just check that the timezone is supported by ICU.

[1] <https://unicode-org.github.io/icu-docs/apidoc/dev/icu4c/classicu_1_1TimeZone.html#a35da0507b62754ffe5d8d59c19775cdb>

Closes GH-7190.
2021-06-28 13:54:22 +02:00
Christoph M. Becker
46a6d481d3
Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #72809: Locale::lookup() wrong result with canonicalize option
2021-06-16 10:38:14 +02:00
Christoph M. Becker
13f3999a77
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #72809: Locale::lookup() wrong result with canonicalize option
2021-06-16 10:36:51 +02:00
Christoph M. Becker
0f1b17e378
Fix #72809: Locale::lookup() wrong result with canonicalize option
Canonicalization converts the locale to ICU format[1].  However, the
lookup described in RFC 4647, section 3.4, is about POSIX format.  To
make that lookup work for ICU format, we also need to cater to keyword
separators.

The results are somewhat unexpected, but apparently canonical lookup is
explicitly supposed to return canonical language tags[2].

[1] <https://unicode-org.github.io/icu/userguide/locale/#canonicalization>
[2] <https://github.com/php/php-src/blob/php-7.4.20/ext/intl/locale/locale_methods.c#L1504>

Closes GH-7151.
2021-06-16 10:33:59 +02:00
Nikita Popov
1eaaabca2b Move test from intl to iconv
Somehow this iconv-specific test ended up in ext/intl instead.
2021-06-14 15:03:46 +02:00
Nikita Popov
6600ad6067 Add some missing EXTENSIONS sections to misc tests 2021-06-14 14:52:44 +02:00
Nikita Popov
39131219e8
Migrate more SKIPIF -> EXTENSIONS (#7139)
This is a mix of more automated and manual migration. It should remove all applicable extension_loaded() checks outside of skipif.inc files.
2021-06-11 12:58:44 +02:00
Nikita Popov
7485978339
Migrate SKIPIF -> EXTENSIONS (#7138)
This is an automated migration of most SKIPIF extension_loaded checks.
2021-06-11 11:57:42 +02:00
deltragon
ae9f6e7a8f
Add IntlDatePatternGenerator (#6771)
Add IntlDatePatternGenerator class per RFC https://wiki.php.net/rfc/intldatetimepatterngenerator.
2021-06-10 12:36:38 +02:00
Nikita Popov
5c5727a57b Avoid make_printable_zval() in intl collator
Use zval_get_string() instead. This code is a real mess though,
and could use some more thorough cleanup.
2021-06-10 10:12:47 +02:00
Nikita Popov
e79a8c05ad Convert UConverter dtor_obj to free_obj
An unusal case where free_obj was not specified at all, and only
dtor_obj was used. Use the right handler.
2021-06-09 11:59:51 +02:00
Nikita Popov
cdbf3fdcdd Remove redundant dtor_obj handlers in intl
Both of these just forward to the default implementation, so
just use that directly. This is simpler and benefits from the
special-casing of the default implementation.
2021-06-09 11:47:37 +02:00