Compare commits

...
293 Commits
Author SHA1 Message Date
Stanislav Malyshev 86d7c5866f 5.4.5 2012-07-17 23:19:16 -07:00
Stanislav Malyshev a66b5c9a28 Revert "Fix bug #62112: number_format() is not binary safe"
This reverts commit 3e62aae1b4.
2012-07-17 14:50:07 -07:00
Stanislav Malyshev da4e5307b9 5.4.5 RC1 2012-07-03 22:43:14 -07:00
Nuno Lopes 91ce8041a3 fix (signed) integer overflow (part of bug #52550 2012-07-02 01:36:35 -04:00
Xinchen Hui be4053cea0 Fixed bug #62433 (Inconsistent behavior of RecursiveDirectoryIterator to dot files). 2012-07-02 11:33:38 +08:00
Nikita Popov ff41bfc878 Fix accidential change of php_version.h
For some reason the merge reverts changed the version :/
2012-07-01 17:05:19 +02:00
Nikita Popov b7903f9778 Revert JSON merges to 5.4
This reverts the following merge commits (-m 1):

405ebfcd18
d372b33c9b
36fa17a5fa
2012-07-01 16:38:26 +02:00
Nikita Popov 9cbd7a24b6 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Revert JSON changes to PHP 5.3
2012-07-01 16:35:43 +02:00
Nikita Popov 250393f925 Revert JSON changes to PHP 5.3
This reverts the following commits:

974324676b
4662151ea7
84fe2cc890

This does not revert the JSON changes released in PHP 5.3.14.
2012-07-01 16:28:57 +02:00
Stanislav Malyshev b741d3315b fix bug #61359: json_encode() calls too many reallocs 2012-06-30 19:14:30 -07:00
Stanislav Malyshev 4420b43907 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  remove duplicates, fix order
2012-06-30 17:37:20 -07:00
Stanislav Malyshev dfce6bf5d6 update NEWS 2012-06-30 17:37:09 -07:00
Stanislav Malyshev 5f31c81f07 remove duplicates, fix order 2012-06-30 17:36:22 -07:00
Marc Easen 896ac689c9 Fixed the common misspelling of the word occurred (occured -> occurred) 2012-06-30 16:54:03 -07:00
Felipe Pena b8d453d8d4 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  - Fixed bug #62415 (Undefined variable: diff in run-tests.php on line 2093 for successful XFAIL)
2012-06-30 16:29:47 -03:00
Felipe Pena 75d8af715c - Fixed bug #62415 (Undefined variable: diff in run-tests.php on line 2093 for successful XFAIL) 2012-06-30 16:29:30 -03:00
andrey ed1f058591 merge 2012-06-29 16:32:55 +03:00
andrey b7dbcbd41f Merge branch 'PHP-5.3' into PHP-5.4 2012-06-29 14:48:37 +03:00
andrey 8fe87e7fea fix Bug #62273 Segmentation Fault in Mysqli/Mysqlnd 2012-06-29 14:42:36 +03:00
andrey a614f8edea Merge branch 'PHP-5.3' into PHP-5.4 2012-06-29 14:41:11 +03:00
andrey a19d5c520c Merge branch 'PHP-5.4' of ssh://git.php.net/php-src into PHP-5.4 2012-06-29 14:41:01 +03:00
andrey 1ac611f24f Merge branch 'PHP-5.3' of ssh://git.php.net/php-src into PHP-5.3 2012-06-29 14:40:41 +03:00
Nikita Popov d86b6ea35c Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fix some lengths in crypt()

Conflicts:
	ext/standard/crypt.c
2012-06-29 13:15:35 +02:00
Nikita Popov e6cf7d7745 Fix some lengths in crypt()
Use salt_len_in instead of strlen(salt) or PHP_MAX_SALT_LEN, otherwise too
much memory will be allocated.

sha512 has a 86 character checksum, not 43. That probably was a copy&paste
from the sha256 code which indeed has 43.

The allocation also was using sizeof(char *), thus allocating 4 or 8 times
as much memory as necessary. The sizeof(char *) was removed in the 5.4
branch in b7a92c9 but forgotten on 5.3.

The memset 0 call was using PHP_MAX_SALT_LEN which can be smaller than the
output buffer and thus not zeroing out everything. Use the size of the
output buffer (needed) instead.
2012-06-29 13:11:43 +02:00
andrey 08f4b3c3ac Merge branch 'PHP-5.3' into PHP-5.4 2012-06-29 12:43:14 +03:00
andrey f826ea093f new charsets 2012-06-29 12:42:54 +03:00
Stanislav Malyshev 8992da2451 fix NEWS order 2012-06-28 18:08:11 -07:00
Anthony Ferrara 34ab5650bc Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed bug #62443 (Crypt SHA256/512 Segfaults With Malformed Salt)
2012-06-28 20:36:21 -04:00
Anthony Ferrara 7e8276ca68 Fixed bug #62443 (Crypt SHA256/512 Segfaults With Malformed Salt)
Fixed a memory allocation bug in crypt() SHA256/512 that can
cause segmentation faults when passed in salts with a null byte
early.
2012-06-28 20:00:03 -04:00
Nikita Popov 405ebfcd18 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Add json_last_error_msg() function
2012-06-28 20:18:19 +02:00
Nikita Popov 974324676b Add json_last_error_msg() function
This replaces json_last_error(true) and is consistent with other custom
error handling functions.
2012-06-28 20:11:27 +02:00
Johannes Schlüter 2996eeeed0 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fix #62432 ReflectionMethod random corrupt memory on high concurrent

Conflicts:
	ext/date/php_date.c
	ext/fileinfo/fileinfo.c
	ext/pdo/pdo_dbh.c
	ext/pdo/pdo_stmt.c
	ext/reflection/php_reflection.c
	ext/spl/spl_array.c
	ext/spl/spl_directory.c
	ext/spl/spl_dllist.c
	ext/spl/spl_fixedarray.c
	ext/spl/spl_heap.c
	ext/spl/spl_iterators.c
	ext/spl/spl_observer.c
	ext/sqlite/sqlite.c
	ext/sqlite3/sqlite3.c
	ext/tidy/tidy.c
	ext/xmlreader/php_xmlreader.c
	ext/xmlwriter/php_xmlwriter.c
	ext/xsl/php_xsl.c
	ext/zip/php_zip.c
2012-06-27 23:35:07 +02:00
Johannes Schlüter b025b9d0cf Fix #62432 ReflectionMethod random corrupt memory on high concurrent
This fixes the same issue in multiple extensions. This isn't needed
in later branches as 5.4 introduced object_properties_init()
2012-06-27 23:26:33 +02:00
Nikita Popov d372b33c9b Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Improve JSON error handling

Conflicts:
	ext/json/tests/bug54058.phpt
	ext/json/tests/bug61537.phpt
2012-06-27 12:28:55 +02:00
Nikita Popov 4662151ea7 Improve JSON error handling
json_encode() no longer throws warnings. Instead only the error code for
json_last_error() is set.

As it is hard to debug the error from just an error code an optional
$as_string parameter was added to json_last_error(), which returns an
error message instead of an error code.
2012-06-27 12:21:48 +02:00
Johannes Schlüter 9a86784859 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fix memleak in CLI

Conflicts:
	sapi/cli/php_cli.c
2012-06-27 11:46:57 +02:00
Johannes Schlüter bc0972e78d Fix memleak in CLI 2012-06-27 11:42:43 +02:00
Stanislav Malyshev 7a0f4cfdde update NEWS 2012-06-26 21:56:11 -07:00
Stanislav Malyshev ffcfa6f920 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  ws fix
  BFN
  Fix bug #62373 (serialize() generates wrong reference to the object)

Conflicts:
	php.ini-development
	php.ini-production
2012-06-26 21:53:40 -07:00
Stanislav Malyshev ad2bee193d ws fix 2012-06-26 15:22:29 -07:00
Xinchen Hui a44a1dc194 Fixed bug #62357 (compile failure: (S) Arguments missing for built-in function __memcmp).
Any C library function may be a macro, We should avoid using ZEND_STRS(L) as their arguments
2012-06-26 18:42:33 +08:00
Moriyoshi Koizumi ce2082d24f BFN 2012-06-25 19:20:38 +09:00
Moriyoshi Koizumi 91e1df704e Fix bug #62373 (serialize() generates wrong reference to the object) 2012-06-25 19:14:19 +09:00
Moriyoshi Koizumi e427182279 Fix bug #62373 (serialize() generates wrong reference to the object) 2012-06-25 19:13:23 +09:00
Nikita Popov ad641950b3 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fix memory allocation checks for base64 encode
2012-06-24 23:56:55 +02:00
Nikita Popov 5b3f4d25ea Fix memory allocation checks for base64 encode
base64_encode used safe_emalloc, but one of the arguments was derived from a
multiplication, thus making the allocation unsafe again.

There was a size check in place, but it was off by a factor of two as it
didn't account for the signedness of the integer type.

The unsafe allocation is not exploitable, but still causes funny behavior
when the sized overflows into a negative number.

To fix the issue the *4 factor is moved into the size argument (where it is
known to be safe), so safe_emalloc can carry out the multiplication.

The size check is removed as it doesn't really make sense once safe_emalloc
works correctly. (Would only cause base64_encode to silently return false
instead of throwing an error. Also could cause problems with other uses of
the base64 encoding API, which all don't check for a NULL return value.)

Furthermore the (length + 2) < 0 check is replaced with just length < 0.
Allowing lengths -2 and -1 doesn't make sense semantically and also is not
honored in the following code (negative length would access unallocated
memory.)

Actually the length < 0 check doesn't make sense altogether, but I left it
there just to be safe.
2012-06-24 23:32:50 +02:00
Nikita Popov 36fa17a5fa Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Improve json_encode error handling
  - BFN

Conflicts:
	ext/json/json.c
2012-06-23 21:14:45 +02:00
Nikita Popov 84fe2cc890 Improve json_encode error handling
json_encode() now returns bool(false) for all possible errors, throws the
respective warning and also sets the respective json_last_error() error
code. Three new error codes have been added:

  * JSON_ERROR_RECURSION
  * JSON_ERROR_INF_OR_NAN
  * JSON_ERROR_UNSUPPORTED_TYPE

To get a partial JSON output instead of bool(false) the option
JSON_PARTIAL_OUTPUT_ON_ERROR can be specified. In this case the invalid
segments will be replaced either by null (for recursion, unsupported type
and invalid JSON) or 0 (for Inf and NaN).

The warning for invalid UTF-8 stays intact and is thrown also with
display_errors = On. If this behavior is undesired this can be remedied
later.
2012-06-23 20:51:52 +02:00
Felipe Pena e886272577 - BFN 2012-06-23 15:21:32 -03:00
Felipe Pena cc90ac54be - BFN 2012-06-23 15:21:20 -03:00
Felipe Pena 5e36306feb Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  - Improved fix for #62384
2012-06-23 15:16:13 -03:00
Felipe Pena c3f34796a0 - Improved fix for #62384 2012-06-23 15:10:47 -03:00
Johannes Schlüter 2418791731 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Remove unneeded and outdated ChangeLog file
2012-06-22 20:01:06 +02:00
Johannes Schlüter 84b1c568f4 Remove unneeded and outdated ChangeLog file 2012-06-22 20:00:20 +02:00
Johannes Schlüter 5e23a047ac Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Remove extra ;
2012-06-22 17:33:22 +02:00
Johannes Schlüter a62d4e2c43 Remove extra ; 2012-06-22 17:32:46 +02:00
Felipe Pena 4af92aca87 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  - Fixed bug #62384 (Attempting to invoke a Closure more than once causes segfaul)
2012-06-22 12:05:55 -03:00
Felipe Pena b8e946b02e - Fixed bug #62384 (Attempting to invoke a Closure more than once causes segfaul) 2012-06-22 12:05:29 -03:00
Johannes Schlüter af516750ff Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Improve check for :memory: pseudo-filename in SQlite

Conflicts:
	ext/sqlite3/sqlite3.c
2012-06-22 12:50:30 +02:00
Johannes Schlüter 055ecbc628 Improve check for :memory: pseudo-filename in SQlite 2012-06-22 12:48:39 +02:00
Johannes Schlüter 041dd77135 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Remove outdated and user-specific files
2012-06-20 19:47:44 +02:00
Johannes Schlüter d93892de7a Remove outdated and user-specific files 2012-06-20 19:46:32 +02:00
Nikita Popov 02cda8fd94 Merge branch 'PHP-5.3' into PHP-5.4
I messed up the last merge somehow :/ Merge again.

* PHP-5.3:
  Add NEWS for bug #62262
  Fixed bug RecursiveArrayIterator does not implement Countable

Conflicts:
	ext/spl/spl_array.c
2012-06-19 18:41:49 +02:00
Nikita Popov 5d81fe6f12 Add NEWS for bug #62262 2012-06-19 18:40:46 +02:00
Nikita Popov fed1f2d124 Fixed bug RecursiveArrayIterator does not implement Countable
ArrayIterator implemented Countable only after it was already inherited by
RecursiveArrayIterator. Thus the interface was missing in RAI.
2012-06-19 18:32:44 +02:00
Nikita Popov cce4764f13 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed bug RecursiveArrayIterator does not implement Countable

Conflicts:
	ext/spl/spl_array.c
2012-06-19 18:08:22 +02:00
Nikita Popov 4cba4c6193 Fixed bug RecursiveArrayIterator does not implement Countable
ArrayIterator implemented Countable only after it was already inherited by
RecursiveArrayIterator. Thus the interface was missing in RAI.
2012-06-19 18:04:14 +02:00
Anatoliy Belsky 34bd1c941b Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  sync zip ext version with pecl
2012-06-19 17:17:11 +02:00
Anatoliy Belsky e793539678 sync zip ext version with pecl 2012-06-19 17:15:56 +02:00
Anatoliy Belsky 5c001d42d4 one more correction for COM upgrading notes 2012-06-19 14:58:06 +02:00
Anatoliy Belsky df138c5719 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  one more correction for COM upgrading notes
2012-06-19 14:51:52 +02:00
Anatoliy Belsky f072662621 one more correction for COM upgrading notes 2012-06-19 14:42:59 +02:00
Anatoliy Belsky 0a65b661e4 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  split gzgetc_basic.phpt for zlib 1.2.7
2012-06-19 14:12:54 +02:00
Anatoliy Belsky a8948d0808 split gzgetc_basic.phpt for zlib 1.2.7 2012-06-19 14:08:34 +02:00
Anatoliy Belsky d8ba49a2c7 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  com ext upgrading correction
2012-06-18 22:08:44 +02:00
Anatoliy Belsky 592917f91f com ext upgrading correction 2012-06-18 22:07:19 +02:00
Anatoliy Belsky 1c4e48650c com ext upgrading infos 2012-06-18 22:04:40 +02:00
Anatoliy Belsky b408028b88 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  com ext upgrading info
2012-06-18 21:59:27 +02:00
Anatoliy Belsky 6176b96a23 com ext upgrading info 2012-06-18 21:56:17 +02:00
Anatoliy Belsky c56ff2bf75 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Reverted the BC fix regarding to #57905, test adopted
2012-06-17 16:10:56 +02:00
Anatoliy Belsky d3780f1f90 Reverted the BC fix regarding to #57905, test adopted
New 0.10.1 has a stronger archive integrity check. Restoring
the old behaviour of libzip < 0.10.1 makes no sense at this
place.
2012-06-17 16:04:36 +02:00
stealth35 11a202ef50 Fix potential leak in cli server 2012-06-16 00:56:54 +03:00
Anatoliy Belsky 280e3a4ec8 Fixed bug #62312 ext\sockets\tests\socket_import_stream-4.phpt fails 2012-06-14 18:02:53 +02:00
Anatoliy Belsky 3faebe2bec Fix bug #62270 Test bug - ext/fileinfo/tests/finfo_open_error-win32 2012-06-14 17:59:39 +02:00
Johannes Schlüter fef691b142 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Merge PHP 5.3.14 NEWS
  re-add 61755 to NEWS
2012-06-13 10:36:49 +02:00
Johannes Schlüter 26cb570615 Merge PHP 5.3.14 NEWS 2012-06-13 10:35:58 +02:00
Stanislav Malyshev 79e44c394f re-add 61755 to NEWS 2012-06-12 11:53:24 -07:00
Stanislav Malyshev f0d6059389 re-add 61755 to NEWS 2012-06-12 11:52:22 -07:00
Stanislav Malyshev c7be96b08f Revert "Add PBKDF2 support via openssl()"
This reverts commit b5b8ea1050.
Looks like we don't have agreement yet on this for 5.4. Let's keep it in 5.5 for now.
2012-06-12 11:22:49 -07:00
Stanislav Malyshev a2bfad051d Revert "Rename openssl_pkcs5_pbkdf2_hmac() to something that doesn't sound like a spell."
This reverts commit bccd1e672f.
Looks like we don't have agreement yet on this for 5.4. Let's keep it in 5.5 for now.
2012-06-12 11:21:54 -07:00
Stanislav Malyshev f8cc363841 add CVE 2012-06-12 11:19:08 -07:00
Scott MacVicar bccd1e672f Rename openssl_pkcs5_pbkdf2_hmac() to something that doesn't sound like a spell.
Summary:
Stas pointed out that this is named pretty poorly. Go for openssl_pbkdf2()
2012-06-11 15:41:41 -07:00
Scott MacVicar b5b8ea1050 Add PBKDF2 support via openssl()
Summary:
No easy way to put these in the hash extension since we don't really support optional
parameters to certain algorithms. Implemented in openssl for now since it has it already
and is pretty stable.

Only SHA1 is confirmed to work as an algorithm but openssl has a parameter so it can be
changed in the future.

Will backport to 5.4 potentially with Stas' approval.

Test Plan:
Ran newly added tests which came from RFC 6070
2012-06-11 13:35:25 -07:00
Matt Ficken a18cede1c5 Fix bug #62271 test bug - ext/wddx/tests/bug48562.phpt 2012-06-11 17:00:36 +02:00
Stanislav Malyshev b55e69285b typo fix 2012-06-10 20:38:22 -07:00
David Soria Parra 51a5e98af6 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Make travis silent
2012-06-10 18:17:49 +04:00
David Soria Parra f464ffd780 Make travis silent
Travis will always build all branches. As we just have a .travis.yml
on master, travis will go ahead and checkout PHP-5.3. It fails and
then sends mails. We really don't want to get spammed, so we add
a .travis.yml that is just silent.
2012-06-10 18:17:37 +04:00
David Soria Parra b9babd22e0 Merge branch 'PHP-5.3' into PHP-5.4
By Stanislav Malyshev (1) and michelangelo (1)
* PHP-5.3:
  Adding a test for ext/posix/tests/posix_getegid_basic.phpt
  typo
2012-06-10 17:08:02 +04:00
michelangelo cda14b995c Adding a test for ext/posix/tests/posix_getegid_basic.phpt 2012-06-10 17:07:49 +04:00
Gustavo André dos Santos Lopes 503358c179 Fix bug #62266
Custom extension segfaults during xmlParseFile with FPM SAPI
because the regular list is not prepared during the MINIT phase
and our custom external entity loader tries to open PHP streams.
2012-06-09 17:29:47 +01:00
Stanislav Malyshev c4cc43169c rearrange news 2012-06-08 13:27:24 -07:00
Stanislav Malyshev ba8333cdb0 typo 2012-06-08 12:23:51 -07:00
Pierrick Charron c467e81c86 NEWS File 2012-06-08 18:02:49 +02:00
Stanislav Malyshev 17c0ff1194 typo 2012-06-08 01:24:49 -07:00
Stanislav Malyshev 59eaa7c877 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  improve overflow checks
  fix potential overflow in _php_stream_scandir
2012-06-08 01:22:46 -07:00
Stanislav Malyshev fc74503792 improve overflow checks 2012-06-08 01:21:37 -07:00
Stanislav Malyshev 0e3a650e74 add NEWS 2012-06-07 23:11:28 -07:00
Stanislav Malyshev 10e8da1738 fix potential overflow in _php_stream_scandir 2012-06-07 23:09:18 -07:00
Stanislav Malyshev 7d04e0fb2e fix potential overflow in _php_stream_scandir 2012-06-07 23:08:35 -07:00
Anatoliy Belsky d24d5b62c1 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  set current versions for libzip and zip ext
2012-06-07 22:37:32 +02:00
Anatoliy Belsky baacc2cb13 set current versions for libzip and zip ext 2012-06-07 22:32:03 +02:00
Anatoliy Belsky 7907dc4d66 updated NEWS 2012-06-07 21:45:30 +02:00
Anatoliy Belsky d206206c10 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  updated NEWS
2012-06-07 21:44:08 +02:00
Anatoliy Belsky 9ecb67d5a4 updated NEWS 2012-06-07 21:43:07 +02:00
Anatoliy Belsky 5ebdc46aa0 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  zip windows fixes
  fixed bc break related to #57905
  fixed a bit overlooked from the last libzip port
  brought the fix for #47667 back
  fixed zip entry freeing
  rechecked the merged libzip, took also the indents from the original to avoid confusion next time
  fixed a double freeing crash
  fixed header include
  initial libzip upgrade patch to 0.10.1
  - BFN

Conflicts:
	NEWS
2012-06-07 21:06:31 +02:00
Anatoliy Belsky bde0e8c2a1 zip windows fixes 2012-06-07 21:01:32 +02:00
Anatoliy Belsky 8ca457f64d fixed bc break related to #57905 2012-06-07 21:01:32 +02:00
Anatoliy Belsky e883892664 fixed a bit overlooked from the last libzip port 2012-06-07 21:01:32 +02:00
Anatoliy Belsky b8cdc731b8 brought the fix for #47667 back 2012-06-07 21:01:32 +02:00
Anatoliy Belsky a37e84e549 fixed zip entry freeing 2012-06-07 21:01:32 +02:00
Anatoliy Belsky f4a44f18b8 rechecked the merged libzip, took also the indents from the original to
avoid confusion next time
2012-06-07 21:01:31 +02:00
Anatoliy Belsky a39bcfc5ee fixed a double freeing crash 2012-06-07 21:01:31 +02:00
Anatoliy Belsky 9a2365412e fixed header include 2012-06-07 21:01:31 +02:00
Anatoliy Belsky 335a11b14b initial libzip upgrade patch to 0.10.1 2012-06-07 21:01:31 +02:00
Felipe Pena 7cae4ff02c - BFN 2012-06-07 14:23:17 -03:00
Felipe Pena 7881158690 - Fix merge 2012-06-07 14:21:10 -03:00
Felipe Pena 018a9b321f Merge commit '15213768e6cc098ab4e53cacc3b5eb86fa85284a' into PHP-5.3 2012-06-07 14:18:34 -03:00
Pierrick Charron c975320eb9 Regenerated files 2012-06-07 18:04:15 +02:00
Pierrick Charron 8e65ce35b9 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Regenerated files
2012-06-07 18:02:49 +02:00
Pierrick Charron 4e6f27f4db Regenerated files 2012-06-07 18:02:27 +02:00
Pierrick Charron 494c170e6f Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed bug #51094 (parse_ini_file() with INI_SCANNER_RAW cuts a value that includes a semi-colon)
2012-06-07 17:45:43 +02:00
Pierrick Charron fed5923dbc Fixed bug #51094 (parse_ini_file() with INI_SCANNER_RAW cuts a value that includes a semi-colon)
Modify the scanner to check if the first char of the raw data is an opening " in which case we
need to find the closing one. Otherwise just search for the next end of value char [\r\n;\000]
2012-06-07 17:44:20 +02:00
David Soria Parra deac80eb9a Merge branch 'PHP-5.3' into PHP-5.4
By Till Klampaeckel
* PHP-5.3:
  Don't depend on a fixed path for PHP shebang but use /usr/bin/env (cherry picked from commit 89c5d981603ed4a2a54f86c20cec4f263c58ded6)
2012-06-07 09:44:59 +02:00
Till Klampaeckel c56ff39c05 Don't depend on a fixed path for PHP shebang but use /usr/bin/env
(cherry picked from commit 89c5d981603ed4a2a54f86c20cec4f263c58ded6)
2012-06-07 09:44:49 +02:00
Xinchen Hui 83542dcf3b Merge branch 'PHP-5.3' into PHP-5.4
By Gustavo André dos Santos Lopes (4) and others
via Felipe Pena (1) and Xinchen Hui (1)
* PHP-5.3:
  Remove unused codes
  based on microsoft's description,the direct convert from FILETIME struct to __int64 is unsafe.
  Fix ext/intl build on ICU < 4.8
  Optimization in ext/intl/msgformat
  Fixed tests in ext/intl
  Changed XFAILed collator_get_sort_key.phpt
2012-06-07 14:32:47 +08:00
Xinchen Hui 6ecc9f1d9d Remove unused codes 2012-06-07 14:31:35 +08:00
slayercat d9810af45a based on microsoft's description,the direct convert from FILETIME struct to __int64 is unsafe.
via http://technet.microsoft.com/en-us/library/ms724284(v=vs.85).aspx

"Do not cast a pointer to a FILETIME structure to either a
ULARGE_INTEGER* or __int64* value because it can cause alignment faults on 64-bit Windows."
2012-06-07 14:28:05 +08:00
Stanislav Malyshev e118a0794a merge 5.3 entries 2012-06-06 23:20:14 -07:00
Stanislav Malyshev db1e425b1a restore NEWS 2012-06-06 23:00:33 -07:00
Gustavo André dos Santos Lopes c1ac325228 Fix ext/intl build on ICU < 4.8 2012-06-06 12:10:00 +02:00
Gustavo André dos Santos Lopes 52d541a314 Optimization in ext/intl/msgformat
Don't transform the string to make it apostrophe friendly in ICU 4.8+
as that it is now the default.
2012-06-06 11:36:00 +02:00
Gustavo André dos Santos Lopes 45b3fa4dee Fixed tests in ext/intl
21 is not a valid value for UNUM_PADDING_POSITION. Changed the test to
use 2 instead.

Remove ICU 4.2- test. No one cares.
2012-06-05 16:47:00 +02:00
Felipe Pena 15213768e6 - Fixed bug #62227 (Invalid phar stream path causes crash) 2012-06-04 20:07:14 -03:00
Gustavo André dos Santos Lopes 9b233b7e5e Changed XFAILed collator_get_sort_key.phpt
Ressurected and limited to ICU 4.8 in the hope that the sort keys
will remain stable in more recent ICU versions. I have only tested
with ICU 4.8 so far.
2012-06-04 10:18:24 +02:00
Felipe Pena 8779a9aad5 Merge commit 'e59b6dc0ae803d49c3f620818285f98dfb61fd57' into PHP-5.4 2012-06-03 19:01:50 -03:00
Felipe Pena 4fc49c04df Merge commit 'e59b6dc0ae803d49c3f620818285f98dfb61fd57' into PHP-5.3 2012-06-03 19:00:49 -03:00
Felipe Pena 60c5f9910f Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  - Optimize comparison between same HashTable pointer
  - Fixed bug #62205 (php-fpm segfaults (null passed to strstr))
  - fix missing include for unix sockets
  - Comment unused function to avoid warnings
2012-06-03 18:20:26 -03:00
Felipe Pena d57b278ad1 - Optimize comparison between same HashTable pointer 2012-06-03 18:16:57 -03:00
Felipe Pena e59b6dc0ae - Fixed information leak in ext exif (discovered by Martin Noga, Matthew "j00ru" Jurczyk, Gynvael Coldwind) 2012-06-03 15:23:07 -03:00
Jerome Loyet 1fa8ecd082 Merge branch 'PHP-5.4' of git.php.net:php-src into PHP-5.4
* 'PHP-5.4' of git.php.net:php-src: (27 commits)
  Fixed Bug #62202 (ReflectionParameter::getDefaultValue() memory leaks with constant)
  sort NEWS
  fix bug #55042 - erealloc without updating pointer
  Fix bug #62186 readline fails to compile
  fix unchecked emalloc (cherry picked from commit 158d8a6b08)
  fix test
  fix test
  Typofix in comment in proc_open.c
  fix CVE-2012-2143
  updated the libmagic patch after Felipes regex fix
  Fix bug #62150 Test Bug - ext/fileinfo/tests/finfo_open_error.phpt
  Bug #62177 deactivate the linux test version on win
  Fix bug #62177 Test Bug - finfo_file_regex.phpt
  Fixed bug #62176 Test Bug - sapi/cli/tests/bug61546.phpt
  fix unchecked emalloc
  add CVE
  add bug 62146
  add bug #62082
  sync with HEAD
  sync with HEAD
  ...
2012-06-01 11:30:49 +02:00
Jerome Loyet 238caeb63c - Fixed bug #62205 (php-fpm segfaults (null passed to strstr)) 2012-06-01 11:23:01 +02:00
Jerome Loyet ec4a1d576b - fix missing include for unix sockets 2012-06-01 11:22:18 +02:00
Jerome Loyet 43ec708882 - Comment unused function to avoid warnings 2012-06-01 11:22:02 +02:00
Jerome Loyet 38ca8cb7a1 - Fixed bug #62205 (php-fpm segfaults (null passed to strstr)) 2012-06-01 11:18:48 +02:00
Jerome Loyet 35abf3f20c - fix missing include for unix sockets 2012-06-01 11:16:53 +02:00
Jerome Loyet 59e0930d37 - Comment unused function to avoid warnings 2012-06-01 11:16:00 +02:00
Xinchen Hui b548d9ad2e Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed Bug #62202 (ReflectionParameter::getDefaultValue() memory leaks with constant)
2012-06-01 15:00:02 +08:00
Xinchen Hui 1f5327a602 Fixed Bug #62202 (ReflectionParameter::getDefaultValue() memory leaks with constant) 2012-06-01 14:57:27 +08:00
Stanislav Malyshev 5ebb0e520f sort NEWS 2012-05-30 22:34:29 -07:00
Stanislav Malyshev ed6ce83101 fix bug #55042 - erealloc without updating pointer 2012-05-30 22:26:26 -07:00
Johannes Schlüter 303dd7f346 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  fix unchecked emalloc (cherry picked from commit 158d8a6b08)
2012-05-31 01:16:42 +02:00
Johannes Schlüter 428dddd3e8 Fix bug #62186 readline fails to compile 2012-05-31 01:15:22 +02:00
Stanislav Malyshev fa05f038cb fix unchecked emalloc
(cherry picked from commit 158d8a6b08)
2012-05-30 21:37:28 +02:00
Stanislav Malyshev 9b98cf7865 fix test 2012-05-29 23:52:47 -07:00
Stanislav Malyshev abe6362716 fix test 2012-05-29 23:52:47 -07:00
Xinchen Hui 7511f972fd Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Typofix in comment in proc_open.c
2012-05-30 14:43:55 +08:00
Jille Timmermans a331f43f8c Typofix in comment in proc_open.c 2012-05-30 14:42:39 +08:00
Stanislav Malyshev 692b3bcd88 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  fix CVE-2012-2143
2012-05-29 23:08:04 -07:00
Stanislav Malyshev aab49e934d fix CVE-2012-2143 2012-05-29 23:07:04 -07:00
Anatoliy Belsky 6074da9809 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  updated the libmagic patch after Felipes regex fix
2012-05-29 17:41:57 +02:00
Anatoliy Belsky 8d5e953a19 updated the libmagic patch after Felipes regex fix 2012-05-29 17:38:30 +02:00
Anatoliy Belsky c0e046a130 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fix bug #62150 Test Bug - ext/fileinfo/tests/finfo_open_error.phpt
  Bug #62177 deactivate the linux test version on win
  Fix bug #62177 Test Bug - finfo_file_regex.phpt
2012-05-29 16:43:20 +02:00
Matt Ficken ad0371ac7e Fix bug #62150 Test Bug - ext/fileinfo/tests/finfo_open_error.phpt 2012-05-29 16:38:57 +02:00
Matt Ficken b4b0aaae93 Bug #62177 deactivate the linux test version on win 2012-05-29 16:37:19 +02:00
Matt Ficken dbc727373c Fix bug #62177 Test Bug - finfo_file_regex.phpt 2012-05-29 16:31:47 +02:00
Anatoliy Belsky c4f9b01422 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed bug #62176 Test Bug - sapi/cli/tests/bug61546.phpt
  sync with HEAD
  Fixed bug #61218 (the previous patch was not enough restritive on fcgi name string checks)
  Fixed bug #61218 (FPM drops connection while receiving some binary valuesin FastCGI requests)
  - Fixed bug #62033 (USR2 signal was sent even if not catch when daemonize and an error occured)
  - Fixed bug #62160 (Add process.priority to set nice(2) priorities)
  - add missing headers to avoid warnings
  - Fixed bug #62153 (when using unix sockets, multiples FPM instances can be launched without errors)
  - Fixed bug #62033 (php-fpm exits with status 0 on some failures to start)

Conflicts:
	NEWS
	sapi/fpm/fpm/fpm_main.c
2012-05-29 12:19:20 +02:00
Matt Ficken 4054890b26 Fixed bug #62176 Test Bug - sapi/cli/tests/bug61546.phpt 2012-05-29 11:41:44 +02:00
Stanislav Malyshev 158d8a6b08 fix unchecked emalloc 2012-05-28 18:54:15 -07:00
Stanislav Malyshev 213119c83f add CVE 2012-05-28 18:54:02 -07:00
Stanislav Malyshev 0a90643e53 add bug 62146 2012-05-28 17:43:36 -07:00
Stanislav Malyshev 4b04bf8793 add bug #62082 2012-05-28 17:38:33 -07:00
Nuno Lopes 339508d6ac sync with HEAD 2012-05-27 20:14:31 -04:00
Nuno Lopes 72911237b5 sync with HEAD 2012-05-27 20:13:09 -04:00
Jerome Loyet 773e85a788 Fixed bug #61218 (the previous patch was not enough restritive on fcgi name string checks) 2012-05-26 19:37:09 +02:00
Jerome Loyet 2f7bd57f93 Fixed bug #61218 (the previous patch was not enough restritive on fcgi name string checks) 2012-05-26 19:36:01 +02:00
Jerome Loyet 60cca8b9c9 Fixed bug #61218 (FPM drops connection while receiving some binary values in FastCGI requests) 2012-05-26 19:27:45 +02:00
Jerome Loyet e7ff3e839b Fixed bug #61218 (FPM drops connection while receiving some binary valuesin FastCGI requests) 2012-05-26 19:27:02 +02:00
Jerome Loyet e052da3a6b Fixed bug #62033 (USR2 signal was sent even if not catch when daemonize and an error occured) 2012-05-26 18:48:40 +02:00
Jerome Loyet 0298b92b69 - Fixed bug #62033 (USR2 signal was sent even if not catch when daemonize and an error occured) 2012-05-26 18:44:35 +02:00
Jerome Loyet decc394a20 - Fixed bug #62160 (Add process.priority to set nice(2) priorities) 2012-05-26 18:24:08 +02:00
Jerome Loyet f6655b62d8 - Fixed bug #62160 (Add process.priority to set nice(2) priorities) 2012-05-26 18:22:12 +02:00
Jerome Loyet 0037598252 - add missing headers to avoid warnings 2012-05-26 17:38:08 +02:00
Jerome Loyet 63e11f9025 - add missing headers to avoid warnings 2012-05-26 17:37:33 +02:00
Jerome Loyet d90003b549 - Fixed bug #62153 (when using unix sockets, multiples FPM instances can be launched without errors) 2012-05-25 21:22:54 +02:00
Jerome Loyet a7761262f7 - Fixed bug #62153 (when using unix sockets, multiples FPM instances can be launched without errors) 2012-05-25 21:21:44 +02:00
Jerome Loyet c2f33fb129 - Fixed bug #62033 (php-fpm exits with status 0 on some failures to start) 2012-05-25 21:13:57 +02:00
Jerome Loyet bf9120ecae - Fixed bug #62033 (php-fpm exits with status 0 on some failures to start) 2012-05-25 21:10:17 +02:00
Xinchen Hui 91ad40d9bb Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed bug #62128 superfluous ";"
2012-05-25 22:33:17 +08:00
Xinchen Hui c3547f1935 Fixed bug #62128 superfluous ";" 2012-05-25 22:31:49 +08:00
Anatoliy Belsky 16a592b13a Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed bug #62149 Test Bug - ext/curl/tests/bug61948
  Fixed bug #62148 mail_skipif doesn't skip imap tests on Release Build
2012-05-25 10:52:38 +02:00
Matt Ficken 86d2fafded Fixed bug #62149 Test Bug - ext/curl/tests/bug61948 2012-05-25 10:44:59 +02:00
Matt Ficken 4aac4da673 Fixed bug #62148 mail_skipif doesn't skip imap tests on Release Build 2012-05-25 10:34:33 +02:00
Anatoliy Belsky 6fb0e4a401 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed bug #62147 test bug - popen_pclose_basic-win32
2012-05-25 09:55:53 +02:00
Matt Ficken d4d36fba28 Fixed bug #62147 test bug - popen_pclose_basic-win32 2012-05-25 09:53:51 +02:00
Johannes Schlüter 3cd50ca714 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fix bug #62146 	com_dotnet cannot be built shared, tested by Anatoliy
  Those changes are in 5.3.15
  - BFN
2012-05-25 00:23:51 +02:00
Johannes Schlüter 8fc9df3f67 Fix bug #62146 com_dotnet cannot be built shared, tested by Anatoliy 2012-05-25 00:22:25 +02:00
Johannes Schlüter cfea8e5d04 Those changes are in 5.3.15 2012-05-25 00:20:29 +02:00
Felipe Pena 6c9056ceb7 Merge branch 'PHP-5.3' of git.php.net:php-src into PHP-5.3 2012-05-24 13:45:36 -03:00
Felipe Pena abe0f17e88 - BFN 2012-05-24 13:45:03 -03:00
Felipe Pena 84b2c39920 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  - Fixed magic file regex support
2012-05-24 13:43:35 -03:00
Felipe Pena 11b4f3becd - Fixed magic file regex support 2012-05-24 13:42:47 -03:00
Xinchen Hui a10da87c6a Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed bug #62073 (Different ways of iterating over an SplMaxHeap result in different keys)
2012-05-24 23:34:14 +08:00
Xinchen Hui bde86a6639 Fixed bug #62073
(Different ways of iterating over an SplMaxHeap result in in different keys)
2012-05-24 23:31:05 +08:00
Gustavo André dos Santos Lopes 04fd0b1098 Merge branch '5.3' into 5.4 2012-05-24 14:33:24 +02:00
Gustavo André dos Santos Lopes 85c777d2f1 Fixed bug #55610: ResourceBundle and Traversable 2012-05-24 14:33:05 +02:00
Gustavo André dos Santos Lopes 888e77ff73 Fixed last commit on 5.4
There's no change from the intended behavior. If INTL_G(default_locale)
is NULL, the default ICU locale, as given by locale_get_default() in
master, will still be used by ures_open().
2012-05-24 14:17:52 +02:00
Anatoliy Belsky 72c7cfe6f2 Fixed bug #62140 ext\standard\tests\file\tempnam_variation7-win32.phpt fails 2012-05-24 13:58:42 +02:00
Gustavo André dos Santos Lopes 92039fed22 Changed ResourceBundle constructor behavior
null is now accepted for two first (mandatory arguments).

Passing null as the package name causes NULL to be passed to ICU  and
the default ICU data to be loaded.

Passing null as the locale name causes the default locale to be used.
2012-05-24 13:50:59 +02:00
Anatoliy Belsky 0e12a778df Fix bug #62139 ext\standard\tests\file\rename_variation13-win32.phpt fails 2012-05-24 13:26:32 +02:00
Anatoliy Belsky 0dc9b0e708 Fixed bug #62138 ext\standard\tests\dir\dir_variation8-win32.phpt fails 2012-05-24 12:39:00 +02:00
Anatoliy Belsky b5511dcfd7 Fix bug #62137 ext\phar\tests\fatal_error_webphar.phpt fails 2012-05-24 12:04:38 +02:00
Gustavo André dos Santos Lopes f1969d4b4c Update NEWS 2012-05-24 11:14:36 +02:00
Gustavo André dos Santos Lopes e8009e2dca Merge branch '5.3' into 5.4 2012-05-24 11:08:55 +02:00
Gustavo André dos Santos Lopes 2da2de46a8 Fixed bug #60785
Memory leak in IntlDateFormatter constructor.

udat_setCalendar() clones the calendar before it adopts it,
so we were leaking the original calendar.

Also we now validate the calendar type.
2012-05-24 11:06:21 +02:00
Rasmus Lerdorf 523fd2c244 Fix broken apache_request_headers test
This test depends on the default_charset setting, so set it to
UTF-8 for consistent output
2012-05-23 17:38:23 -07:00
Gustavo André dos Santos Lopes acd711685a Fixed bug #62097
This fixes the fix for bug #54547 in 32-bit machines by accepting
float comparisons in 32-bit machines as long as the integer is
not larger than the mantissa.
2012-05-23 18:55:36 -05:00
Gustavo André dos Santos Lopes 0838a2b7c5 Merge branch '5.3' into 5.4 2012-05-23 15:52:32 +02:00
Gustavo André dos Santos Lopes e08566c613 Fixed bug #62017
IntlDateFormatter constructor would release some resources
under certain error conditions.
2012-05-23 15:52:19 +02:00
Reeze Xia 9205c4fd62 Fixed bug #62073 (Different ways of iterating over an SplMaxHeap result in different keys) 2012-05-23 20:42:06 +08:00
Gustavo André dos Santos Lopes c449bf1443 Fixed bug number in NEWS 2012-05-23 13:42:24 +02:00
Gustavo André dos Santos Lopes 1c19146f46 Updated NEWS w.r.t to ext/intl changes 2012-05-23 13:35:11 +02:00
Gustavo André dos Santos Lopes 8ee8ccda19 Merge branch '5.3' into 5.4
Conflicts:
	sapi/fpm/fpm/fpm_main.c
2012-05-23 13:27:21 +02:00
Gustavo André dos Santos Lopes 1eff3b01b8 Fixed bug #6208: memory leak in grapheme_extract() 2012-05-23 13:25:45 +02:00
Gustavo André dos Santos Lopes 86ea921291 Fixed bug #62082
This was a buffer overflow in internal function
get_icu_disp_value_src_php().
2012-05-23 13:25:42 +02:00
Gustavo André dos Santos Lopes 07c0d714a5 Fixed bug #62081
Constructor of IntlDateFormatter would leak if called twice.

Made calling it more than once error out before starting
using resources.
2012-05-23 13:25:37 +02:00
Gustavo André dos Santos Lopes 51286bd8e5 Fixed bug #62070
Collator::getSortKey() was returning an unterminated string
due the length given to RETURN_STRINGL being off by one.
2012-05-23 13:25:32 +02:00
Jerome Loyet 1299503936 - Fixed bug #61026 (FPM pools can listen on the same address) 2012-05-23 11:53:04 +02:00
Jerome Loyet 5d61e56dd7 - Fixed bug #61026 (FPM pools can listen on the same address) 2012-05-23 11:52:04 +02:00
Jerome Loyet d236c1af8a Merge branch 'PHP-5.4' of git.php.net:php-src into PHP-5.4
* 'PHP-5.4' of git.php.net:php-src:
  Fix bug #62112: number_format() is not binary safe
2012-05-23 11:41:29 +02:00
Jerome Loyet 0b44f16ea2 - Fixed bug #61839 (Unable to cross-compile PHP with --enable-fpm) 2012-05-23 11:40:22 +02:00
Gustavo André dos Santos Lopes 3e62aae1b4 Fix bug #62112: number_format() is not binary safe
The bug report actually urges PHP 5.3's behavior to be
reinstated -- that is, make "\0", when used as a separator,
be the same as no separator at all. I believe that is not a
proper course of action and that "\0" being interpreted as
no seperator was a bug in PHP 5.3.

Using "" for no separator, in both 5.3 and 5.4, before and
after this change, causes no separator to be used, so
there is no functionality loss.
2012-05-23 11:37:27 +02:00
Jerome Loyet a07d76c0ba - Fixed bug #61295 (php-fpm should not fail with commented 'user' for non-root start) 2012-05-23 11:31:33 +02:00
Jerome Loyet 812d248193 - Fixed bug #61295 (php-fpm should not fail with commented 'user' for non-root start) 2012-05-23 11:30:27 +02:00
Jerome Loyet f4c38016b6 - Fix help message for '-R' 2012-05-23 10:36:45 +02:00
Jerome Loyet 757e3fc3d5 - fix help message for '-R' 2012-05-23 10:35:37 +02:00
Jerome Loyet 629273d11b - add missing help message for '-R' 2012-05-23 10:34:16 +02:00
Jerome Loyet 06c7c3674b - Fixed bug #61835 (php-fpm is not allowed to run as root) 2012-05-23 10:32:42 +02:00
Jerome Loyet 7b396c078c - Fixed bug #61835 (php-fpm is not allowed to run as root) 2012-05-23 09:49:13 +02:00
Xinchen Hui 8475c5b98d Merge remote-tracking branch 'origin/PHP-5.3' into PHP-5.4 2012-05-23 13:52:36 +08:00
Xinchen Hui 5b8316188c Revert NEWS 2012-05-23 13:52:18 +08:00
Xinchen Hui df481764f3 Revert "Implemented FR #61602 Allow access to name of constant used as default value"
This reverts commit 054f3e3ce5.

See: http://news.php.net/php.cvs/69137 and the author confirmed.
Will commit later after the author fixed this then make a new PR.

Conflicts:

	ext/reflection/php_reflection.c
2012-05-23 13:50:12 +08:00
Xinchen Hui f733173b1f Fix typo while resolving conflicts 2012-05-23 13:43:49 +08:00
Xinchen Hui a7df6ce664 Revert "Implemented FR #61602 Allow access to name of constant used as default value"
This reverts commit 054f3e3ce5.

See: http://news.php.net/php.cvs/69137 and the author confirmed.
Will commit later after the author fixed this then make a new PR.

Conflicts:

	ext/reflection/php_reflection.c
2012-05-23 13:39:00 +08:00
Anatoliy Belsky 29876c5c29 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fix bug #62109 tests\basic\bug46313-win.phpt fails
  - Fixed bug #61045 (fpm don't send error log to fastcgi clients)
2012-05-22 18:43:10 +02:00
Anatoliy Belsky 621fddab93 Fix bug #62109 tests\basic\bug46313-win.phpt fails 2012-05-22 18:41:03 +02:00
Jerome Loyet bdf0c9ccbe Merge branch 'PHP-5.4' of git.php.net:php-src into PHP-5.4
* 'PHP-5.4' of git.php.net:php-src:
  add news for new pg_ functions
2012-05-22 08:47:40 +02:00
Jerome Loyet dce259099d - Fixed bug #61045 (fpm don't send error log to fastcgi clients) 2012-05-22 08:40:37 +02:00
Jerome Loyet d1e529c1cb - fix NEWS for bug #61812 2012-05-22 08:38:09 +02:00
Jerome Loyet faca4e08b4 - Fixed bug #61045 (fpm don't send error log to fastcgi clients) 2012-05-22 08:34:27 +02:00
Stanislav Malyshev a472649016 add news for new pg_ functions 2012-05-21 16:15:12 -07:00
Felipe Pena 074d361d64 - Fix the fix (typo s/AIX/_AIX/g) 2012-05-21 08:54:59 -03:00
Xinchen Hui 4c9a11c857 Use free instead of efree 2012-05-21 19:02:45 +08:00
Xinchen Hui bbcea230e1 Use emalloc instead of malloc 2012-05-21 18:58:19 +08:00
Anatoliy Belsky fbb86bd7b3 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fix bug #62066 Test Bug - ext/tidy/tests/004.phpt
2012-05-21 12:52:10 +02:00
Matt Ficken c973fef48d Fix bug #62066 Test Bug - ext/tidy/tests/004.phpt 2012-05-21 12:51:24 +02:00
Anatoliy Belsky 77e70b391c Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed bug #62068 Test bug - gmp_nextprime and 022
  Fix: 62067 Moved comments to FILE section
  - BFN

Conflicts:
	NEWS
2012-05-21 12:37:59 +02:00
Matt Ficken 645d65f3e3 Fixed bug #62068 Test bug - gmp_nextprime and 022 2012-05-21 12:31:16 +02:00
Dmitry Stogov 2ae8d2fbfb Fixed bug #61998 (Using traits with method aliases appears to result in crash during execution) 2012-05-21 13:57:41 +04:00
Dmitry Stogov c8f47a8e7c Fixed bug #61998 (Using traits with method aliases appears to result in crash during execution) 2012-05-21 13:46:07 +04:00
Felipe Pena c5fcd9f5af - BFN 2012-05-20 19:41:15 -03:00
Felipe Pena ffe8303f24 - Fixed bug #62025 (__ss_family was changed on AIX 5.3) 2012-05-20 19:37:20 -03:00
zoe slattery 867447f420 Fix: 62067 Moved comments to FILE section 2012-05-19 16:34:16 +01:00
zoe slattery 778d69ddfe Fix: 62067 Moved comments to FILE section 2012-05-19 16:33:36 +01:00
Felipe Pena c9331a3ef2 - BFN 2012-05-18 21:26:24 -03:00
Felipe Pena 79d52503a4 - BFN 2012-05-18 19:38:02 -03:00
Felipe Pena 88275e547f Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  - Fixed bug #62064 (memory leak in the XML Writer module)
2012-05-18 19:23:42 -03:00
Felipe Pena 6d928fd26d - Fixed bug #62064 (memory leak in the XML Writer module) 2012-05-18 19:23:29 -03:00
Christopher Jones 29a85d49ae Dummy (whitespace) change so Dan Brown can verify snap generation from git
PHP snapshots were still pulling from SVN and were out of date. This
is a dummy PHP 5.4-only commit so Dan can verify what he's updated for
git in the backend.
2012-05-16 10:13:34 -07:00
Johannes Schlüter 89e7a195bc Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  PHP 5.3.15-dev

Conflicts:
	configure.in
	main/php_version.h
2012-05-16 16:50:33 +02:00
Johannes Schlüter 72a9b595ca PHP 5.3.15-dev 2012-05-16 16:49:35 +02:00
Johannes Schlüter 67039363cd Merge branch 'PHP-5.3' of git.php.net:/php-src into PHP-5.3
* 'PHP-5.3' of git.php.net:/php-src:
  Fix for bug#62046
2012-05-16 16:46:08 +02:00
Johannes Schlüter 1f6f619451 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  fd fix
  fix bug #61065 (cherry picked from commit a10e778bfb)
2012-05-16 16:40:29 +02:00
Stanislav Malyshev 6e51989501 fd fix 2012-05-16 16:35:16 +02:00
Stanislav Malyshev 4eb802bb14 fix bug #61065
(cherry picked from commit a10e778bfb)
2012-05-16 16:30:29 +02:00
andrey 4d2d8e8717 Merge branch 'PHP-5.3' into PHP-5.4
Conflicts:
	ext/mysqlnd/mysqlnd_ps.c

merge fix for bug#62046
2012-05-16 15:59:39 +02:00
andrey d4afbd487a Fix for bug#62046
Bug#62046 mysqli@mysqlnd can't iterate over stored sets after call to
mysqli_stmt_reset().

Stmt's state was changed to STMT_PREPARED and leads the driver to think
that the stmt was just prepared. Because result set exist also for only
prepared but not executed sets, the check for stmt->result isn't any good.
There is a result set, because as response for COM_PREPARE the server sends
metadata and metadata is part of a result set. After COM_EXECUTE the server
sends metadata again, which could be different and in this case more correct.
2012-05-16 14:28:55 +02:00
Felipe Pena 1abcd81872 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  - Fixed bug #55299 (multiple null pointer in win32/registry.c)
2012-05-16 08:40:45 -03:00
Felipe Pena 93c91c733c - Fixed bug #55299 (multiple null pointer in win32/registry.c) 2012-05-16 08:40:12 -03:00
Stanislav Malyshev d84fa39667 Revert "Update test to fix breakage caused by the previous commit."
This reverts commit 05c8d4766c.
Connected to revert 7bbd5521d2.
2012-05-15 23:25:06 -07:00
Stanislav Malyshev e36a5a1197 fix test 2012-05-15 23:09:46 -07:00
Stanislav Malyshev be8b1c74cf to 5.4.5-dev 2012-05-15 22:46:49 -07:00
Stanislav Malyshev df2a38e7f8 fd fix 2012-05-15 22:35:43 -07:00
Stanislav Malyshev a10e778bfb fix bug #61065 2012-05-15 22:34:34 -07:00
259 changed files with 6886 additions and 25722 deletions

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
language: php
php:
# We only specify one version so we only get one worker
- 5.4
notifications:
email: false
script: exit 0
+208 -26
View File
@@ -1,6 +1,97 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2012, PHP 5.4.4
19 Jul 2012, PHP 5.4.5
- Core:
. Fixed bug #62443 (Crypt SHA256/512 Segfaults With Malformed
Salt). (Anthony Ferrara)
. Fixed bug #62432 (ReflectionMethod random corrupt memory on high
concurrent). (Johannes)
. Fixed bug #62373 (serialize() generates wrong reference to the object).
(Moriyoshi)
. Fixed bug #62357 (compile failure: (S) Arguments missing for built-in
function __memcmp). (Laruence)
. Fixed bug #61998 (Using traits with method aliases appears to result in
crash during execution). (Dmitry)
. Fixed bug #51094 (parse_ini_file() with INI_SCANNER_RAW cuts a value that
includes a semi-colon). (Pierrick)
. Fixed potential overflow in _php_stream_scandir (CVE-2012-2688).
(Jason Powell, Stas)
- EXIF:
. Fixed information leak in ext exif (discovered by Martin Noga,
Matthew "j00ru" Jurczyk, Gynvael Coldwind)
- FPM:
. Fixed bug #62205 (php-fpm segfaults (null passed to strstr)). (fat)
. Fixed bug #62160 (Add process.priority to set nice(2) priorities). (fat)
. Fixed bug #62153 (when using unix sockets, multiples FPM instances
. Fixed bug #62033 (php-fpm exits with status 0 on some failures to start).
(fat)
. Fixed bug #61839 (Unable to cross-compile PHP with --enable-fpm). (fat)
. Fixed bug #61835 (php-fpm is not allowed to run as root). (fat)
. Fixed bug #61295 (php-fpm should not fail with commented 'user'
. Fixed bug #61218 (FPM drops connection while receiving some binary values
in FastCGI requests). (fat)
. Fixed bug #61045 (fpm don't send error log to fastcgi clients). (fat)
for non-root start). (fat)
. Fixed bug #61026 (FPM pools can listen on the same address). (fat)
can be launched without errors). (fat)
- Iconv:
. Fix bug #55042 (Erealloc in iconv.c unsafe). (Stas)
- Intl:
. Fixed bug #62083 (grapheme_extract() memory leaks). (Gustavo)
. ResourceBundle constructor now accepts NULL for the first two arguments.
(Gustavo)
. Fixed bug #62081 (IntlDateFormatter constructor leaks memory when called
twice). (Gustavo)
. Fixed bug #62070 (Collator::getSortKey() returns garbage). (Gustavo)
. Fixed bug #62017 (datefmt_create with incorrectly encoded timezone leaks
pattern). (Gustavo)
. Fixed bug #60785 (memory leak in IntlDateFormatter constructor). (Gustavo)
- JSON:
. Fixed bug #61359 (json_encode() calls too many reallocs). (Stas)
- libxml:
. Fixed bug #62266 (Custom extension segfaults during xmlParseFile with FPM
SAPI). (Gustavo)
- Phar:
. Fixed bug #62227 (Invalid phar stream path causes crash). (Felipe)
- Readline:
. Fixed bug #62186 (readline fails to compile - void function should not
return a value). (Johannes)
- Reflection:
. Fixed bug #62384 (Attempting to invoke a Closure more than once causes
segfault). (Felipe)
. Fixed bug #62202 (ReflectionParameter::getDefaultValue() memory leaks
with constant). (Laruence)
- Sockets:
. Fixed bug #62025 (__ss_family was changed on AIX 5.3). (Felipe)
- SPL:
. Fixed bug #62433 (Inconsistent behavior of RecursiveDirectoryIterator to
dot files). (Laruence)
. Fixed bug #62262 (RecursiveArrayIterator does not implement Countable).
(Nikita Popov)
- XML Writer:
. Fixed bug #62064 (memory leak in the XML Writer module).
(jean-pierre dot lozi at lip6 dot fr)
- Zip:
. Upgraded libzip to 0.10.1 (Anatoliy)
14 Jun 2012, PHP 5.4.4
- COM:
. Fixed bug #62146 com_dotnet cannot be built shared. (Johannes)
- CLI Server:
. Implemented FR #61977 (Need CLI web-server support for files with .htm &
@@ -11,12 +102,10 @@ PHP NEWS
. Fixed bug #61546 (functions related to current script failed when chdir()
in cli sapi). (Laruence, reeze.xia@gmail.com)
- CURL:
. Fixed bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction).
(Laruence)
- Core:
. Fixed missing bound check in iptcparse(). (chris at chiappa.net)
. Fixed CVE-2012-2143. (Solar Designer)
. Fixed bug #62097 (fix for for bug #54547). (Gustavo)
. Fixed bug #62005 (unexpected behavior when incrementally assigning to a
member of a null object). (Laruence)
. Fixed bug #61978 (Object recursion not detected for classes that implement
@@ -27,12 +116,15 @@ PHP NEWS
. Fixed bug #61827 (incorrect \e processing on Windows) (Anatoliy)
. Fixed bug #61782 (__clone/__destruct do not match other methods when checking
access controls). (Stas)
. Fixed bug #61764 ('I' unpacks n as signed if n > 2^31-1 on LP64). (Gustavo)
. Fixed bug #61761 ('Overriding' a private static method with a different
signature causes crash). (Laruence)
. Fixed bug #61730 (Segfault from array_walk modifying an array passed by
reference). (Laruence)
. Fixed bug #61728 (PHP crash when calling ob_start in request_shutdown
phase). (Laruence)
. Fixed bug #61713 (Logic error in charset detection for htmlentities).
(Anatoliy)
. Fixed bug #61660 (bin2hex(hex2bin($data)) != $data). (Nikita Popov)
. Fixed bug #61650 (ini parser crashes when using ${xxxx} ini variables
(without apache2)). (Laruence)
@@ -40,19 +132,42 @@ PHP NEWS
. Fixed bug #54547 (wrong equality of string numbers). (Gustavo)
. Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename
set to null). (Anatoliy)
. Changed php://fd to be available only for CLI.
- Reflection:
. Implemented FR #61602 (Allow access to the name of constant
used as function/method parameter's default value). (reeze.xia@gmail.com)
- CURL:
. Fixed bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction).
(Laruence)
- FPM
- Fileinfo
. Fixed bug #61812 (Uninitialised value used in libmagic).
(Laruence, Gustavo)
. Fixed bug #61566 failure caused by the posix lseek and read versions
under windows in cdf_read(). (Anatoliy)
. Fixed bug #61565 where php_stream_open_wrapper_ex tries to open a
directory descriptor under windows. (Anatoliy)
- Intl
. Fixed bug #62082 (Memory corruption in internal function
get_icu_disp_value_src_php()). (Gustavo)
- Libxml:
. Fixed bug #61617 (Libxml tests failed(ht is already destroyed)).
(Laruence)
- PDO:
. Fixed bug #61755 (A parsing bug in the prepared statements can lead to
access violations). (Johannes)
- Phar:
. Fixed bug #61065 (Secunia SA44335, CVE-2012-2386). (Rasmus)
- Pgsql:
. Added pg_escape_identifier/pg_escape_literal. (Yasuo Ohgaki)
- Streams:
. Fixed bug #61961 (file_get_contents leaks when access empty file with
maxlen set). (Reeze)
- Zlib:
. Fixed bug #61820 (using ob_gzhandler will complain about headers already
sent when no compression). (Mike)
@@ -141,23 +256,6 @@ PHP NEWS
. Fixed bug #60948 (mysqlnd FTBFS when -Wformat-security is enabled).
(Johannes)
- Readline:
. Fixed bug #61088 (Memory leak in readline_callback_handler_install).
(Nikic, Laruence)
- Session
. Fixed bug #60634 (Segmentation fault when trying to die() in
SessionHandler::write()). (Ilia)
- SOAP
. Fixed bug #61423 (gzip compression fails). (Ilia)
. Fixed bug #60887 (SoapClient ignores user_agent option and sends no
User-Agent header). (carloschilazo at gmail dot com)
. Fixed bug #60842, #51775 (Chunked response parsing error when
chunksize length line is > 10 bytes). (Ilia)
. Fixed bug #49853 (Soap Client stream context header option ignored).
(Dmitry)
- PDO
. Fixed bug #61292 (Segfault while calling a method on an overloaded PDO
object). (Laruence)
@@ -175,12 +273,29 @@ PHP NEWS
. Fixed bug #61184 (Phar::webPhar() generates headers with trailing NUL
bytes). (Nikita Popov)
- Readline:
. Fixed bug #61088 (Memory leak in readline_callback_handler_install).
(Nikic, Laruence)
- Reflection:
. Implemented FR #61602 (Allow access to the name of constant
used as function/method parameter's default value). (reeze.xia@gmail.com)
. Fixed bug #60968 (Late static binding doesn't work with
ReflectionMethod::invokeArgs()). (Laruence)
- Session
. Fixed bug #60634 (Segmentation fault when trying to die() in
SessionHandler::write()). (Ilia)
- SOAP
. Fixed bug #61423 (gzip compression fails). (Ilia)
. Fixed bug #60887 (SoapClient ignores user_agent option and sends no
User-Agent header). (carloschilazo at gmail dot com)
. Fixed bug #60842, #51775 (Chunked response parsing error when
chunksize length line is > 10 bytes). (Ilia)
. Fixed bug #49853 (Soap Client stream context header option ignored).
(Dmitry)
- SPL:
. Fixed bug #61453 (SplObjectStorage does not identify objects correctly).
(Gustavo)
@@ -637,6 +752,73 @@ PHP NEWS
. Fixed bug #55544 (ob_gzhandler always conflicts with zlib.output_compression).
(Mike)
14 Jun 2012, PHP 5.3.14
- CLI SAPI:
. Fixed bug #61546 (functions related to current script failed when chdir()
in cli sapi). (Laruence, reeze.xia@gmail.com)
- CURL:
. Fixed bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction).
(Laruence)
- COM:
. Fixed bug #62146 com_dotnet cannot be built shared. (Johannes)
- Core:
. Fixed CVE-2012-2143. (Solar Designer)
. Fixed missing bound check in iptcparse(). (chris at chiappa.net)
. Fixed bug #62373 (serialize() generates wrong reference to the object).
(Moriyoshi)
. Fixed bug #62005 (unexpected behavior when incrementally assigning to a
member of a null object). (Laruence)
. Fixed bug #61991 (long overflow in realpath_cache_get()). (Anatoliy)
. Fixed bug #61764 ('I' unpacks n as signed if n > 2^31-1 on LP64). (Gustavo)
. Fixed bug #61730 (Segfault from array_walk modifying an array passed by
reference). (Laruence)
. Fixed bug #61713 (Logic error in charset detection for htmlentities).
(Anatoliy)
. Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename
set to null). (Anatoliy)
. Changed php://fd to be available only for CLI.
- Fileinfo:
. Fixed bug #61812 (Uninitialised value used in libmagic).
(Laruence, Gustavo)
- Iconv extension:
. Fixed a bug that iconv extension fails to link to the correct library
when another extension makes use of a library that links to the iconv
library. See https://bugs.gentoo.org/show_bug.cgi?id=364139 for detail.
(Moriyoshi)
- Intl:
. Fixed bug #62082 (Memory corruption in internal function
get_icu_disp_value_src_php()). (Gustavo)
- JSON
. Fixed bug #61537 (json_encode() incorrectly truncates/discards
information). (Adam)
- PDO:
. Fixed bug #61755 (A parsing bug in the prepared statements can lead to
access violations). (Johannes)
- Phar:
. Fix bug #61065 (Secunia SA44335). (Rasmus)
- Streams:
. Fixed bug #61961 (file_get_contents leaks when access empty file with
maxlen set). (Reeze)
08 May 2012, PHP 5.3.13
- CGI
. Improve fix for PHP-CGI query string parameter vulnerability, CVE-2012-2311.
(Stas)
03 May 2012, PHP 5.3.12
- Fix PHP-CGI query string parameter vulnerability, CVE-2012-1823. (Rasmus)
26 Apr 2012, PHP 5.3.11
- Core:
+26 -10
View File
@@ -37,9 +37,9 @@ PHP 5.4 UPGRADE NOTES
=============================
- PHP 5.4 now checks at compile time if /dev/urandom or /dev/arandom
are present. If either is available, session.entropy_file now
are present. If either is available, session.entropy_file now
defaults to that file and session.entropy_length defaults to 32.
This provides non-blocking entropy to session id generation. If you
This provides non-blocking entropy to session id generation. If you
do not want extra entropy for your session ids, add:
session.entropy_file=
@@ -89,9 +89,9 @@ PHP 5.4 UPGRADE NOTES
session.upload_progress.min_freq
- Added a zend.multibyte directive as a replacement of the PHP compile time
configuration option --enable-zend-multibyte. Now the Zend Engine always
configuration option --enable-zend-multibyte. Now the Zend Engine always
contains code for multibyte support, which can be enabled or disabled at
runtime. Note: It doesn't make a lot of sense to enable this option if
runtime. Note: It doesn't make a lot of sense to enable this option if
ext/mbstring is not enabled, because most functionality is implemented by
mbstrings callbacks.
@@ -107,7 +107,7 @@ PHP 5.4 UPGRADE NOTES
in a stream fashion (through php://input) without having it copied in memory
multiple times.
- Added windows_show_crt_warning. This directive shows the CRT warnings when
- Added windows_show_crt_warning. This directive shows the CRT warnings when
enabled. These warnings were displayed by default until now. It is disabled
by default.
@@ -162,7 +162,7 @@ PHP 5.4 UPGRADE NOTES
- Non-numeric string offsets, e.g. $a['foo'] where $a is a string, now
return false on isset() and true on empty(), and produce warning if
trying to use them. Offsets of types double, bool and null produce
trying to use them. Offsets of types double, bool and null produce
notice. Numeric strings ($a['2']) still work as before.
Note that offsets like '12.3' and '5 and a half' are considered
@@ -207,7 +207,7 @@ PHP 5.4 UPGRADE NOTES
- htmlentities() and htmlspecialchars() are stricter in the code units they
accept for the asian encodings. For Big5-HKSCS, the octets 0x80 and 0xFF are
rejected. For GB2312/EUC-CN, the octets 0x8E, 0x8F, 0xA0 and 0xFF are
rejected. For GB2312/EUC-CN, the octets 0x8E, 0x8F, 0xA0 and 0xFF are
rejected. For SJIS, the octets 0x80, 0xA0, 0xFD, 0xFE and 0xFF are rejected,
except maybe after a valid starting byte. For EUC-JP, the octets 0xA0 and
0xFF are rejected.
@@ -233,7 +233,7 @@ PHP 5.4 UPGRADE NOTES
checks on the validity of the entities. Numerical entities are checked for a
valid range (0 to 0x10FFFF); if the flag ENT_DISALLOWED is given, the
validity of such numerical entity in the target document type is also
checked. Named entities are checked for necessary existence in the target
checked. Named entities are checked for necessary existence in the target
document type instead of only checking whether they were constituted by
alphanumeric characters.
@@ -339,6 +339,10 @@ PHP 5.4 UPGRADE NOTES
- ob_start() no longer starts multiple output buffers when passed
array("callback1", "callback2", "callback3", ...).
- Since 5.4.4, "php://fd" stream syntax is available only in CLI build.
- Since 5.4.5, resourcebundle_create() accepts null for the first two arguments.
==============================
5. Changes to existing classes
==============================
@@ -371,6 +375,9 @@ PHP 5.4 UPGRADE NOTES
- FilesystemIterator, GlobIterator and (Recursive)DirectoryIterator now use
the default stream context.
- Since 5.4.5, the constructor of ResourceBundle accepts NULL for the first two
arguments.
===========================
7. Deprecated Functionality
===========================
@@ -429,7 +436,7 @@ d. Removed hash algorithms
a. Extensions no longer maintained
- ext/sqlite is no longer part of the base distribution and has been moved
to PECL. Use sqlite3 or PDO_SQLITE instead.
to PECL. Use sqlite3 or PDO_SQLITE instead.
b. Extensions with changed behavior
@@ -483,7 +490,7 @@ b. Extensions with changed behavior
===========================
- A REQUEST_TIME_FLOAT value returns a floating point number indicating the
time with microsecond precision. All SAPIs providing this value should be
time with microsecond precision. All SAPIs providing this value should be
returning float and not time_t.
- apache_child_terminate(), getallheaders(), apache_request_headers()
@@ -506,6 +513,11 @@ b. Extensions with changed behavior
- is_link now works properly for symbolic links on Windows Vista
or later. Earlier systems do not support symbolic links.
- As of PHP 5.4.5 and above the COM extension isn't compiled statically in PHP
anymore but shared. It'll still be delivered with the standard PHP release but
must be activated manually with the "extension = php_com_dotnet.dll" directive
in php.ini.
==================
12. New in PHP 5.4
==================
@@ -608,6 +620,10 @@ c. New functions
- mysqli_error_list()
- mysqli_stmt_error_list()
- pgsql
- pg_escape_identifier() (5.4.4)
- pg_escape_literal() (5.4.4)
- Session:
- session_register_shutdown()
- session_status()
-22097
View File
File diff suppressed because it is too large. Load diff
+7 -7
View File
@@ -62,17 +62,17 @@ print "\nDone\n";
?>
--EXPECTF--
Notice: String offset cast occured in %s on line %d
Notice: String offset cast occurred in %s on line %d
Notice: Uninitialized string offset: 0 in %s on line %d
Notice: Uninitialized string offset: 0 in %s on line %d
Notice: String offset cast occured in %s on line %d
Notice: String offset cast occurred in %s on line %d
Notice: Uninitialized string offset: %i in %s on line %d
Notice: String offset cast occured in %s on line %d
Notice: String offset cast occurred in %s on line %d
Notice: Uninitialized string offset: %i in %s on line %d
@@ -88,16 +88,16 @@ Notice: Uninitialized string offset: 4 in %s on line %d
Notice: Uninitialized string offset: 4 in %s on line %d
Notice: String offset cast occured in %s on line %d
Notice: String offset cast occurred in %s on line %d
Notice: Uninitialized string offset: 12 in %s on line %d
Notice: String offset cast occured in %s on line %d
Notice: String offset cast occurred in %s on line %d
Notice: Uninitialized string offset: 12 in %s on line %d
Notice: String offset cast occured in %s on line %d
Notice: String offset cast occurred in %s on line %d
Notice: String offset cast occured in %s on line %d
Notice: String offset cast occurred in %s on line %d
b
Done
+17
View File
@@ -0,0 +1,17 @@
--TEST--
Bug #62097: fix for bug #54547 is wrong for 32-bit machines
--SKIPIF--
<?php
if (PHP_INT_MAX !== 2147483647)
die('skip for system with 32-bit wide longs only');
--FILE--
<?php
var_dump("02147483647" == "2147483647",
"02147483648" == "2147483648",
"09007199254740991" == "9007199254740991",
"09007199254740992" == "9007199254740992");
--EXPECT--
bool(true)
bool(true)
bool(true)
bool(false)
+4 -4
View File
@@ -30,10 +30,10 @@ echo "Done\n";
--EXPECTF--
string(1) "i"
Notice: String offset cast occured in %s on line %d
Notice: String offset cast occurred in %s on line %d
string(1) "S"
Notice: String offset cast occured in %s on line %d
Notice: String offset cast occurred in %s on line %d
string(1) "S"
Warning: Illegal string offset 'run away' in %s on line %d
@@ -46,10 +46,10 @@ string(1) "o"
Notice: A non well formed numeric value encountered in %s on line %d
string(1) "r"
Notice: String offset cast occured in %s on line %d
Notice: String offset cast occurred in %s on line %d
string(1) "i"
Notice: String offset cast occured in %s on line %d
Notice: String offset cast occurred in %s on line %d
string(1) "S"
Warning: Illegal offset type in %s on line %d
+68
View File
@@ -0,0 +1,68 @@
--TEST--
Bug #61998 (Using traits with method aliases appears to result in crash during execution)
--FILE--
<?php
class Foo {
use T1 {
func as newFunc;
}
public function func() {
echo "From Foo\n";
}
}
trait T1 {
public function func() {
echo "From T1\n";
}
}
class Bar {
public function func() {
echo "From Bar\n";
}
public function func2() {
echo "From Bar\n";
}
public function func3() {
echo "From Bar\n";
}
use T1 {
func as newFunc;
func as func2;
}
use T2 {
func2 as newFunc2;
func2 as newFunc3;
func2 as func3;
}
}
trait T2 {
public function func2() {
echo "From T2\n";
}
}
$f = new Foo();
$f->newFunc(); //from T1
$f->func(); //from Foo
$b = new Bar();
$b->newFunc(); //from T1
$b->func(); //from Bar
$b->func2(); //from Bar
$b->newFunc2(); //from T2
$b->newFunc3(); //from T2
$b->func3(); //from Bar
--EXPECTF--
From T1
From Foo
From T1
From Bar
From Bar
From T2
From T2
From Bar
+13 -12
View File
@@ -1685,7 +1685,7 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
zval key;
if (CG(current_namespace)) {
/* Prefix function name with current namespcae name */
/* Prefix function name with current namespace name */
znode tmp;
tmp.u.constant = *CG(current_namespace);
@@ -3619,6 +3619,7 @@ ZEND_API void zend_do_implement_trait(zend_class_entry *ce, zend_class_entry *tr
}
}
ce->traits[ce->num_traits++] = trait;
trait->refcount++;
}
}
/* }}} */
@@ -3711,7 +3712,7 @@ static int zend_traits_merge_functions(zend_function *fn TSRMLS_DC, int num_args
} else {
/* Add it to result function table */
if (zend_hash_quick_add(resulting_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h, fn, sizeof(zend_function), NULL)==FAILURE) {
zend_error(E_COMPILE_ERROR, "Trait method %s has not been applied, because failure occured during updating resulting trait method table", fn->common.function_name);
zend_error(E_COMPILE_ERROR, "Trait method %s has not been applied, because failure occurred during updating resulting trait method table", fn->common.function_name);
}
}
@@ -3828,7 +3829,7 @@ static int zend_traits_merge_functions_to_class(zend_function *fn TSRMLS_DC, int
function_add_ref(&fn_copy);
if (zend_hash_quick_update(&ce->function_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h, &fn_copy, sizeof(zend_function), (void**)&fn_copy_p)==FAILURE) {
zend_error(E_COMPILE_ERROR, "Trait method %s has not been applied, because failure occured during updating class method table", hash_key->arKey);
zend_error(E_COMPILE_ERROR, "Trait method %s has not been applied, because failure occurred during updating class method table", hash_key->arKey);
}
zend_add_magic_methods(ce, hash_key->arKey, hash_key->nKeyLength, fn_copy_p TSRMLS_CC);
@@ -3870,8 +3871,8 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args,
fn_copy = *fn;
function_add_ref(&fn_copy);
/* this function_name is never destroyed, because its refcount
greater than 1, classes are always destoyed in reverse order
and trait is declared early than this class */
greater than 1 and classes are always destoyed before the
traits they use */
fn_copy.common.function_name = aliases[i]->alias;
/* if it is 0, no modifieres has been changed */
@@ -4076,14 +4077,14 @@ static void zend_do_traits_method_binding(zend_class_entry *ce TSRMLS_DC) /* {{{
size_t i;
/* prepare copies of trait function tables for combination */
function_tables = malloc(sizeof(HashTable*) * ce->num_traits);
resulting_table = (HashTable *) malloc(sizeof(HashTable));
function_tables = emalloc(sizeof(HashTable*) * ce->num_traits);
resulting_table = (HashTable *)emalloc(sizeof(HashTable));
/* TODO: revisit this start size, may be its not optimal */
zend_hash_init_ex(resulting_table, 10, NULL, NULL, 1, 0);
zend_hash_init_ex(resulting_table, 10, NULL, NULL, 0, 0);
for (i = 0; i < ce->num_traits; i++) {
function_tables[i] = (HashTable *) malloc(sizeof(HashTable));
function_tables[i] = (HashTable *)emalloc(sizeof(HashTable));
zend_hash_init_ex(function_tables[i], ce->traits[i]->function_table.nNumOfElements, NULL, NULL, 1, 0);
if (ce->trait_precedences) {
@@ -4116,14 +4117,14 @@ static void zend_do_traits_method_binding(zend_class_entry *ce TSRMLS_DC) /* {{{
for (i = 0; i < ce->num_traits; i++) {
/* zend_hash_destroy(function_tables[i]); */
zend_hash_graceful_destroy(function_tables[i]);
free(function_tables[i]);
efree(function_tables[i]);
}
free(function_tables);
efree(function_tables);
/* free temporary resulting table */
/* zend_hash_destroy(resulting_table); */
zend_hash_graceful_destroy(resulting_table);
free(resulting_table);
efree(resulting_table);
}
/* }}} */
+2 -2
View File
@@ -1161,7 +1161,7 @@ convert_to_array:
case IS_DOUBLE:
case IS_NULL:
case IS_BOOL:
zend_error(E_NOTICE, "String offset cast occured");
zend_error(E_NOTICE, "String offset cast occurred");
break;
default:
zend_error(E_WARNING, "Illegal offset type");
@@ -1284,7 +1284,7 @@ static void zend_fetch_dimension_address_read(temp_variable *result, zval **cont
case IS_NULL:
case IS_BOOL:
if (type != BP_VAR_IS) {
zend_error(E_NOTICE, "String offset cast occured");
zend_error(E_NOTICE, "String offset cast occurred");
}
break;
default:
+1 -1
View File
@@ -330,7 +330,7 @@ END_EXTERN_C()
if (idx-1 > LONG_MAX) { /* overflow */ \
break; \
} \
idx = (ulong)(-(long)idx); \
idx = -idx; \
} else if (idx > LONG_MAX) { /* overflow */ \
break; \
} \
+1612 -1574
View File
File diff suppressed because it is too large. Load diff
+27 -6
View File
@@ -347,7 +347,7 @@ DOLLAR_CURLY "${"
SECTION_RAW_CHARS [^\]\n\r]
SINGLE_QUOTED_CHARS [^']
RAW_VALUE_CHARS [^\n\r;\000]
RAW_VALUE_CHARS [^"\n\r;\000]
LITERAL_DOLLAR ("$"([^{\000]|("\\"{ANY_CHAR})))
VALUE_CHARS ([^$= \t\n\r;&|~()!"'\000]|{LITERAL_DOLLAR})
@@ -445,12 +445,33 @@ SECTION_VALUE_CHARS ([^$\n\r;"'\]\\]|("\\"{ANY_CHAR})|{LITERAL_DOLLAR})
return '=';
}
<ST_RAW>{RAW_VALUE_CHARS}+ { /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
/* Eat leading and trailing double quotes */
if (yytext[0] == '"' && yytext[yyleng - 1] == '"') {
SCNG(yy_text)++;
yyleng = yyleng - 2;
<ST_RAW>["] {
while (YYCURSOR < YYLIMIT) {
switch (*YYCURSOR++) {
case '\n':
SCNG(lineno)++;
break;
case '\r':
if (*YYCURSOR != '\n') {
SCNG(lineno)++;
}
break;
case '"':
yyleng = YYCURSOR - SCNG(yy_text) - 2;
SCNG(yy_text)++;
RETURN_TOKEN(TC_RAW, yytext, yyleng);
case '\\':
if (YYCURSOR < YYLIMIT) {
YYCURSOR++;
}
break;
}
}
yyleng = YYCURSOR - SCNG(yy_text);
RETURN_TOKEN(TC_RAW, yytext, yyleng);
}
<ST_RAW>{RAW_VALUE_CHARS}+ { /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
RETURN_TOKEN(TC_RAW, yytext, yyleng);
}
+1 -1
View File
@@ -1,4 +1,4 @@
/* Generated by re2c 0.13.5 on Fri Mar 2 11:49:21 2012 */
/* Generated by re2c 0.13.5 on Thu Jun 7 17:48:25 2012 */
#line 3 "Zend/zend_ini_scanner_defs.h"
enum YYCONDTYPE {
+1 -1
View File
@@ -1191,7 +1191,7 @@ static YYSIZE_T zend_yytnamerr(char *yyres, const char *yystr)
if (LANG_SCNG(yy_text)[0] == 0 &&
LANG_SCNG(yy_leng) == 1 &&
memcmp(yystr, ZEND_STRL("\"end of file\"")) == 0) {
memcmp(yystr, "\"end of file\"", sizeof("\"end of file\"") - 1) == 0) {
yystpcpy(yyres, "end of file");
return sizeof("end of file")-1;
}
+1 -1
View File
@@ -168,7 +168,7 @@ ZEND_API const zend_encoding *zend_multibyte_get_script_encoding(TSRMLS_D)
ZEND_API int zend_multibyte_set_script_encoding(const zend_encoding **encoding_list, size_t encoding_list_size TSRMLS_DC)
{
if (CG(script_encoding_list)) {
efree(CG(script_encoding_list));
free(CG(script_encoding_list));
}
CG(script_encoding_list) = encoding_list;
CG(script_encoding_list_size) = encoding_list_size;
+6
View File
@@ -215,6 +215,12 @@ ZEND_API int zend_cleanup_class_data(zend_class_entry **pce TSRMLS_DC)
void _destroy_zend_class_traits_info(zend_class_entry *ce)
{
if (ce->num_traits > 0 && ce->traits) {
size_t i;
for (i = 0; i < ce->num_traits; i++) {
if (ce->traits[i]) {
destroy_zend_class(&ce->traits[i]);
}
}
efree(ce->traits);
}
+10 -3
View File
@@ -1605,7 +1605,8 @@ ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
&& (!memcmp(Z_STRVAL_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op1))));
break;
case IS_ARRAY:
Z_LVAL_P(result) = zend_hash_compare(Z_ARRVAL_P(op1), Z_ARRVAL_P(op2), (compare_func_t) hash_zval_identical_function, 1 TSRMLS_CC)==0;
Z_LVAL_P(result) = (Z_ARRVAL_P(op1) == Z_ARRVAL_P(op2) ||
zend_hash_compare(Z_ARRVAL_P(op1), Z_ARRVAL_P(op2), (compare_func_t) hash_zval_identical_function, 1 TSRMLS_CC)==0);
break;
case IS_OBJECT:
if (Z_OBJ_HT_P(op1) == Z_OBJ_HT_P(op2)) {
@@ -2041,7 +2042,13 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2) /* {{{ */
if ((ret1=is_numeric_string_ex(Z_STRVAL_P(s1), Z_STRLEN_P(s1), &lval1, &dval1, 0, &oflow1)) &&
(ret2=is_numeric_string_ex(Z_STRVAL_P(s2), Z_STRLEN_P(s2), &lval2, &dval2, 0, &oflow2))) {
#if ULONG_MAX == 0xFFFFFFFF
if (oflow1 != 0 && oflow1 == oflow2 && dval1 - dval2 == 0. &&
((oflow1 == 1 && dval1 > 9007199254740991. /*0x1FFFFFFFFFFFFF*/)
|| (oflow1 == -1 && dval1 < -9007199254740991.))) {
#else
if (oflow1 != 0 && oflow1 == oflow2 && dval1 - dval2 == 0.) {
#endif
/* both values are integers overflown to the same side, and the
* double comparison may have resulted in crucial accuracy lost */
goto string_cmp;
@@ -2091,13 +2098,13 @@ static int hash_zval_compare_function(const zval **z1, const zval **z2 TSRMLS_DC
ZEND_API int zend_compare_symbol_tables_i(HashTable *ht1, HashTable *ht2 TSRMLS_DC) /* {{{ */
{
return zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC);
return ht1 == ht2 ? 0 : zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC);
}
/* }}} */
ZEND_API void zend_compare_symbol_tables(zval *result, HashTable *ht1, HashTable *ht2 TSRMLS_DC) /* {{{ */
{
ZVAL_LONG(result, zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC));
ZVAL_LONG(result, ht1 == ht2 ? 0 : zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC));
}
/* }}} */
+2 -2
View File
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=5
PHP_MINOR_VERSION=4
PHP_RELEASE_VERSION=4
PHP_EXTRA_VERSION="-dev"
PHP_RELEASE_VERSION=5
PHP_EXTRA_VERSION=""
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
+3 -3
View File
@@ -42,7 +42,7 @@ void php_com_throw_exception(HRESULT code, char *message TSRMLS_DC)
}
}
PHPAPI void php_com_wrap_dispatch(zval *z, IDispatch *disp,
PHP_COM_DOTNET_API void php_com_wrap_dispatch(zval *z, IDispatch *disp,
int codepage TSRMLS_DC)
{
php_com_dotnet_object *obj;
@@ -65,7 +65,7 @@ PHPAPI void php_com_wrap_dispatch(zval *z, IDispatch *disp,
z->value.obj.handlers = &php_com_object_handlers;
}
PHPAPI void php_com_wrap_variant(zval *z, VARIANT *v,
PHP_COM_DOTNET_API void php_com_wrap_variant(zval *z, VARIANT *v,
int codepage TSRMLS_DC)
{
php_com_dotnet_object *obj;
@@ -92,7 +92,7 @@ PHPAPI void php_com_wrap_variant(zval *z, VARIANT *v,
/* this is a convenience function for fetching a particular
* element from a (possibly multi-dimensional) safe array */
PHPAPI int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC)
PHP_COM_DOTNET_API int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC)
{
UINT dims;
LONG lbound, ubound;
+2 -2
View File
@@ -30,7 +30,7 @@
#include "php_com_dotnet_internal.h"
PHPAPI OLECHAR *php_com_string_to_olestring(char *string, uint string_len, int codepage TSRMLS_DC)
PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string, uint string_len, int codepage TSRMLS_DC)
{
OLECHAR *olestring = NULL;
DWORD flags = codepage == CP_UTF8 ? 0 : MB_PRECOMPOSED | MB_ERR_INVALID_CHARS;
@@ -65,7 +65,7 @@ PHPAPI OLECHAR *php_com_string_to_olestring(char *string, uint string_len, int c
return olestring;
}
PHPAPI char *php_com_olestring_to_string(OLECHAR *olestring, uint *string_len, int codepage TSRMLS_DC)
PHP_COM_DOTNET_API char *php_com_olestring_to_string(OLECHAR *olestring, uint *string_len, int codepage TSRMLS_DC)
{
char *string;
uint length = 0;
+1 -1
View File
@@ -268,7 +268,7 @@ static void istream_destructor(php_istream *stm TSRMLS_DC)
}
/* }}} */
PHPAPI IStream *php_com_wrapper_export_stream(php_stream *stream TSRMLS_DC)
PHP_COM_DOTNET_API IStream *php_com_wrapper_export_stream(php_stream *stream TSRMLS_DC)
{
php_istream *stm = (php_istream*)CoTaskMemAlloc(sizeof(*stm));
+3 -3
View File
@@ -35,7 +35,7 @@
* b) a CLSID, major, minor e.g. "{00000200-0000-0010-8000-00AA006D2EA4},2,0"
* c) a Type Library name e.g. "Microsoft OLE DB ActiveX Data Objects 1.0 Library"
*/
PHPAPI ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC)
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC)
{
ITypeLib *TL = NULL;
char *strtok_buf, *major, *minor;
@@ -153,7 +153,7 @@ PHPAPI ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_D
}
/* Given a type-library, merge it into the current engine state */
PHPAPI int php_com_import_typelib(ITypeLib *TL, int mode, int codepage TSRMLS_DC)
PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode, int codepage TSRMLS_DC)
{
int i, j, interfaces;
TYPEKIND pTKind;
@@ -228,7 +228,7 @@ void php_com_typelibrary_dtor(void *pDest)
ITypeLib_Release(*Lib);
}
PHPAPI ITypeLib *php_com_load_typelib_via_cache(char *search_string,
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib_via_cache(char *search_string,
int codepage, int *cached TSRMLS_DC)
{
ITypeLib **TLp;
+3 -3
View File
@@ -98,7 +98,7 @@ bogus:
}
}
PHPAPI void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC)
PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC)
{
OLECHAR *olestring;
php_com_dotnet_object *obj;
@@ -166,7 +166,7 @@ PHPAPI void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_D
}
}
PHPAPI int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC)
PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC)
{
OLECHAR *olestring = NULL;
int ret = SUCCESS;
@@ -258,7 +258,7 @@ PHPAPI int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC
}
PHPAPI int php_com_copy_variant(VARIANT *dstvar, VARIANT *srcvar TSRMLS_DC)
PHP_COM_DOTNET_API int php_com_copy_variant(VARIANT *dstvar, VARIANT *srcvar TSRMLS_DC)
{
int ret = SUCCESS;
+2 -2
View File
@@ -578,7 +578,7 @@ static void disp_destructor(php_dispatchex *disp TSRMLS_DC)
CoTaskMemFree(disp);
}
PHPAPI IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid,
PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid,
HashTable *id_to_name TSRMLS_DC)
{
php_dispatchex *disp = disp_constructor(val TSRMLS_CC);
@@ -617,7 +617,7 @@ PHPAPI IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid,
return (IDispatch*)disp;
}
PHPAPI IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC)
PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC)
{
php_dispatchex *disp = NULL;
+8
View File
@@ -28,6 +28,14 @@ extern zend_module_entry com_dotnet_module_entry;
#include "TSRM.h"
#endif
#ifdef PHP_WIN32
# define PHP_COM_DOTNET_API __declspec(dllexport)
#elif defined(__GNUC__) && __GNUC__ >= 4
# define PHP_COM_DOTNET_API __attribute__ ((visibility("default")))
#else
# define PHP_COM_DOTNET_API
#endif
PHP_MINIT_FUNCTION(com_dotnet);
PHP_MSHUTDOWN_FUNCTION(com_dotnet);
PHP_RINIT_FUNCTION(com_dotnet);
+14 -14
View File
@@ -84,9 +84,9 @@ zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *objec
int php_com_saproxy_create(zval *com_object, zval *proxy_out, zval *index TSRMLS_DC);
/* com_olechar.c */
PHPAPI char *php_com_olestring_to_string(OLECHAR *olestring,
PHP_COM_DOTNET_API char *php_com_olestring_to_string(OLECHAR *olestring,
uint *string_len, int codepage TSRMLS_DC);
PHPAPI OLECHAR *php_com_string_to_olestring(char *string,
PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string,
uint string_len, int codepage TSRMLS_DC);
@@ -112,8 +112,8 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, char *name, int namelen,
/* com_wrapper.c */
int php_com_wrapper_minit(INIT_FUNC_ARGS);
PHPAPI IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid, HashTable *id_to_name TSRMLS_DC);
PHPAPI IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC);
PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid, HashTable *id_to_name TSRMLS_DC);
PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC);
/* com_persist.c */
int php_com_persist_minit(INIT_FUNC_ARGS);
@@ -147,10 +147,10 @@ PHP_FUNCTION(variant_get_type);
PHP_FUNCTION(variant_set_type);
PHP_FUNCTION(variant_cast);
PHPAPI void php_com_variant_from_zval_with_type(VARIANT *v, zval *z, VARTYPE type, int codepage TSRMLS_DC);
PHPAPI void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC);
PHPAPI int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC);
PHPAPI int php_com_copy_variant(VARIANT *dst, VARIANT *src TSRMLS_DC);
PHP_COM_DOTNET_API void php_com_variant_from_zval_with_type(VARIANT *v, zval *z, VARTYPE type, int codepage TSRMLS_DC);
PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC);
PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC);
PHP_COM_DOTNET_API int php_com_copy_variant(VARIANT *dst, VARIANT *src TSRMLS_DC);
/* com_dotnet.c */
PHP_FUNCTION(com_dotnet_create_instance);
@@ -159,17 +159,17 @@ void php_com_dotnet_mshutdown(TSRMLS_D);
/* com_misc.c */
void php_com_throw_exception(HRESULT code, char *message TSRMLS_DC);
PHPAPI void php_com_wrap_dispatch(zval *z, IDispatch *disp,
PHP_COM_DOTNET_API void php_com_wrap_dispatch(zval *z, IDispatch *disp,
int codepage TSRMLS_DC);
PHPAPI void php_com_wrap_variant(zval *z, VARIANT *v,
PHP_COM_DOTNET_API void php_com_wrap_variant(zval *z, VARIANT *v,
int codepage TSRMLS_DC);
PHPAPI int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC);
PHP_COM_DOTNET_API int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC);
/* com_typeinfo.c */
PHPAPI ITypeLib *php_com_load_typelib_via_cache(char *search_string,
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib_via_cache(char *search_string,
int codepage, int *cached TSRMLS_DC);
PHPAPI ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC);
PHPAPI int php_com_import_typelib(ITypeLib *TL, int mode,
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC);
PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode,
int codepage TSRMLS_DC);
void php_com_typelibrary_dtor(void *pDest);
ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj, char *dispname, int sink TSRMLS_DC);
+25
View File
@@ -0,0 +1,25 @@
--TEST--
Bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction)
--SKIPIF--
<?php if (!extension_loaded("curl")) print "skip";
if(substr(PHP_OS, 0, 3) != 'WIN' )
die("skip Not Valid for Linux");
?>
--INI--
open_basedir="c:/tmp"
--FILE--
<?php
$ch = curl_init();
var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, ""));
var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, "c:/tmp/foo"));
var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, "c:/xxx/bar"));
curl_close($ch);
?>
--EXPECTF--
%a
Warning: curl_setopt(): open_basedir restriction in effect. File(c:/tmp/foo) is not within the allowed path(s): (c:/tmp) in %sbug61948-win32.php on line %d
bool(false)
Warning: curl_setopt(): open_basedir restriction in effect. File(c:/xxx/bar) is not within the allowed path(s): (c:/tmp) in %sbug61948-win32.php on line %d
bool(false)
+4 -1
View File
@@ -1,7 +1,10 @@
--TEST--
Bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction)
--SKIPIF--
<?php if (!extension_loaded("curl")) print "skip"; ?>
<?php if (!extension_loaded("curl")) print "skip";
if(substr(PHP_OS, 0, 3) == 'WIN' )
die("skip Not Valid for Windows");
?>
--INI--
open_basedir="/tmp"
--FILE--
+1 -1
View File
@@ -216,7 +216,7 @@ static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs,
if (Z_TYPE(handler) == IS_STRING) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call handler %s()", Z_STRVAL_P(&handler));
}
/* retval is == NULL, when an exception occured, don't report anything, because PHP itself will handle that */
/* retval is == NULL, when an exception occurred, don't report anything, because PHP itself will handle that */
} else if (retval == NULL) {
} else {
if (retval->type == IS_OBJECT && instanceof_function( Z_OBJCE_P(retval), dom_node_class_entry TSRMLS_CC)) {
+5 -1
View File
@@ -3254,7 +3254,7 @@ static void exif_process_APP12(image_info_type *ImageInfo, char *buffer, size_t
if ((l1 = php_strnlen(buffer+2, length-2)) > 0) {
exif_iif_add_tag(ImageInfo, SECTION_APP12, "Company", TAG_NONE, TAG_FMT_STRING, l1, buffer+2 TSRMLS_CC);
if (length > 2+l1+1) {
l2 = php_strnlen(buffer+2+l1+1, length-2-l1+1);
l2 = php_strnlen(buffer+2+l1+1, length-2-l1-1);
exif_iif_add_tag(ImageInfo, SECTION_APP12, "Info", TAG_NONE, TAG_FMT_STRING, l2, buffer+2+l1+1 TSRMLS_CC);
}
}
@@ -3404,6 +3404,10 @@ static int exif_scan_JPEG_header(image_info_type *ImageInfo TSRMLS_DC)
case M_SOF13:
case M_SOF14:
case M_SOF15:
if ((itemlen - 2) < 6) {
return FALSE;
}
exif_process_SOFn(Data, marker, &sof_info);
ImageInfo->Width = sof_info.width;
ImageInfo->Height = sof_info.height;
+50 -74
View File
@@ -1,6 +1,6 @@
diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
--- libmagic.orig/apprentice.c 2012-04-22 19:30:43.182305355 +0800
+++ libmagic/apprentice.c 2012-04-22 19:28:57.346309536 +0800
--- libmagic.orig/apprentice.c 2012-05-29 14:40:41.710960045 +0200
+++ libmagic/apprentice.c 2012-04-22 18:57:16.215980866 +0200
@@ -29,6 +29,8 @@
* apprentice - make one pass through /etc/magic, learning its secrets.
*/
@@ -729,8 +729,8 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
m->str_flags = swap4(m->str_flags);
}
diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
--- libmagic.orig/ascmagic.c 2012-04-22 19:30:43.182305355 +0800
+++ libmagic/ascmagic.c 2012-04-22 19:28:57.330309533 +0800
--- libmagic.orig/ascmagic.c 2012-05-29 14:40:41.710960045 +0200
+++ libmagic/ascmagic.c 2012-04-22 18:57:16.215980866 +0200
@@ -139,10 +139,8 @@
/* malloc size is a conservative overestimate; could be
improved, or at least realloced after conversion. */
@@ -755,8 +755,8 @@ diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
return rv;
}
diff -u libmagic.orig/cdf.c libmagic/cdf.c
--- libmagic.orig/cdf.c 2012-04-22 19:30:43.182305355 +0800
+++ libmagic/cdf.c 2012-04-22 19:28:57.370309531 +0800
--- libmagic.orig/cdf.c 2012-05-29 14:40:41.710960045 +0200
+++ libmagic/cdf.c 2012-04-22 18:57:16.219978162 +0200
@@ -43,7 +43,17 @@
#include <err.h>
#endif
@@ -819,8 +819,8 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
(void)fprintf(stderr, "timestamp %s\n", buf);
} else {
diff -u libmagic.orig/cdf.h libmagic/cdf.h
--- libmagic.orig/cdf.h 2012-04-22 19:30:43.182305355 +0800
+++ libmagic/cdf.h 2012-04-22 19:28:57.370309531 +0800
--- libmagic.orig/cdf.h 2012-05-29 14:40:41.710960045 +0200
+++ libmagic/cdf.h 2012-04-22 18:57:16.219978162 +0200
@@ -35,7 +35,7 @@
#ifndef _H_CDF_
#define _H_CDF_
@@ -857,8 +857,8 @@ diff -u libmagic.orig/cdf.h libmagic/cdf.h
void cdf_swap_header(cdf_header_t *);
void cdf_unpack_header(cdf_header_t *, char *);
diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
--- libmagic.orig/cdf_time.c 2012-04-22 19:30:43.182305355 +0800
+++ libmagic/cdf_time.c 2012-04-22 19:28:57.326309537 +0800
--- libmagic.orig/cdf_time.c 2012-05-29 14:40:41.710960045 +0200
+++ libmagic/cdf_time.c 2012-04-22 18:57:16.219978162 +0200
@@ -96,7 +96,7 @@
}
@@ -916,8 +916,8 @@ diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
static const char *ref = "Sat Apr 23 01:30:00 1977";
char *p, *q;
diff -u libmagic.orig/compress.c libmagic/compress.c
--- libmagic.orig/compress.c 2012-04-22 19:30:43.182305355 +0800
+++ libmagic/compress.c 2012-04-22 19:28:57.314309548 +0800
--- libmagic.orig/compress.c 2012-05-29 14:40:41.710960045 +0200
+++ libmagic/compress.c 2012-04-22 18:57:16.219978162 +0200
@@ -32,6 +32,7 @@
* uncompress(method, old, n, newch) - uncompress old into new,
* using method, return sizeof new
@@ -1079,8 +1079,8 @@ diff -u libmagic.orig/compress.c libmagic/compress.c
-#endif
+#endif /* if PHP_FILEINFO_UNCOMPRESS */
diff -u libmagic.orig/file.h libmagic/file.h
--- libmagic.orig/file.h 2012-04-22 19:30:43.186305188 +0800
+++ libmagic/file.h 2012-04-22 19:49:58.922256776 +0800
--- libmagic.orig/file.h 2012-05-29 14:40:41.710960045 +0200
+++ libmagic/file.h 2012-04-22 18:57:16.219978162 +0200
@@ -33,11 +33,9 @@
#ifndef __file_h__
#define __file_h__
@@ -1252,8 +1252,8 @@ diff -u libmagic.orig/file.h libmagic/file.h
+
#endif /* __file_h__ */
diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
--- libmagic.orig/fsmagic.c 2012-04-22 19:30:43.186305188 +0800
+++ libmagic/fsmagic.c 2012-04-22 19:28:57.298309521 +0800
--- libmagic.orig/fsmagic.c 2012-05-29 14:40:41.710960045 +0200
+++ libmagic/fsmagic.c 2012-04-22 18:57:16.219978162 +0200
@@ -59,27 +59,21 @@
# define minor(dev) ((dev) & 0xff)
#endif
@@ -1577,8 +1577,8 @@ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
/*
diff -u libmagic.orig/funcs.c libmagic/funcs.c
--- libmagic.orig/funcs.c 2012-04-22 19:30:43.186305188 +0800
+++ libmagic/funcs.c 2012-04-22 19:28:57.370309531 +0800
--- libmagic.orig/funcs.c 2012-05-29 14:40:41.710960045 +0200
+++ libmagic/funcs.c 2012-04-22 18:57:16.219978162 +0200
@@ -41,52 +41,42 @@
#if defined(HAVE_WCTYPE_H)
#include <wctype.h>
@@ -1872,11 +1872,9 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
+ return rep_cnt;
}
+
Only in libmagic.orig: funcs.c.orig
Only in libmagic.orig: funcs.c.rej
diff -u libmagic.orig/magic.c libmagic/magic.c
--- libmagic.orig/magic.c 2012-04-22 19:30:43.186305188 +0800
+++ libmagic/magic.c 2012-04-22 19:28:57.370309531 +0800
--- libmagic.orig/magic.c 2012-05-29 14:40:41.710960045 +0200
+++ libmagic/magic.c 2012-04-22 18:57:16.219978162 +0200
@@ -25,11 +25,6 @@
* SUCH DAMAGE.
*/
@@ -2253,8 +2251,8 @@ diff -u libmagic.orig/magic.c libmagic/magic.c
public const char *
magic_error(struct magic_set *ms)
diff -u libmagic.orig/magic.h libmagic/magic.h
--- libmagic.orig/magic.h 2012-04-22 19:30:43.190305058 +0800
+++ libmagic/magic.h 2012-04-22 19:28:57.326309537 +0800
--- libmagic.orig/magic.h 2012-05-29 14:40:41.710960045 +0200
+++ libmagic/magic.h 2012-04-22 18:57:16.219978162 +0200
@@ -85,6 +85,7 @@
const char *magic_getpath(const char *, int);
@@ -2272,8 +2270,8 @@ diff -u libmagic.orig/magic.h libmagic/magic.h
int magic_errno(magic_t);
diff -u libmagic.orig/print.c libmagic/print.c
--- libmagic.orig/print.c 2012-04-22 19:30:43.190305058 +0800
+++ libmagic/print.c 2012-04-22 19:28:57.326309537 +0800
--- libmagic.orig/print.c 2012-05-29 14:40:41.710960045 +0200
+++ libmagic/print.c 2012-05-29 14:34:03.770376387 +0200
@@ -29,6 +29,9 @@
* print.c - debugging printout routines
*/
@@ -2467,8 +2465,8 @@ diff -u libmagic.orig/print.c libmagic/print.c
protected const char *
diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
--- libmagic.orig/readcdf.c 2012-04-22 19:30:43.190305058 +0800
+++ libmagic/readcdf.c 2012-04-22 19:28:57.326309537 +0800
--- libmagic.orig/readcdf.c 2012-05-29 14:40:41.710960045 +0200
+++ libmagic/readcdf.c 2012-04-22 18:57:16.219978162 +0200
@@ -30,7 +30,11 @@
#endif
@@ -2515,8 +2513,8 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
if ((ec = strchr(c, '\n')) != NULL)
*ec = '\0';
diff -u libmagic.orig/readelf.c libmagic/readelf.c
--- libmagic.orig/readelf.c 2012-04-22 19:30:43.190305058 +0800
+++ libmagic/readelf.c 2012-04-22 19:28:57.378309534 +0800
--- libmagic.orig/readelf.c 2012-05-29 14:40:41.710960045 +0200
+++ libmagic/readelf.c 2012-04-22 18:57:16.219978162 +0200
@@ -49,7 +49,7 @@
off_t, int *, int);
private int doshn(struct magic_set *, int, int, int, off_t, int, size_t,
@@ -2672,8 +2670,8 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
if (fstat(fd, &st) == -1) {
diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
--- libmagic.orig/softmagic.c 2012-04-22 19:30:43.194304945 +0800
+++ libmagic/softmagic.c 2012-04-22 19:28:57.286309597 +0800
--- libmagic.orig/softmagic.c 2012-05-29 14:40:41.710960045 +0200
+++ libmagic/softmagic.c 2012-05-29 14:34:31.900417647 +0200
@@ -41,6 +41,11 @@
#include <stdlib.h>
#include <time.h>
@@ -2860,7 +2858,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
}
}
@@ -1669,6 +1642,65 @@
@@ -1669,6 +1642,42 @@
return file_strncmp(a, b, len, flags);
}
@@ -2876,29 +2874,6 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
+
+ for (i=0; i<Z_STRLEN_P(pattern); i++, j++) {
+ switch (Z_STRVAL_P(pattern)[i]) {
+ case '?':
+ t[j] = '.';
+ break;
+ case '*':
+ t[j++] = '.';
+ t[j] = '*';
+ break;
+ case '.':
+ t[j++] = '\\';
+ t[j] = '.';
+ break;
+ case '\\':
+ t[j++] = '\\';
+ t[j] = '\\';
+ break;
+ case '(':
+ t[j++] = '\\';
+ t[j] = '(';
+ break;
+ case ')':
+ t[j++] = '\\';
+ t[j] = ')';
+ break;
+ case '~':
+ t[j++] = '\\';
+ t[j] = '~';
@@ -2926,7 +2901,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
private int
magiccheck(struct magic_set *ms, struct magic *m)
{
@@ -1825,67 +1857,163 @@
@@ -1825,67 +1834,163 @@
break;
}
case FILE_REGEX: {
@@ -2937,23 +2912,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
- if (ms->search.s == NULL)
- return 0;
-
+ zval *pattern;
+ int options = 0;
+ pcre_cache_entry *pce;
+ TSRMLS_FETCH();
+
+ MAKE_STD_ZVAL(pattern);
+ ZVAL_STRINGL(pattern, (char *)m->value.s, m->vallen, 0);
+
+ options |= PCRE_MULTILINE;
+
+ if (m->str_flags & STRING_IGNORE_CASE) {
+ options |= PCRE_CASELESS;
+ }
+
+ convert_libmagic_pattern(pattern, options);
+
l = 0;
- l = 0;
- rc = regcomp(&rx, m->value.s,
- REG_EXTENDED|REG_NEWLINE|
- ((m->str_flags & STRING_IGNORE_CASE) ? REG_ICASE : 0));
@@ -2970,6 +2929,23 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
- size_t l = ms->search.s_len - 1;
- char c = ms->search.s[l];
- ((char *)(intptr_t)ms->search.s)[l] = '\0';
+ zval *pattern;
+ int options = 0;
+ pcre_cache_entry *pce;
+ TSRMLS_FETCH();
+
+ MAKE_STD_ZVAL(pattern);
+ ZVAL_STRINGL(pattern, (char *)m->value.s, m->vallen, 0);
+
+ options |= PCRE_MULTILINE;
+
+ if (m->str_flags & STRING_IGNORE_CASE) {
+ options |= PCRE_CASELESS;
+ }
+
+ convert_libmagic_pattern(pattern, options);
+
+ l = v = 0;
+#if (PHP_MAJOR_VERSION < 6)
+ if ((pce = pcre_get_compiled_regex_cache(Z_STRVAL_P(pattern), Z_STRLEN_P(pattern) TSRMLS_CC)) == NULL) {
#else
+1 -24
View File
@@ -1654,29 +1654,6 @@ convert_libmagic_pattern(zval *pattern, int options)
for (i=0; i<Z_STRLEN_P(pattern); i++, j++) {
switch (Z_STRVAL_P(pattern)[i]) {
case '?':
t[j] = '.';
break;
case '*':
t[j++] = '.';
t[j] = '*';
break;
case '.':
t[j++] = '\\';
t[j] = '.';
break;
case '\\':
t[j++] = '\\';
t[j] = '\\';
break;
case '(':
t[j++] = '\\';
t[j] = '(';
break;
case ')':
t[j++] = '\\';
t[j] = ')';
break;
case '~':
t[j++] = '\\';
t[j] = '~';
@@ -1873,7 +1850,7 @@ magiccheck(struct magic_set *ms, struct magic *m)
convert_libmagic_pattern(pattern, options);
l = 0;
l = v = 0;
#if (PHP_MAJOR_VERSION < 6)
if ((pce = pcre_get_compiled_regex_cache(Z_STRVAL_P(pattern), Z_STRLEN_P(pattern) TSRMLS_CC)) == NULL) {
#else
+3 -1
View File
@@ -18,9 +18,11 @@ ksort($results);
var_dump($results);
?>
--EXPECTF--
array(6) {
array(7) {
["%s/resources/dir.zip"]=>
string(15) "application/zip"
["%s/resources/test.awk"]=>
string(10) "text/plain"
["%s/resources/test.bmp"]=>
string(14) "image/x-ms-bmp"
["%s/resources/test.gif"]=>
@@ -0,0 +1,36 @@
--TEST--
Test finfo_file() function : regex rules
--SKIPIF--
<?php require_once(dirname(__FILE__) . '/skipif.inc');
if (substr(PHP_OS, 0, 3) != 'WIN') {
die('skip.. only for Windows');
}
?>
--FILE--
<?php
/**
* Works with the unix file command:
* $ file -m magic resources/test.awk
* resources/test.awk: awk script, ASCII text
*/
$magicFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'magic';
$finfo = finfo_open( FILEINFO_MIME, $magicFile );
echo "*** Testing finfo_file() : regex rules ***\n";
// Calling finfo_file() with all possible arguments
$file = __DIR__ . '/resources/test.awk';
var_dump( finfo_file( $finfo, $file ) );
var_dump( finfo_file( $finfo, $file, FILEINFO_CONTINUE ) );
// Windows uses libfileinfo 1.0.5-dev
// this may be causing the slightly different output from the first
// finfo_file() call
?>
===DONE===
--EXPECTF--
*** Testing finfo_file() : regex rules ***
string(10) "text/plain"
string(22) "awk script, ASCII text"
===DONE===
+32
View File
@@ -0,0 +1,32 @@
--TEST--
Test finfo_file() function : regex rules
--SKIPIF--
<?php require_once(dirname(__FILE__) . '/skipif.inc');
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip.. only for Non Windows Systems');
}
?>
--FILE--
<?php
/**
* Works with the unix file command:
* $ file -m magic resources/test.awk
* resources/test.awk: awk script, ASCII text
*/
$magicFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'magic';
$finfo = finfo_open( FILEINFO_MIME, $magicFile );
echo "*** Testing finfo_file() : regex rules ***\n";
// Calling finfo_file() with all possible arguments
$file = __DIR__ . '/resources/test.awk';
var_dump( finfo_file( $finfo, $file ) );
var_dump( finfo_file( $finfo, $file, FILEINFO_CONTINUE ) );
?>
===DONE===
--EXPECTF--
*** Testing finfo_file() : regex rules ***
string(28) "text/plain; charset=us-ascii"
string(22) "awk script, ASCII text"
===DONE===
@@ -0,0 +1,59 @@
--TEST--
Test finfo_open() function : error functionality
--SKIPIF--
<?php require_once(dirname(__FILE__) . '/skipif.inc');
if(substr(PHP_OS, 0, 3) != 'WIN' )
die("skip Not Valid for Linux");
?>
--FILE--
<?php
/* Prototype : resource finfo_open([int options [, string arg]])
* Description: Create a new fileinfo resource.
* Source code: ext/fileinfo/fileinfo.c
* Alias to functions:
*/
$magicFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'magic';
echo "*** Testing finfo_open() : error functionality ***\n";
// on 5_4, this line generates additional warning messages that 5_3 does not. functionally, it should be fine (should pass)
var_dump( finfo_open( FILEINFO_MIME, 'foobarfile' ) );
var_dump( finfo_open( array(), $magicFile ) );
var_dump( finfo_open( FILEINFO_MIME, $magicFile, 'extraArg' ) );
var_dump( finfo_open( PHP_INT_MAX - 1, $magicFile ) );
var_dump( finfo_open( 'foobar' ) );
var_dump( new finfo('foobar') );
?>
===DONE===
--EXPECTF--
*** Testing finfo_open() : error functionality ***
Warning: finfo_open(%sfoobarfile): failed to open stream: No such file or directory in %sfinfo_open_error-win32.php on line %d
Warning: finfo_open(%sfoobarfile): failed to open stream: No such file or directory in %sfinfo_open_error-win32.php on line %d
Warning: finfo_open(): Failed to load magic database at '%sfoobarfile'. in %sfinfo_open_error-win32.php on line %d
bool(false)
Warning: finfo_open() expects parameter 1 to be long, array given in %sfinfo_open_error-win32.php on line %d
bool(false)
Warning: finfo_open() expects at most 2 parameters, 3 given in %sfinfo_open_error-win32.php on line %d
bool(false)
Warning: finfo_open(%smagic): failed to open stream: No such file or directory in %sfinfo_open_error-win32.php on line %d
Warning: finfo_open(%smagic): failed to open stream: No such file or directory in %sfinfo_open_error-win32.php on line %d
Warning: finfo_open(): Failed to load magic database at '%smagic'. in %sfinfo_open_error-win32.php on line %d
bool(false)
Warning: finfo_open() expects parameter 1 to be long, string given in %sfinfo_open_error-win32.php on line %d
bool(false)
Warning: finfo::finfo() expects parameter 1 to be long, string given in %sfinfo_open_error-win32.php on line %d
NULL
===DONE===
+4 -1
View File
@@ -1,7 +1,10 @@
--TEST--
Test finfo_open() function : error functionality
--SKIPIF--
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
<?php require_once(dirname(__FILE__) . '/skipif.inc');
if(substr(PHP_OS, 0, 3) == 'WIN' )
die("skip Not Valid for Windows");
?>
--FILE--
<?php
/* Prototype : resource finfo_open([int options [, string arg]])
+1
View File
@@ -0,0 +1 @@
BEGIN { print "START" }
+90
View File
@@ -0,0 +1,90 @@
--TEST--
gmp_gcdext() basic tests
--SKIPIF--
<?php if (!extension_loaded("gmp")) print "skip";
if(substr(PHP_OS, 0, 3) != 'WIN' ) {
die('skip windows only test');
}
?>
--FILE--
<?php
$n = gmp_init("34293864345");
$n1 = gmp_init("23434293864345");
$a = array(
array(123,45),
array(4341,9734),
array(23487,333),
array(-234234,-123123),
array(-100,-2234),
array(345,"34587345"),
array(345,"0"),
array("345556456",345873),
array("34545345556456","323432445873"),
array($n, $n1),
);
foreach ($a as $val) {
$r = gmp_gcdext($val[0],$val[1]);
var_dump(gmp_strval($r['g']));
var_dump(gmp_strval($r['s']));
var_dump(gmp_strval($r['t']));
}
var_dump(gmp_gcdext($val[0],array()));
var_dump(gmp_gcdext(array(),array()));
var_dump(gmp_gcdext(array(),array(),1));
var_dump(gmp_gcdext(array()));
var_dump(gmp_gcdext());
echo "Done\n";
?>
--EXPECTF--
string(1) "3"
string(2) "41"
string(4) "-112"
string(1) "1"
string(4) "-805"
string(3) "359"
string(1) "3"
string(2) "32"
string(5) "-2257"
string(4) "3003"
string(3) "-10"
string(2) "19"
string(1) "2"
string(2) "67"
string(2) "-3"
string(2) "15"
string(7) "-601519"
string(1) "6"
string(3) "345"
string(1) "1"
string(1) "0"
string(1) "1"
string(5) "84319"
string(9) "-84241831"
string(1) "1"
string(12) "167180205823"
string(15) "-17856272782919"
string(3) "195"
string(15) "-23387298979862"
string(11) "34225091793"
Warning: gmp_gcdext(): Unable to convert variable to GMP - wrong type in %s on line %d
bool(false)
Warning: gmp_gcdext(): Unable to convert variable to GMP - wrong type in %s on line %d
bool(false)
Warning: gmp_gcdext() expects exactly 2 parameters, 3 given in %s on line %d
NULL
Warning: gmp_gcdext() expects exactly 2 parameters, 1 given in %s on line %d
NULL
Warning: gmp_gcdext() expects exactly 2 parameters, 0 given in %s on line %d
NULL
Done
+5 -1
View File
@@ -1,7 +1,11 @@
--TEST--
gmp_gcdext() basic tests
--SKIPIF--
<?php if (!extension_loaded("gmp")) print "skip"; ?>
<?php if (!extension_loaded("gmp")) print "skip";
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip.. only for Non Windows Systems');
}
?>
--FILE--
<?php
+45
View File
@@ -0,0 +1,45 @@
--TEST--
gmp_nextprime()
--SKIPIF--
<?php if (!extension_loaded("gmp")) print "skip";
if(substr(PHP_OS, 0, 3) != 'WIN' ) {
die('skip windows only test');
}
?>
--FILE--
<?php
$n = gmp_nextprime(-1);
var_dump(gmp_strval($n));
$n = gmp_nextprime(0);
var_dump(gmp_strval($n));
$n = gmp_nextprime(-1000);
var_dump(gmp_strval($n));
$n = gmp_nextprime(1000);
var_dump(gmp_strval($n));
$n = gmp_nextprime(100000);
var_dump(gmp_strval($n));
$n = gmp_nextprime(array());
var_dump(gmp_strval($n));
$n = gmp_nextprime("");
var_dump(gmp_strval($n));
$n = gmp_nextprime(new stdclass());
var_dump(gmp_strval($n));
echo "Done\n";
?>
--EXPECTF--
string(1) "2"
string(1) "2"
string(4) "-997"
string(4) "1009"
string(6) "100003"
Warning: gmp_nextprime(): Unable to convert variable to GMP - wrong type in %s on line %d
string(1) "0"
string(1) "0"
Warning: gmp_nextprime(): Unable to convert variable to GMP - wrong type in %s on line %d
string(1) "0"
Done
+5 -1
View File
@@ -1,7 +1,11 @@
--TEST--
gmp_nextprime()
--SKIPIF--
<?php if (!extension_loaded("gmp")) print "skip"; ?>
<?php if (!extension_loaded("gmp")) print "skip";
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip.. only for Non Windows Systems');
}
?>
--FILE--
<?php
+66 -62
View File
@@ -190,7 +190,7 @@ typedef enum _php_iconv_enc_scheme_t {
#define PHP_ICONV_MIME_DECODE_STRICT (1<<0)
#define PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR (1<<1)
/* {{{ prototypes */
/* {{{ prototypes */
static php_iconv_err_t _php_iconv_appendl(smart_str *d, const char *s, size_t l, iconv_t cd);
static php_iconv_err_t _php_iconv_appendc(smart_str *d, const char c, iconv_t cd);
@@ -249,7 +249,7 @@ PHP_MINIT_FUNCTION(miconv)
{
static char buf[16];
snprintf(buf, sizeof(buf), "%d.%d",
((_libiconv_version >> 8) & 0x0f), (_libiconv_version & 0x0f));
((_libiconv_version >> 8) & 0x0f), (_libiconv_version & 0x0f));
version = buf;
}
#elif HAVE_GLIBC_ICONV
@@ -354,7 +354,7 @@ static int php_iconv_output_handler(void **nothing, php_output_context *output_c
if (mimetype != NULL && !(output_context->op & PHP_OUTPUT_HANDLER_CLEAN)) {
int len;
char *p = strstr(ICONVG(output_encoding), "//");
char *p = strstr(ICONVG(output_encoding), "//");
if (p) {
len = spprintf(&content_type, 0, "Content-Type:%.*s; charset=%.*s", mimetype_len ? mimetype_len : (int) strlen(mimetype), mimetype, (int)(p - ICONVG(output_encoding)), ICONVG(output_encoding));
@@ -375,7 +375,7 @@ static int php_iconv_output_handler(void **nothing, php_output_context *output_c
return SUCCESS;
}
/* {{{ _php_iconv_appendl() */
static php_iconv_err_t _php_iconv_appendl(smart_str *d, const char *s, size_t l, iconv_t cd)
{
@@ -400,7 +400,7 @@ static php_iconv_err_t _php_iconv_appendl(smart_str *d, const char *s, size_t l,
if (iconv(cd, (char **)&in_p, &in_left, (char **) &out_p, &out_left) == (size_t)-1) {
#if ICONV_SUPPORTS_ERRNO
switch (errno) {
switch (errno) {
case EINVAL:
return PHP_ICONV_ERR_ILLEGAL_CHAR;
@@ -415,7 +415,7 @@ static php_iconv_err_t _php_iconv_appendl(smart_str *d, const char *s, size_t l,
}
#else
if (prev_in_left == in_left) {
return PHP_ICONV_ERR_UNKNOWN;
return PHP_ICONV_ERR_UNKNOWN;
}
#endif
}
@@ -446,7 +446,7 @@ static php_iconv_err_t _php_iconv_appendl(smart_str *d, const char *s, size_t l,
#else
if (out_left != 0) {
return PHP_ICONV_ERR_UNKNOWN;
}
}
#endif
}
(d)->len += (buf_growth - out_left);
@@ -492,31 +492,35 @@ PHP_ICONV_API php_iconv_err_t php_iconv_string(const char *in_p, size_t in_len,
in_size = in_len;
cd = iconv_open(out_charset, in_charset);
if (cd == (iconv_t)(-1)) {
return PHP_ICONV_ERR_UNKNOWN;
}
out_buffer = (char *) emalloc(out_size + 1);
out_p = out_buffer;
#ifdef NETWARE
result = iconv(cd, (char **) &in_p, &in_size, (char **)
#else
result = iconv(cd, (const char **) &in_p, &in_size, (char **)
#endif
&out_p, &out_left);
if (result == (size_t)(-1)) {
efree(out_buffer);
return PHP_ICONV_ERR_UNKNOWN;
}
if (out_left < 8) {
out_buffer = (char *) erealloc(out_buffer, out_size + 8);
size_t pos = out_p - out_buffer;
out_buffer = (char *) safe_erealloc(out_buffer, out_size, 1, 8);
out_p = out_buffer+pos;
out_size += 7;
out_left += 7;
}
/* flush the shift-out sequences */
/* flush the shift-out sequences */
result = iconv(cd, NULL, NULL, &out_p, &out_left);
if (result == (size_t)(-1)) {
@@ -555,10 +559,10 @@ PHP_ICONV_API php_iconv_err_t php_iconv_string(const char *in_p, size_t in_len,
}
}
in_left= in_len;
out_left = in_len + 32; /* Avoid realloc() most cases */
out_left = in_len + 32; /* Avoid realloc() most cases */
out_size = 0;
bsz = out_left;
out_buf = (char *) emalloc(bsz+1);
out_buf = (char *) emalloc(bsz+1);
out_p = out_buf;
while (in_left > 0) {
@@ -573,14 +577,14 @@ PHP_ICONV_API php_iconv_err_t php_iconv_string(const char *in_p, size_t in_len,
out_p = out_buf = tmp_buf;
out_p += out_size;
out_left = bsz - out_size;
continue;
continue;
}
}
break;
}
if (result != (size_t)(-1)) {
/* flush the shift-out sequences */
/* flush the shift-out sequences */
for (;;) {
result = iconv(cd, NULL, NULL, (char **) &out_p, &out_left);
out_size = bsz - out_left;
@@ -592,7 +596,7 @@ PHP_ICONV_API php_iconv_err_t php_iconv_string(const char *in_p, size_t in_len,
if (errno == E2BIG) {
bsz += 16;
tmp_buf = (char *) erealloc(out_buf, bsz);
out_p = out_buf = tmp_buf;
out_p += out_size;
out_left = bsz - out_size;
@@ -684,7 +688,7 @@ static php_iconv_err_t _php_iconv_strlen(unsigned int *pretval, const char *str,
}
if (out_left > 0) {
cnt -= out_left / GENERIC_SUPERSET_NBYTES;
cnt -= out_left / GENERIC_SUPERSET_NBYTES;
}
#if ICONV_SUPPORTS_ERRNO
@@ -735,12 +739,12 @@ static php_iconv_err_t _php_iconv_substr(smart_str *pretval,
unsigned int cnt;
int total_len;
err = _php_iconv_strlen(&total_len, str, nbytes, enc);
if (err != PHP_ICONV_ERR_SUCCESS) {
return err;
}
if (len < 0) {
if ((len += (total_len - offset)) < 0) {
return PHP_ICONV_ERR_SUCCESS;
@@ -772,7 +776,7 @@ static php_iconv_err_t _php_iconv_substr(smart_str *pretval,
smart_str_0(pretval);
return PHP_ICONV_ERR_SUCCESS;
}
cd1 = iconv_open(GENERIC_SUPERSET_NAME, enc);
if (cd1 == (iconv_t)(-1)) {
@@ -857,7 +861,7 @@ static php_iconv_err_t _php_iconv_substr(smart_str *pretval,
if (cd2 != (iconv_t)NULL) {
iconv_close(cd2);
}
}
return err;
}
@@ -1042,7 +1046,7 @@ static php_iconv_err_t _php_iconv_strpos(unsigned int *pretval,
if (ndl_buf) {
efree(ndl_buf);
}
iconv_close(cd);
return err;
@@ -1089,7 +1093,7 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fn
if ((fname_nbytes + 2) >= max_line_len
|| (out_charset_len + 12) >= max_line_len) {
/* field name is too long */
err = PHP_ICONV_ERR_TOO_BIG;
err = PHP_ICONV_ERR_TOO_BIG;
goto out;
}
@@ -1131,7 +1135,7 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fn
char_cnt -= 2;
in_p = fval;
in_left = fval_nbytes;
in_left = fval_nbytes;
do {
size_t prev_in_left;
@@ -1142,8 +1146,8 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fn
smart_str_appendl(pretval, lfchars, lfchars_len);
smart_str_appendc(pretval, ' ');
char_cnt = max_line_len - 1;
}
}
smart_str_appendl(pretval, "=?", sizeof("=?") - 1);
char_cnt -= 2;
smart_str_appendl(pretval, out_charset, out_charset_len);
@@ -1195,7 +1199,7 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fn
goto out;
}
break;
default:
err = PHP_ICONV_ERR_UNKNOWN;
goto out;
@@ -1295,7 +1299,7 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fn
goto out;
}
break;
default:
err = PHP_ICONV_ERR_UNKNOWN;
goto out;
@@ -1372,7 +1376,7 @@ out:
}
if (encoded != NULL) {
efree(encoded);
}
}
if (buf != NULL) {
efree(buf);
}
@@ -1391,7 +1395,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
size_t str_left;
unsigned int scan_stat = 0;
const char *csname = NULL;
size_t csname_len;
size_t csname_len;
const char *encoded_text = NULL;
size_t encoded_text_len = 0;
const char *encoded_word = NULL;
@@ -1430,7 +1434,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
break;
case '\n':
scan_stat = 8;
scan_stat = 8;
break;
case '=': /* first letter of an encoded chunk */
@@ -1455,7 +1459,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
case 1: /* expecting a delimiter */
if (*p1 != '?') {
err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
if (err != PHP_ICONV_ERR_SUCCESS) {
goto out;
}
@@ -1470,7 +1474,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
csname = p1 + 1;
scan_stat = 2;
break;
case 2: /* expecting a charset name */
switch (*p1) {
case '?': /* normal delimiter: encoding scheme follows */
@@ -1480,7 +1484,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
case '*': /* new style delimiter: locale id follows */
scan_stat = 10;
break;
}
}
if (scan_stat != 2) {
char tmpbuf[80];
@@ -1493,7 +1497,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
if (csname_len > sizeof(tmpbuf) - 1) {
if ((mode & PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR)) {
err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
if (err != PHP_ICONV_ERR_SUCCESS) {
goto out;
}
@@ -1549,7 +1553,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
--str_left;
}
err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
if (err != PHP_ICONV_ERR_SUCCESS) {
goto out;
}
@@ -1608,12 +1612,12 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
}
}
break;
case 4: /* expecting a delimiter */
if (*p1 != '?') {
if ((mode & PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR)) {
/* pass the entire chunk through the converter */
err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
if (err != PHP_ICONV_ERR_SUCCESS) {
goto out;
}
@@ -1669,7 +1673,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
if (*p1 != '=') {
if ((mode & PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR)) {
/* pass the entire chunk through the converter */
err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
if (err != PHP_ICONV_ERR_SUCCESS) {
goto out;
}
@@ -1696,17 +1700,17 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
switch (*p1) {
default:
/* Handle non-RFC-compliant formats
*
*
* RFC2047 requires the character that comes right
* after an encoded word (chunk) to be a whitespace,
* while there are lots of broken implementations that
* generate such malformed headers that don't fulfill
* that requirement.
*/
if (!eos) {
*/
if (!eos) {
if ((mode & PHP_ICONV_MIME_DECODE_STRICT)) {
/* pass the entire chunk through the converter */
err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
if (err != PHP_ICONV_ERR_SUCCESS) {
goto out;
}
@@ -1738,7 +1742,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
if (decoded_text == NULL) {
if ((mode & PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR)) {
/* pass the entire chunk through the converter */
err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
if (err != PHP_ICONV_ERR_SUCCESS) {
goto out;
}
@@ -1761,7 +1765,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
if (err != PHP_ICONV_ERR_SUCCESS) {
if ((mode & PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR)) {
/* pass the entire chunk through the converter */
err = _php_iconv_appendl(pretval, encoded_word, (size_t)(p1 - encoded_word), cd_pl);
err = _php_iconv_appendl(pretval, encoded_word, (size_t)(p1 - encoded_word), cd_pl);
encoded_word = NULL;
if (err != PHP_ICONV_ERR_SUCCESS) {
break;
@@ -1956,7 +1960,7 @@ PHP_FUNCTION(iconv_strlen)
char *charset = ICONVG(internal_encoding);
int charset_len = 0;
char *str;
int str_len;
int str_len;
php_iconv_err_t err;
@@ -1972,7 +1976,7 @@ PHP_FUNCTION(iconv_strlen)
RETURN_FALSE;
}
err = _php_iconv_strlen(&retval, str, str_len, charset);
err = _php_iconv_strlen(&retval, str, str_len, charset);
_php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset TSRMLS_CC);
if (err == PHP_ICONV_ERR_SUCCESS) {
RETVAL_LONG(retval);
@@ -1989,7 +1993,7 @@ PHP_FUNCTION(iconv_substr)
char *charset = ICONVG(internal_encoding);
int charset_len = 0;
char *str;
int str_len;
int str_len;
long offset, length = 0;
php_iconv_err_t err;
@@ -2008,10 +2012,10 @@ PHP_FUNCTION(iconv_substr)
}
if (ZEND_NUM_ARGS() < 3) {
length = str_len;
length = str_len;
}
err = _php_iconv_substr(&retval, str, str_len, offset, length, charset);
err = _php_iconv_substr(&retval, str, str_len, offset, length, charset);
_php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset TSRMLS_CC);
if (err == PHP_ICONV_ERR_SUCCESS && str != NULL && retval.c != NULL) {
@@ -2029,7 +2033,7 @@ PHP_FUNCTION(iconv_strpos)
char *charset = ICONVG(internal_encoding);
int charset_len = 0;
char *haystk;
int haystk_len;
int haystk_len;
char *ndl;
int ndl_len;
long offset = 0;
@@ -2059,7 +2063,7 @@ PHP_FUNCTION(iconv_strpos)
}
err = _php_iconv_strpos(&retval, haystk, haystk_len, ndl, ndl_len,
offset, charset);
offset, charset);
_php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset TSRMLS_CC);
if (err == PHP_ICONV_ERR_SUCCESS && retval != (unsigned int)-1) {
@@ -2077,7 +2081,7 @@ PHP_FUNCTION(iconv_strrpos)
char *charset = ICONVG(internal_encoding);
int charset_len = 0;
char *haystk;
int haystk_len;
int haystk_len;
char *ndl;
int ndl_len;
@@ -2101,7 +2105,7 @@ PHP_FUNCTION(iconv_strrpos)
}
err = _php_iconv_strpos(&retval, haystk, haystk_len, ndl, ndl_len,
-1, charset);
-1, charset);
_php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset TSRMLS_CC);
if (err == PHP_ICONV_ERR_SUCCESS && retval != (unsigned int)-1) {
@@ -2241,7 +2245,7 @@ PHP_FUNCTION(iconv_mime_decode)
char *charset = ICONVG(internal_encoding);
int charset_len = 0;
long mode = 0;
smart_str retval = {0};
php_iconv_err_t err;
@@ -2282,7 +2286,7 @@ PHP_FUNCTION(iconv_mime_decode_headers)
char *charset = ICONVG(internal_encoding);
int charset_len = 0;
long mode = 0;
php_iconv_err_t err = PHP_ICONV_ERR_SUCCESS;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ls",
@@ -2350,14 +2354,14 @@ PHP_FUNCTION(iconv_mime_decode_headers)
zend_hash_update(Z_ARRVAL_P(return_value), header_name, header_name_len, (void *)&new_elem, sizeof(new_elem), NULL);
elem = &new_elem;
}
}
add_next_index_stringl(*elem, header_value, header_value_len, 1);
} else {
add_assoc_stringl_ex(return_value, header_name, header_name_len, header_value, header_value_len, 1);
}
}
encoded_str_len -= next_pos - encoded_str;
encoded_str = next_pos;
encoded_str = next_pos;
smart_str_free(&decoded_header);
}
@@ -2378,7 +2382,7 @@ PHP_NAMED_FUNCTION(php_if_iconv)
size_t out_len;
int in_charset_len = 0, out_charset_len = 0, in_buffer_len;
php_iconv_err_t err;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss",
&in_charset, &in_charset_len, &out_charset, &out_charset_len, &in_buffer, &in_buffer_len) == FAILURE)
return;
@@ -2390,7 +2394,7 @@ PHP_NAMED_FUNCTION(php_if_iconv)
err = php_iconv_string(in_buffer, (size_t)in_buffer_len,
&out_buffer, &out_len, out_charset, in_charset);
_php_iconv_show_error(err, out_charset, in_charset TSRMLS_CC);
_php_iconv_show_error(err, out_charset, in_charset TSRMLS_CC);
if (err == PHP_ICONV_ERR_SUCCESS && out_buffer != NULL) {
RETVAL_STRINGL(out_buffer, out_len, 0);
} else {
@@ -2539,7 +2543,7 @@ static int php_iconv_stream_filter_append_bucket(
icnt = buf_len;
}
out_buf_size = ocnt = prev_ocnt = initial_out_buf_size;
out_buf_size = ocnt = prev_ocnt = initial_out_buf_size;
if (NULL == (out_buf = pemalloc(out_buf_size, persistent))) {
return FAILURE;
}
+1 -1
View File
@@ -7,7 +7,7 @@ require_once(dirname(__FILE__).'/skipif.inc');
--FILE--
<?php
/* Prototype : array imap_errors ( void )
* Description: Returns all of the IMAP errors that have occured.
* Description: Returns all of the IMAP errors that have occurred.
* Source code: ext/imap/php_imap.c
*/
+3 -1
View File
@@ -594,6 +594,8 @@ PHP_FUNCTION( collator_get_sort_key )
RETURN_FALSE;
}
/* ucol_getSortKey is exception in that the key length includes the
* NUL terminator*/
key_len = ucol_getSortKey(co->ucoll, ustr, ustr_len, key, 0);
if(!key_len) {
efree( ustr );
@@ -605,7 +607,7 @@ PHP_FUNCTION( collator_get_sort_key )
if(!key_len) {
RETURN_FALSE;
}
RETURN_STRINGL((char *)key, key_len, 0);
RETURN_STRINGL((char *)key, key_len - 1, 0);
}
/* }}} */
+2 -2
View File
@@ -24,7 +24,7 @@
#include "common_error.h"
/* {{{ proto int intl_get_error_code()
* Get code of the last occured error.
* Get code of the last occurred error.
*/
PHP_FUNCTION( intl_get_error_code )
{
@@ -33,7 +33,7 @@ PHP_FUNCTION( intl_get_error_code )
/* }}} */
/* {{{ proto string intl_get_error_message()
* Get text description of the last occured error.
* Get text description of the last occurred error.
*/
PHP_FUNCTION( intl_get_error_message )
{
+64 -20
View File
@@ -99,17 +99,46 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
}
INTL_CHECK_LOCALE_LEN_OBJ(locale_len, return_value);
if (calendar != UCAL_TRADITIONAL && calendar != UCAL_GREGORIAN) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_create: "
"invalid value for calendar type; it must be one of "
"IntlDateFormatter::TRADITIONAL (locale's default calendar) "
"or IntlDateFormatter::GREGORIAN", 0 TSRMLS_CC);
goto error;
}
DATE_FORMAT_METHOD_FETCH_OBJECT;
if (DATE_FORMAT_OBJECT(dfo) != NULL) {
intl_errors_set(INTL_DATA_ERROR_P(dfo), U_ILLEGAL_ARGUMENT_ERROR,
"datefmt_create: cannot call constructor twice", 0 TSRMLS_CC);
return;
}
/* Convert pattern (if specified) to UTF-16. */
if( pattern_str && pattern_str_len>0 ){
intl_convert_utf8_to_utf16(&svalue, &slength, pattern_str, pattern_str_len, &INTL_DATA_ERROR_CODE(dfo));
INTL_CTOR_CHECK_STATUS(dfo, "datefmt_create: error converting pattern to UTF-16");
intl_convert_utf8_to_utf16(&svalue, &slength,
pattern_str, pattern_str_len, &INTL_DATA_ERROR_CODE(dfo));
if (U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
/* object construction -> only set global error */
intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create: "
"error converting pattern to UTF-16", 0 TSRMLS_CC);
goto error;
}
}
/* resources allocated from now on */
/* Convert pattern (if specified) to UTF-16. */
if( timezone_str && timezone_str_len >0 ){
intl_convert_utf8_to_utf16(&timezone_utf16, &timezone_utf16_len, timezone_str, timezone_str_len, &INTL_DATA_ERROR_CODE(dfo));
INTL_CTOR_CHECK_STATUS(dfo, "datefmt_create: error converting timezone_str to UTF-16" );
intl_convert_utf8_to_utf16(&timezone_utf16, &timezone_utf16_len,
timezone_str, timezone_str_len, &INTL_DATA_ERROR_CODE(dfo));
if (U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create: "
"error converting timezone_str to UTF-16", 0 TSRMLS_CC);
goto error;
}
}
if(locale_len == 0) {
@@ -122,24 +151,24 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
DATE_FORMAT_OBJECT(dfo) = udat_open(time_type, date_type, locale, timezone_utf16, timezone_utf16_len, svalue, slength, &INTL_DATA_ERROR_CODE(dfo));
}
/* Set the calendar if passed */
if(!U_FAILURE(INTL_DATA_ERROR_CODE(dfo)) && calendar) {
ucal_obj = ucal_open( timezone_utf16, timezone_utf16_len, locale, calendar, &INTL_DATA_ERROR_CODE(dfo) );
if(!U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
udat_setCalendar( DATE_FORMAT_OBJECT(dfo), ucal_obj );
if (!U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
if (calendar != UCAL_TRADITIONAL) {
ucal_obj = ucal_open(timezone_utf16, timezone_utf16_len, locale,
calendar, &INTL_DATA_ERROR_CODE(dfo));
if (!U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
udat_setCalendar(DATE_FORMAT_OBJECT(dfo), ucal_obj);
ucal_close(ucal_obj);
} else {
intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create"
": error opening calendar", 0 TSRMLS_CC);
goto error;
}
}
}
if(svalue)
{
efree(svalue);
} else {
intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create: date "
"formatter creation failed", 0 TSRMLS_CC);
goto error;
}
if(timezone_utf16)
{
efree(timezone_utf16);
}
INTL_CTOR_CHECK_STATUS(dfo, "datefmt_create: date formatter creation failed");
/* Set the class variables */
dfo->date_type = date_type;
@@ -148,6 +177,19 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
if( timezone_str && timezone_str_len > 0){
dfo->timezone_id = estrndup( timezone_str, timezone_str_len);
}
error:
if (svalue) {
efree(svalue);
}
if (timezone_utf16) {
efree(timezone_utf16);
}
if (U_FAILURE(intl_error_get_code(NULL TSRMLS_CC))) {
/* free_object handles partially constructed instances fine */
zval_dtor(return_value);
RETVAL_NULL();
}
}
/* }}} */
@@ -169,6 +211,8 @@ PHP_FUNCTION( datefmt_create )
*/
PHP_METHOD( IntlDateFormatter, __construct )
{
/* return_value param is being changed, therefore we will always return
* NULL here */
return_value = getThis();
datefmt_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU);
}
+4 -4
View File
@@ -116,7 +116,7 @@ class Collator {
/**
* Return error text for the last ICU operation.
*
* @return string Description of an error occured in the last
* @return string Description of an error occurred in the last
* Collator method call.
*/
public function getErrorMessage() {}
@@ -236,7 +236,7 @@ class Collator {
*
* @return string Real locale name from which the
* collation data comes. If the collator
* was instantiated from rules or an error occured,
* was instantiated from rules or an error occurred,
* returns false.
*/
public function getLocale( $type ) {}
@@ -331,7 +331,7 @@ function collator_sort_with_sort_keys( $coll, $arr ) {}
*
* @return string Real locale name from which the
* collation data comes. If the collator
* was instantiated from rules or an error occured,
* was instantiated from rules or an error occurred,
* returns false.
*/
function collator_get_locale( $coll, $type ) {}
@@ -391,7 +391,7 @@ function collator_get_error_code( $coll ) {}
*
* @param Collator $coll Collator object.
*
* @return string Description of an error occured in the last
* @return string Description of an error occurred in the last
* Collator API function call.
*/
function collator_get_error_message( $coll ) {}
+2 -2
View File
@@ -1,7 +1,7 @@
<?php
/**
* Handling of errors occured in static methods
* Handling of errors occurred in static methods
* when there's no object to get error code/message from.
*
* Example #1:
@@ -29,7 +29,7 @@ function intl_get_error_code() {}
/**
* Get description of the last error.
*
* @return string Description of an error occured in the last
* @return string Description of an error occurred in the last
* API function call.
*/
function intl_get_error_message() {}
+2 -2
View File
@@ -215,7 +215,7 @@ class DateFormatter {
/**
* Sets the pattern to use
* @param string $pattern new pattern string to use
* @return boolean 'true' if successful, 'false' if an error occured. Bad format
* @return boolean 'true' if successful, 'false' if an error occurred. Bad format
* strings are usually the cause of the latter.
*/
public function setPattern($pattern) {}
@@ -410,7 +410,7 @@ class DateFormatter {
* Sets the pattern to use
* @param DateFormatter $fmt The date formatter resource
* @param string $pattern new pattern string to use
* @return boolean 'true' if successful, 'false' if an error occured. Bad format
* @return boolean 'true' if successful, 'false' if an error occurred. Bad format
* strings are usually the cause of the latter.
*/
function datefmt_set_pattern($fmt , $pattern) {}
+2 -2
View File
@@ -317,7 +317,7 @@ class NumberFormatter {
/**
* Get the error text from the last operation.
*
* @return string Description of the last occured error.
* @return string Description of the last occurred error.
*/
public public function getErrorMessage() {}
@@ -495,6 +495,6 @@ function numfmt_get_error_code($formatter) {}
* Get the error text from the last operation.
*
* @param NumberFormatter $formatter The formatter resource
* @return string Description of the last occured error.
* @return string Description of the last occurred error.
*/
function numfmt_get_error_message($formatter) {}
+2 -2
View File
@@ -54,7 +54,7 @@ class MessageFormatter {
* @param string $locale the locale to use when formatting numbers and dates and suchlike
* @param string $pattern the pattern string to insert things into
* @param array $args the array of values to insert into $pattern
* @return string the formatted pattern string or false if an error occured
* @return string the formatted pattern string or false if an error occurred
*/
public static function formatMessage($locale, $pattern, $args) {}
@@ -148,7 +148,7 @@ class MessageFormatter {
* @param string $locale the locale to use when formatting numbers and dates and suchlike
* @param string $pattern the pattern string to insert things into
* @param array $args the array of values to insert into $pattern
* @return string the formatted pattern string or false if an error occured
* @return string the formatted pattern string or false if an error occurred
*/
function msgfmt_format_message($locale, $pattern, $args) {}
+1
View File
@@ -822,6 +822,7 @@ PHP_FUNCTION(grapheme_extract)
}
else {
/* initialize next */
zval_dtor(next);
ZVAL_LONG(next, lstart);
}
}
+2 -2
View File
@@ -67,7 +67,7 @@ void intl_convert_utf8_to_utf16(
return;
}
/* Bail out if an unexpected error occured.
/* Bail out if an unexpected error occurred.
* (U_BUFFER_OVERFLOW_ERROR means that *target buffer is not large enough).
* (U_STRING_NOT_TERMINATED_WARNING usually means that the input string is empty).
*/
@@ -119,7 +119,7 @@ void intl_convert_utf16_to_utf8(
*status = U_ZERO_ERROR;
u_strToUTF8( NULL, 0, &dst_len, src, src_len, status );
/* Bail out if an unexpected error occured.
/* Bail out if an unexpected error occurred.
* (U_BUFFER_OVERFLOW_ERROR means that *target buffer is not large enough).
* (U_STRING_NOT_TERMINATED_WARNING usually means that the input string is empty).
*/
+4 -3
View File
@@ -527,7 +527,7 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME
/* Get the disp_value for the given locale */
do{
disp_name = erealloc( disp_name , buflen );
disp_name = erealloc( disp_name , buflen * sizeof(UChar) );
disp_name_len = buflen;
if( strcmp(tag_name , LOC_LANG_TAG)==0 ){
@@ -542,6 +542,7 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME
buflen = uloc_getDisplayName ( mod_loc_name , disp_loc_name , disp_name , disp_name_len , &status);
}
/* U_STRING_NOT_TERMINATED_WARNING is admissible here; don't look for it */
if( U_FAILURE( status ) )
{
if( status == U_BUFFER_OVERFLOW_ERROR )
@@ -1562,11 +1563,11 @@ PHP_FUNCTION(locale_lookup)
/* }}} */
/* {{{ proto string Locale::acceptFromHttp(string $http_accept)
* Tries to find out best available locale based on HTTP “Accept-Language” header
* Tries to find out best available locale based on HTTP �Accept-Language� header
*/
/* }}} */
/* {{{ proto string locale_accept_from_http(string $http_accept)
* Tries to find out best available locale based on HTTP “Accept-Language” header
* Tries to find out best available locale based on HTTP �Accept-Language� header
*/
PHP_FUNCTION(locale_accept_from_http)
{
+2
View File
@@ -64,9 +64,11 @@ static void msgfmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
locale = INTL_G(default_locale);
}
#ifdef MSG_FORMAT_QUOTE_APOS
if(msgformat_fix_quotes(&spattern, &spattern_len, &INTL_DATA_ERROR_CODE(mfo)) != SUCCESS) {
INTL_CTOR_CHECK_STATUS(mfo, "msgfmt_create: error converting pattern to quote-friendly format");
}
#endif
if ((mfo)->mf_data.orig_format) {
msgformat_data_free(&mfo->mf_data TSRMLS_CC);
+2
View File
@@ -82,11 +82,13 @@ PHP_FUNCTION( msgfmt_set_pattern )
intl_convert_utf8_to_utf16(&spattern, &spattern_len, value, value_len, &INTL_DATA_ERROR_CODE(mfo));
INTL_METHOD_CHECK_STATUS(mfo, "Error converting pattern to UTF-16" );
#ifdef MSG_FORMAT_QUOTE_APOS
if(msgformat_fix_quotes(&spattern, &spattern_len, &INTL_DATA_ERROR_CODE(mfo)) != SUCCESS) {
intl_error_set( NULL, U_INVALID_FORMAT_ERROR,
"msgfmt_set_pattern: error converting pattern to quote-friendly format", 0 TSRMLS_CC );
RETURN_FALSE;
}
#endif
/* TODO: add parse error information */
umsg_applyPattern(MSG_FORMAT_OBJECT(mfo), spattern, spattern_len, NULL, &INTL_DATA_ERROR_CODE(mfo));
+9 -3
View File
@@ -19,9 +19,11 @@
#include <php.h>
#include "intl_common.h"
#include "intl_error.h"
#include "intl_data.h"
#include <unicode/uconfig.h>
#include "../intl_common.h"
#include "../intl_error.h"
#include "../intl_data.h"
#include "msgformat_data.h"
typedef struct {
@@ -38,4 +40,8 @@ extern zend_class_entry *MessageFormatter_ce_ptr;
#define MSG_FORMAT_METHOD_FETCH_OBJECT INTL_METHOD_FETCH_OBJECT(MessageFormatter, mfo)
#define MSG_FORMAT_OBJECT(mfo) (mfo)->mf_data.umsgf
#if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM < 48
# define MSG_FORMAT_QUOTE_APOS 1
#endif
#endif // #ifndef MSG_FORMAT_CLASS_H
+4
View File
@@ -21,6 +21,8 @@
#include <unicode/ustring.h>
#include "msgformat_data.h"
#include "msgformat_class.h"
/* {{{ void msgformat_data_init( msgformat_data* mf_data )
* Initialize internals of msgformat_data.
*/
@@ -69,6 +71,7 @@ msgformat_data* msgformat_data_create( TSRMLS_D )
}
/* }}} */
#ifdef MSG_FORMAT_QUOTE_APOS
int msgformat_fix_quotes(UChar **spattern, uint32_t *spattern_len, UErrorCode *ec)
{
if(*spattern && *spattern_len && u_strchr(*spattern, (UChar)'\'')) {
@@ -86,6 +89,7 @@ int msgformat_fix_quotes(UChar **spattern, uint32_t *spattern_len, UErrorCode *e
}
return SUCCESS;
}
#endif
/*
+5 -2
View File
@@ -19,9 +19,9 @@
#include <php.h>
#include <unicode/umsg.h>
#include "../intl_error.h"
#include "intl_error.h"
#include <unicode/umsg.h>
typedef struct {
// error hangling
@@ -36,6 +36,9 @@ typedef struct {
msgformat_data* msgformat_data_create( TSRMLS_D );
void msgformat_data_init( msgformat_data* mf_data TSRMLS_DC );
void msgformat_data_free( msgformat_data* mf_data TSRMLS_DC );
#ifdef MSG_FORMAT_QUOTE_APOS
int msgformat_fix_quotes(UChar **spattern, uint32_t *spattern_len, UErrorCode *ec);
#endif
#endif // MSG_FORMAT_DATA_H
+2
View File
@@ -154,11 +154,13 @@ PHP_FUNCTION( msgfmt_format_message )
slocale = INTL_G(default_locale);
}
#ifdef MSG_FORMAT_QUOTE_APOS
if(msgformat_fix_quotes(&spattern, &spattern_len, &INTL_DATA_ERROR_CODE(mfo)) != SUCCESS) {
intl_error_set( NULL, U_INVALID_FORMAT_ERROR,
"msgfmt_format_message: error converting pattern to quote-friendly format", 0 TSRMLS_CC );
RETURN_FALSE;
}
#endif
/* Create an ICU message formatter. */
MSG_FORMAT_OBJECT(mfo) = umsg_open(spattern, spattern_len, slocale, NULL, &INTL_DATA_ERROR_CODE(mfo));
+2
View File
@@ -129,11 +129,13 @@ PHP_FUNCTION( msgfmt_parse_message )
slocale = INTL_G(default_locale);
}
#ifdef MSG_FORMAT_QUOTE_APOS
if(msgformat_fix_quotes(&spattern, &spattern_len, &INTL_DATA_ERROR_CODE(mfo)) != SUCCESS) {
intl_error_set( NULL, U_INVALID_FORMAT_ERROR,
"msgfmt_parse_message: error converting pattern to quote-friendly format", 0 TSRMLS_CC );
RETURN_FALSE;
}
#endif
/* Create an ICU message formatter. */
MSG_FORMAT_OBJECT(mfo) = umsg_open(spattern, spattern_len, slocale, NULL, &INTL_DATA_ERROR_CODE(mfo));
+3 -3
View File
@@ -110,7 +110,7 @@ PHP_FUNCTION( normalizer_normalize )
/* normalize */
size_needed = unorm_normalize( uinput, uinput_len, form, (int32_t) 0 /* options */, uret_buf, uret_len, &status);
/* Bail out if an unexpected error occured.
/* Bail out if an unexpected error occurred.
* (U_BUFFER_OVERFLOW_ERROR means that *target buffer is not large enough).
* (U_STRING_NOT_TERMINATED_WARNING usually means that the input string is empty).
*/
@@ -133,7 +133,7 @@ PHP_FUNCTION( normalizer_normalize )
/* try normalize again */
size_needed = unorm_normalize( uinput, uinput_len, form, (int32_t) 0 /* options */, uret_buf, uret_len, &status);
/* Bail out if an unexpected error occured. */
/* Bail out if an unexpected error occurred. */
if( U_FAILURE(status) ) {
/* Set error messages. */
intl_error_set_custom_msg( NULL,"Error normalizing string", 0 TSRMLS_CC );
@@ -234,7 +234,7 @@ PHP_FUNCTION( normalizer_is_normalized )
efree( uinput );
/* Bail out if an unexpected error occured. */
/* Bail out if an unexpected error occurred. */
if( U_FAILURE(status) ) {
/* Set error messages. */
intl_error_set_custom_msg( NULL,"Error testing if string is the given normalization form.", 0 TSRMLS_CC );
+17 -7
View File
@@ -91,7 +91,7 @@ static void resourcebundle_ctor(INTERNAL_FUNCTION_PARAMETERS)
intl_error_reset( NULL TSRMLS_CC );
if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "ss|b",
if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s!s!|b",
&locale, &locale_len, &bundlename, &bundlename_len, &fallback ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
@@ -101,6 +101,10 @@ static void resourcebundle_ctor(INTERNAL_FUNCTION_PARAMETERS)
}
INTL_CHECK_LOCALE_LEN_OBJ(locale_len, return_value);
if (locale == NULL) {
locale = INTL_G(default_locale);
}
if (fallback) {
rb->me = ures_open(bundlename, locale, &INTL_DATA_ERROR_CODE(rb));
@@ -110,13 +114,17 @@ static void resourcebundle_ctor(INTERNAL_FUNCTION_PARAMETERS)
INTL_CTOR_CHECK_STATUS(rb, "resourcebundle_ctor: Cannot load libICU resource bundle");
if (!fallback && (INTL_DATA_ERROR_CODE(rb) == U_USING_FALLBACK_WARNING || INTL_DATA_ERROR_CODE(rb) == U_USING_DEFAULT_WARNING)) {
intl_errors_set_code( NULL, INTL_DATA_ERROR_CODE(rb) TSRMLS_CC );
spprintf( &pbuf, 0, "resourcebundle_ctor: Cannot load libICU resource '%s' without fallback from %s to %s",
bundlename, locale, ures_getLocaleByType( rb->me, ULOC_ACTUAL_LOCALE, &INTL_DATA_ERROR_CODE(rb)) );
intl_errors_set_custom_msg( INTL_DATA_ERROR_P(rb), pbuf, 1 TSRMLS_CC );
if (!fallback && (INTL_DATA_ERROR_CODE(rb) == U_USING_FALLBACK_WARNING ||
INTL_DATA_ERROR_CODE(rb) == U_USING_DEFAULT_WARNING)) {
intl_errors_set_code(NULL, INTL_DATA_ERROR_CODE(rb) TSRMLS_CC);
spprintf(&pbuf, 0, "resourcebundle_ctor: Cannot load libICU resource "
"'%s' without fallback from %s to %s",
bundlename ? bundlename : "(default data)", locale,
ures_getLocaleByType(
rb->me, ULOC_ACTUAL_LOCALE, &INTL_DATA_ERROR_CODE(rb)));
intl_errors_set_custom_msg(INTL_DATA_ERROR_P(rb), pbuf, 1 TSRMLS_CC);
efree(pbuf);
zval_dtor( return_value );
zval_dtor(return_value);
RETURN_NULL();
}
}
@@ -427,6 +435,8 @@ void resourcebundle_register_class( TSRMLS_D )
ResourceBundle_object_handlers.clone_obj = NULL; /* ICU ResourceBundle has no clone implementation */
ResourceBundle_object_handlers.read_dimension = resourcebundle_array_get;
ResourceBundle_object_handlers.count_elements = resourcebundle_array_count;
zend_class_implements(ResourceBundle_ce_ptr TSRMLS_CC, 1, zend_ce_traversable);
}
/* }}} */
+1 -1
View File
@@ -15,7 +15,7 @@ $value = $formatter->parse('2147483650', \NumberFormatter::TYPE_INT64);
var_dump($value);
?>
--EXPECTREGEX--
--EXPECT--
int(2147483647)
int(2147483650)
+22
View File
@@ -0,0 +1,22 @@
--TEST--
Bug #62017: datefmt_create with incorrectly encoded timezone leaks pattern
--SKIPIF--
<?php
if (!extension_loaded('intl'))
die('skip intl extension not enabled');
--FILE--
<?php
ini_set('intl.error_level', E_WARNING);
var_dump(
datefmt_create('', IntlDateFormatter::NONE, IntlDateFormatter::NONE, "\xFF",
IntlDateFormatter::GREGORIAN, 'a'));
var_dump(
new IntlDateFormatter('', IntlDateFormatter::NONE, IntlDateFormatter::NONE, "Europe/Lisbon",
IntlDateFormatter::GREGORIAN, "\x80"));
--EXPECTF--
Warning: datefmt_create(): datefmt_create: error converting timezone_str to UTF-16 in %s on line %d
NULL
Warning: IntlDateFormatter::__construct(): datefmt_create: error converting pattern to UTF-16 in %s on line %d
NULL
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug #62070: Collator::getSortKey() returns garbage
--SKIPIF--
<?php
if (!extension_loaded('intl'))
die('skip intl extension not enabled');
--FILE--
<?php
$s1 = 'Hello';
$coll = collator_create('en_US');
$res = collator_get_sort_key($coll, $s1);
echo urlencode($res);
--EXPECT--
5%2F%3D%3DC%01%09%01%8F%08
+14
View File
@@ -0,0 +1,14 @@
--TEST--
Bug #62081: IntlDateFormatter leaks memory if called twice
--SKIPIF--
<?php
if (!extension_loaded('intl'))
die('skip intl extension not enabled');
--FILE--
<?php
ini_set('intl.error_level', E_WARNING);
$x = new IntlDateFormatter(1,1,1,1,1);
var_dump($x->__construct(1,1,1,1,1));
--EXPECTF--
Warning: IntlDateFormatter::__construct(): datefmt_create: cannot call constructor twice in %s on line %d
NULL
+15
View File
@@ -0,0 +1,15 @@
--TEST--
Bug #62082: Memory corruption in internal get_icu_disp_value_src_php()
--SKIPIF--
<?php
if (!extension_loaded('intl'))
die('skip intl extension not enabled');
--FILE--
<?php
var_dump(locale_get_display_name(str_repeat("a", 300), null));
var_dump(locale_get_display_name(str_repeat("a", 512), null));
var_dump(locale_get_display_name(str_repeat("a", 600), null));
--EXPECT--
string(300) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
string(512) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
string(600) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+12
View File
@@ -0,0 +1,12 @@
--TEST--
Bug #62083: grapheme_extract() leaks memory
--SKIPIF--
<?php
if (!extension_loaded('intl'))
die('skip intl extension not enabled');
--FILE--
<?php
$arr1 = array();
var_dump(grapheme_extract(-1, -1, -1,-1, $arr1));
--EXPECT--
bool(false)
+35 -36
View File
@@ -2,8 +2,7 @@
collator_get_sort_key()
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
--XFAIL--
Sort keys are not fixed, comparing them to fixed strings doesn't work.
<?php if(version_compare(INTL_ICU_VERSION, '4.8') < 0) print 'skip ICU >= 4.8 only'; ?>
--FILE--
<?php
@@ -18,8 +17,8 @@ function sort_arrays( $locale, $data )
foreach($data as $value) {
$res_val = ut_coll_get_sort_key( $coll, $value );
$res_str .= "source: ".urlencode($value)."\n".
"key: ".urlencode($res_val)."\n";
$res_str .= "source: ".$value."\n".
"key: ".bin2hex($res_val)."\n";
}
return $res_str;
@@ -58,42 +57,42 @@ ut_run();
?>
--EXPECT--
source: abc
key: %29%2B-%01%07%01%07%00
key: 27292b01070107
source: abd
key: %29%2B%2F%01%07%01%07%00
key: 27292d01070107
source: aaa
key: %29%29%29%01%07%01%07%00
source: %D0%B0%D0%B0
key: _++%01%06%01%06%00
source: %D0%B0
key: _+%01%05%01%05%00
key: 27272701070107
source: аа
key: 5c0a0a01060106
source: а
key: 5c0a01050105
source: z
key: %5B%01%05%01%05%00
source:
key: %01%01%00
source:
key: %01%01%00
key: 5901050105
source:
key: 0101
source:
key: 0101
source: 3
key: %26%80%01%05%01%05%00
key: 1801050105
source: y
key: Y%01%05%01%05%00
key: 5701050105
source: i
key: 9%01%05%01%05%00
key: 3701050105
source: k
key: %3D%01%05%01%05%00
source: %D0%B0%D0%B1%D0%B3
key: _+%2C0%01%07%01%07%00
source: %D0%B0%D0%B1%D0%B2
key: _+%2C.%01%07%01%07%00
source: %D0%B6%D0%B6%D0%B6
key: _LLL%01%07%01%07%00
source: %D1%8D%D1%8E%D1%8F
key: %60%05%09%0B%01%07%01%07%00
source: %D0%B0%D0%B1%D0%B3
key: _+%2C0%01%07%01%07%00
source: %D0%B0%D0%B1%D0%B2
key: _+%2C.%01%07%01%07%00
source: %D0%B6%D0%B6%D0%B6
key: _LLL%01%07%01%07%00
source: %D1%8D%D1%8E%D1%8F
key: %60%05%09%0B%01%07%01%07%00
key: 3b01050105
source: абг
key: 5c0a161a01070107
source: абв
key: 5c0a161801070107
source: жжж
key: 5c3a3a3a01070107
source: эюя
key: 5d3b3f4501070107
source: абг
key: 5c0a161a01070107
source: абв
key: 5c0a161801070107
source: жжж
key: 5c3a3a3a01070107
source: эюя
key: 5d3b3f4501070107
+45
View File
@@ -0,0 +1,45 @@
--TEST--
IntlDateFormatter, calendars and time zone
--INI--
date.timezone=Atlantic/Azores
--SKIPIF--
<?php
if (!extension_loaded('intl'))
die('skip intl extension not enabled');
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
$fmt1 = new IntlDateFormatter('en_US',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'GMT+05:12',
IntlDateFormatter::TRADITIONAL);
$fmt2 = new IntlDateFormatter('en_US',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'GMT+05:12',
IntlDateFormatter::GREGORIAN);
$fmt3 = new IntlDateFormatter('en_US@calendar=hebrew',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'GMT+05:12',
IntlDateFormatter::TRADITIONAL);
var_dump($fmt1->format(strtotime('2012-01-01 00:00:00 +0000')));
var_dump($fmt2->format(strtotime('2012-01-01 00:00:00 +0000')));
var_dump($fmt3->format(strtotime('2012-01-01 00:00:00 +0000')));
new IntlDateFormatter('en_US@calendar=hebrew',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'GMT+05:12',
-1);
?>
==DONE==
--EXPECTF--
string(44) "Sunday, January 1, 2012 5:12:00 AM GMT+05:12"
string(44) "Sunday, January 1, 2012 5:12:00 AM GMT+05:12"
string(42) "Sunday, Tevet 6, 5772 5:12:00 AM GMT+05:12"
Warning: IntlDateFormatter::__construct(): datefmt_create: invalid value for calendar type; it must be one of IntlDateFormatter::TRADITIONAL (locale's default calendar) or IntlDateFormatter::GREGORIAN in %s on line %d
==DONE==
+1 -1
View File
@@ -19,7 +19,7 @@ function ut_main()
if( $num === false )
return $fmt->getErrorMessage() . " (" . $fmt->getErrorCode() . ")\n";
else
return "Ooops, an error should have occured.";
return "Ooops, an error should have occurred.";
}
include_once( 'ut_common.inc' );
@@ -1,8 +1,8 @@
--TEST--
numfmt_get/set_attribute() icu < 4.2
numfmt_get/set_attribute()
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
<?php if(version_compare(INTL_ICU_VERSION, '4.2', '<') != 1) print 'skip'; ?>
<?php if(version_compare(INTL_ICU_VERSION, '4.2', '<') != 1) print 'skip for ICU 4.4+'; ?>
--FILE--
<?php
@@ -29,7 +29,7 @@ function ut_main()
'ROUNDING_MODE' => array( NumberFormatter::ROUNDING_MODE, 1, 12345.123456 ),
'ROUNDING_INCREMENT' => array( NumberFormatter::ROUNDING_INCREMENT, (float)2, 12345.123456 ),
'FORMAT_WIDTH' => array( NumberFormatter::FORMAT_WIDTH, 27, 12345.123456 ),
'PADDING_POSITION' => array( NumberFormatter::PADDING_POSITION, 21, 12345.123456 ),
'PADDING_POSITION' => array( NumberFormatter::PADDING_POSITION, 2, 12345.123456 ),
'SECONDARY_GROUPING_SIZE' => array( NumberFormatter::SECONDARY_GROUPING_SIZE, 2, 12345.123456 ),
'SIGNIFICANT_DIGITS_USED' => array( NumberFormatter::SIGNIFICANT_DIGITS_USED, 1, 12345.123456 ),
'MIN_SIGNIFICANT_DIGITS' => array( NumberFormatter::MIN_SIGNIFICANT_DIGITS, 3, 1 ),
@@ -159,7 +159,7 @@ Setting attribute: ok
New attribute value: 1 ; Format result: '0,012,345.12345' ; Parse result: 12345.12345
Attribute ROUNDING_INCREMENT
Old attribute value: 1.0E-5 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346
Old attribute value: 0 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346
Setting attribute: ok
New attribute value: 2 ; Format result: '0,012,346.00000' ; Parse result: 12346
@@ -171,7 +171,7 @@ New attribute value: 27 ; Format result: '************0,012,345.12346' ; Parse
Attribute PADDING_POSITION
Old attribute value: 0 ; Format result: '************0,012,345.12346' ; Parse result: 12345.12346
Setting attribute: ok
New attribute value: 21 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346
New attribute value: 2 ; Format result: '0,012,345.12346************' ; Parse result: 12345.12346
Attribute SECONDARY_GROUPING_SIZE
Old attribute value: 0 ; Format result: '************0,012,345.12346' ; Parse result: 12345.12346
@@ -1,194 +0,0 @@
--TEST--
numfmt_get/set_attribute() icu >= 4.8
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
<?php if(version_compare(INTL_ICU_VERSION, '4.8') < 0) print 'skip'; ?>
--FILE--
<?php
/*
* Get/set various number formatting attributes.
*/
function ut_main()
{
// attr_name => array( attr, value )
$attributes = array(
'PARSE_INT_ONLY' => array( NumberFormatter::PARSE_INT_ONLY, 1, 12345.123456 ),
'GROUPING_USED' => array( NumberFormatter::GROUPING_USED, 0, 12345.123456 ),
'DECIMAL_ALWAYS_SHOWN' => array( NumberFormatter::DECIMAL_ALWAYS_SHOWN, 1, 12345 ),
'MAX_INTEGER_DIGITS' => array( NumberFormatter::MAX_INTEGER_DIGITS, 2, 12345.123456 ),
'MIN_INTEGER_DIGITS' => array( NumberFormatter::MIN_INTEGER_DIGITS, 20, 12345.123456 ),
'INTEGER_DIGITS' => array( NumberFormatter::INTEGER_DIGITS, 7, 12345.123456 ),
'MAX_FRACTION_DIGITS' => array( NumberFormatter::MAX_FRACTION_DIGITS, 2, 12345.123456 ),
'MIN_FRACTION_DIGITS' => array( NumberFormatter::MIN_FRACTION_DIGITS, 20, 12345.123456 ),
'FRACTION_DIGITS' => array( NumberFormatter::FRACTION_DIGITS, 5, 12345.123456 ),
'MULTIPLIER' => array( NumberFormatter::MULTIPLIER, 2, 12345.123456 ),
'GROUPING_SIZE' => array( NumberFormatter::GROUPING_SIZE, 2, 12345.123456 ),
'ROUNDING_MODE' => array( NumberFormatter::ROUNDING_MODE, 1, 12345.123456 ),
'ROUNDING_INCREMENT' => array( NumberFormatter::ROUNDING_INCREMENT, (float)2, 12345.123456 ),
'FORMAT_WIDTH' => array( NumberFormatter::FORMAT_WIDTH, 27, 12345.123456 ),
'PADDING_POSITION' => array( NumberFormatter::PADDING_POSITION, 21, 12345.123456 ),
'SECONDARY_GROUPING_SIZE' => array( NumberFormatter::SECONDARY_GROUPING_SIZE, 2, 12345.123456 ),
'SIGNIFICANT_DIGITS_USED' => array( NumberFormatter::SIGNIFICANT_DIGITS_USED, 1, 12345.123456 ),
'MIN_SIGNIFICANT_DIGITS' => array( NumberFormatter::MIN_SIGNIFICANT_DIGITS, 3, 1 ),
'MAX_SIGNIFICANT_DIGITS' => array( NumberFormatter::MAX_SIGNIFICANT_DIGITS, 4, 12345.123456 ),
// 'LENIENT_PARSE' => array( NumberFormatter::LENIENT_PARSE, 2, 12345.123456 )
);
$res_str = '';
$fmt = ut_nfmt_create( "en_US", NumberFormatter::DECIMAL );
foreach( $attributes as $attr_name => $args )
{
list( $attr, $new_val, $number ) = $args;
$res_str .= "\nAttribute $attr_name\n";
// Get original value of the attribute.
$orig_val = ut_nfmt_get_attribute( $fmt, $attr );
// Format the number using the original attribute value.
$rc = ut_nfmt_format( $fmt, $number );
$ps = ut_nfmt_parse( $fmt, $rc );
$res_str .= sprintf( "Old attribute value: %s ; Format result: %s ; Parse result: %s\n",
dump( $orig_val ),
dump( $rc ),
dump( $ps ) );
// Set new attribute value.
$rc = ut_nfmt_set_attribute( $fmt, $attr, $new_val );
if( $rc )
$res_str .= "Setting attribute: ok\n";
else
$res_str .= sprintf( "Setting attribute failed: %s\n", ut_nfmt_get_error_message( $fmt ) );
// Format the number using the new value.
$rc = ut_nfmt_format( $fmt, $number );
// Get current value of the attribute and check if it equals $new_val.
$attr_val_check = ut_nfmt_get_attribute( $fmt, $attr );
if( $attr_val_check !== $new_val )
$res_str .= "ERROR: New $attr_name attribute value has not been set correctly.\n";
$ps = ut_nfmt_parse( $fmt, $rc );
$res_str .= sprintf( "New attribute value: %s ; Format result: %s ; Parse result: %s\n",
dump( $new_val ),
dump( $rc ),
dump( $ps ) );
// Restore original attribute of the value
if( $attr != NumberFormatter::INTEGER_DIGITS && $attr != NumberFormatter::FRACTION_DIGITS
&& $attr != NumberFormatter::FORMAT_WIDTH && $attr != NumberFormatter::SIGNIFICANT_DIGITS_USED )
ut_nfmt_set_attribute( $fmt, $attr, $orig_val );
}
return $res_str;
}
include_once( 'ut_common.inc' );
// Run the test
ut_run();
?>
--EXPECT--
Attribute PARSE_INT_ONLY
Old attribute value: 0 ; Format result: '12,345.123' ; Parse result: 12345.123
Setting attribute: ok
New attribute value: 1 ; Format result: '12,345.123' ; Parse result: 12345
Attribute GROUPING_USED
Old attribute value: 1 ; Format result: '12,345.123' ; Parse result: 12345.123
Setting attribute: ok
New attribute value: 0 ; Format result: '12345.123' ; Parse result: 12345.123
Attribute DECIMAL_ALWAYS_SHOWN
Old attribute value: 0 ; Format result: '12,345' ; Parse result: 12345
Setting attribute: ok
New attribute value: 1 ; Format result: '12,345.' ; Parse result: 12345
Attribute MAX_INTEGER_DIGITS
Old attribute value: 309 ; Format result: '12,345.123' ; Parse result: 12345.123
Setting attribute: ok
New attribute value: 2 ; Format result: '45.123' ; Parse result: 45.123
Attribute MIN_INTEGER_DIGITS
Old attribute value: 1 ; Format result: '12,345.123' ; Parse result: 12345.123
Setting attribute: ok
New attribute value: 20 ; Format result: '00,000,000,000,000,012,345.123' ; Parse result: 12345.123
Attribute INTEGER_DIGITS
Old attribute value: 1 ; Format result: '12,345.123' ; Parse result: 12345.123
Setting attribute: ok
New attribute value: 7 ; Format result: '0,012,345.123' ; Parse result: 12345.123
Attribute MAX_FRACTION_DIGITS
Old attribute value: 3 ; Format result: '0,012,345.123' ; Parse result: 12345.123
Setting attribute: ok
New attribute value: 2 ; Format result: '0,012,345.12' ; Parse result: 12345.12
Attribute MIN_FRACTION_DIGITS
Old attribute value: 0 ; Format result: '0,012,345.123' ; Parse result: 12345.123
Setting attribute: ok
New attribute value: 20 ; Format result: '0,012,345.12345600000000000000' ; Parse result: 12345.123456
Attribute FRACTION_DIGITS
Old attribute value: 0 ; Format result: '0,012,345.123456' ; Parse result: 12345.123456
Setting attribute: ok
New attribute value: 5 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346
Attribute MULTIPLIER
Old attribute value: 1 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346
Setting attribute: ok
New attribute value: 2 ; Format result: '0,024,690.24691' ; Parse result: 12345.123455
Attribute GROUPING_SIZE
Old attribute value: 3 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346
Setting attribute: ok
New attribute value: 2 ; Format result: '0,01,23,45.12346' ; Parse result: 12345.12346
Attribute ROUNDING_MODE
Old attribute value: 4 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346
Setting attribute: ok
New attribute value: 1 ; Format result: '0,012,345.12345' ; Parse result: 12345.12345
Attribute ROUNDING_INCREMENT
Old attribute value: 0 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346
Setting attribute: ok
New attribute value: 2 ; Format result: '0,012,346.00000' ; Parse result: 12346
Attribute FORMAT_WIDTH
Old attribute value: 0 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346
Setting attribute: ok
New attribute value: 27 ; Format result: '************0,012,345.12346' ; Parse result: 12345.12346
Attribute PADDING_POSITION
Old attribute value: 0 ; Format result: '************0,012,345.12346' ; Parse result: 12345.12346
Setting attribute: ok
New attribute value: 21 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346
Attribute SECONDARY_GROUPING_SIZE
Old attribute value: 0 ; Format result: '************0,012,345.12346' ; Parse result: 12345.12346
Setting attribute: ok
New attribute value: 2 ; Format result: '************00,12,345.12346' ; Parse result: 12345.12346
Attribute SIGNIFICANT_DIGITS_USED
Old attribute value: 0 ; Format result: '************0,012,345.12346' ; Parse result: 12345.12346
Setting attribute: ok
New attribute value: 1 ; Format result: '*******************12,345.1' ; Parse result: 12345.1
Attribute MIN_SIGNIFICANT_DIGITS
Old attribute value: 1 ; Format result: '**************************1' ; Parse result: 1
Setting attribute: ok
New attribute value: 3 ; Format result: '***********************1.00' ; Parse result: 1
Attribute MAX_SIGNIFICANT_DIGITS
Old attribute value: 6 ; Format result: '*******************12,345.1' ; Parse result: 12345.1
Setting attribute: ok
New attribute value: 4 ; Format result: '*********************12,350' ; Parse result: 12350
@@ -0,0 +1,26 @@
--TEST--
IntlCalendar::setTime() basic test
--INI--
date.timezone=Atlantic/Azores
--SKIPIF--
<?php
if (!extension_loaded('intl'))
die('skip intl extension not enabled');
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
$r = new ResourceBundle('en_US', NULL);
$c = $r->get('calendar')->get('gregorian')->get('DateTimePatterns')->get(0);
var_dump($c);
ini_set('intl.default_locale', 'pt_PT');
$r = new ResourceBundle(NULL, NULL);
$c = $r->get('calendar')->get('gregorian')->get('DateTimePatterns')->get(0);
var_dump($c);
?>
==DONE==
--EXPECT--
string(14) "h:mm:ss a zzzz"
string(12) "H:mm:ss zzzz"
==DONE==
@@ -0,0 +1,23 @@
--TEST--
Bug #55610: ResourceBundle does not implement Traversable
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
--FILE--
<?php
include "resourcebundle.inc";
$r = new ResourceBundle( 'es', BUNDLE );
var_dump($r instanceof Traversable);
var_dump(iterator_to_array($r->get('testarray')));
?>
--EXPECTF--
bool(true)
array(3) {
[0]=>
string(8) "cadena 1"
[1]=>
string(8) "cadena 2"
[2]=>
string(8) "cadena 3"
}
+12 -9
View File
@@ -302,7 +302,7 @@ static void json_encode_array(smart_str *buf, zval **val, int options TSRMLS_DC)
smart_str_appendc(buf, ':');
json_pretty_print_char(buf, options, ' ' TSRMLS_CC);
php_json_encode(buf, *data, options TSRMLS_CC);
} else {
if (need_comma) {
@@ -320,7 +320,7 @@ static void json_encode_array(smart_str *buf, zval **val, int options TSRMLS_DC)
smart_str_appendc(buf, ':');
json_pretty_print_char(buf, options, ' ' TSRMLS_CC);
php_json_encode(buf, *data, options TSRMLS_CC);
}
}
@@ -331,7 +331,7 @@ static void json_encode_array(smart_str *buf, zval **val, int options TSRMLS_DC)
}
}
}
--JSON_G(encoder_depth);
json_pretty_print_char(buf, options, '\n' TSRMLS_CC);
json_pretty_print_indent(buf, options TSRMLS_CC);
@@ -351,6 +351,7 @@ static void json_escape_string(smart_str *buf, char *s, int len, int options TSR
int pos = 0, ulen = 0;
unsigned short us;
unsigned short *utf16;
size_t newlen;
if (len == 0) {
smart_str_appendl(buf, "\"\"", 2);
@@ -378,9 +379,9 @@ static void json_escape_string(smart_str *buf, char *s, int len, int options TSR
}
return;
}
}
utf16 = (options & PHP_JSON_UNESCAPED_UNICODE) ? NULL : (unsigned short *) safe_emalloc(len, sizeof(unsigned short), 0);
ulen = utf8_to_utf16(utf16, s, len);
if (ulen <= 0) {
@@ -402,6 +403,8 @@ static void json_escape_string(smart_str *buf, char *s, int len, int options TSR
len = ulen;
}
/* pre-allocate for string length plus 2 quotes */
smart_str_alloc(buf, len+2, 0);
smart_str_appendc(buf, '"');
while (pos < len)
@@ -514,13 +517,13 @@ static void json_encode_serializable_object(smart_str *buf, zval *val, int optio
zend_class_entry *ce = Z_OBJCE_P(val);
zval *retval = NULL, fname;
HashTable* myht;
if (Z_TYPE_P(val) == IS_ARRAY) {
myht = HASH_OF(val);
} else {
myht = Z_OBJPROP_P(val);
}
}
if (myht && myht->nApplyCount > 1) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "recursion detected");
smart_str_appendl(buf, "null", 4);
@@ -533,7 +536,7 @@ static void json_encode_serializable_object(smart_str *buf, zval *val, int optio
zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Failed calling %s::jsonSerialize()", ce->name);
smart_str_appendl(buf, "null", sizeof("null") - 1);
return;
}
}
if (EG(exception)) {
/* Error already raised */
+3 -7
View File
@@ -9,12 +9,8 @@ var_dump(json_encode("latin 1234 -/ russian мама мыла раму speci
var_dump(json_encode("ab\xE0"));
var_dump(json_encode("ab\xE0", JSON_UNESCAPED_UNICODE));
?>
--EXPECTF--
--EXPECT--
string(156) ""latin 1234 -\/ russian \u043c\u0430\u043c\u0430 \u043c\u044b\u043b\u0430 \u0440\u0430\u043c\u0443 specialchars \u0002 \b \n U+1D11E >\ud834\udd1e<""
string(100) ""latin 1234 -\/ russian мама мыла раму specialchars \u0002 \b \n U+1D11E >𝄞<""
Warning: json_encode(): Invalid UTF-8 sequence in argument in %s on line %d
bool(false)
Warning: json_encode(): Invalid UTF-8 sequence in argument in %s on line %d
bool(false)
string(4) "null"
string(4) "null"
+11 -2
View File
@@ -677,9 +677,18 @@ is_string:
static xmlParserInputPtr _php_libxml_pre_ext_ent_loader(const char *URL,
const char *ID, xmlParserCtxtPtr context)
{
TSRMLS_FETCH();
/* Check whether we're running in a PHP context, since the entity loader
* we've defined is an application level (true global) setting */
if (xmlGenericError == php_libxml_error_handler) {
* we've defined is an application level (true global) setting.
* If we are, we also want to check whether we've finished activating
* the modules (RINIT phase). Using our external entity loader during a
* RINIT should not be problem per se (though during MINIT it is, because
* we don't even have a resource list by then), but then whether one
* extension would be using the custom external entity loader or not
* could depend on extension loading order
* (if _php_libxml_per_request_initialization */
if (xmlGenericError == php_libxml_error_handler && PG(modules_activated)) {
return _php_libxml_external_entity_loader(URL, ID, context);
} else {
return _php_libxml_default_entity_loader(URL, ID, context);
+3 -2
View File
@@ -4,11 +4,12 @@ Bug #61367: open_basedir bypass in libxml RSHUTDOWN: read test
<?php if(!extension_loaded('dom')) echo 'skip'; ?>
--INI--
open_basedir=.
; Suppress spurious "Trying to get property of non-object" notices
error_reporting=E_ALL & ~E_NOTICE
--FILE--
<?php
/*
* Note: Using error_reporting=E_ALL & ~E_NOTICE to supress "Trying to get property of non-object" notices.
*/
class StreamExploiter {
public function stream_close ( ) {
$doc = new DOMDocument;
-2
View File
@@ -4,8 +4,6 @@ Bug #61367: open_basedir bypass in libxml RSHUTDOWN: write test
<?php if(!extension_loaded('dom')) echo 'skip'; ?>
--INI--
open_basedir=.
; Suppress spurious "Trying to get property of non-object" notices
error_reporting=E_ALL & ~E_NOTICE
--FILE--
<?php
+1 -1
View File
@@ -162,7 +162,7 @@ void php_clear_stmt_bind(MY_STMT *stmt TSRMLS_DC)
{
if (stmt->stmt) {
if (mysqli_stmt_close(stmt->stmt, TRUE)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error occured while closing statement");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error occurred while closing statement");
return;
}
}
+40
View File
@@ -0,0 +1,40 @@
--TEST--
Bug #62046 mysqli@mysqlnd can't iterate over stored sets after call to mysqli_stmt_reset()
--SKIPIF--
<?php
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
?>
--FILE--
<?php
require_once("connect.inc");
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
printf("[001] Connect failed, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
}
if (FALSE === ($stmt = $link->prepare('SELECT 42'))) {
printf("[002] Prepare failed, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
}
if (FALSE === $stmt->execute()) {
printf("[003] Execute failed, [%d] %s\n", $stmt->errorno, $stmt->error);
}
if (FALSE === $stmt->store_result()) {
printf("[004] store_result failed, [%d] %s\n", $stmt->errorno, $stmt->error);
}
$one = NULL;
if (FALSE === $stmt->bind_result($one)) {
printf("[005] bind_result failed, [%d] %s\n", $stmt->errorno, $stmt->error);
}
if (FALSE === $stmt->reset()) {
printf("[006] bind_result failed, [%d] %s\n", $stmt->errorno, $stmt->error);
}
while ($stmt->fetch()) {
var_dump($one);
}
$stmt->close();
$link->close();
echo "done!";
?>
--EXPECT--
int(42)
done!
@@ -63,7 +63,7 @@ require_once('skipifconnectfailure.inc');
// NOTE: the error message varies with the MySQL Server version, dump only the error code!
printf("[009] [%d] (error message varies with the MySQL Server version, check the error code)\n", mysqli_stmt_errno($stmt));
/* an error occured: affected rows should return -1 */
/* an error occurred: affected rows should return -1 */
if (-1 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
printf("[010] Expecting int/0, got %s/%s\n", gettype($tmp), $tmp);
+7
View File
@@ -764,6 +764,13 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
conn->server_version = mnd_pestrdup(greet_packet->server_version, conn->persistent);
conn->greet_charset = mysqlnd_find_charset_nr(greet_packet->charset_no);
if (!conn->greet_charset) {
php_error_docref(NULL TSRMLS_CC, E_WARNING,
"Server sent charset (%d) unknown to the client. Please, report to the developers", greet_packet->charset_no);
SET_CLIENT_ERROR(*conn->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE,
"Server sent charset unknown to the client. Please, report to the developers");
goto err;
}
/* we allow load data local infile by default */
mysql_flags |= MYSQLND_CAPABILITIES;
+56 -19
View File
@@ -450,20 +450,27 @@ const MYSQLND_CHARSET mysqlnd_charsets[] =
{ 6, "hp8", "hp8_english_ci", 1, 1, "", NULL, NULL},
{ 7, "koi8r", "koi8r_general_ci", 1, 1, "", NULL, NULL},
{ 8, "latin1", "latin1_swedish_ci", 1, 1, "", NULL, NULL},
{ 5, "latin1", "latin1_german_ci", 1, 1, "", NULL, NULL}, /* should be after 0x9 because swedish_ci is the default collation */
{ 9, "latin2", "latin2_general_ci", 1, 1, "", NULL, NULL},
{ 2, "latin2", "latin2_czech_cs", 1, 1, "", NULL, NULL}, /* should be after 0x9 because general_ci is the default collation */
{ 10, "swe7", "swe7_swedish_ci", 1, 1, "", NULL, NULL},
{ 11, "ascii", "ascii_general_ci", 1, 1, "", NULL, NULL},
{ 12, "ujis", "ujis_japanese_ci", 1, 3, "", mysqlnd_mbcharlen_ujis, check_mb_ujis},
{ 13, "sjis", "sjis_japanese_ci", 1, 2, "", mysqlnd_mbcharlen_sjis, check_mb_sjis},
{ 16, "hebrew", "hebrew_general_ci", 1, 1, "", NULL, NULL},
{ 17, "filename", "filename", 1, 5, "", NULL, NULL},
{ 18, "tis620", "tis620_thai_ci", 1, 1, "", NULL, NULL},
{ 19, "euckr", "euckr_korean_ci", 1, 2, "", mysqlnd_mbcharlen_euckr, check_mb_euckr},
{ 21, "latin2", "latin2_hungarian_ci", 1, 1, "", NULL, NULL},
{ 27, "latin2", "latin2_croatian_ci", 1, 1, "", NULL, NULL},
{ 22, "koi8u", "koi8u_general_ci", 1, 1, "", NULL, NULL},
{ 24, "gb2312", "gb2312_chinese_ci", 1, 2, "", mysqlnd_mbcharlen_gb2312, check_mb_gb2312},
{ 25, "greek", "greek_general_ci", 1, 1, "", NULL, NULL},
{ 26, "cp1250", "cp1250_general_ci", 1, 1, "", NULL, NULL},
{ 28, "gbk", "gbk_chinese_ci", 1, 2, "", mysqlnd_mbcharlen_gbk, check_mb_gbk},
{ 30, "latin5", "latin5_turkish_ci", 1, 1, "", NULL, NULL},
{ 31, "latin1", "latin1_german2_ci", 1, 1, "", NULL, NULL},
{ 15, "latin1", "latin1_danish_ci", 1, 1, "", NULL, NULL},
{ 32, "armscii8", "armscii8_general_ci", 1, 1, "", NULL, NULL},
{ 33, UTF8_MB3, UTF8_MB3"_general_ci", 1, 3, "UTF-8 Unicode", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
{ 35, "ucs2", "ucs2_general_ci", 2, 2, "UCS-2 Unicode", mysqlnd_mbcharlen_ucs2, check_mb_ucs2},
@@ -473,22 +480,11 @@ const MYSQLND_CHARSET mysqlnd_charsets[] =
{ 39, "macroman", "macroman_general_ci", 1, 1, "", NULL, NULL},
{ 40, "cp852", "cp852_general_ci", 1, 1, "", NULL, NULL},
{ 41, "latin7", "latin7_general_ci", 1, 1, "", NULL, NULL},
{ 51, "cp1251", "cp1251_general_ci", 1, 1, "", NULL, NULL},
{ 20, "latin7", "latin7_estonian_cs", 1, 1, "", NULL, NULL},
{ 57, "cp1256", "cp1256_general_ci", 1, 1, "", NULL, NULL},
{ 59, "cp1257", "cp1257_general_ci", 1, 1, "", NULL, NULL},
{ 63, "binary", "binary", 1, 1, "", NULL, NULL},
{ 92, "geostd8", "geostd8_general_ci", 1, 1, "", NULL, NULL},
{ 95, "cp932", "cp932_japanese_ci", 1, 2, "", mysqlnd_mbcharlen_cp932, check_mb_cp932},
{ 97, "eucjpms", "eucjpms_japanese_ci", 1, 3, "", mysqlnd_mbcharlen_eucjpms, check_mb_eucjpms},
{ 2, "latin2", "latin2_czech_cs", 1, 1, "", NULL, NULL},
{ 5, "latin1", "latin1_german_ci", 1, 1, "", NULL, NULL},
{ 14, "cp1251", "cp1251_bulgarian_ci", 1, 1, "", NULL, NULL},
{ 15, "latin1", "latin1_danish_ci", 1, 1, "", NULL, NULL},
{ 17, "filename", "filename", 1, 5, "", NULL, NULL},
{ 20, "latin7", "latin7_estonian_cs", 1, 1, "", NULL, NULL},
{ 21, "latin2", "latin2_hungarian_ci", 1, 1, "", NULL, NULL},
{ 23, "cp1251", "cp1251_ukrainian_ci", 1, 1, "", NULL, NULL},
{ 27, "latin2", "latin2_croatian_ci", 1, 1, "", NULL, NULL},
{ 29, "cp1257", "cp1257_lithunian_ci", 1, 1, "", NULL, NULL},
{ 31, "latin1", "latin1_german2_ci", 1, 1, "", NULL, NULL},
{ 34, "cp1250", "cp1250_czech_cs", 1, 1, "", NULL, NULL},
@@ -500,6 +496,9 @@ const MYSQLND_CHARSET mysqlnd_charsets[] =
{ 47, "latin1", "latin1_bin", 1, 1, "", NULL, NULL},
{ 48, "latin1", "latin1_general_ci", 1, 1, "", NULL, NULL},
{ 49, "latin1", "latin1_general_cs", 1, 1, "", NULL, NULL},
{ 51, "cp1251", "cp1251_general_ci", 1, 1, "", NULL, NULL},
{ 14, "cp1251", "cp1251_bulgarian_ci", 1, 1, "", NULL, NULL},
{ 23, "cp1251", "cp1251_ukrainian_ci", 1, 1, "", NULL, NULL},
{ 50, "cp1251", "cp1251_bin", 1, 1, "", NULL, NULL},
{ 52, "cp1251", "cp1251_general_cs", 1, 1, "", NULL, NULL},
{ 53, "macroman", "macroman_bin", 1, 1, "", NULL, NULL},
@@ -509,8 +508,8 @@ const MYSQLND_CHARSET mysqlnd_charsets[] =
#ifdef USED_TO_BE_SO_BEFORE_MYSQL_5_5
{ 60, "armascii8", "armascii8_bin", 1, 1, "", NULL, NULL},
#endif
{ 60, "utf32", "utf32_general_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
{ 61, "utf32", "utf32_bin", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
/*55*/{ 60, "utf32", "utf32_general_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
/*55*/{ 61, "utf32", "utf32_bin", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
{ 65, "ascii", "ascii_bin", 1, 1, "", NULL, NULL},
{ 66, "cp1250", "cp1250_bin", 1, 1, "", NULL, NULL},
{ 67, "cp1256", "cp1256_bin", 1, 1, "", NULL, NULL},
@@ -528,7 +527,6 @@ const MYSQLND_CHARSET mysqlnd_charsets[] =
{ 80, "cp850", "cp850_bin", 1, 1, "", NULL, NULL},
{ 81, "cp852", "cp852_bin", 1, 1, "", NULL, NULL},
{ 82, "swe7", "swe7_bin", 1, 1, "", NULL, NULL},
{ 93, "geostd8", "geostd8_bin", 1, 1, "", NULL, NULL},
{ 83, UTF8_MB3, UTF8_MB3"_bin", 1, 3, "UTF-8 Unicode", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
{ 84, "big5", "big5_bin", 1, 2, "", mysqlnd_mbcharlen_big5, check_mb_big5},
{ 85, "euckr", "euckr_bin", 1, 2, "", mysqlnd_mbcharlen_euckr, check_mb_euckr},
@@ -538,10 +536,14 @@ const MYSQLND_CHARSET mysqlnd_charsets[] =
{ 89, "tis620", "tis620_bin", 1, 1, "", NULL, NULL},
{ 90, "ucs2", "ucs2_bin", 2, 2, "UCS-2 Unicode", mysqlnd_mbcharlen_ucs2, check_mb_ucs2},
{ 91, "ujis", "ujis_bin", 1, 3, "", mysqlnd_mbcharlen_ujis, check_mb_ujis},
{ 92, "geostd8", "geostd8_general_ci", 1, 1, "", NULL, NULL},
{ 93, "geostd8", "geostd8_bin", 1, 1, "", NULL, NULL},
{ 94, "latin1", "latin1_spanish_ci", 1, 1, "", NULL, NULL},
{ 95, "cp932", "cp932_japanese_ci", 1, 2, "", mysqlnd_mbcharlen_cp932, check_mb_cp932},
{ 96, "cp932", "cp932_bin", 1, 2, "", mysqlnd_mbcharlen_cp932, check_mb_cp932},
{ 99, "cp1250", "cp1250_polish_ci", 1, 1, "", NULL, NULL},
{ 97, "eucjpms", "eucjpms_japanese_ci", 1, 3, "", mysqlnd_mbcharlen_eucjpms, check_mb_eucjpms},
{ 98, "eucjpms", "eucjpms_bin", 1, 3, "", mysqlnd_mbcharlen_eucjpms, check_mb_eucjpms},
{ 99, "cp1250", "cp1250_polish_ci", 1, 1, "", NULL, NULL},
{ 128, "ucs2", "ucs2_unicode_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2},
{ 129, "ucs2", "ucs2_icelandic_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2},
{ 130, "ucs2", "ucs2_latvian_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2},
@@ -562,7 +564,35 @@ const MYSQLND_CHARSET mysqlnd_charsets[] =
{ 145, "ucs2", "ucs2_esperanto_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2},
{ 146, "ucs2", "ucs2_hungarian_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2},
{ 147, "ucs2", "ucs2_sinhala_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2},
{ 149, "ucs2", "ucs2_croatian_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2}, /* MDB */
{ 148, "ucs2", "ucs2_german2_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2},
{ 149, "ucs2", "ucs2_croatian_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2},
{ 150, "ucs2", "ucs2_unicode_520_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2},
{ 151, "ucs2", "ucs2_vietnamese_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2},
/*56*/{160, "utf32", "utf32_unicode_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
/*56*/{161, "utf32", "utf32_icelandic_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
/*56*/{162, "utf32", "utf32_latvian_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
/*56*/{163, "utf32", "utf32_romanian_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
/*56*/{164, "utf32", "utf32_slovenian_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
/*56*/{165, "utf32", "utf32_polish_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
/*56*/{166, "utf32", "utf32_estonian_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
/*56*/{167, "utf32", "utf32_spanish_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
/*56*/{168, "utf32", "utf32_swedish_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
/*56*/{169, "utf32", "utf32_turkish_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
/*56*/{170, "utf32", "utf32_czech_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
/*56*/{171, "utf32", "utf32_danish_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
/*56*/{172, "utf32", "utf32_lithuanian_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
/*56*/{173, "utf32", "utf32_slovak_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
/*56*/{174, "utf32", "utf32_spanish2_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
/*56*/{175, "utf32", "utf32_roman_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
/*56*/{176, "utf32", "utf32_persian_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
/*56*/{177, "utf32", "utf32_esperanto_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
/*56*/{178, "utf32", "utf32_hungarian_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
/*56*/{179, "utf32", "utf32_sinhala_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
/*56*/{180, "utf32", "utf32_german2_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
/*56*/{181, "utf32", "utf32_croatian_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
/*56*/{182, "utf32", "utf32_unicode_520_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
/*56*/{183, "utf32", "utf32_vietnamese_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
{ 192, UTF8_MB3, UTF8_MB3"_general_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
{ 193, UTF8_MB3, UTF8_MB3"_icelandic_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
@@ -571,7 +601,7 @@ const MYSQLND_CHARSET mysqlnd_charsets[] =
{ 196, UTF8_MB3, UTF8_MB3"_slovenian_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
{ 197, UTF8_MB3, UTF8_MB3"_polish_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
{ 198, UTF8_MB3, UTF8_MB3"_estonian_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
{ 119, UTF8_MB3, UTF8_MB3"_spanish_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
{ 199, UTF8_MB3, UTF8_MB3"_spanish_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
{ 200, UTF8_MB3, UTF8_MB3"_swedish_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
{ 201, UTF8_MB3, UTF8_MB3"_turkish_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
{ 202, UTF8_MB3, UTF8_MB3"_czech_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
@@ -584,7 +614,10 @@ const MYSQLND_CHARSET mysqlnd_charsets[] =
{ 209, UTF8_MB3, UTF8_MB3"_esperanto_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
{ 210, UTF8_MB3, UTF8_MB3"_hungarian_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
{ 211, UTF8_MB3, UTF8_MB3"_sinhala_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
{ 213, UTF8_MB3, UTF8_MB3"_croatian_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, /*MDB*/
{ 211, UTF8_MB3, UTF8_MB3"_german2_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
{ 213, UTF8_MB3, UTF8_MB3"_croatian_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
{ 214, UTF8_MB3, UTF8_MB3"_unicode_520_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
{ 215, UTF8_MB3, UTF8_MB3"_vietnamese_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
{ 224, UTF8_MB4, UTF8_MB4"_unicode_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 225, UTF8_MB4, UTF8_MB4"_icelandic_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
@@ -606,6 +639,10 @@ const MYSQLND_CHARSET mysqlnd_charsets[] =
{ 241, UTF8_MB4, UTF8_MB4"_esperanto_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 242, UTF8_MB4, UTF8_MB4"_hungarian_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 243, UTF8_MB4, UTF8_MB4"_sinhala_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 244, UTF8_MB4, UTF8_MB4"_german2_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 245, UTF8_MB4, UTF8_MB4"_croatian_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 246, UTF8_MB4, UTF8_MB4"_unicode_520_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 247, UTF8_MB4, UTF8_MB4"_vietnamese_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 254, UTF8_MB3, UTF8_MB3"_general_cs", 1, 3, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 0, NULL, NULL, 0, 0, NULL, NULL, NULL}
+2 -2
View File
@@ -188,7 +188,7 @@ mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * filename, zen
char tmp_buf[sizeof(conn->error_info->error)];
int tmp_error_no;
*is_warning = TRUE;
/* error occured */
/* error occurred */
tmp_error_no = infile.local_infile_error(info, tmp_buf, sizeof(tmp_buf) TSRMLS_CC);
SET_CLIENT_ERROR(*conn->error_info, tmp_error_no, UNKNOWN_SQLSTATE, tmp_buf);
/* write empty packet to server */
@@ -211,7 +211,7 @@ mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * filename, zen
goto infile_error;
}
/* error during read occured */
/* error during read occurred */
if (bufsize < 0) {
char tmp_buf[sizeof(conn->error_info->error)];
int tmp_error_no;
+2 -4
View File
@@ -636,6 +636,8 @@ MYSQLND_METHOD(mysqlnd_stmt, execute)(MYSQLND_STMT * const s TSRMLS_DC)
have it again.
*/
stmt->result->m.free_result_buffers(stmt->result TSRMLS_CC);
stmt->state = MYSQLND_STMT_PREPARED;
} else if (stmt->state < MYSQLND_STMT_PREPARED) {
/* Only initted - error */
SET_CLIENT_ERROR(*conn->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE,
@@ -1221,8 +1223,6 @@ MYSQLND_METHOD(mysqlnd_stmt, reset)(MYSQLND_STMT * const s TSRMLS_DC)
COPY_CLIENT_ERROR(*stmt->error_info, *conn->error_info);
}
*stmt->upsert_status = *conn->upsert_status;
stmt->state = MYSQLND_STMT_PREPARED;
}
DBG_INF(ret == PASS? "PASS":"FAIL");
DBG_RETURN(ret);
@@ -1261,8 +1261,6 @@ MYSQLND_METHOD(mysqlnd_stmt, flush)(MYSQLND_STMT * const s TSRMLS_DC)
stmt->result->m.skip_result(stmt->result TSRMLS_CC);
}
} while (mysqlnd_stmt_more_results(s) && mysqlnd_stmt_next_result(s) == PASS);
stmt->state = MYSQLND_STMT_PREPARED;
}
DBG_INF(ret == PASS? "PASS":"FAIL");
DBG_RETURN(ret);
+1 -1
View File
@@ -387,7 +387,7 @@ const zend_function_entry odbc_functions[] = {
};
/* }}} */
ZEND_DECLARE_MODULE_GLOBALS(odbc);
ZEND_DECLARE_MODULE_GLOBALS(odbc)
static PHP_GINIT_FUNCTION(odbc);
/* {{{ odbc_module_entry
+4 -4
View File
@@ -816,7 +816,7 @@ PHP_FUNCTION(pcntl_exec)
if (execve(path, argv, envp) == -1) {
PCNTL_G(last_error) = errno;
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error has occured: (errno %d) %s", errno, strerror(errno));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error has occurred: (errno %d) %s", errno, strerror(errno));
}
/* Cleanup */
@@ -826,7 +826,7 @@ PHP_FUNCTION(pcntl_exec)
if (execv(path, argv) == -1) {
PCNTL_G(last_error) = errno;
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error has occured: (errno %d) %s", errno, strerror(errno));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error has occurred: (errno %d) %s", errno, strerror(errno));
}
}
@@ -1127,7 +1127,7 @@ PHP_FUNCTION(pcntl_getpriority)
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error %d: Invalid identifier flag", errno);
break;
default:
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error %d has occured", errno);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error %d has occurred", errno);
break;
}
RETURN_FALSE;
@@ -1167,7 +1167,7 @@ PHP_FUNCTION(pcntl_setpriority)
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error %d: Only a super user may attempt to increase the process priority", errno);
break;
default:
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error %d has occured", errno);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error %d has occurred", errno);
break;
}
RETURN_FALSE;
+1 -1
View File
@@ -13,5 +13,5 @@ unlink($file);
Warning: pcntl_exec() expects at least 1 parameter, 0 given %s
NULL
Warning: pcntl_exec(): Error has occured: (errno %d) %s
Warning: pcntl_exec(): Error has occurred: (errno %d) %s
bool(false)
+1 -1
View File
@@ -134,7 +134,7 @@ static int pdo_mysql_fill_stmt_from_result(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
row_count = mysql_affected_rows(H->server);
if (row_count == (my_ulonglong)-1) {
/* we either have a query that returned a result set or an error occured
/* we either have a query that returned a result set or an error occurred
lets see if we have access to a result set */
if (!H->buffered) {
S->result = mysql_use_result(H->server);
+1 -1
View File
@@ -35,7 +35,7 @@
ZEND_GET_MODULE(pdo_mysql)
#endif
ZEND_DECLARE_MODULE_GLOBALS(pdo_mysql);
ZEND_DECLARE_MODULE_GLOBALS(pdo_mysql)
/*
The default socket location is sometimes defined by configure.
+1 -1
View File
@@ -760,7 +760,7 @@ static struct pdo_dbh_methods sqlite_methods = {
static char *make_filename_safe(const char *filename TSRMLS_DC)
{
if (*filename && strncmp(filename, ":memory:", sizeof(":memory:")-1)) {
if (*filename && memcmp(filename, ":memory:", sizeof(":memory:"))) {
char *fullpath = expand_filepath(filename, NULL TSRMLS_CC);
if (!fullpath) {
-11
View File
@@ -1,11 +0,0 @@
#!/bin/sh
export SCRIPT_NAME=/front.phar.php
export PATH_INFO=/index.php
export SCRIPT_FILENAME=/home/cellog/workspace/php5/ext/phar/tests/front.phar.php
export PATH_TRANSLATED=/home/cellog/workspace/php5/ext/phar/tests/front.phar.php
export REDIRECT_STATUS=1
export REQUEST_METHOD=GET
export REQUEST_URI=/front.phar.php/index.php
cd /home/cellog/workspace/php5
ddd sapi/cgi/php-cgi &
cd /home/cellog/workspace/php5/ext/phar
-139
View File
@@ -1,139 +0,0 @@
<?php
$notes = '
BC BREAKING RELEASE
BC breaks:
* Phar object Compression API is rewritten. Use Phar::compress() and decompress(),
Phar::compressFiles()/decompressFiles() and PharFileInfo->compress()/decompress().
* phar.extract_list and Phar::getExtractList() are removed
Major feature functionality release
* phar.cache_list allows web-based phar applications to run at equal or faster than
their on-disk equivalent [Greg]
* new default stub allows running of phar-based phars without phar extension [Greg/Steph]
* add support for tar-based and zip-based phar archives [Greg]
* add support for OpenSSL-based true signatures [Greg]
* add support for signatures to tar-based phar archives [Greg]
* add Phar::isFileFormat() [Greg]
* add Phar::convertToExecutable(), Phar::convertToData() [Greg]
* add Phar::compress() [Greg]
* rename Phar::compressAllFiles() to compressFiles(), uncompressAllFiles() to
decompressFiles() [Greg]
* conversion to compressed or to other file formats automatically copies the archive
to a new extension (i.e. ".phar" to ".phar.tar" or ".tar" to ".tar.gz") [Steph]
* add Phar::webPhar() for running a web-based application unmodified
directly from a phar archive [Greg]
* file functions (fopen-based and stat-based) can be instructed to only look for
relative paths within a phar via Phar::interceptFileFuncs()
* add PharData class to allow manipulation/creation of non-executable tar and zip archives. [Steph]
non-executable tar/zip manipulation is allowed even when phar.readonly=1 [Greg]
* paths with . and .. work (phar://blah.phar/a/../b.php => phar://blah.phar/b.php) [Greg]
* add support for mkdir()/rmdir() and support for empty directories to phar file format [Greg]
* add option to compress the entire phar file for phar/tar file format [Greg]
* implement Phar::isCompressed() returning 0, Phar::GZ or Phar::BZ2 [Greg]
* implement Phar::copy(string $from, string $to) [Greg]
* implement Phar::running(), returns path or URL to currently executed phar
* implement Phar::buildFromIterator(Iterator $it[, string $base_directory]) [Greg]
* implement Phar::buildFromDirectory(string $base_directory[, string $regex]) [Steph]
* implement Phar::mount() for mounting external paths or files to locations inside a phar [Greg]
* add Phar::delete() [Greg]
* implement Phar::unlinkArchive() [Greg]
Security addition
* aliases are validated so that they contain no directory separators as intended
* on conversion to other formats, user-supplied aliases are validated
Changes since 2.0.0RC2:
fixed PHP Bug #49021: phar tar signature algorithm reports as Unknown (0) in
getSignature() call
fixed PHP Bug #49020: phar misinterprets ustar long filename standard
fixed PHP Bug #49018: phar tar stores long filenames with prefix/name reversed
fixed PHP Bug #48791: open office files always reported as corrupted
fixed PHP Bug #48783: make install will fail saying phar file exists
fixed PHP Bug #48740: PHAR install fails when INSTALL_ROOT is not the final install location
fixed PHP Bug #48681: openssl signature verification for tar archives broken
fixed PHP Bug #48377: error message unclear on converting phar with existing file
fixed isset() on sub-directories (isset("blah") if file "blah/foo.php" exists)
make phar work in PHP 6
Changes since 2.0.0RC1:
security vulnerability in handling of long tar filenames fixed
fixed PECL Bug #14646: phar error message unclear with php stream wrappers
fixed PECL Bug #16338: php_stream_copy_to_stream{,_ex}()
fixed PHP Bug #48257: PharData throws an exception with non-phar tar
fixed PHP Bug #47085: rename() returns true even if the file in PHAR does not exist
fixed PHP Bug #46032: PharData::__construct() - wrong memory read
fixed PHP Bug #46060: Phar::addEmptyDir() breaks
fixed PHP Bug #45907: undefined reference to \'PHP_SHA512Init\'
fixed PHP Bug #45726: PHP_Archive / Archive.php missing
Changes since 2.0.0a2: many bugfixes, removal of phar.extract_list, compression API refactored,
conversion API refactored
Changes since 2.0.0b1: addition of phar.cache_list, many performance improvements and bugfixes
implement OpenSSL asynchronous true package signing
add support for package signing to tar-based archives
require PHP 5.2.1+
';
if (!class_exists("Phar") && !extension_loaded("Phar")) {
die("Extension phar not present");
}
error_reporting(E_ALL & ~E_DEPRECATED);
require_once 'PEAR/PackageFileManager2.php';
PEAR::setErrorHandling(PEAR_ERROR_DIE);
$options = array(
'filelistgenerator' => 'svn',
'changelogoldtonew' => false,
'simpleoutput' => true,
'baseinstalldir' => '/',
'packagedirectory' => dirname(__FILE__),
'packagefile' => 'package.xml',
'clearcontents' => true,
'ignore' => array('package*.php', 'package*.xml'),
'dir_roles' => array(
'docs' => 'doc',
'examples' => 'doc',
'tests' => 'test',
'phar' => 'src',
),
'exceptions' => array(
'CREDITS' => 'doc',
'EXPERIMENTAL' => 'doc',
'LICENSE' => 'doc',
'Makefile.frag' => 'src',
'phar_path_check.re' => 'src',
'TODO' => 'doc',
'phar.phar' => 'script',
),
);
$package = PEAR_PackageFileManager2::importOptions(dirname(__FILE__) . '/package.xml', $options);
$package->clearDeps();
$package->setPhpDep('5.2.1');
$package->setPearInstallerDep('1.4.3');
$package->addPackageDepWithChannel('optional', 'bz2', 'pecl.php.net', false, false, false, false, 'bz2');
// all this false business sets the <providesextension> tag that allows us to have hash built
// in statically
$package->addPackageDepWithChannel('optional', 'hash', 'pecl.php.net', false, false, false, false, 'hash');
$package->addExtensionDep('optional', 'spl');
$package->addExtensionDep('optional', 'zlib');
$package->setPackageType('extsrc');
$package->addRelease();
$package->setReleaseVersion(phpversion('phar'));
$package->setAPIVersion(Phar::apiVersion());
$package->setReleaseStability('stable');
$package->setAPIStability('stable');
$package->setNotes("\n$notes\n");
//$package->addGlobalReplacement('package-info', '@package_version@', 'version');
$package->generateContents();
if (isset($_GET['make']) || (isset($_SERVER['argv']) && @$_SERVER['argv'][1] == 'make')) {
$package->writePackageFile();
} else {
$package->debugPackageFile();
}
?>
-1
View File
@@ -941,7 +941,6 @@ Changes since 2.0.0b1: addition of phar.cache_list, many performance improvement
<file name="zf_test.phpt" role="test" />
</dir> <!-- /tests -->
<file name="build_precommand.php" role="php" />
<file name="cgidebug" role="data" />
<file name="config.m4" role="src" />
<file name="config.w32" role="src" />
<file name="CREDITS" role="doc" />
+13 -3
View File
@@ -38,7 +38,7 @@ static php_uint32 phar_tar_number(char *buf, int len) /* {{{ */
/* }}} */
/* adapted from format_octal() in libarchive
*
*
* Copyright (c) 2003-2009 Tim Kientzle
* All rights reserved.
*
@@ -161,7 +161,7 @@ static int phar_tar_process_metadata(phar_entry_info *entry, php_stream *fp TSRM
size_t save = php_stream_tell(fp), read;
phar_entry_info *mentry;
metadata = (char *) emalloc(entry->uncompressed_filesize + 1);
metadata = (char *) safe_emalloc(1, entry->uncompressed_filesize, 1);
read = php_stream_read(fp, metadata, entry->uncompressed_filesize);
if (read != entry->uncompressed_filesize) {
@@ -337,6 +337,16 @@ bail:
last_was_longlink = 1;
/* support the ././@LongLink system for storing long filenames */
entry.filename_len = entry.uncompressed_filesize;
/* Check for overflow - bug 61065 */
if (entry.filename_len == UINT_MAX) {
if (error) {
spprintf(error, 4096, "phar error: \"%s\" is a corrupted tar file (invalid entry size)", fname);
}
php_stream_close(fp);
phar_destroy_phar_data(myphar TSRMLS_CC);
return FAILURE;
}
entry.filename = pemalloc(entry.filename_len+1, myphar->is_persistent);
read = php_stream_read(fp, entry.filename, entry.filename_len);
@@ -367,7 +377,7 @@ bail:
}
read = php_stream_read(fp, buf, sizeof(buf));
if (read != sizeof(buf)) {
efree(entry.filename);
if (error) {
Loaded 100 of 259 files, more files were not shown because too many files have changed in this diff. Show more