Commit Graph

30198 Commits

Author SHA1 Message Date
andrey
049abdfb26 fix valgrind warning 2012-07-09 18:13:35 +03:00
andrey
66e1ac23c1 Merge branch 'PHP-5.4' of ssh://git.php.net/php-src into PHP-5.4 2012-07-09 17:59:42 +03:00
andrey
555db7dc4e fix valgrind warning 2012-07-09 17:59:23 +03:00
Anatoliy Belsky
f76bb14814 Merge branch 'PHP-5.4'
* PHP-5.4:
  fixed #62433 test for win
2012-07-09 12:45:56 +02:00
Anatoliy Belsky
2032470e41 fixed #62433 test for win 2012-07-09 12:42:10 +02:00
Xinchen Hui
0e97cdf86b Merge branch 'PHP-5.4'
* PHP-5.4:
  update NEWS
  Fixed bug #62499 (curl_setopt($ch, CURLOPT_COOKIEFILE, "") returns false)
  appease MSVC (doesnt like unary minus of unsigned ints)
  appease MSVC (doesnt like unary minus of unsigned ints)
2012-07-09 08:46:38 +08:00
Xinchen Hui
0398cc22a9 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed bug #62499 (curl_setopt($ch, CURLOPT_COOKIEFILE, "") returns false)
  appease MSVC (doesnt like unary minus of unsigned ints)

Conflicts:
	ext/curl/interface.c
2012-07-09 08:38:03 +08:00
Xinchen Hui
c819cf9d6b Fixed bug #62499 (curl_setopt($ch, CURLOPT_COOKIEFILE, "") returns false)
this bc break is caused by the fix for #61948
2012-07-09 08:32:40 +08:00
Xinchen Hui
96651f8094 Merge branch 'PHP-5.4'
* PHP-5.4:
  Fixed Bug #62500 (Segfault in DateInterval class when extended)
2012-07-09 00:28:04 +08:00
Xinchen Hui
e3b9b1e6dc Fixed Bug #62500 (Segfault in DateInterval class when extended)
This fix also fixed bug #62508  (Segfault while access a non-string
property of DateInterval object)
2012-07-09 00:25:48 +08:00
Stanislav Malyshev
9aa4851485 Merge branch 'PHP-5.4'
* PHP-5.4:
  Added in NEWS and UPGRADING for feature 55218
  Adding in test for feature 55218
  Implements feature 55218

Conflicts:
	UPGRADING
2012-07-07 12:52:35 -07:00
Stanislav Malyshev
a213c10ef2 Merge branch 'pull-request/112' into PHP-5.4
* pull-request/112:
  Added in NEWS and UPGRADING for feature 55218
  Adding in test for feature 55218
  Implements feature 55218
2012-07-07 12:51:26 -07:00
Nikita Popov
ed54357fcd Merge branch 'PHP-5.4'
* PHP-5.4:
  Fix potential integer overflow in nl2br
  Fix potential integer overflow in bin2hex
2012-07-05 21:00:16 +02:00
Nikita Popov
5cf2f87fa7 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fix potential integer overflow in nl2br
  Fix potential integer overflow in bin2hex

Conflicts:
	ext/standard/string.c
2012-07-05 20:59:18 +02:00
Nikita Popov
157ddd9577 Fix potential integer overflow in nl2br
The buffer size was calculated manually, thus creating integer overflows
for very large inputs, e.g. nl2br(str_repeat("\n", 613566757)).

The code now uses safe_emalloc, thus making the code throw an error
instead of crashing.
2012-07-05 20:41:54 +02:00
Nikita Popov
88f46b162b Fix potential integer overflow in bin2hex
The code was already using safe_emalloc but did the multiplication in
the first argument, thus making the use of safe_emalloc pretty useless.

The *2 is now moved to the second argument.
2012-07-05 20:14:49 +02:00
johannes
bcc87ba68e Revert change 3f3ad30c50: There shouldn't be new features in 5.3, especially
not if they aren't in 5.4, too.
2012-07-05 00:55:47 +02:00
Xinchen Hui
8d81a03e43 Merge branch 'PHP-5.4'
* PHP-5.4:
  Fixed bug #62433 (Inconsistent behavior of RecursiveDirectoryIterator to dot files).
