Commit Graph

79 Commits

Author SHA1 Message Date
Máté Kocsis
e08ce4c13d
Add stubs for various intl functions
Closes GH-4819
- Add stubs for idn functions
- Add stubs for grapheme functions
- Add stubs for Spoofchecker
- Add stubs for Normalizer
- Add stubs for ResourceBundle
- Fix arginfos
- Add support for union return types
- Fix arginfo for resourcebundle_create()
2020-01-03 18:54:57 +01:00
Máté Kocsis
345703724c
Use RETURN_THROWS() during ZPP in most of the extensions
Except for some bigger ones: reflection, sodium, spl
2019-12-31 11:46:11 +01:00
Máté Kocsis
969e7a3c8b Cleanup return values for Intl when parameter parsing is unsuccessful
Closes GH-4871.
2019-10-30 13:21:40 +01:00
Gabriel Caruso
5d6e923d46
Remove mention of PHP major version in Copyright headers
Closes GH-4732.
2019-09-25 14:51:43 +02:00
Nikita Popov
86ef425177 Intl: Don't separately report "bad arguments" errors
zpp will be throwing for these now, don't report them in addition to
that.
2019-03-11 11:32:20 +01:00
Peter Kokot
92ac598aab Remove local variables
This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly used by Vim and Emacs editors
yet with recent changes the once working definitions don't work
anymore in Vim without custom plugins or additional configuration.
Neither are these settings synced across the PHP code base.

A simpler and better approach is EditorConfig and fixing code
using some code style fixing tools in the future instead.

This patch also removes the so called modelines for Vim. Modelines
allow Vim editor specifically to set some editor configuration such as
syntax highlighting, indentation style and tab width to be set in the
first line or the last 5 lines per file basis. Since the php test
files have syntax highlighting already set in most editors properly and
EditorConfig takes care of the indentation settings, this patch removes
these as well for the Vim 6.0 and newer versions.

With the removal of local variables for certain editors such as
Emacs and Vim, the footer is also probably not needed anymore when
creating extensions using ext_skel.php script.

Additionally, Vim modelines for setting php syntax and some editor
settings has been removed from some *.phpt files.  All these are
mostly not relevant for phpt files neither work properly in the
middle of the file.
2019-02-03 21:03:00 +01:00
Peter Kokot
1ad08256f3 Sync leading and final newlines in source code files
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-14 12:56:38 +02:00
Christoph M. Becker
8a4c2f1621 Require ICU ≥ 50.1
Given that ICU is a set of lively developed libraries, that ICU 50.1
has been released on 2012-11-05, and PHP 7.4 is scheduled to be
released seven years after it, we consider it appropriate to ditch
these legacy versions.

Particularly, that would be a reasonable groundwork to implement part
two of the “Deprecate and remove INTL_IDNA_VARIANT_2003” RFC[1], namely
to default idn_to_ascii()'s and idn_to_utf8()'s $variant parameter to
INTL_IDNA_VARIANT_UTS46, which is not defined in ICU < 4.6.

See also the related discussion on internals@[2].

[1] <https://wiki.php.net/rfc/deprecate-and-remove-intl_idna_variant_2003>
[2] <http://news.php.net/php.internals/101626>ff
2018-09-15 13:59:54 +02:00
Anatol Belski
9a8e7b5718 Use recommended way to handle utf*.h headers and obsolete symbols 2018-04-05 17:22:44 +02:00
Anatol Belski
119be77051 Reduce var scope 2018-02-16 12:52:59 +01:00
Dmitry Stogov
40ecad3402 Fixed wrong usage of old ZPP API. 2017-06-19 18:08:50 +03:00
Stanislav Malyshev
34d6b63501 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix bug #73634 - grapheme_strpos illegal memory access
  Fix typo
2017-01-16 01:18:50 -08:00
Stanislav Malyshev
8c44d07fd4 Fix bug #73634 - grapheme_strpos illegal memory access 2017-01-16 01:18:16 -08:00
Dmitry Stogov
96655ad01e Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bad merge
2016-12-01 16:22:23 +03:00
Dmitry Stogov
7f22e3c879 Fixed bad merge 2016-12-01 16:21:57 +03:00
Dmitry Stogov
d149ba217f Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Workaround for GCC-4.9.2 bug
  oops, changed in wrong place
2016-12-01 15:50:19 +03:00
Dmitry Stogov
b7b7dd8cea Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Workaround for GCC-4.9.2 bug
  oops, changed in wrong place
2016-12-01 15:50:05 +03:00
Stanislav Malyshev
c8778eb293 oops, changed in wrong place 2016-11-27 16:11:41 -08:00
Stanislav Malyshev
53655c5af1 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  add NEWS
  Fix #68447: grapheme_extract take an extra trailing character
2016-11-27 15:38:33 -08:00
Stanislav Malyshev
f1a9851c3e Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix #68447: grapheme_extract take an extra trailing character
2016-11-27 15:36:29 -08:00
Stanislav Malyshev
8856b3a63c Merge branch 'pull-request/1974' into PHP-5.6
* pull-request/1974:
  Fix #68447: grapheme_extract take an extra trailing character