2012-07-02 11:34:33 +08:00
Xinchen Hui
be4053cea0 Fixed bug #62433 (Inconsistent behavior of RecursiveDirectoryIterator to dot files). 2012-07-02 11:33:38 +08:00
Gustavo André dos Santos Lopes
46629e35ff Refactored internal_get_timestamp()
Added bounds checking for 32-bit ints.

Do not fetch array elements that ::parse() generates but that
::format() does not actually care about.y
2012-07-02 00:26:38 +02:00
Gustavo André dos Santos Lopes
2416719fb1 Unified zval -> UDate conversions
Now IntlDateFormatter::format() also accepts IntlCalendar objects.
Code is shared in MessageFormatter and IntlDateFormatter.
2012-07-02 00:24:54 +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
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
f3a4612c47 Merge branch 'PHP-5.4'
* PHP-5.4:
  fix bug #61359: json_encode() calls too many reallocs
2012-06-30 19:15:10 -07:00
Stanislav Malyshev
b741d3315b fix bug #61359: json_encode() calls too many reallocs 2012-06-30 19:14:30 -07:00
Stanislav Malyshev
a3322f8927 Merge branch 'PHP-5.4'
* PHP-5.4:
  Fixed the common misspelling of the word occurred (occured -> occurred)
2012-06-30 17:00:25 -07:00
Marc Easen
896ac689c9 Fixed the common misspelling of the word occurred (occured -> occurred) 2012-06-30 16:54:03 -07:00
andrey
c51fbbe4b4 merge 2012-06-29 16:58:53 +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
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
andrey
2abf2738f4 Merge branch 'master' of ssh://git.php.net/php-src 2012-06-29 14:39:47 +03:00
Nikita Popov
0b96fb4af5 Merge branch 'PHP-5.4'
* PHP-5.4:
  Fix some lengths in crypt()
2012-06-29 13:15:53 +02: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
267eba1805 Merge branch 'master' of ssh://git.php.net/php-src 2012-06-29 12:44:49 +03:00
andrey
0620ad2031 Merge branch 'PHP-5.4' 2012-06-29 12:43:41 +03: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
Anthony Ferrara
63318772ae Merge branch 'PHP-5.4'
* PHP-5.4:
  Fixed bug #62443 (Crypt SHA256/512 Segfaults With Malformed Salt)
2012-06-28 20:38:31 -04: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
cd7ab5cd11 Merge branch 'PHP-5.4'
* PHP-5.4:
  Add json_last_error_msg() function
2012-06-29 00:22:45 +02: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
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
andrey
46879ee4c2 Merge branch 'master' of http://git.php.net/repository/php-src 2012-06-27 16:51:35 +03:00
andrey
6e648e9340 trace allocations in a file 2012-06-27 16:51:07 +03:00
Felipe Pena
8d264dba93 - Fixed build 2012-06-27 09:01:02 -03:00
Nikita Popov
31dbd46641 Merge branch 'PHP-5.4'
* PHP-5.4:
  Improve JSON error handling

Conflicts:
	main/php_version.h
2012-06-27 12:32:20 +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
02d8e8959b Merge branch 'master' of git.php.net:/php-src
* 'master' of git.php.net:/php-src: (22 commits)
  Fix bug #62373 (serialize() generates wrong reference to the object)
  Update UPGRADING given 7596445
  Fix typo in error message
  BreakIterator: fix compat with old ICU versions
  Fix build error one ext/intl
  Duplicate test for ICU 49
  Fix undeclared intl_locale_get_default()
  Fix memory allocation checks for base64 encode
  Improve json_encode error handling
  - BFN
  - BFN
  - Improved fix for #62384
  BreakIterator::getPartsIterator: new optional arg
  Added IntlCodePointBreakIterator.
  Add Intl prefix to BreakIterator/RuleBasedBI
  Remove trailing space
  Replaced zend_parse_method_params with plain zpp
  BreakIter: Removed getAvailableLocales/getHashCode
  Change in BreakIterator::getPartsIterator()
  BreakIterator: add rules status constants
  ...
2012-06-26 12:34:36 +02:00
Johannes Schlüter
d6e421f6a6 Pass orig filename and line through to emalloc and friends 2012-06-26 12:33:36 +02:00
Moriyoshi Koizumi
88cf472b92 Merge branch 'PHP-5.4'
* PHP-5.4:
  Fix bug #62373 (serialize() generates wrong reference to the object)
2012-06-25 19:16:40 +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
Gustavo André dos Santos Lopes
75964450ed Merge branch 'break_iterator'
* break_iterator:
  Fix typo in error message
  BreakIterator: fix compat with old ICU versions
  Fix build error one ext/intl
  BreakIterator::getPartsIterator: new optional arg
  Added IntlCodePointBreakIterator.
  Add Intl prefix to BreakIterator/RuleBasedBI
  Remove trailing space
  Replaced zend_parse_method_params with plain zpp
  BreakIter: Removed getAvailableLocales/getHashCode
  Change in BreakIterator::getPartsIterator()
  BreakIterator: add rules status constants
  Tests for (RuleBased)BreakIterator.
  BreakIterator and RuleBasedBreakiterator added
2012-06-25 12:11:49 +02:00
Gustavo André dos Santos Lopes
0df73a85e1 Fix typo in error message 2012-06-25 12:06:31 +02:00
Gustavo André dos Santos Lopes
d8b067e66f BreakIterator: fix compat with old ICU versions 2012-06-25 12:05:13 +02:00
Gustavo André dos Santos Lopes
5a9dca458a Fix build error one ext/intl 2012-06-25 11:53:20 +02:00
Gustavo André dos Santos Lopes
715e59ad82 Duplicate test for ICU 49
The output in ICU < 49 actually seems wrong here; ICU 49 seems to
fix the data.
2012-06-25 11:13:23 +02:00
Gustavo André dos Santos Lopes
9c5074a484 Fix undeclared intl_locale_get_default()
This was causing segfaults at least in the resourcebundle
constructor.

Also moved intl_locale_get_default() to a more central location
and fixed a constness warning in resourcebundle_ctor().
2012-06-25 10:59:58 +02:00
Nikita Popov
ee8b9d5c6f Merge branch 'PHP-5.4'
* PHP-5.4:
  Fix memory allocation checks for base64 encode
2012-06-25 00:09:05 +02: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
d68b614b09 Merge branch 'PHP-5.4'
* PHP-5.4:
  Improve json_encode error handling
  - BFN
  - BFN
2012-06-23 21:15:59 +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
1fc5659ebd Merge branch 'PHP-5.4'
* PHP-5.4:
  - Improved fix for #62384
2012-06-23 15:16: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
Gustavo André dos Santos Lopes
77daa3482d BreakIterator::getPartsIterator: new optional arg
Can take one of:
* IntlPartsIterator::KEY_SEQUENTIAL (keys are 0, 1, ...)
* IntlPartsIterator::KEY_LEFT (keys are left boundaries)
* IntlPartsIterator::KEY_LEFT (keys are right boundaries)

The default is IntlPartsIterator::KEY_SEQUENTIAL (the previous behavior).
2012-06-22 18:52:06 +02:00
Gustavo André dos Santos Lopes
0a7ae87e91 Added IntlCodePointBreakIterator.
Objects of this class can be instantiated with

IntlBreakIterator::createCodePointInstance()

The method does not take a locale, as it would not make sense in this
context.

This class has one additional method:

long IntlCodePointIterator::getLastCodePoint()

which returns either -1 or the last code point we moved over, if any
(and discounting any movement before the last call to
IntlBreakIterator::first() or IntlBreakIterator::last()).
2012-06-22 18:19:54 +02:00
Johannes Schlüter
21cbe30be3 Merge branch 'PHP-5.4'
* PHP-5.4:
  Remove extra ;
2012-06-22 17:33:38 +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
d980e95997 Merge branch 'PHP-5.4'
* PHP-5.4:
  - Fixed bug #62384 (Attempting to invoke a Closure more than once causes segfaul)
2012-06-22 12:06:05 -03: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
4f5c7ee240 Merge branch 'PHP-5.4'
* PHP-5.4:
  Improve check for :memory: pseudo-filename in SQlite
2012-06-22 12:50:55 +02: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
Lonny Kapelushnik
2178b1d02d Adding in test for feature 55218 2012-06-21 23:21:17 -04:00
Lonny Kapelushnik
f1ef8b327f Implements feature 55218
Allows you to recursively check namespaces under a child node
instead of from the root of the XML doc
2012-06-21 22:34:46 -04:00
Johannes Schlüter
6e6e98b9e3 Merge branch 'PHP-5.4'
* PHP-5.4:
  Remove outdated and user-specific files