2016-11-27 15:34:58 -08:00
Christoph M. Becker
29849e5ba1 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-20 03:11:05 +02:00
Christoph M. Becker
078f674212 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-20 03:04:08 +02:00
Christoph M. Becker
e4a006cd3e Fix #65732: grapheme_*() is not Unicode compliant on CR LF sequence
According to the Unicode specification (at least as of 5.1), CRLF sequences
are considered to be a single grapheme. We cater to that special case by
letting grapheme_ascii_check() fail. While it would be trivial to fix
grapheme_ascii_check() wrt. grapheme_strlen(), grapheme_substr() and
grapheme_strrpos() would be much harder to handle, so we accept the slight
performance penalty if CRLF is involved.
2016-08-20 03:01:35 +02:00
SATO Kentaro
df683fa3b0 Fix #68447: grapheme_extract take an extra trailing character
grapheme_extract() converts UTF-8 string in the argument to UTF-16 to
iterate through graphemes, and count each UTF-16 character as one Unicode
character, which is not correct for UTF-16 surrogate pairs.
The patch removes the conversion and counts UTF-8 directly if needed.
2016-07-01 22:45:37 +09:00
Dmitry Stogov
323b2733f6 Fixed compilation warnings 2016-06-22 00:40:50 +03:00
Anatol Belski
1a154c7db5 Merge branch 'PHP-7.0'
* PHP-7.0:
  fix merge
  Fix memory leak
  Fix bug #72099: xml_parse_into_struct segmentation fault
  5.5.36 now
  Fix bug #72094 - Out of bounds heap read access in exif header processing
  Fix bug #72093: bcpowmod accepts negative scale and corrupts _one_ definition
  Fix bug #72061 - Out-of-bounds reads in zif_grapheme_stripos with negative offset
  Fix for bug #71912 (libgd: signedness vulnerability)
  Typo in NEWS
2016-04-27 12:30:34 +02:00
Anatol Belski
33d41da347 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix memory leak
  Fix bug #72099: xml_parse_into_struct segmentation fault
  5.5.36 now
  Fix bug #72094 - Out of bounds heap read access in exif header processing
  Fix bug #72093: bcpowmod accepts negative scale and corrupts _one_ definition
  Fix bug #72061 - Out-of-bounds reads in zif_grapheme_stripos with negative offset
  Fix for bug #71912 (libgd: signedness vulnerability)
  Typo in NEWS
2016-04-27 11:45:29 +02:00
Stanislav Malyshev
fd9689745c Fix bug #72061 - Out-of-bounds reads in zif_grapheme_stripos with negative offset 2016-04-24 13:15:17 -07:00
Francois Laupretre
4a8c51c7d7 Add negative offset support to grapheme_strpos/stripos/extract() 2016-03-09 14:41:37 +01:00
Nikita Popov
1287c48082 Fix/improve zpp usage
The ext/interbase changes are done blindly, fingers crossed.

Some of these are bug fixes, some make zpp usage more idiomatic.
2015-10-02 09:35:00 +02:00
Dmitry Stogov
560e4fa393 Removed or simplified incorrect SEPARATE_*() macros usage. 2015-09-29 11:17:43 +03:00
Dmitry Stogov
f7b6de5b5e Cleanup (avoid string reallocations) 2015-07-01 13:26:39 +03:00
Lior Kaplan
a4384bd3d4 s/PHP Version 5/PHP Version 7/g
Follow up for d0cb7153
2015-03-13 11:09:42 +02:00
Stanislav Malyshev
b7a7b1a624 trailing whitespace removal 2015-01-10 15:07:38 -08:00
Stanislav Malyshev
82f3d36583 cleanup intl types 2014-12-29 14:06:12 -08:00
Anatol Belski
bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +01:00
Johannes Schlüter
d0cb715373 s/PHP 5/PHP 7/ 2014-09-19 18:33:14 +02:00
Anatol Belski
6db8d4f829 's' works with size_t round 3 2014-08-27 20:49:36 +02:00
Anatol Belski
3234480827 first show to make 's' work with size_t 2014-08-27 20:49:31 +02:00
Anatol Belski
c3e3c98ec6 master renames phase 1 2014-08-25 19:24:55 +02:00
Anatol Belski
888ef26cc5 yet trivial fixes 2014-08-20 22:54:00 +02:00
Anatol Belski
063079b62e ported ext/intl, bugfixes to go 2014-08-19 22:57:17 +02:00
Anatol Belski
63d3f0b844 basic macro replacements, all at once 2014-08-19 08:07:31 +02:00
Dmitry Stogov
3ad4a8a5fa Separate argument passed by reference 2014-07-08 16:40:26 +04:00
Xinchen Hui
b6e9c76d67 Refactoring ext/intl (only compilerable now, far to finish :<) 2014-06-28 12:20:35 +08:00
Xinchen Hui
4fbaddb4f8 Refactoring ext/intl (incompleted) 2014-06-28 00:02:50 +08:00
Christopher Jones
39612afc72 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Reduce (some) compile noise of 'unused variable' and 'may be used uninitialized' warnings.

Conflicts:
	ext/dba/libinifile/inifile.c
2013-08-14 20:43:25 -07:00
Christopher Jones
9ad97cd489 Reduce (some) compile noise of 'unused variable' and 'may be used uninitialized' warnings. 2013-08-14 20:36:50 -07:00
Stanislav Malyshev
4020ef8980 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Add a __wakeup() method to SplFixedArray, thereby fixing serialising an
  Update NEWS
  small optimization
  fix bug #61860: use USearch for searches, it does the right thing
2013-06-28 13:56:11 -07:00