2012-06-20 19:48:17 +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
Anatoliy Belsky
40af974c73 fix windows build 2012-06-20 15:02:49 +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
12b252e1dd Merge branch 'PHP-5.4'
* PHP-5.4:
  Fixed bug RecursiveArrayIterator does not implement Countable
2012-06-19 18:13:14 +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
e31cebcae0 Merge branch 'PHP-5.4'
* PHP-5.4:
  sync zip ext version with pecl
2012-06-19 17:18:00 +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
5087778f42 Merge branch 'PHP-5.4'
* PHP-5.4:
  split gzgetc_basic.phpt for zlib 1.2.7
2012-06-19 14:13:53 +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
69ee7a241b Merge branch 'PHP-5.4'
* PHP-5.4:
  Reverted the BC fix regarding to #57905, test adopted
2012-06-17 16:16:59 +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
Anatoliy Belsky
bf8b58429b Merge branch 'PHP-5.4'
* PHP-5.4:
  Fixed bug #62312 ext\sockets\tests\socket_import_stream-4.phpt fails
2012-06-14 18:04:13 +02: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
b04e8145c9 Merge branch 'PHP-5.4'
* PHP-5.4:
  Fix bug #62270 Test bug - ext/fileinfo/tests/finfo_open_error-win32
2012-06-14 18:01:23 +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
Stanislav Malyshev
784b4cddc6 simplify boolval() 2012-06-13 12:03:36 -07:00
Anthony Ferrara
03536e889a More cleanup of documentation and comments, as well as code formatting 2012-06-12 15:05:44 -04:00
Anthony Ferrara
2f1cd2cb13 Fix tests to use proper casing 2012-06-12 14:52:43 -04:00
Anthony Ferrara
43eb8dc04a Remove un-needed memset, and replacing stray spaces 2012-06-12 14:32:21 -04: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
Anthony Ferrara
df3d351cad Update error messages to be more inline with PHP standards 2012-06-12 14:10:35 -04:00
Anthony Ferrara
4918acccc6 refactor away un-necessary casts in hashing routines 2012-06-12 14:09:16 -04:00
Anthony Ferrara
6387498823 Create hash_pbkdf2 function addition 2012-06-12 09:57:11 -04:00
Scott MacVicar
5b3c9f4fd1 One more time 2012-06-11 16:23:27 -07:00
Scott MacVicar
bcd671d999 Merge branch '5.4'
* 5.4:
  Rename openssl_pkcs5_pbkdf2_hmac() to something that doesn't sound like a spell.
  Add PBKDF2 support via openssl()

Conflicts:
	ext/openssl/openssl.c
2012-06-11 16:04:01 -07:00
Scott MacVicar
aadf59dfa4 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 15:59:58 -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
Scott MacVicar
b481ebae55 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 12:38:54 -07:00
Felipe Pena
733aaf23b1 - Fixed build (PKCS5_PBKDF2_HMAC is from 1.0.0) 2012-06-11 14:08:38 -03:00
Anatoliy Belsky
0c6351778a Merge branch 'PHP-5.4'
* PHP-5.4:
  Fix bug #62271 test bug - ext/wddx/tests/bug48562.phpt
2012-06-11 17:03:14 +02:00
Matt Ficken
a18cede1c5 Fix bug #62271 test bug - ext/wddx/tests/bug48562.phpt 2012-06-11 17:00:36 +02:00
Scott MacVicar
32040b574e Merge branch '5.4'
* 5.4:
  Add PBKDF2 support via openssl()
2012-06-11 00:29:02 -07:00
Scott MacVicar
f4847efc5d 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 00:24:44 -07:00
Gustavo André dos Santos Lopes
cee31091a9 Add Intl prefix to BreakIterator/RuleBasedBI 2012-06-10 22:42:38 +02:00
David Soria Parra
ff13501d33 Merge branch 'PHP-5.4'
By Stanislav Malyshev (1) and michelangelo (1)
* PHP-5.4:
  Adding a test for ext/posix/tests/posix_getegid_basic.phpt
  typo
2012-06-10 17:08:10 +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
87dd0269ba Remove trailing space 2012-06-10 13:26:28 +02:00
Gustavo André dos Santos Lopes
a4925fae9b Replaced zend_parse_method_params with plain zpp 2012-06-10 00:23:09 +02:00
Gustavo André dos Santos Lopes
afed66bb9e BreakIter: Removed getAvailableLocales/getHashCode 2012-06-10 00:05:00 +02:00
Gustavo André dos Santos Lopes
4ec75539db Change in BreakIterator::getPartsIterator()
BreakIterator::getPartsIterator() now returns an IntlIterator subclass
with a special method, getBreakIterator(), that returns the
associated BreakIterator.

Any call to getRuleStatus() is forwarded to the BreakIterator.
2012-06-10 00:04:53 +02:00
Gustavo André dos Santos Lopes
76a26d8419 Merge branch '5.4'
* 5.4:
  Fix bug #62266
  rearrange news
  typo
  NEWS File
2012-06-09 17:32:18 +01: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
Anatoliy Belsky
730493f2bb Merge branch 'PHP-5.4'
* PHP-5.4:
  set current versions for libzip and zip ext
2012-06-07 22:47:00 +02: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
ba4bfad257 Merge branch 'PHP-5.4'
* PHP-5.4:
  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
2012-06-07 21:07:53 +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
018a9b321f Merge commit '15213768e6cc098ab4e53cacc3b5eb86fa85284a' into PHP-5.3 2012-06-07 14:18:34 -03:00
Pierrick Charron
5b10a65617 Merge branch 'PHP-5.4'
* PHP-5.4:
  Fixed bug #51094 (parse_ini_file() with INI_SCANNER_RAW cuts a value that includes a semi-colon)
2012-06-07 17:51:56 +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
753c3367c0 Merge branch 'pull-request/60'
By David Soria Parra (1) and Jille Timmermans (1)
* pull-request/60:
  NEWS entry for boolval()
  Implement boolval() with a test
2012-06-07 09:38:17 +02:00
Xinchen Hui
07d0eab204 Merge branch 'PHP-5.4'
By Gustavo André dos Santos Lopes (4) and others
via Felipe Pena (2) and Xinchen Hui (2)
* PHP-5.4:
  Remove unused codes
  based on microsoft's description,the direct convert from FILETIME struct to __int64 is unsafe.
  merge 5.3 entries
  restore NEWS
  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:42:35 +08: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
Jille Timmermans
74b4ef5036 Implement boolval() with a test 2012-06-06 22:34:51 +02: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
c6593a0e9b BreakIterator: add rules status constants 2012-06-04 23:09:10 +02:00
Gustavo André dos Santos Lopes
036b1eb291 Tests for (RuleBased)BreakIterator. 2012-06-04 22:25:08 +02:00
Gustavo André dos Santos Lopes
f5b421621d BreakIterator and RuleBasedBreakiterator added
This commit adds wrappers for the classes BreakIterator and
RuleBasedbreakIterator. The C++ ICU classes are described here:
<http://icu-project.org/apiref/icu4c/classBreakIterator.html>
<http://icu-project.org/apiref/icu4c/classRuleBasedBreakIterator.html>

Additionally, a tutorial is available at:
<http://userguide.icu-project.org/boundaryanalysis>

This implementation wraps UTF-8 text in a UText. The text is
iterated without any copying or conversion to UTF-16. There is
also no validation that the input is actually UTF-8; where there
are malformed sequences, the UText will simply U+FFFD.

The class BreakIterator cannot be instantiated directly (has a
private constructor). It provides the interface exposed by the ICU
abstract class with the same name. The PHP class is not abstract
because we may use it to wrap native subclasses of BreakIterator
that we don't know how to wrap. This class includes methods to
move the iterator position to the beginning (first()), to the
end (last()), forward (next()), backwards (previous()), to the
boundary preceding a certain position (preceding()) and following
a certain position (following()) and to obtain the current position
(current()). next() can also be used to advance or recede an
arbitrary number of positions.

BreakIterator also exposes other native methods:
getAvailableLocales(), getLocale() and factory methods to build
several predefined types of BreakIterators: createWordInstance()
for word boundaries, createCharacterInstance() for locale
dependent notions of "characters", createSentenceInstance() for
sentences, createLineInstance() and createTitleInstance() -- for
title casing breaks. These factories currently return
RuleBasedbreakIterators where the names of the rule sets are found
in the ICU data, observing the passed locale (although the locale
is taken into considering there are very few exceptions to the
root rules).

The clone and compare_object PHP object handlers are also
implemented, though the comparison does not yield meaningful results
when used with >, <, >= and <=.

Note that BreakIterator is an iterator only in the sense of the
first 'Iterator' in 'IteratorIterator', i.e., it does not
implement the Iterator interface. The reason is that there is
no sensible implementation for Iterator::key(). Using it for
an ordinal of the current boundary is not feasible because
we are allowed to move to any boundary at any time. It we were
to determine the current ordinal when last() is called we'd
have to traverse the whole input text to find out how many
breaks there were before. Therefore, BreakIterator implements
only Traversable. It can be wrapped in an IteratorIterator,
but the usual warnings apply.

Finally, I added a convenience method to BreakIterator:
getPartsIterator(). This provides an IntlIterator, backed
by the BreakIterator PHP object (i.e. moving the pointer or
changing the text in BreakIterator affects the iterator
and also moving the iterator affects the backing BreakIterator),
which allows traversing the text between each boundary.
This iterator uses the original text to retrieve the text
between two positions, not the code points returned by the
wrapping UText. Therefore, if the text includes invalid code
unit sequences, these invalid sequences will be in the output
of this iterator, not U+FFFD code points.

The class RuleBasedIterator exposes a constructor that allows
building an iterator from arbitrary compiled or non-compiled
rules. The form of these rules in described in the tutorial linked
above. The rest of the methods allow retrieving the rules --
getRules() and getCompiledRules() --, a hash code of the rule set
(hashCode()) and the rules statuses (getRuleStatus() and
getRuleStatusVec()).

Because the RuleBasedBreakIterator constructor may return parse
errors, I reuse the UParseError to text function that was in the
transliterator files. Therefore, I move that function to
intl_error.c.

common_enum.cpp was also changed, mainly to expose previously
static functions. This avoided code duplication when implementing
the BreakIterator iterator and the IntlIterator returned by
BreakIterator::getPartsIterator().
2012-06-04 22:25:07 +02: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
Gustavo André dos Santos Lopes
6efc877826 Merge branch 'datefmt_tz_cal_interop'
* datefmt_tz_cal_interop:
  Added and fixed tests given eb346ef
  DateFormat plays nice with Calendar, TimeZone
  Added private constructor to IntlTimeZone.
  Fixed write in constant memory.
2012-06-03 23:08:19 +01:00
Gustavo André dos Santos Lopes
758f0686d4 Added and fixed tests given eb346ef 2012-06-04 00:02:35 +02:00
Felipe Pena
9434f5e41f Merge commit 'e59b6dc0ae803d49c3f620818285f98dfb61fd57' 2012-06-03 19:02:00 -03:00
Felipe Pena
8779a9aad5 Merge commit 'e59b6dc0ae803d49c3f620818285f98dfb61fd57' into PHP-5.4 2012-06-03 19:01:50 -03:00
Gustavo André dos Santos Lopes
eb346ef0f4 DateFormat plays nice with Calendar, TimeZone
The following changes were made:

* The IntlDateFormatter constructor now accepts the usual values
  for its $timezone argument. This includes timezone identifiers,
  IntlTimeZone objects, DateTimeZone objects and NULL. An empty
  string is not accepted. An invalid time zone is no longer accepted
  (it used to use UTC in this case).
* When NULL is passed to IntlDateFormatter, the time zone specified in
  date.timezone is used instead of the ICU default.
* The IntlDateFormatter $calendar argument now accepts also an
  IntlCalendar. In this case, IntlDateFormatter::getCalendar() will
  return false.
* The time zone passed to the IntlDateFormatter is ignored if it is
  NULL and if the calendar passed is an IntlCalendar object -- in this
  case, the IntlCalendar time zone will be used instead. Otherwise,
  the time zone specified in the $timezone argument is used instead.
* Added IntlDateFormatter::getCalendarObject(), which always returns
  the IntlCalendar object that backs the DateFormat, even if a
  constant was passed to the constructor, i.e., if an IntlCalendar
  was not passed to the constructor.
* Added IntlDateFormatter::setTimeZone(). It accepts the usual values
  for time zone arguments. If NULL is passed, the time zone of the
  IntlDateFormatter WILL be overridden with the default time zone,
  even if an IntlCalendar object was passed to the constructor.
* Added IntlDateFormatter::getTimeZone(), which returns the time zone
  that's associated with the DateFormat.
* Depreacated IntlDateFormatter::setTimeZoneId() and made it an alias
  for IntlDateFormatter::setTimeZone(), as the new ::setTimeZone()
  also accepts plain identifiers, besides other types.
  IntlDateFormatter::getTimeZoneId() is not deprecated however.
* IntlDateFormatter::setCalendar() with a constant passed should now
  work correctly. This requires saving the requested locale to the
  constructor.
* Centralized the hacks required to avoid compilation disasters on
  Windows due to some headers being included inside and outside of
  extern "C" blocks.
2012-06-04 00:01:48 +02:00
Felipe Pena
4fc49c04df Merge commit 'e59b6dc0ae803d49c3f620818285f98dfb61fd57' into PHP-5.3 2012-06-03 19:00:49 -03:00
Gustavo André dos Santos Lopes
72beff0d41 Added private constructor to IntlTimeZone. 2012-06-03 23:39:34 +02:00
Gustavo André dos Santos Lopes
f3802db7a0 Fixed write in constant memory.
clang did not forgive.
2012-06-03 23:39:27 +02: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
andrey
2c230fb574 close the underlying stream as early as possible and so notify the
NET layer
2012-06-01 22:12:08 +03:00
andrey
ba23ddd06c Merge branch 'master' of git.php.net:php-src 2012-06-01 11:22:52 +03:00
andrey
f96d19fa70 close the stream whenever possible, no need to keep it open altough the
connection is marked as unusable
2012-06-01 11:22:19 +03:00
Xinchen Hui
fc6462ec7b Merge branch 'PHP-5.4'
* PHP-5.4:
  Fixed Bug #62202 (ReflectionParameter::getDefaultValue() memory leaks with constant)
  sort NEWS
2012-06-01 15:00:55 +08: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
Reeze Xia
13a9555342 Implemented FR #61602 Allow access to name of constant used as default value
This is an improved commit for FR #61602, this fixed the previous
commit 054f3e3's C99 compiler compatibility issue
2012-05-31 23:31:00 +08:00
andrey
9a64a23caf Merge branch 'master' of git.php.net:php-src 2012-05-31 15:46:55 +03:00
andrey
0d1bc3e8e5 more refactoring stuff. Reduced code duplication in the authentication
code
2012-05-31 15:46:26 +03:00
Stanislav Malyshev
0c658c39f6 Merge branch 'PHP-5.4'
* PHP-5.4:
  fix bug #55042 - erealloc without updating pointer
2012-05-30 22:27:54 -07:00
Stanislav Malyshev
ed6ce83101 fix bug #55042 - erealloc without updating pointer 2012-05-30 22:26:26 -07:00
Johannes Schlüter
33849c2211 Merge branch 'PHP-5.4'
* PHP-5.4:
  Fix bug #62186 readline fails to compile
  fix unchecked emalloc (cherry picked from commit 158d8a6b08)
2012-05-31 01:18:02 +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
andrey
56532895a8 Merge branch 'master' of git.php.net:php-src 2012-05-30 15:25:26 +03:00
andrey
5a2578a333 small refactoring - factour out code from connection establishment.
Add a define for the default authentication protocol - get away from
the hardcoded magic value
2012-05-30 15:24:17 +03:00
Stanislav Malyshev
ec2029a894 Merge branch 'PHP-5.4'
* PHP-5.4:
  fix test
  fix test
2012-05-29 23:53:01 -07:00
Stanislav Malyshev
9b98cf7865 fix test 2012-05-29 23:52:47 -07:00
Xinchen Hui
4770fe2c97 Merge branch 'PHP-5.4'
* PHP-5.4:
  Typofix in comment in proc_open.c
2012-05-30 14:44:35 +08: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
f428578138 Merge branch 'PHP-5.4'
* PHP-5.4:
  fix CVE-2012-2143
2012-05-29 23:14:09 -07: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