Compare commits

..
Author SHA1 Message Date
Stanislav Malyshev 00f84126d1 5.4.13 2013-03-13 22:29:53 -07:00
Stanislav Malyshev 993f9fbccc Fixed timestamp update on Phar contents modification. 2013-03-02 15:57:00 -08:00
Stanislav Malyshev 0351fd5552 5.4.13 RC1 2013-02-26 22:24:09 -08:00
Stanislav Malyshev 7ffb77d243 add news for SOAP fixes 2013-02-26 22:20:21 -08:00
Stanislav Malyshev 7c08232509 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Bug #52861: unset fails with ArrayObject and deep arrays
2013-02-26 22:12:36 -08:00
Mike Willbanks 61099f8585 Bug #52861: unset fails with ArrayObject and deep arrays
When checking to make into a reference write, readwrite are checked but not unset
2013-02-26 22:11:52 -08:00
Remi Collet 52d1add0fe add support for ppc64p7 arch (Power7 optimized) 2013-02-26 14:35:34 +01:00
Xinchen Hui d24ac6953e Merge branch 'PHP-5.3' into PHP-5.4
Conflicts:
	ext/spl/spl_fixedarray.c
2013-02-24 12:58:39 +08:00
Xinchen Hui 1b58bd39a6 Fixed bug #64264 (SPLFixedArray toArray problem) 2013-02-24 12:55:53 +08:00
Johannes Schlüter 064c62e4cf Fix #60840 (undefined symbol: mysqlnd_debug_std_no_trace_funcs) 2013-02-21 16:49:28 +01:00
Johannes Schlüter 1e9bc56775 Merge branch 'PHP-5.3' into PHP-5.4 2013-02-21 15:10:15 +01:00
Johannes Schlüter fcd4b5335a Fix TSRM (after afc1debb) 2013-02-21 15:08:58 +01:00
Dmitry Stogov b5d267aa95 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  PHAR should modify entry timestamp when it's modified
2013-02-21 15:57:26 +04:00
Dmitry Stogov 7b113d789d PHAR should modify entry timestamp when it's modified 2013-02-21 15:55:20 +04:00
Sara Golemon c16d6befd4 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  http-stream test requires network connectivity
2013-02-21 03:21:49 -08:00
Sara Golemon bc55a8eb9f http-stream test requires network connectivity 2013-02-21 03:21:23 -08:00
Xinchen Hui 9a44a9806c Fixed bug #64235 (Insteadof not work for class method in 5.4.11)
As we discussed with stefan, we think previous of allowing use with
classes is a bug, should be forbided, anyway, the error message should
be improved.
2013-02-21 18:18:41 +08:00
Anatol Belski bae95bd9d4 updated lib versions 2013-02-21 10:27:37 +01:00
Anatol Belski 07a13fd9fa Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  updated lib versions
2013-02-21 10:26:38 +01:00
Anatol Belski 81e9aa6c8d updated lib versions 2013-02-21 09:46:50 +01:00
Dmitry Stogov c737b89473 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed external entity loading

Conflicts:
	ext/libxml/libxml.c
	ext/libxml/php_libxml.h
2013-02-20 22:27:41 +04:00
Dmitry Stogov 8e76d0404b Fixed external entity loading 2013-02-20 22:14:59 +04:00
Johannes Schlüter 021f57ef0e Merge branch 'PHP-5.3' into PHP-5.4 2013-02-20 11:57:11 +01:00
Johannes Schlüter afc1debb2f 5.3.22 NEWS 2013-02-20 11:56:29 +01:00
Anatol Belski cc34dfce16 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  fix the test for curl 7.29.0+
2013-02-19 09:04:52 +01:00
Anatol Belski 558c5dbe65 fix the test for curl 7.29.0+ 2013-02-19 09:04:06 +01:00
Dmitry Stogov 42437dd870 Fixed bug #64070 (Inheritance with Traits failed with error) 2013-02-18 16:07:51 +04:00
Stanislav Malyshev 7b0107cc5d fix bug #61930: openssl corrupts ssl key resource when using openssl_get_publickey() 2013-02-17 13:28:42 -08:00
Stanislav Malyshev 92b1cb3ca0 update NEWS 2013-02-17 02:37:58 -08:00
Jonh Wendell 59b016192d Added HTTP codes as of RFC 6585
Added descriptions for the new HTTP codes:

- 428 Precondition Required
- 429 Too Many Requests
- 431 Request Header Fields Too Large
- 511 Network Authentication Required
2013-02-17 01:18:40 -08:00
Xinchen Hui 263accb626 Merge branch 'PHP-5.3' into PHP-5.4 2013-02-17 11:05:34 +08:00
Xinchen Hui 01ae5c3c2f Fixed bug #64228 (RecursiveDirectoryIterator always assumes SKIP_DOTS) 2013-02-17 11:04:36 +08:00
Xinchen Hui 375e3c273b Fix test failed after 0ea83ff847 2013-02-16 22:28:28 +08:00
Boris Lytochkin 68fa6a3eb7 +Fixed bug #64124 (IPv6 malformed). (Boris Lytochkin) 2013-02-14 23:08:08 +04:00
Dmitry Stogov 4b900f4831 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Proper bit reset code
2013-02-13 22:07:21 +04:00
Dmitry Stogov 188c196d4d Proper bit reset code 2013-02-13 22:06:37 +04:00
Ard Biesheuvel 050aae2860 Fixed bug #64197 (_Offsetof() macro used but not defined on ARM/Clang)
Updated the code to test for __ARMCC_VERSION instead of __arm, as
that is a more reliable indicator of whether the ARMCC compiler is
being used.
2013-02-13 12:22:50 +01:00
Remi Collet e67a2b9e47 Fixed bug #64142 (dval to lval different behavior on ppc64)
See discussion on internals
http://marc.info/?t=136042277700003&r=1&w=2
2013-02-11 09:10:51 +01:00
Stanislav Malyshev bfdb889d4f update NEWS 2013-02-09 23:02:26 -08:00
Moriyoshi Koizumi 0ea83ff847 mb_split() can now handle empty matches like preg_split() does. 2013-02-10 15:04:23 +09:00
Boris Lytochkin 92a7924c1a Merge branch 'PHP-5.4' of https://git.php.net/push/php-src into PHP-5.4 2013-02-07 21:43:37 +04:00
Dmitry Stogov 1a18e84822 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Disabled external entities loading
2013-02-07 16:09:12 +04:00
Dmitry Stogov afe98b7829 Disabled external entities loading 2013-02-07 16:07:05 +04:00
Boris Lytochkin ed6763420c fix bug #64124 (IPv6 malformed)
hostname returned from zend_parse_parameters() was modified in
netsnmp_session_init() that caused imput parameter modification along with
unpredictable changes when parameter is a constant sctring.

One typo in comment was fixed.
2013-02-07 14:48:28 +04:00
Dmitry Stogov 702b436ef4 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Check if soap.wsdl_cache_dir confirms to open_basedir
2013-02-07 13:10:04 +04:00
Dmitry Stogov cc4c318b0c Check if soap.wsdl_cache_dir confirms to open_basedir 2013-02-07 13:04:47 +04:00
Remi Collet e7ce002c01 revert 2013-02-05 12:28:47 +01:00
Remi Collet 6533094d9e Fixed bug #64142 (dval to lval different behavior on ppc64)
On x86_64:
(long)(double)9223372036854775807+1 = -9223372036854775808
On ppc64
(long)(double)9223372036854775807-1 = 9223372036854775807
2013-02-04 15:19:32 +01:00
Andrey Hristov 740b823be8 check the validity of the parameter 2013-02-04 14:27:56 +01:00
Andrey Hristov 643ce95b5b Merge branch 'PHP-5.4' of ssh://git.php.net/php-src into PHP-5.4 2013-02-04 14:15:58 +01:00
Gustavo Lopes 0110662ae9 Move macro back to .c file
Because it depends on a static function on that .c file.
2013-02-02 18:32:38 +01:00
Gustavo Lopes 73de4d8c68 Merge branch 'sockets_54_improv' into PHP-5.4
* sockets_54_improv:
  Fix wrong blocking state being set
  Fix tests (Windows)
  Remove a Windows only warning
  Move & improve PHP_SOCKET_ERROR def
  Move some declarations to sockets.c
  Fix overbroad skipif include
2013-02-02 15:31:44 +01:00
Gustavo Lopes ac6342bbc0 Fix wrong blocking state being set 2013-02-02 15:29:18 +01:00
Gustavo Lopes 40663ede83 Fix tests (Windows) 2013-02-02 15:29:18 +01:00
Gustavo Lopes 24e380f970 Remove a Windows only warning 2013-02-02 15:29:18 +01:00
Gustavo Lopes 9283b8aea4 Move & improve PHP_SOCKET_ERROR def 2013-02-02 15:29:11 +01:00
Gustavo Lopes 97d656fc82 Move some declarations to sockets.c 2013-02-02 14:06:23 +01:00
Gustavo Lopes a100c25ea4 Fix overbroad skipif include 2013-02-02 14:06:23 +01:00
Remi Collet 0cea9e6843 Fixed bug #64128 buit-in web server is broken on ppc64.
fdset management using bit operator is broken on non-x86 arch
and cause built-in server the enter an infinite loop of "select"
and never handle any request.
2013-02-01 19:23:25 +01:00
Andrey Hristov f45a85c386 add new charset, from MySQL 5.6 2013-02-01 17:21:50 +01:00
Johannes Schlüter b09f5a4f56 Fix typo in error message 2013-02-01 12:31:07 +01:00
Remi Collet 9d75bf35e9 Mark this test as requiring internet connecion. 2013-01-31 14:38:39 +01:00
Remi Collet f7362232f4 Fix failed test: sys_errlist[116] have changed on recent glibc (Fedora 18)
old: Stale NFS file handle
new: Stale file handle
2013-01-31 14:22:56 +01:00
Johannes Schlüter 9d6636364d Merge branch 'PHP-5.3' into PHP-5.4
Conflicts:
	configure.in
	main/php_version.h
2013-01-31 00:58:52 +01:00
Johannes Schlüter a80fdc47b3 This will be PHP 5.3.23 2013-01-31 00:57:29 +01:00
Lars Strojny 836a2b1131 NEWS entry new OpenSSL option [doc] 2013-01-31 00:32:44 +01:00
Daniel Lowrey 4a01ddfb55 Added ssl context option, "disable_compression"
The CRIME attack vector exploits TLS compression. This patch adds a stream context option
allowing servers to disable TLS compression for versions of OpenSSL >= 1.0.0 (which first
introduced the SSL_OP_NO_COMPRESSION option). A summary rundown of the CRIME attack can
be found at https://community.qualys.com/blogs/securitylabs/2012/09/14/crime-information-leakage-attack-against-ssltls

Thanks to @DaveRandom for pointing out the relevant section of code.
2013-01-31 00:31:10 +01:00
Nikita Popov bb4d11b405 Merge branch 'PHP-5.3' into PHP-5.4 2013-01-30 20:25:59 +01:00
Nikita Popov 321f4f18e5 Fixed bug #64106: Segfault on SplFixedArray[][x] = y when extended 2013-01-30 20:23:39 +01:00
Jelle Zijlstra 31468401b7 Fix build problem in C++11 2013-01-30 19:07:52 +01:00
Stanislav Malyshev 09b6e33b40 branched 5.4.12 2013-01-29 12:33:45 -08:00
Stanislav Malyshev 7a6e76fd2f update NEWS 2013-01-29 12:31:49 -08:00
Johannes Schlüter 1433854681 Merge branch 'PHP-5.3' into PHP-5.4 2013-01-29 19:49:43 +01:00
Johannes Schlüter 264279439b Merge branch 'PHP-5.4' of git.php.net:/php-src into PHP-5.4 2013-01-29 19:49:39 +01:00
Johannes Schlüter ec53b60072 Merge branch 'PHP-5.3' of git.php.net:/php-src into PHP-5.3 2013-01-29 19:49:13 +01:00
Johannes Schlüter 93fd9c704b Fix bug #64099 (Wrong TSRM usage in zend_register_class_alias) 2013-01-29 19:47:45 +01:00
Stanislav Malyshev 5382e156f9 Fix bug #62524, only follow redirects in file streams for 3xx HTTP statuses 2013-01-29 00:27:35 -08:00
Andras Elso 3e6d633a0d Fix missing parameter 2013-01-27 17:11:14 -08:00
Stanislav Malyshev 122570443b fix tests 2013-01-23 10:44:53 -08:00
Gustavo Lopes 38bf6951b3 NEWS for bug #64023 (see aa0adce) 2013-01-23 13:30:40 +01:00
Gustavo Lopes b8b3bb08b2 Merge branch 'bug64023' into PHP-5.4
* bug64023:
  Fix bug #64023 (__toString() & SplFileInfo)

Conflicts:
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2013-01-22 12:24:33 +01:00
Gustavo Lopes aa0adce47d Fix bug #64023 (__toString() & SplFileInfo)
Defining a __toString() method was having no effect when concatenating
the object. This was because the cast_object() handler would ignore
__toString().

Using echo() directly would actually use __toString(), but this was a
bug: the ECHO handler would try zend_std_cast_object_tostring() before
cast_object(), but cast_object() should have priority as
zend_std_cast_object_tostring() assumes an object with a
zend_class_entry.
2013-01-22 11:33:29 +01:00
Xinchen Hui 86c1a26169 Merge fix of #62836 to ?.re, and regenerate ?.c 2013-01-21 11:35:22 +08:00
Stanislav Malyshev 9e7c2e5906 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  fix bug #63462 (Magic methods called twice for unset protected properties)
2013-01-18 13:35:09 -08:00
Stanislav Malyshev 33b104c778 fix bug #63462 (Magic methods called twice for unset protected properties) 2013-01-18 13:29:43 -08:00
Gustavo Lopes b69fd9c9b8 NEWS for bug #64011. See 77ee200 2013-01-18 12:12:08 +01:00
Gustavo Lopes 77ee200097 Fix bug #64011 (get_html_translation_table())
get_html_translation_table() with encoding ISO-8859-1 and HTMLENTITIES
was broken. Only entities for characters U+0000 to U+0040 were being
included in the result.
2013-01-18 12:10:27 +01:00
Johannes Schlüter a85ae16e74 Merge branch 'PHP-5.3' into PHP-5.4 2013-01-16 17:38:41 +01:00
Johannes Schlüter be2f547497 Fix NEWS after 5.3.21 2013-01-16 17:38:17 +01:00
Christopher Jones 94a4e0f823 Fix News 2013-01-15 20:38:24 -08:00
Adam Harvey 142c40f32c Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Update the arguments in the prototype of fpm_socket_unix_test_connect().
2013-01-16 10:18:00 +08:00
Adam Harvey f63a9f6c11 Update the arguments in the prototype of fpm_socket_unix_test_connect().
Fixes bug #63999 (php with fpm fails to build on Solaris 10 or 11).
2013-01-16 10:06:56 +08:00
Anatoliy Belsky 9498cf6194 fixed build 2013-01-15 22:36:29 +01:00
Gustavo Lopes 4c38003dbd NEWS for bug #63893 2013-01-15 21:07:21 +01:00
Gustavo Lopes 93e35137aa Merge remote-tracking branch 'remotes/cataphract/strtr_wu94_54' into PHP-5.4
* remotes/cataphract/strtr_wu94_54:
  Fixed inconsequential bug in strtr()
  Remove _GNU_SOURCE, add local heap sort
  The compiler can figure this out
  Remove unused block
  strtr() with 2nd param array - optimization
  Refactoring, bugs & leaks
  Optimize strtr w/ 2nd arg array
2013-01-15 21:05:21 +01:00
Gustavo Lopes 930ef9ddd6 Fixed inconsequential bug in strtr() 2013-01-15 17:25:59 +01:00
Adam Harvey 83864b470b Revert "Apply the fputcsv test fix to SplFileObject_fputcsv.phpt. Mea culpa."
This reverts commit 0510701474.
2013-01-15 17:37:21 +08:00
Adam Harvey b1bf524140 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Revert "Update fputcsv() to escape all characters equally."
2013-01-15 17:35:34 +08:00
Adam Harvey c077074c13 Revert "Update fputcsv() to escape all characters equally."
On second thoughts, while the behaviour _is_ broken, this isn't the right fix.

This reverts commit 9b5cb0e805.
2013-01-15 17:33:54 +08:00
Stanislav Malyshev 374ebc8741 fix NEWS 2013-01-15 00:08:12 -08:00
Adam Harvey 0510701474 Apply the fputcsv test fix to SplFileObject_fputcsv.phpt. Mea culpa. 2013-01-15 15:49:52 +08:00
Xinchen Hui 3bc7490370 Merge branch 'PHP-5.4' of git.php.net:php-src into PHP-5.4 2013-01-15 15:32:42 +08:00
Xinchen Hui 4fcf4e0845 Fixed bug #57702 (Multi-row BLOB fetches) 2013-01-15 15:31:49 +08:00
Adam Harvey a4191b0aad Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Update fputcsv() to escape all characters equally.
2013-01-15 15:24:21 +08:00
Adam Harvey 9b5cb0e805 Update fputcsv() to escape all characters equally.
At present, backslashes have special case handling within fputcsv(): when one
is encountered within a field that's being escaped, escaping stops until the
next instance of the enclosure character is hit.  This can result in malformed
CSV.

Fixes bug #43225 (fputcsv incorrectly handles cells ending in \ followed by ").
2013-01-15 15:17:45 +08:00
Lars Strojny 6a065876b9 Bug #52958: Segfault in PDO_OCI on cleanup after running a long testsuite. 2013-01-14 21:35:48 +01:00
Lars Strojny bf9ad4e661 Support BITMAPV5HEADER in getimagesize(): https://en.wikipedia.org/wiki/BMP_file_format#DIB_header_.28bitmap_information_header.29 2013-01-14 18:52:38 +01:00
Lars Strojny 1e9a3ed234 Fix bug #63916: PDO::PARAM_INT casts to 32bit int internally even on 64bit builds in pdo_sqlite 2013-01-14 17:59:11 +01:00
Lars Strojny 99d087e5d4 Fixed bug #63921: sqlite3::bindvalue and relative PHP functions aren't using sqlite3_*_int64 API 2013-01-14 17:35:07 +01:00
Gustavo Lopes d7bac4f5ba Remove _GNU_SOURCE, add local heap sort 2013-01-14 17:06:52 +01:00
Gustavo Lopes e5029ac40b The compiler can figure this out 2013-01-14 12:22:42 +01:00
Gustavo Lopes 93d1171c47 Remove unused block 2013-01-14 12:22:42 +01:00
Gustavo Lopes cddbb98ada strtr() with 2nd param array - optimization
About a 1.25x speedup in my test script by writing the result string
only when a match is found and at the end instead of on each iteration.
2013-01-14 12:22:42 +01:00
Gustavo Lopes 2111ee3df5 Refactoring, bugs & leaks 2013-01-14 12:22:41 +01:00
Gustavo Lopes ccf15cf2dc Optimize strtr w/ 2nd arg array
Fixes bug #63893: poor efficiency of strtr() using array with keys of
very different length.

The implementation is basically all new, which carries some risk with
it.

The algorithm is described in "A Fast Algorithm For Multi-Pattern
Searching" (1994) by Sun Wu and Udi Manber.
2013-01-14 12:22:41 +01:00
Stanislav Malyshev 1a96fe0b32 fix bug #63982: isset() inconsistently produces a fatal error on protected property 2013-01-13 17:08:52 -08:00
Stanislav Malyshev c6203da6c2 different OSes have different messages, and that's not what the test is about anyway 2013-01-13 16:58:27 -08:00
Arnaud Le Blanc a06313fe5a fixed alternate form for 'x' and 'X' formats
same fix exists in original code:
https://svn.apache.org/viewvc?view=revision&revision=1152309
2013-01-13 15:45:15 +01:00
Dmitry Stogov 046ae2f77c Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed uninitialized zval.type (Yoram)
2013-01-10 18:54:19 +04:00
Dmitry Stogov e1410b5a70 Fixed uninitialized zval.type (Yoram) 2013-01-10 18:53:10 +04:00
ULF WENDEL 36e88d78e6 MySQL 5.6 EXPIRE PASSWORD flag tests 2013-01-10 14:51:14 +01:00
Remi Collet f659ec108f Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fix test after fix for bug #63943 (Bad warning text from strpos() on empty needle) See commit c05ee74e7f
2013-01-10 11:17:53 +01:00
Remi Collet dc9f0e70b7 Fix test after fix for bug #63943 (Bad warning text from strpos() on empty needle)
See commit c05ee74e7f
2013-01-10 11:14:38 +01:00
Andrey Hristov d430b5a4eb Add mysqli support - constants and checking in mysqli_options() for the
new constant for password expriration
2013-01-09 19:14:48 +01:00
Andrey Hristov 258c76eb41 backport handling of expired passwords in mysqlnd to 5.4 2013-01-09 18:58:29 +01:00
Andrey Hristov bcd278ad7f fix compilation error after merge 2013-01-09 18:39:59 +01:00
Andrey Hristov 6a6ec195ac Merge branch 'PHP-5.3' into PHP-5.4 2013-01-09 18:27:50 +01:00
Andrey Hristov 12e759c2ea Use during connect the flags set with set_client_option() 2013-01-09 18:27:06 +01:00
Dmitry Stogov 625000ab44 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed compilator bug that might cause jump depended on unitialized value
2013-01-09 17:36:44 +04:00
Dmitry Stogov d4650c5d69 Fixed compilator bug that might cause jump depended on unitialized value 2013-01-09 17:16:47 +04:00
Dmitry Stogov f9e8678dd3 Fixed bug #63882 (zend_std_compare_objects crash on recursion) 2013-01-09 11:30:50 +04:00
Xinchen Hui f3b1b85169 update NEWS 2013-01-09 10:55:50 +08:00
Xinchen Hui 15aaa9c660 Merge branch 'PHP-5.3' into PHP-5.4 2013-01-09 10:54:23 +08:00
Xinchen Hui c05ee74e7f Fixed bug #63943 (Bad warning text from strpos() on empty needle) 2013-01-09 10:53:20 +08:00
Adam Harvey 6e684e6a6c Add NEWS for the previously cherry picked commit. 2013-01-08 11:40:51 +08:00
George Wang 9c52d09ebc sapi/litespeed/lsapi_main.c: Fix bug #63228
Fix compiling error at line 606 (error: format not a string
literal and no format arguments [-Werror=format-security]
2013-01-08 11:40:13 +08:00
Derick Rethans 0de5fb4165 Merge branch 'PHP-5.4' of git.php.net:/php-src into PHP-5.4 2013-01-06 15:09:55 +00:00
Derick Rethans 67c662a0a2 Update news with new bug fix. 2013-01-06 15:08:26 +00:00
Derick Rethans ba35ae32b7 Merge branch 'PHP-5.3' into PHP-5.4 2013-01-06 15:07:13 +00:00
Lars Strojny bdc1e2302c Adding test for bug #63462 2013-01-06 14:46:49 +01:00
Derick Rethans ff9c1b12ff Fixed bug #55397: Comparsion of incomplete DateTime causes SIGSEGV. 2013-01-06 13:39:34 +00:00
Lars Strojny d7da1aa694 Coding style, ANSI C compatibility 2013-01-06 14:08:23 +01:00
Xinchen Hui a426e0b050 bump year 2013-01-06 10:22:15 +08:00
Xinchen Hui a3a699e090 Merge branch 'PHP-5.4' of git.php.net:php-src into PHP-5.4 2013-01-06 10:20:10 +08:00
Xinchen Hui c2f8e90504 Merge branch 'PHP-5.3' into PHP-5.4 2013-01-06 10:20:00 +08:00
Xinchen Hui bc11e6fdbb bump year 2013-01-06 10:19:09 +08:00
Lars Strojny 8e5460ad86 Adding test from 5.5 2013-01-06 03:15:08 +01:00
Lars Strojny 67557fcfce Bug #63699: performance improvements for varios ext/date functions 2013-01-06 03:06:09 +01:00
Xinchen Hui 2feea39a33 Update NEWS 2013-01-04 11:05:24 +08:00
Xinchen Hui aff5d084a5 Merge branch 'PHP-5.3' into PHP-5.4 2013-01-04 11:03:52 +08:00
Xinchen Hui c3e6de2227 Fixed bug #63899 (Use after scope error in zend_compile) 2013-01-04 11:02:21 +08:00
Stanislav Malyshev 5894aa0950 5.4.12-dev 2013-01-03 17:25:56 -08:00
Johannes Schlüter aaecb99c6b Merge branch 'PHP-5.3' into PHP-5.4
Conflicts:
	configure.in
	main/php_version.h
2013-01-03 22:59:38 +01:00
Johannes Schlüter 712710bfec This will be PHP 5.3.22 2013-01-03 22:56:46 +01:00
152 changed files with 2135 additions and 502 deletions

No files matched your search

+94 -2
View File
@@ -1,11 +1,103 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
03 Jan 2013, PHP 5.4.11 RC1
14 Mar 2012, PHP 5.4.13
- Core:
. Fixed bug #64235 (Insteadof not work for class method in 5.4.11).
(Laruence)
. Implemented FR #64175 (Added HTTP codes as of RFC 6585). (Jonh Wendell)
. Fixed bug #64142 (dval to lval different behavior on ppc64). (Remi)
. Fixed bug #64070 (Inheritance with Traits failed with error). (Dmitry)
- CLI server:
. Fixed bug #64128 (buit-in web server is broken on ppc64). (Remi)
- Mbstring:
. mb_split() can now handle empty matches like preg_split() does. (Moriyoshi)
- OpenSSL:
. Fixed bug #61930 (openssl corrupts ssl key resource when using
openssl_get_publickey()). (Stas)
- PDO_mysql:
. Fixed bug #60840 (undefined symbol: mysqlnd_debug_std_no_trace_funcs).
(Johannes)
- Phar:
. Fixed timestamp update on Phar contents modification. (Dmitry)
- SOAP
. Added check that soap.wsdl_cache_dir conforms to open_basedir
(CVE-2013-1635). (Dmitry)
. Disabled external entities loading (CVE-2013-1643). (Dmitry)
- SPL:
. Fixed bug #64264 (SPLFixedArray toArray problem). (Laruence)
. Fixed bug #64228 (RecursiveDirectoryIterator always assumes SKIP_DOTS).
(patch by kriss@krizalys.com, Laruence)
. Fixed bug #64106 (Segfault on SplFixedArray[][x] = y when extended).
(Nikita Popov)
. Fixed bug #52861 (unset fails with ArrayObject and deep arrays).
(Mike Willbanks)
- SNMP:
. Fixed bug #64124 (IPv6 malformed). (Boris Lytochkin)
21 Feb 2012, PHP 5.4.12
- Core:
. Fixed bug #64099 (Wrong TSRM usage in zend_Register_class alias). (Johannes)
. Fixed bug #64011 (get_html_translation_table() output incomplete with
HTML_ENTITIES and ISO-8859-1). (Gustavo)
. Fixed bug #63982 (isset() inconsistently produces a fatal error on
protected property). (Stas)
. Fixed bug #63943 (Bad warning text from strpos() on empty needle).
(Laruence)
. Fixed bug #63899 (Use after scope error in zend_compile). (Laruence)
. Fixed bug #63893 (Poor efficiency of strtr() using array with keys of very
different length). (Gustavo)
. Fixed bug #63882 (zend_std_compare_objects crash on recursion). (Dmitry)
. Fixed bug #63462 (Magic methods called twice for unset protected
properties). (Stas)
. Fixed bug #62524 (fopen follows redirects for non-3xx statuses).
(Wes Mason)
. Support BITMAPV5HEADER in getimagesize(). (AsamK, Lars)
- Date:
. Fixed bug #63699 (Performance improvements for various ext/date functions).
(Lars, original patch by njaguar at gmail dot com)
. Fixed bug #55397: Comparsion of incomplete DateTime causes SIGSEGV.
(Derick)
- FPM:
. Fixed bug #63999 (php with fpm fails to build on Solaris 10 or 11). (Adam)
- Litespeed:
. Fixed bug #63228 (-Werror=format-security error in lsapi code). (George)
- ext/sqlite3:
. Fixed bug #63921 (sqlite3::bindvalue and relative PHP functions aren't
using sqlite3_*_int64 API). (srgoogleguy, Lars)
- PDO_OCI
. Fixed bug #57702 (Multi-row BLOB fetches). (hswong3i, Laruence)
. Fixed bug #52958 (Segfault in PDO_OCI on cleanup after running a long
testsuite). (hswong3i, Lars)
- PDO_sqlite:
. Fixed bug #63916 (PDO::PARAM_INT casts to 32bit int internally even
on 64bit builds in pdo_sqlite). (srgoogleguy, Lars)
- OpenSSL:
. New SSL stream context option to prevent CRIME attack vector. (Daniel Lowrey,
Lars)
17 Jan 2012, PHP 5.4.11
- Core:
. Fixed bug #63762 (Sigsegv when Exception::$trace is changed by user).
(Johannes)
. Fixed bug #43177 (Errors in eval()'ed code produce status code 500).
. Fixed bug #43177 (Errors in eval()'ed code produce status code 500).
(Todd Ruth, Stas).
- Filter:
+2 -2
View File
@@ -15,7 +15,7 @@ $f = fopen("/tmp/blah", "r");
?>
===DONE===
--EXPECTF--
fopen(/tmp/blah): failed to open stream: No such file or directory (2) in %s:%d
fopen(/tmp/blah): failed to open stream: %s (2) in %s:%d
Warning: fopen(/tmp/blah): failed to open stream: No such file or directory in %s on line %d
Warning: fopen(/tmp/blah): failed to open stream: %s in %s on line %d
===DONE===
+1 -1
View File
@@ -10,7 +10,7 @@ set_error_handler(function($errno, $errstr, $errfile, $errline){
require 'notfound.php';
--EXPECTF--
error(require(notfound.php): failed to open stream: No such file or directory)
error(require(notfound.php): failed to open stream: %s)
Warning: Uncaught exception 'Exception' with message 'Foo' in %sbug60909_1.php:5
Stack trace:
#0 %sbug60909_1.php(8): {closure}(2, 'require(notfoun...', '%s', 8, Array)
+74
View File
@@ -0,0 +1,74 @@
--TEST--
Test script to verify that magic methods should be called only once when accessing an unset property.
--CREDITS--
Marco Pivetta <ocramius@gmail.com>
--FILE--
<?php
class Test {
public $publicProperty;
protected $protectedProperty;
private $privateProperty;
public function __construct() {
unset(
$this->publicProperty,
$this->protectedProperty,
$this->privateProperty
);
}
function __get($name) {
echo '__get ' . $name . "\n";
return $this->$name;
}
function __set($name, $value) {
echo '__set ' . $name . "\n";
$this->$name = $value;
}
function __isset($name) {
echo '__isset ' . $name . "\n";
return isset($this->$name);
}
}
$test = new Test();
$test->nonExisting;
$test->publicProperty;
$test->protectedProperty;
$test->privateProperty;
isset($test->nonExisting);
isset($test->publicProperty);
isset($test->protectedProperty);
isset($test->privateProperty);
$test->nonExisting = 'value';
$test->publicProperty = 'value';
$test->protectedProperty = 'value';
$test->privateProperty = 'value';
?>
--EXPECTF--
__get nonExisting
Notice: Undefined property: Test::$nonExisting in %s on line %d
__get publicProperty
Notice: Undefined property: Test::$publicProperty in %s on line %d
__get protectedProperty
Notice: Undefined property: Test::$protectedProperty in %s on line %d
__get privateProperty
Notice: Undefined property: Test::$privateProperty in %s on line %d
__isset nonExisting
__isset publicProperty
__isset protectedProperty
__isset privateProperty
__set nonExisting
__set publicProperty
__set protectedProperty
__set privateProperty
+15
View File
@@ -0,0 +1,15 @@
--TEST--
Bug #63882 (zend_std_compare_objects crash on recursion)
--FILE--
<?php
class Test { public $x = 5; }
$testobj1 = new Test;
$testobj2 = new Test;
$testobj1->x = $testobj1;
$testobj2->x = $testobj2;
var_dump($testobj1 == $testobj2);
?>
--EXPECTF--
Fatal error: Nesting level too deep - recursive dependency? in %sbug63882.php on line 9
+15
View File
@@ -0,0 +1,15 @@
--TEST--
Bug #63982 (isset() inconsistently produces a fatal error on protected property)
--FILE--
<?php
class Test {
protected $protectedProperty;
}
$test = new Test();
var_dump(isset($test->protectedProperty));
var_dump(isset($test->protectedProperty->foo));
--EXPECTF--
bool(false)
bool(false)
+36
View File
@@ -0,0 +1,36 @@
--TEST--
Bug #64070 (Inheritance with Traits failed with error)
--FILE--
<?php
trait first_trait
{
function first_function()
{
echo "From First Trait\n";
}
}
trait second_trait
{
use first_trait {
first_trait::first_function as second_function;
}
function first_function()
{
echo "From Second Trait\n";
}
}
class first_class
{
use second_trait;
}
$obj = new first_class();
$obj->first_function();
$obj->second_function();
?>
--EXPECT--
From Second Trait
From First Trait
+34
View File
@@ -0,0 +1,34 @@
--TEST--
Bug #64235 (Insteadof not work for class method in 5.4.11)
--FILE--
<?php
class TestParentClass
{
public function method()
{
print_r('Parent method');
print "\n";
}
}
trait TestTrait
{
public function method()
{
print_r('Trait method');
print "\n";
}
}
class TestChildClass extends TestParentClass
{
use TestTrait
{
TestTrait::method as methodAlias;
TestParentClass::method insteadof TestTrait;
}
}
?>
--EXPECTF--
Fatal error: Class TestParentClass is not a trait, Only traits may be used in 'as' and 'insteadof' statements in %sbug64235.php on line %d
+35
View File
@@ -0,0 +1,35 @@
--TEST--
Bug #64235 (Insteadof not work for class method in 5.4.11)
--FILE--
<?php
class TestParentClass
{
public function method()
{
print_r('Parent method');
print "\n";
}
}
trait TestTrait
{
public function method()
{
print_r('Trait method');
print "\n";
}
}
class TestChildClass extends TestParentClass
{
use TestTrait
{
TestTrait::method as methodAlias;
TestParentClass::method as TestParent;
}
}
?>
--EXPECTF--
Fatal error: Class TestParentClass is not a trait, Only traits may be used in 'as' and 'insteadof' statements in %sbug64235b.php on line %d
+1 -1
View File
@@ -14,4 +14,4 @@ class C {
}
}
--EXPECTF--
Fatal error: Trait T2 is not used in %s on line %d
Fatal error: Required Trait T2 wasn't added to C in %slanguage015.php on line %d
+1 -1
View File
@@ -14,4 +14,4 @@ class C {
}
}
--EXPECTF--
Fatal error: Trait T2 is not used in %s on line %d
Fatal error: Required Trait T2 wasn't added to C in %slanguage016.php on line %d
+1 -1
View File
@@ -14,4 +14,4 @@ class C {
}
}
--EXPECTF--
Fatal error: Trait T2 is not used in %s on line %d
Fatal error: Required Trait T2 wasn't added to C in %slanguage017.php on line %d
+3 -3
View File
@@ -60,7 +60,7 @@ typedef struct _zend_fcall_info_cache {
zval *object_ptr;
} zend_fcall_info_cache;
#define ZEND_NS_NAME(ns, name) ns"\\"name
#define ZEND_NS_NAME(ns, name) ns "\\" name
#define ZEND_FN(name) zif_##name
#define ZEND_MN(name) zim_##name
@@ -279,9 +279,9 @@ ZEND_API void zend_class_implements(zend_class_entry *class_entry TSRMLS_DC, int
ZEND_API int zend_register_class_alias_ex(const char *name, int name_len, zend_class_entry *ce TSRMLS_DC);
#define zend_register_class_alias(name, ce) \
zend_register_class_alias_ex(name, sizeof(name)-1, ce TSRMLS_DC)
zend_register_class_alias_ex(name, sizeof(name)-1, ce TSRMLS_CC)
#define zend_register_ns_class_alias(ns, name, ce) \
zend_register_class_alias_ex(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, ce TSRMLS_DC)
zend_register_class_alias_ex(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, ce TSRMLS_CC)
ZEND_API int zend_disable_function(char *function_name, uint function_name_length TSRMLS_DC);
ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_DC);
+12 -9
View File
@@ -3786,7 +3786,7 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args,
overriden = va_arg(args, HashTable**);
exclude_table = va_arg(args, HashTable*);
fnname_len = strlen(fn->common.function_name);
fnname_len = hash_key->nKeyLength - 1;
/* apply aliases which are qualified with a class name, there should not be any ambiguity */
if (ce->trait_aliases) {
@@ -3797,7 +3797,7 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args,
if (alias->alias != NULL
&& (!alias->trait_method->ce || fn->common.scope == alias->trait_method->ce)
&& alias->trait_method->mname_len == fnname_len
&& (zend_binary_strcasecmp(alias->trait_method->method_name, alias->trait_method->mname_len, fn->common.function_name, fnname_len) == 0)) {
&& (zend_binary_strcasecmp(alias->trait_method->method_name, alias->trait_method->mname_len, hash_key->arKey, fnname_len) == 0)) {
fn_copy = *fn;
/* if it is 0, no modifieres has been changed */
@@ -3819,7 +3819,7 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args,
}
}
lcname = zend_str_tolower_dup(fn->common.function_name, fnname_len);
lcname = hash_key->arKey;
if (exclude_table == NULL || zend_hash_find(exclude_table, lcname, fnname_len, &dummy) == FAILURE) {
/* is not in hashtable, thus, function is not to be excluded */
@@ -3834,7 +3834,7 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args,
if (alias->alias == NULL && alias->modifiers != 0
&& (!alias->trait_method->ce || fn->common.scope == alias->trait_method->ce)
&& (alias->trait_method->mname_len == fnname_len)
&& (zend_binary_strcasecmp(alias->trait_method->method_name, alias->trait_method->mname_len, fn->common.function_name, fnname_len) == 0)) {
&& (zend_binary_strcasecmp(alias->trait_method->method_name, alias->trait_method->mname_len, lcname, fnname_len) == 0)) {
fn_copy.common.fn_flags = alias->modifiers | (fn->common.fn_flags ^ (fn->common.fn_flags & ZEND_ACC_PPP_MASK));
@@ -3851,8 +3851,6 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args,
zend_add_trait_method(ce, fn->common.function_name, lcname, fnname_len+1, &fn_copy, overriden TSRMLS_CC);
}
efree(lcname);
return ZEND_HASH_APPLY_KEEP;
}
/* }}} */
@@ -3861,12 +3859,16 @@ static void zend_check_trait_usage(zend_class_entry *ce, zend_class_entry *trait
{
zend_uint i;
if ((trait->ce_flags & ZEND_ACC_TRAIT) != ZEND_ACC_TRAIT) {
zend_error(E_COMPILE_ERROR, "Class %s is not a trait, Only traits may be used in 'as' and 'insteadof' statements", trait->name);
}
for (i = 0; i < ce->num_traits; i++) {
if (ce->traits[i] == trait) {
return;
}
}
zend_error(E_COMPILE_ERROR, "Trait %s is not used", trait->name);
zend_error(E_COMPILE_ERROR, "Required Trait %s wasn't added to %s", trait->name, ce->name);
}
/* }}} */
@@ -4795,10 +4797,11 @@ void zend_do_begin_class_declaration(const znode *class_token, znode *class_name
/* Prefix class name with name of current namespace */
znode tmp;
tmp.op_type = IS_CONST;
tmp.u.constant = *CG(current_namespace);
zval_copy_ctor(&tmp.u.constant);
zend_do_build_namespace_name(&tmp, &tmp, class_name TSRMLS_CC);
class_name = &tmp;
*class_name = tmp;
efree(lcname);
lcname = zend_str_tolower_dup(Z_STRVAL(class_name->u.constant), Z_STRLEN(class_name->u.constant));
}
@@ -4931,7 +4934,7 @@ void zend_do_end_class_declaration(const znode *class_token, const znode *parent
}
if (!(ce->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS))
&& ((parent_token->op_type != IS_UNUSED) || (ce->num_interfaces > 0))) {
&& (parent_token || (ce->num_interfaces > 0))) {
zend_verify_abstract_class(ce TSRMLS_CC);
if (ce->num_interfaces && !(ce->ce_flags & ZEND_ACC_IMPLEMENT_TRAITS)) {
do_verify_abstract_class(TSRMLS_C);
+1 -1
View File
@@ -28,7 +28,7 @@
#define ZEND_INI_ALL (ZEND_INI_USER|ZEND_INI_PERDIR|ZEND_INI_SYSTEM)
#ifndef XtOffsetOf
# if defined(CRAY) || (defined(__arm) && !defined(LINUX))
# if defined(CRAY) || (defined(__ARMCC_VERSION) && !defined(LINUX))
# ifdef __STDC__
# define XtOffset(p_type, field) _Offsetof(p_type, field)
# else
+2 -2
View File
@@ -375,13 +375,13 @@ unticked_class_declaration_statement:
implements_list
'{'
class_statement_list
'}' { zend_do_end_class_declaration(&$1, &$2 TSRMLS_CC); }
'}' { zend_do_end_class_declaration(&$1, &$3 TSRMLS_CC); }
| interface_entry T_STRING
{ zend_do_begin_class_declaration(&$1, &$2, NULL TSRMLS_CC); }
interface_extends_list
'{'
class_statement_list
'}' { zend_do_end_class_declaration(&$1, &$2 TSRMLS_CC); }
'}' { zend_do_end_class_declaration(&$1, NULL TSRMLS_CC); }
;
+37 -1
View File
@@ -35,6 +35,17 @@
#define Z_OBJ_P(zval_p) \
((zend_object*)(EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(zval_p)].bucket.obj.object))
#define Z_OBJ_PROTECT_RECURSION(zval_p) \
do { \
if (EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(zval_p)].apply_count++ >= 3) { \
zend_error(E_ERROR, "Nesting level too deep - recursive dependency?"); \
} \
} while (0)
#define Z_OBJ_UNPROTECT_RECURSION(zval_p) \
EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(zval_p)].apply_count--
/*
__X accessors explanation:
@@ -382,6 +393,16 @@ static int zend_get_property_guard(zend_object *zobj, zend_property_info *proper
info.name = Z_STRVAL_P(member);
info.name_length = Z_STRLEN_P(member);
info.h = zend_get_hash_value(Z_STRVAL_P(member), Z_STRLEN_P(member) + 1);
} else if(property_info->name[0] == '\0'){
const char *class_name = NULL, *prop_name = NULL;
zend_unmangle_property_name(property_info->name, property_info->name_length, &class_name, &prop_name);
if(class_name) {
/* use unmangled name for protected properties */
info.name = prop_name;
info.name_length = strlen(prop_name);
info.h = zend_get_hash_value(info.name, info.name_length+1);
property_info = &info;
}
}
if (!zobj->guards) {
ALLOC_HASHTABLE(zobj->guards);
@@ -424,7 +445,7 @@ zval *zend_std_read_property(zval *object, zval *member, int type, const zend_li
#endif
/* make zend_get_property_info silent if we have getter - we may want to use it */
property_info = zend_get_property_info_quick(zobj->ce, member, (zobj->ce->__get != NULL), key TSRMLS_CC);
property_info = zend_get_property_info_quick(zobj->ce, member, silent || (zobj->ce->__get != NULL), key TSRMLS_CC);
if (UNEXPECTED(!property_info) ||
((EXPECTED((property_info->flags & ZEND_ACC_STATIC) == 0) &&
@@ -1319,28 +1340,43 @@ static int zend_std_compare_objects(zval *o1, zval *o2 TSRMLS_DC) /* {{{ */
}
if (!zobj1->properties && !zobj2->properties) {
int i;
Z_OBJ_PROTECT_RECURSION(o1);
Z_OBJ_PROTECT_RECURSION(o2);
for (i = 0; i < zobj1->ce->default_properties_count; i++) {
if (zobj1->properties_table[i]) {
if (zobj2->properties_table[i]) {
zval result;
if (compare_function(&result, zobj1->properties_table[i], zobj2->properties_table[i] TSRMLS_CC)==FAILURE) {
Z_OBJ_UNPROTECT_RECURSION(o1);
Z_OBJ_UNPROTECT_RECURSION(o2);
return 1;
}
if (Z_LVAL(result) != 0) {
Z_OBJ_UNPROTECT_RECURSION(o1);
Z_OBJ_UNPROTECT_RECURSION(o2);
return Z_LVAL(result);
}
} else {
Z_OBJ_UNPROTECT_RECURSION(o1);
Z_OBJ_UNPROTECT_RECURSION(o2);
return 1;
}
} else {
if (zobj2->properties_table[i]) {
Z_OBJ_UNPROTECT_RECURSION(o1);
Z_OBJ_UNPROTECT_RECURSION(o2);
return 1;
} else {
Z_OBJ_UNPROTECT_RECURSION(o1);
Z_OBJ_UNPROTECT_RECURSION(o2);
return 0;
}
}
}
Z_OBJ_UNPROTECT_RECURSION(o1);
Z_OBJ_UNPROTECT_RECURSION(o2);
return 0;
} else {
if (!zobj1->properties) {
+1
View File
@@ -117,6 +117,7 @@ ZEND_API zend_object_handle zend_objects_store_put(void *object, zend_objects_st
obj = &EG(objects_store).object_buckets[handle].bucket.obj;
EG(objects_store).object_buckets[handle].destructor_called = 0;
EG(objects_store).object_buckets[handle].valid = 1;
EG(objects_store).object_buckets[handle].apply_count = 0;
obj->refcount = 1;
GC_OBJ_INIT(obj);
+1
View File
@@ -31,6 +31,7 @@ typedef void (*zend_objects_store_clone_t)(void *object, void **object_clone TSR
typedef struct _zend_object_store_bucket {
zend_bool destructor_called;
zend_bool valid;
zend_uchar apply_count;
union _store_bucket {
struct _store_object {
void *object;
+2 -1
View File
@@ -79,7 +79,8 @@ static zend_always_inline long zend_dval_to_lval(double d)
#else
static zend_always_inline long zend_dval_to_lval(double d)
{
if (d > LONG_MAX) {
/* >= as (double)LONG_MAX is outside signed range */
if (d >= LONG_MAX) {
return (long)(unsigned long) d;
}
return (long) d;
+3 -15
View File
@@ -974,27 +974,15 @@ ZEND_VM_HANDLER(40, ZEND_ECHO, CONST|TMP|VAR|CV, ANY)
{
USE_OPLINE
zend_free_op free_op1;
zval z_copy;
zval *z;
SAVE_OPLINE();
z = GET_OP1_ZVAL_PTR(BP_VAR_R);
if (OP1_TYPE != IS_CONST &&
UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) &&
Z_OBJ_HT_P(z)->get_method != NULL) {
if (OP1_TYPE == IS_TMP_VAR) {
INIT_PZVAL(z);
}
if (zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
zend_print_variable(&z_copy);
zval_dtor(&z_copy);
} else {
zend_print_variable(z);
}
} else {
zend_print_variable(z);
if (OP1_TYPE == IS_TMP_VAR && Z_TYPE_P(z) == IS_OBJECT) {
INIT_PZVAL(z);
}
zend_print_variable(z);
FREE_OP1();
CHECK_EXCEPTION();
+12 -60
View File
@@ -2024,27 +2024,15 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zval z_copy;
zval *z;
SAVE_OPLINE();
z = opline->op1.zv;
if (IS_CONST != IS_CONST &&
UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) &&
Z_OBJ_HT_P(z)->get_method != NULL) {
if (IS_CONST == IS_TMP_VAR) {
INIT_PZVAL(z);
}
if (zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
zend_print_variable(&z_copy);
zval_dtor(&z_copy);
} else {
zend_print_variable(z);
}
} else {
zend_print_variable(z);
if (IS_CONST == IS_TMP_VAR && Z_TYPE_P(z) == IS_OBJECT) {
INIT_PZVAL(z);
}
zend_print_variable(z);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -6443,27 +6431,15 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zend_free_op free_op1;
zval z_copy;
zval *z;
SAVE_OPLINE();
z = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
if (IS_TMP_VAR != IS_CONST &&
UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) &&
Z_OBJ_HT_P(z)->get_method != NULL) {
if (IS_TMP_VAR == IS_TMP_VAR) {
INIT_PZVAL(z);
}
if (zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
zend_print_variable(&z_copy);
zval_dtor(&z_copy);
} else {
zend_print_variable(z);
}
} else {
zend_print_variable(z);
if (IS_TMP_VAR == IS_TMP_VAR && Z_TYPE_P(z) == IS_OBJECT) {
INIT_PZVAL(z);
}
zend_print_variable(z);
zval_dtor(free_op1.var);
CHECK_EXCEPTION();
@@ -10761,27 +10737,15 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zend_free_op free_op1;
zval z_copy;
zval *z;
SAVE_OPLINE();
z = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
if (IS_VAR != IS_CONST &&
UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) &&
Z_OBJ_HT_P(z)->get_method != NULL) {
if (IS_VAR == IS_TMP_VAR) {
INIT_PZVAL(z);
}
if (zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
zend_print_variable(&z_copy);
zval_dtor(&z_copy);
} else {
zend_print_variable(z);
}
} else {
zend_print_variable(z);
if (IS_VAR == IS_TMP_VAR && Z_TYPE_P(z) == IS_OBJECT) {
INIT_PZVAL(z);
}
zend_print_variable(z);
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
CHECK_EXCEPTION();
@@ -26741,27 +26705,15 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zval z_copy;
zval *z;
SAVE_OPLINE();
z = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
if (IS_CV != IS_CONST &&
UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) &&
Z_OBJ_HT_P(z)->get_method != NULL) {
if (IS_CV == IS_TMP_VAR) {
INIT_PZVAL(z);
}
if (zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
zend_print_variable(&z_copy);
zval_dtor(&z_copy);
} else {
zend_print_variable(z);
}
} else {
zend_print_variable(z);
if (IS_CV == IS_TMP_VAR && Z_TYPE_P(z) == IS_OBJECT) {
INIT_PZVAL(z);
}
zend_print_variable(z);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
Vendored
+1 -1
View File
@@ -897,7 +897,7 @@ case $basic_machine in
;;
ppc64) basic_machine=powerpc64-unknown
;;
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppc64le | powerpc64little | ppc64-le | powerpc64-little)
basic_machine=powerpc64le-unknown
+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=11
PHP_EXTRA_VERSION="RC1"
PHP_RELEASE_VERSION=13
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`
+1 -1
View File
@@ -38,4 +38,4 @@ curl_close($ch);
?>
--EXPECTF--
== Testing curl_error with a fake URL ==
string(%d) "%sfakeURL%s"
string(%d) "%sfakeURL%S"
+45 -9
View File
@@ -495,9 +495,11 @@ int php_date_global_timezone_db_enabled;
/* on 90'35; common sunrise declaration (sun body disappeared) */
#define DATE_SUNRISE_ZENITH "90.583333"
static PHP_INI_MH(OnUpdate_date_timezone);
/* {{{ INI Settings */
PHP_INI_BEGIN()
STD_PHP_INI_ENTRY("date.timezone", "", PHP_INI_ALL, OnUpdateString, default_timezone, zend_date_globals, date_globals)
STD_PHP_INI_ENTRY("date.timezone", "", PHP_INI_ALL, OnUpdate_date_timezone, default_timezone, zend_date_globals, date_globals)
PHP_INI_ENTRY("date.default_latitude", DATE_DEFAULT_LATITUDE, PHP_INI_ALL, NULL)
PHP_INI_ENTRY("date.default_longitude", DATE_DEFAULT_LONGITUDE, PHP_INI_ALL, NULL)
PHP_INI_ENTRY("date.sunset_zenith", DATE_SUNSET_ZENITH, PHP_INI_ALL, NULL)
@@ -599,6 +601,7 @@ static PHP_GINIT_FUNCTION(date)
date_globals->default_timezone = NULL;
date_globals->timezone = NULL;
date_globals->tzcache = NULL;
date_globals->timezone_valid = 0;
}
/* }}} */
@@ -844,25 +847,54 @@ timelib_tzinfo *php_date_parse_tzfile_wrapper(char *formal_tzname, const timelib
}
/* }}} */
/* Callback to check the date.timezone only when changed increases performance */
/* {{{ static PHP_INI_MH(OnUpdate_date_timezone) */
static PHP_INI_MH(OnUpdate_date_timezone)
{
if (OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC) == FAILURE) {
return FAILURE;
}
DATEG(timezone_valid) = 0;
if (stage == PHP_INI_STAGE_RUNTIME) {
if (!timelib_timezone_id_is_valid(DATEG(default_timezone), DATE_TIMEZONEDB)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, DATE_TZ_ERRMSG);
} else {
DATEG(timezone_valid) = 1;
}
}
return SUCCESS;
}
/* }}} */
/* {{{ Helper functions */
static char* guess_timezone(const timelib_tzdb *tzdb TSRMLS_DC)
{
/* Checking configure timezone */
if (DATEG(timezone) && (strlen(DATEG(timezone)) > 0)) {
if (DATEG(timezone) && (strlen(DATEG(timezone))) > 0) {
return DATEG(timezone);
}
/* Check config setting for default timezone */
if (!DATEG(default_timezone)) {
/* Special case: ext/date wasn't initialized yet */
zval ztz;
if (SUCCESS == zend_get_configuration_directive("date.timezone", sizeof("date.timezone"), &ztz) &&
Z_TYPE(ztz) == IS_STRING &&
Z_STRLEN(ztz) > 0 &&
timelib_timezone_id_is_valid(Z_STRVAL(ztz), tzdb)) {
if (SUCCESS == zend_get_configuration_directive("date.timezone", sizeof("date.timezone"), &ztz)
&& Z_TYPE(ztz) == IS_STRING && Z_STRLEN(ztz) > 0 && timelib_timezone_id_is_valid(Z_STRVAL(ztz), tzdb)) {
return Z_STRVAL(ztz);
}
} else if (*DATEG(default_timezone) && timelib_timezone_id_is_valid(DATEG(default_timezone), tzdb)) {
} else if (*DATEG(default_timezone)) {
if (DATEG(timezone_valid) == 1) {
return DATEG(default_timezone);
}
if (!timelib_timezone_id_is_valid(DATEG(default_timezone), tzdb)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid date.timezone value '%s', we selected the timezone 'UTC' for now.", DATEG(default_timezone));
return "UTC";
}
DATEG(timezone_valid) = 1;
return DATEG(default_timezone);
}
/* Fallback to UTC */
@@ -2013,7 +2045,11 @@ static int date_object_compare_date(zval *d1, zval *d2 TSRMLS_DC)
instanceof_function(Z_OBJCE_P(d2), date_ce_date TSRMLS_CC)) {
php_date_obj *o1 = zend_object_store_get_object(d1 TSRMLS_CC);
php_date_obj *o2 = zend_object_store_get_object(d2 TSRMLS_CC);
if (!o1->time || !o2->time) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Trying to compare an incomplete DateTime object");
return 1;
}
if (!o1->time->sse_uptodate) {
timelib_update_ts(o1->time, o1->time->tz_info);
}
+4 -3
View File
@@ -150,10 +150,11 @@ struct _php_period_obj {
};
ZEND_BEGIN_MODULE_GLOBALS(date)
char *default_timezone;
char *timezone;
HashTable *tzcache;
char *default_timezone;
char *timezone;
HashTable *tzcache;
timelib_error_container *last_errors;
int timezone_valid;
ZEND_END_MODULE_GLOBALS(date)
#ifdef ZTS
+11
View File
@@ -0,0 +1,11 @@
--TEST--
Bug #55397 (comparsion of incomplete DateTime causes SIGSEGV)
--INI--
--FILE--
<?php
date_default_timezone_set('Europe/Prague');
var_dump(unserialize('O:8:"DateTime":0:{}') == new DateTime);
?>
--EXPECTF--
Warning: %s: Trying to compare an incomplete DateTime object in %s on line %d
bool(false)
@@ -0,0 +1,11 @@
--TEST--
date_default_timezone_get() function [4]
--INI--
date.timezone=Incorrect/Zone
--FILE--
<?php
echo date_default_timezone_get(), "\n";
?>
--EXPECTF--
Warning: date_default_timezone_get(): Invalid date.timezone value 'Incorrect/Zone', we selected the timezone 'UTC' for now. in %sdate_default_timezone_get-4.php on line %d
UTC
+15 -18
View File
@@ -270,6 +270,7 @@ static PHP_GINIT_FUNCTION(libxml)
libxml_globals->error_buffer.c = NULL;
libxml_globals->error_list = NULL;
libxml_globals->entity_loader.fci.size = 0;
libxml_globals->entity_loader_disabled = 0;
}
static void _php_libxml_destroy_fci(zend_fcall_info *fci)
@@ -368,17 +369,16 @@ static int php_libxml_streams_IO_close(void *context)
return php_stream_close((php_stream*)context);
}
static xmlParserInputBufferPtr
php_libxml_input_buffer_noload(const char *URI, xmlCharEncoding enc)
{
return NULL;
}
static xmlParserInputBufferPtr
php_libxml_input_buffer_create_filename(const char *URI, xmlCharEncoding enc)
{
xmlParserInputBufferPtr ret;
void *context = NULL;
TSRMLS_FETCH();
if (LIBXML(entity_loader_disabled)) {
return NULL;
}
if (URI == NULL)
return(NULL);
@@ -1052,28 +1052,25 @@ static PHP_FUNCTION(libxml_clear_errors)
}
/* }}} */
PHP_LIBXML_API zend_bool php_libxml_disable_entity_loader(zend_bool disable TSRMLS_DC)
{
zend_bool old = LIBXML(entity_loader_disabled);
LIBXML(entity_loader_disabled) = disable;
return old;
}
/* {{{ proto bool libxml_disable_entity_loader([boolean disable])
Disable/Enable ability to load external entities */
static PHP_FUNCTION(libxml_disable_entity_loader)
{
zend_bool disable = 1;
xmlParserInputBufferCreateFilenameFunc old;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &disable) == FAILURE) {
return;
}
if (disable == 0) {
old = xmlParserInputBufferCreateFilenameDefault(php_libxml_input_buffer_create_filename);
} else {
old = xmlParserInputBufferCreateFilenameDefault(php_libxml_input_buffer_noload);
}
if (old == php_libxml_input_buffer_noload) {
RETURN_TRUE;
}
RETURN_FALSE;
RETURN_BOOL(php_libxml_disable_entity_loader(disable TSRMLS_CC));
}
/* }}} */
+2
View File
@@ -47,6 +47,7 @@ ZEND_BEGIN_MODULE_GLOBALS(libxml)
zend_fcall_info fci;
zend_fcall_info_cache fcc;
} entity_loader;
zend_bool entity_loader_disabled;
ZEND_END_MODULE_GLOBALS(libxml)
typedef struct _libxml_doc_props {
@@ -97,6 +98,7 @@ PHP_LIBXML_API void php_libxml_ctx_error(void *ctx, const char *msg, ...);
PHP_LIBXML_API int php_libxml_xmlCheckUTF8(const unsigned char *s);
PHP_LIBXML_API zval *php_libxml_switch_context(zval *context TSRMLS_DC);
PHP_LIBXML_API void php_libxml_issue_error(int level, const char *msg TSRMLS_DC);
PHP_LIBXML_API zend_bool php_libxml_disable_entity_loader(zend_bool disable TSRMLS_DC);
/* Init/shutdown functions*/
PHP_LIBXML_API void php_libxml_initialize(void);
+22 -23
View File
@@ -1055,7 +1055,7 @@ PHP_FUNCTION(mb_split)
php_mb_regex_t *re;
OnigRegion *regs = NULL;
char *string;
OnigUChar *pos;
OnigUChar *pos, *chunk_pos;
int string_len;
int n, err;
@@ -1065,8 +1065,8 @@ PHP_FUNCTION(mb_split)
RETURN_FALSE;
}
if (count == 0) {
count = 1;
if (count > 0) {
count--;
}
/* create regex pattern buffer */
@@ -1076,31 +1076,30 @@ PHP_FUNCTION(mb_split)
array_init(return_value);
pos = (OnigUChar *)string;
chunk_pos = pos = (OnigUChar *)string;
err = 0;
regs = onig_region_new();
/* churn through str, generating array entries as we go */
while ((--count != 0) &&
(err = onig_search(re, (OnigUChar *)string, (OnigUChar *)(string + string_len), pos, (OnigUChar *)(string + string_len), regs, 0)) >= 0) {
if (regs->beg[0] == regs->end[0]) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty regular expression");
while (count != 0 && (pos - (OnigUChar *)string) < string_len) {
int beg, end;
err = onig_search(re, (OnigUChar *)string, (OnigUChar *)(string + string_len), pos, (OnigUChar *)(string + string_len), regs, 0);
if (err < 0) {
break;
}
beg = regs->beg[0], end = regs->end[0];
/* add it to the array */
if (regs->beg[0] < string_len && regs->beg[0] >= (pos - (OnigUChar *)string)) {
add_next_index_stringl(return_value, (char *)pos, ((OnigUChar *)(string + regs->beg[0]) - pos), 1);
if ((pos - (OnigUChar *)string) < end) {
if (beg < string_len && beg >= (chunk_pos - (OnigUChar *)string)) {
add_next_index_stringl(return_value, (char *)chunk_pos, ((OnigUChar *)(string + beg) - chunk_pos), 1);
--count;
} else {
err = -2;
break;
}
/* point at our new starting point */
chunk_pos = pos = (OnigUChar *)string + end;
} else {
err = -2;
break;
}
/* point at our new starting point */
n = regs->end[0];
if ((pos - (OnigUChar *)string) < n) {
pos = (OnigUChar *)string + n;
}
if (count < 0) {
count = 0;
pos++;
}
onig_region_free(regs, 0);
}
@@ -1117,9 +1116,9 @@ PHP_FUNCTION(mb_split)
}
/* otherwise we just have one last element to add to the array */
n = ((OnigUChar *)(string + string_len) - pos);
n = ((OnigUChar *)(string + string_len) - chunk_pos);
if (n > 0) {
add_next_index_stringl(return_value, (char *)pos, n, 1);
add_next_index_stringl(return_value, (char *)chunk_pos, n, 1);
} else {
add_next_index_stringl(return_value, "", 0, 1);
}
-2
View File
@@ -13,6 +13,4 @@ mb_ereg_search_regs();
--EXPECTF--
Warning: mb_ereg_search_init(): Empty pattern in %s on line %d
Warning: mb_split(): Empty regular expression in %s on line %d
Warning: mb_ereg_search_regs(): No regex given in %s on line %d
@@ -0,0 +1,23 @@
--TEST--
mb_split() empty match
--
--SKIPIF--
<?php
extension_loaded('mbstring') or die('skip');
function_exists('mb_split') or die("skip mb_split() is not available in this build");
?>
--FILE--
<?php
mb_regex_set_options('m');
var_dump(mb_split('^', "a\nb\nc"));
--EXPECT--
array(3) {
[0]=>
string(2) "a
"
[1]=>
string(2) "b
"
[2]=>
string(1) "c"
}
+1 -17
View File
@@ -156,16 +156,12 @@ array(1) {
}
-- Iteration 10 --
Warning: mb_split(): Empty regular expression in %s on line %d
array(1) {
[0]=>
string(13) "a b c d e f g"
}
-- Iteration 11 --
Warning: mb_split(): Empty regular expression in %s on line %d
array(1) {
[0]=>
string(13) "a b c d e f g"
@@ -178,8 +174,6 @@ array(1) {
}
-- Iteration 13 --
Warning: mb_split(): Empty regular expression in %s on line %d
array(1) {
[0]=>
string(13) "a b c d e f g"
@@ -192,24 +186,18 @@ array(1) {
}
-- Iteration 15 --
Warning: mb_split(): Empty regular expression in %s on line %d
array(1) {
[0]=>
string(13) "a b c d e f g"
}
-- Iteration 16 --
Warning: mb_split(): Empty regular expression in %s on line %d
array(1) {
[0]=>
string(13) "a b c d e f g"
}
-- Iteration 17 --
Warning: mb_split(): Empty regular expression in %s on line %d
array(1) {
[0]=>
string(13) "a b c d e f g"
@@ -240,16 +228,12 @@ array(1) {
}
-- Iteration 22 --
Warning: mb_split(): Empty regular expression in %s on line %d
array(1) {
[0]=>
string(13) "a b c d e f g"
}
-- Iteration 23 --
Warning: mb_split(): Empty regular expression in %s on line %d
array(1) {
[0]=>
string(13) "a b c d e f g"
@@ -259,4 +243,4 @@ array(1) {
Warning: mb_split() expects parameter 1 to be string, resource given in %s on line %d
bool(false)
Done
Done
+3
View File
@@ -838,6 +838,9 @@ PHP_MINIT_FUNCTION(mysqli)
REGISTER_LONG_CONSTANT("MYSQLI_REFRESH_BACKUP_LOG", REFRESH_BACKUP_LOG, CONST_CS | CONST_PERSISTENT);
#endif
#if MYSQL_VERSION_ID >= 50611 || defined(MYSQLI_USE_MYSQLND)
REGISTER_LONG_CONSTANT("MYSQLI_OPT_CAN_HANDLE_EXPIRED_PASSWORDS", MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS, CONST_CS | CONST_PERSISTENT);
#endif
#ifdef MYSQLI_USE_MYSQLND
mysqlnd_reverse_api_register_api(&mysqli_reverse_api TSRMLS_CC);
+3
View File
@@ -1672,6 +1672,9 @@ static int mysqli_options_get_option_zval_type(int option)
#ifdef MYSQL_OPT_SSL_VERIFY_SERVER_CERT
REGISTER_LONG_CONSTANT("MYSQLI_OPT_SSL_VERIFY_SERVER_CERT", MYSQL_OPT_SSL_VERIFY_SERVER_CERT, CONST_CS | CONST_PERSISTENT);
#endif /* MySQL 5.1.1., mysqlnd @ PHP 5.3.3 */
#if MYSQL_VERSION_ID >= 50611 || defined(MYSQLI_USE_MYSQLND)
case MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS:
#endif
return IS_LONG;
#ifdef MYSQL_SHARED_MEMORY_BASE_NAME
+4
View File
@@ -176,6 +176,10 @@ require_once('skipifconnectfailure.inc');
}
}
if (($IS_MYSQLND && version_compare(PHP_VERSION, ' 5.4.12-dev', '>=')) || (!$IS_MYSQLND && ($version > 50610))) {
/* could be that MySQL/libmysql 5.6.9 had the flag already but it was no stable release */
$expected_constants["MYSQLI_OPT_CAN_HANDLE_EXPIRED_PASSWORDS"] = true;
}
$unexpected_constants = array();
@@ -0,0 +1,145 @@
--TEST--
MySQL 5.6 EXPIRE PASSWORD protocol change
--SKIPIF--
<?php
require_once('skipif.inc');
require_once('skipifemb.inc');
require_once('connect.inc');
if ($IS_MYSQLND && !version_compare(PHP_VERSION, '5.4.12-dev', ">=")) {
die("SKIP Available in mysqlnd as of PHP 5.4.12-dev");
}
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
die(sprintf("SKIP Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
$host, $user, $db, $port, $socket));
}
if ($link->server_version < 50610)
die(sprintf("SKIP Needs MySQL 5.6.10 or newer, found MySQL %s\n", $link->server_info));
if (!$IS_MYSQLND && (mysqli_get_client_version() < 50610)) {
die(sprintf("SKIP Needs libmysql 5.6.10 or newer, found %s\n", mysqli_get_client_version()));
}
mysqli_query($link, 'DROP USER expiretest');
mysqli_query($link, 'DROP USER expiretest@localhost');
if (!mysqli_query($link, 'CREATE USER expiretest@"%"') ||
!mysqli_query($link, 'CREATE USER expiretest@"localhost"')) {
printf("skip Cannot create second DB user [%d] %s", mysqli_errno($link), mysqli_error($link));
mysqli_close($link);
die("skip CREATE USER failed");
}
if (!mysqli_query($link, 'ALTER USER expiretest@"%" PASSWORD EXPIRE') ||
!mysqli_query($link, 'ALTER USER expiretest@"localhost" PASSWORD EXPIRE')) {
printf("skip Cannot modify second DB user [%d] %s", mysqli_errno($link), mysqli_error($link));
mysqli_close($link);
die("skip ALTER USER failed");
}
if (!$link->query("DROP TABLE IF EXISTS test") ||
!$link->query("CREATE TABLE test (id INT)") || !$link->query("INSERT INTO test(id) VALUES (1)"))
die(sprintf("SKIP [%d] %s\n", $link->errno, $link->error));
if (!mysqli_query($link, sprintf("GRANT SELECT ON TABLE %s.test TO expiretest@'%%'", $db)) ||
!mysqli_query($link, sprintf("GRANT SELECT ON TABLE %s.test TO expiretest@'localhost'", $db))) {
printf("skip Cannot grant SELECT to user [%d] %s", mysqli_errno($link), mysqli_error($link));
mysqli_close($link);
die("skip GRANT failed");
}
?>
--FILE--
<?php
require_once('connect.inc');
require_once('table.inc');
/* default */
if (!$link = my_mysqli_connect($host, 'expiretest', "", $db, $port, $socket)) {
printf("[001] Cannot connect [%d] %s\n",
mysqli_connect_errno(), mysqli_connect_error());
} else {
$link->query("SELECT id FROM test WHERE id = 1");
printf("[002] Connect should fail, [%d] %s\n", $link->errno, $link->error);
}
/* explicitly requesting default */
$link = mysqli_init();
$link->options(MYSQLI_OPT_CAN_HANDLE_EXPIRED_PASSWORDS, 0);
if (!my_mysqli_real_connect($link, $host, 'expiretest', "", $db, $port, $socket)) {
printf("[003] Cannot connect [%d] %s\n",
mysqli_connect_errno(), mysqli_connect_error());
} else {
$link->query("SELECT id FROM test WHERE id = 1");
printf("[004] Connect should fail, [%d] %s\n", $link->errno, $link->error);
}
/* allow connect */
$link = mysqli_init();
$link->options(MYSQLI_OPT_CAN_HANDLE_EXPIRED_PASSWORDS, 1);
if (!my_mysqli_real_connect($link, $host, 'expiretest', "", $db, $port, $socket)) {
printf("[005] Cannot connect [%d] %s\n",
mysqli_connect_errno(), mysqli_connect_error());
} else {
$link->query("SELECT id FROM test WHERE id = 1");
printf("[006] Connect allowed, query fail, [%d] %s\n", $link->errno, $link->error);
$link->close();
}
/* allow connect, fix pw */
$link = mysqli_init();
$link->options(MYSQLI_OPT_CAN_HANDLE_EXPIRED_PASSWORDS, 1);
if (!my_mysqli_real_connect($link, $host, 'expiretest', "", $db, $port, $socket)) {
printf("[007] Cannot connect [%d] %s\n",
mysqli_connect_errno(), mysqli_connect_error());
} else {
$link->query("SET PASSWORD=PASSWORD('expiretest')");
printf("[008] Connect allowed, pw set, [%d] %s\n", $link->errno, $link->error);
if ($res = $link->query("SELECT id FROM test WHERE id = 1"))
var_dump($res->fetch_assoc());
$link->close();
}
/* check login */
if (!$link = my_mysqli_connect($host, 'expiretest', "expiretest", $db, $port, $socket)) {
printf("[001] Cannot connect [%d] %s\n",
mysqli_connect_errno(), mysqli_connect_error());
} else {
$link->query("SELECT id FROM test WHERE id = 1");
if ($res = $link->query("SELECT id FROM test WHERE id = 1"))
var_dump($res->fetch_assoc());
$link->close();
}
print "done!";
?>
--CLEAN--
<?php
require_once("clean_table.inc");
mysqli_query($link, 'DROP USER expiretest');
mysqli_query($link, 'DROP USER expiretest@localhost');
?>
--EXPECTF--
Warning: mysqli_real_connect(): (HY000/1820): %s in %s on line %d
[001] Cannot connect [1820] %s
Warning: mysqli_real_connect(): (HY000/1820): %s in %s on line %d
[003] Cannot connect [1820] %s
[006] Connect allowed, query fail, [1820] %s
[008] Connect allowed, pw set, [0%A
array(1) {
["id"]=>
string(1) "1"
}
array(1) {
["id"]=>
string(1) "1"
}
done!
+19 -3
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -774,6 +774,8 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
/* we allow load data local infile by default */
mysql_flags |= MYSQLND_CAPABILITIES;
mysql_flags |= conn->options->flags; /* use the flags from set_client_option() */
if (db) {
mysql_flags |= CLIENT_CONNECT_WITH_DB;
}
@@ -2284,7 +2286,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option)(MYSQLND_CONN_DATA * const c
break;
#endif
case MYSQL_OPT_LOCAL_INFILE:
if (!value || (*(unsigned int*) value) ? 1 : 0) {
if (value && (*(unsigned int*) value) ? 1 : 0) {
conn->options->flags |= CLIENT_LOCAL_FILES;
} else {
conn->options->flags &= ~CLIENT_LOCAL_FILES;
@@ -2319,7 +2321,14 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option)(MYSQLND_CONN_DATA * const c
break;
case MYSQL_SET_CHARSET_NAME:
{
char * new_charset_name = mnd_pestrdup(value, conn->persistent);
char * new_charset_name;
if (!mysqlnd_find_charset_name(value)) {
SET_CLIENT_ERROR(*conn->error_info, CR_CANT_FIND_CHARSET, UNKNOWN_SQLSTATE, "Unknown character set");
ret = FAIL;
break;
}
new_charset_name = mnd_pestrdup(value, conn->persistent);
if (!new_charset_name) {
goto oom;
}
@@ -2368,6 +2377,13 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option)(MYSQLND_CONN_DATA * const c
DBG_INF_FMT("auth_protocol=%s", conn->options->auth_protocol);
break;
}
case MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS:
if (value && (*(unsigned int*) value) ? 1 : 0) {
conn->options->flags |= CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS;
} else {
conn->options->flags &= ~CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS;
}
break;
#ifdef WHEN_SUPPORTED_BY_MYSQLI
case MYSQL_SHARED_MEMORY_BASE_NAME:
case MYSQL_OPT_USE_RESULT:
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+2 -2
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -42,7 +42,7 @@ static const char mysqlnd_free_name[] = "_mysqlnd_free";
static const char mysqlnd_pestrndup_name[] = "_mysqlnd_pestrndup";
static const char mysqlnd_pestrdup_name[] = "_mysqlnd_pestrdup";
const char * mysqlnd_debug_std_no_trace_funcs[] =
PHPAPI const char * mysqlnd_debug_std_no_trace_funcs[] =
{
mysqlnd_emalloc_name,
mysqlnd_ecalloc_name,
+2 -2
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -24,7 +24,7 @@
#ifndef MYSQLND_ALLOC_H
#define MYSQLND_ALLOC_H
extern const char * mysqlnd_debug_std_no_trace_funcs[];
PHPAPI extern const char * mysqlnd_debug_std_no_trace_funcs[];
#define MYSQLND_MEM_D TSRMLS_DC ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC
#define MYSQLND_MEM_C TSRMLS_CC ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+12 -9
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -504,12 +504,14 @@ const MYSQLND_CHARSET mysqlnd_charsets[] =
{ 53, "macroman", "macroman_bin", 1, 1, "", NULL, NULL},
{ 54, "utf16", "utf16_general_ci", 2, 4, "UTF-16 Unicode", mysqlnd_mbcharlen_utf16, check_mb_utf16},
{ 55, "utf16", "utf16_bin", 2, 4, "UTF-16 Unicode", mysqlnd_mbcharlen_utf16, check_mb_utf16},
{ 56, "utf16le", "utf16le_general_ci", 2, 4, "UTF-16LE Unicode", mysqlnd_mbcharlen_utf16, check_mb_utf16},
{ 58, "cp1257", "cp1257_bin", 1, 1, "", NULL, NULL},
#ifdef USED_TO_BE_SO_BEFORE_MYSQL_5_5
{ 60, "armascii8", "armascii8_bin", 1, 1, "", NULL, NULL},
#endif
/*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},
{ 62, "utf16le", "utf16le_bin", 2, 4, "UTF-16LE Unicode", mysqlnd_mbcharlen_utf16, check_mb_utf16},
{ 65, "ascii", "ascii_bin", 1, 1, "", NULL, NULL},
{ 66, "cp1250", "cp1250_bin", 1, 1, "", NULL, NULL},
{ 67, "cp1256", "cp1256_bin", 1, 1, "", NULL, NULL},
@@ -669,14 +671,15 @@ PHPAPI const MYSQLND_CHARSET * mysqlnd_find_charset_nr(unsigned int charsetnr)
/* {{{ mysqlnd_find_charset_name */
PHPAPI const MYSQLND_CHARSET * mysqlnd_find_charset_name(const char * const name)
{
const MYSQLND_CHARSET * c = mysqlnd_charsets;
do {
if (!strcasecmp(c->name, name)) {
return c;
}
++c;
} while (c[0].nr != 0);
if (name) {
const MYSQLND_CHARSET * c = mysqlnd_charsets;
do {
if (!strcasecmp(c->name, name)) {
return c;
}
++c;
} while (c[0].nr != 0);
}
return NULL;
}
/* }}} */
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+7 -2
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -95,7 +95,9 @@
#define CLIENT_MULTI_RESULTS (1UL << 17) /* Enable/disable multi-results */
#define CLIENT_PS_MULTI_RESULTS (1UL << 18) /* Multi-results in PS-protocol */
#define CLIENT_PLUGIN_AUTH (1UL << 19) /* Client supports plugin authentication */
#define CLIENT_CONNECT_ATTRS (1UL << 20) /* Client supports connection attributes */
#define CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA (1UL << 21) /* Enable authentication response packet to be larger than 255 bytes. */
#define CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS (1UL << 22) /* Don't close the connection for a connection with expired password. */
#define CLIENT_SSL_VERIFY_SERVER_CERT (1UL << 30)
#define MYSQLND_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | CLIENT_TRANSACTIONS | \
@@ -164,6 +166,9 @@ typedef enum mysqlnd_option
MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
MYSQL_PLUGIN_DIR,
MYSQL_DEFAULT_AUTH,
MYSQL_SERVER_PUBLIC_KEY,
MYSQL_ENABLE_CLEARTEXT_PLUGIN,
MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS,
#if MYSQLND_UNICODE
MYSQLND_OPT_NUMERIC_AND_DATETIME_AS_UNICODE = 200,
#endif
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+2
View File
@@ -3204,6 +3204,7 @@ PHP_FUNCTION(openssl_pkey_get_public)
if (pkey == NULL) {
RETURN_FALSE;
}
zend_list_addref(Z_LVAL_P(return_value));
}
/* }}} */
@@ -3240,6 +3241,7 @@ PHP_FUNCTION(openssl_pkey_get_private)
if (pkey == NULL) {
RETURN_FALSE;
}
zend_list_addref(Z_LVAL_P(return_value));
}
/* }}} */
+24
View File
@@ -0,0 +1,24 @@
--TEST--
Bug #61930: openssl corrupts ssl key resource when using openssl_get_publickey()
--SKIPIF--
<?php
if (!extension_loaded("openssl")) die("skip");
?>
--FILE--
<?php
$cert = file_get_contents(__DIR__.'/cert.crt');
$data = <<<DATA
Please verify me
DATA;
$sig = 'f9Gyb6NV/ENn7GUa37ygTLcF93XHf5fbFTnoYF/O+fXbq3iChGUbET0RuhOsptlAODi6JsDLnJO4ikcVZo0tC1fFTj3LyCuPy3ZdgJbbVxQ/rviROCmuMFTqUW/Xa2LQYiapeCCgLQeWTLg7TM/BoHEkKbKLG/XT5jHvep1758A=';
$key = openssl_get_publickey($cert);
var_dump(openssl_get_publickey($key));
var_dump(openssl_verify($data, base64_decode($sig), $key));
?>
--EXPECTF--
resource(%d) of type (OpenSSL key)
int(1)
+12
View File
@@ -395,6 +395,18 @@ static inline int php_openssl_setup_crypto(php_stream *stream,
}
#endif
#if OPENSSL_VERSION_NUMBER >= 0x10000000L
{
zval **val;
if (stream->context && SUCCESS == php_stream_context_get_option(
stream->context, "ssl", "disable_compression", &val) &&
zval_is_true(*val)) {
SSL_CTX_set_options(sslsock->ctx, SSL_OP_NO_COMPRESSION);
}
}
#endif
sslsock->ssl_handle = php_SSL_new_from_context(sslsock->ctx, stream TSRMLS_CC);
if (sslsock->ssl_handle == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to create an SSL handle");
+4 -2
View File
@@ -227,8 +227,10 @@ static int oci_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
H->server = NULL;
}
OCIHandleFree(H->err, OCI_HTYPE_ERROR);
H->err = NULL;
if (H->err) {
OCIHandleFree(H->err, OCI_HTYPE_ERROR);
H->err = NULL;
}
if (H->charset && H->env) {
OCIHandleFree(H->env, OCI_HTYPE_ENV);
+1 -2
View File
@@ -99,7 +99,7 @@ static int oci_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
switch (S->cols[i].dtype) {
case SQLT_BLOB:
case SQLT_CLOB:
/* do nothing */
OCIDescriptorFree(S->cols[i].data, OCI_DTYPE_LOB);
break;
default:
efree(S->cols[i].data);
@@ -654,7 +654,6 @@ static int oci_blob_close(php_stream *stream, int close_handle TSRMLS_DC)
if (close_handle) {
OCILobClose(self->S->H->svc, self->S->err, self->lob);
OCIDescriptorFree(self->lob, OCI_DTYPE_LOB);
efree(self);
}
+165
View File
@@ -0,0 +1,165 @@
--TEST--
PDO OCI Bug #57702 (Multi-row BLOB fetches)
--SKIPIF--
<?php
if (!extension_loaded('pdo') || !extension_loaded('pdo_oci')) die('skip not loaded');
require(dirname(__FILE__).'/../../pdo/tests/pdo_test.inc');
PDOTest::skip();
?>
--FILE--
<?php
require('ext/pdo/tests/pdo_test.inc');
$db = PDOTest::test_factory('ext/pdo_oci/tests/common.phpt');
// Note the PDO test setup sets PDO::ATTR_STRINGIFY_FETCHES to true
// (and sets PDO::ATTR_CASE to PDO::CASE_LOWER)
$query = "begin execute immediate 'drop table mytable'; exception when others then if sqlcode <> -942 then raise; end if; end;";
$stmt = $db->prepare($query);
$stmt->execute();
$query = "create table bug57702 (id number, data1 blob, data2 blob)";
$stmt = $db->prepare($query);
$stmt->execute();
function do_insert($db, $id, $data1, $data2)
{
$db->beginTransaction();
$stmt = $db->prepare("insert into bug57702 (id, data1, data2) values (:id, empty_blob(), empty_blob()) returning data1, data2 into :blob1, :blob2");
$stmt->bindParam(':id', $id);
$stmt->bindParam(':blob1', $blob1, PDO::PARAM_LOB);
$stmt->bindParam(':blob2', $blob2, PDO::PARAM_LOB);
$blob1 = null;
$blob2 = null;
$stmt->execute();
fwrite($blob1, $data1);
fclose($blob1);
fwrite($blob2, $data2);
fclose($blob2);
$db->commit();
}
do_insert($db, 1, "row 1 col 1", "row 1 col 2");
do_insert($db, 2, "row 2 col 1", "row 2 col 2");
////////////////////
echo "First Query\n";
// Fetch it back
$stmt = $db->prepare('select data1, data2 from bug57702 order by id');
$stmt->execute();
$row = $stmt->fetch(PDO::FETCH_ASSOC);
var_dump($row['data1']);
var_dump($row['data2']);
$row = $stmt->fetch(PDO::FETCH_ASSOC);
var_dump($row['data1']);
var_dump($row['data2']);
////////////////////
echo "\nSecond Query\n";
foreach($db->query("select data1 as d1, data2 as d2 from bug57702 order by id") as $row) {
var_dump($row['d1']);
var_dump($row['d2']);
}
////////////////////
echo "\nThird Query\n";
$stmt = $db->prepare('select data1 as d3_1, data2 as d3_2 from bug57702 order by id');
$rs = $stmt->execute();
$stmt->bindColumn('d3_1' , $clob1, PDO::PARAM_LOB);
$stmt->bindColumn('d3_2' , $clob2, PDO::PARAM_LOB);
while ($stmt->fetch(PDO::FETCH_BOUND)) {
var_dump($clob1);
var_dump($clob2);
}
print "done\n";
////////////////////
echo "\nFourth Query\n";
$a = array();
$i = 0;
foreach($db->query("select data1 as d4_1, data2 as d4_2 from bug57702 order by id") as $row) {
$a[$i][0] = $row['d4_1'];
$a[$i][1] = $row['d4_2'];
$i++;
}
for ($i = 0; $i < count($a); $i++) {
var_dump($a[$i][0]);
var_dump($a[$i][1]);
}
////////////////////
echo "\nFifth Query\n";
$db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false); // Let's use streams
// Since each column only has one lob descriptor, the last row is
// shown twice because the lob descriptor for each column is reused in
// the stream
$a = array();
$i = 0;
foreach($db->query("select data1 as d4_1, data2 as d4_2 from bug57702 order by id") as $row) {
$a[$i][0] = $row['d4_1'];
$a[$i][1] = $row['d4_2'];
$i++;
}
for ($i = 0; $i < count($a); $i++) {
var_dump(stream_get_contents($a[$i][0]));
var_dump(stream_get_contents($a[$i][1]));
}
// Cleanup
$query = "drop table bug57702";
$stmt = $db->prepare($query);
$stmt->execute();
print "done\n";
?>
--EXPECTF--
First Query
string(11) "row 1 col 1"
string(11) "row 1 col 2"
string(11) "row 2 col 1"
string(11) "row 2 col 2"
Second Query
string(11) "row 1 col 1"
string(11) "row 1 col 2"
string(11) "row 2 col 1"
string(11) "row 2 col 2"
Third Query
string(11) "row 1 col 1"
string(11) "row 1 col 2"
string(11) "row 2 col 1"
string(11) "row 2 col 2"
done
Fourth Query
string(11) "row 1 col 1"
string(11) "row 1 col 2"
string(11) "row 2 col 1"
string(11) "row 2 col 2"
Fifth Query
string(11) "row 2 col 1"
string(11) "row 2 col 2"
string(11) "row 2 col 1"
string(11) "row 2 col 2"
done
+6
View File
@@ -112,9 +112,15 @@ static int pdo_sqlite_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_d
}
} else {
convert_to_long(param->parameter);
#if LONG_MAX > 2147483647
if (SQLITE_OK == sqlite3_bind_int64(S->stmt, param->paramno + 1, Z_LVAL_P(param->parameter))) {
return 1;
}
#else
if (SQLITE_OK == sqlite3_bind_int(S->stmt, param->paramno + 1, Z_LVAL_P(param->parameter))) {
return 1;
}
#endif
}
pdo_sqlite_error_stmt(stmt);
return 0;
+27
View File
@@ -0,0 +1,27 @@
--TEST--
Bug #63916 PDO::PARAM_INT casts to 32bit int internally even on 64bit builds in pdo_sqlite
--SKIPIF--
<?php
if (!extension_loaded('pdo_sqlite')) die('skip');
if (PHP_INT_SIZE > 4) die('skip');
?>
--FILE--
<?php
$num = PHP_INT_MAX; // 32 bits
$conn = new PDO('sqlite::memory:');
$conn->query('CREATE TABLE users (id INTEGER NOT NULL, num INTEGER NOT NULL, PRIMARY KEY(id))');
$stmt = $conn->prepare('insert into users (id, num) values (:id, :num)');
$stmt->bindValue(':id', 1, PDO::PARAM_INT);
$stmt->bindValue(':num', $num, PDO::PARAM_INT);
$stmt->execute();
$stmt = $conn->query('SELECT num FROM users');
$result = $stmt->fetchAll(PDO::FETCH_COLUMN);
var_dump($num,$result[0]);
?>
--EXPECT--
int(2147483647)
string(10) "2147483647"
+27
View File
@@ -0,0 +1,27 @@
--TEST--
Bug #63916 PDO::PARAM_INT casts to 32bit int internally even on 64bit builds in pdo_sqlite
--SKIPIF--
<?php
if (!extension_loaded('pdo_sqlite')) die('skip');
if (PHP_INT_SIZE < 8) die('skip');
?>
--FILE--
<?php
$num = 100004313234244; // exceeds 32 bits
$conn = new PDO('sqlite::memory:');
$conn->query('CREATE TABLE users (id INTEGER NOT NULL, num INTEGER NOT NULL, PRIMARY KEY(id))');
$stmt = $conn->prepare('insert into users (id, num) values (:id, :num)');
$stmt->bindValue(':id', 1, PDO::PARAM_INT);
$stmt->bindValue(':num', $num, PDO::PARAM_INT);
$stmt->execute();
$stmt = $conn->query('SELECT num FROM users');
$result = $stmt->fetchAll(PDO::FETCH_COLUMN);
var_dump($num,$result[0]);
?>
--EXPECT--
int(100004313234244)
string(15) "100004313234244"
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| phar:// stream wrapper support |
+----------------------------------------------------------------------+
| Copyright (c) 2005-2012 The PHP Group |
| Copyright (c) 2005-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| phar php single-file executable PHP extension |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| phar php single-file executable PHP extension |
+----------------------------------------------------------------------+
| Copyright (c) 2005-2012 The PHP Group |
| Copyright (c) 2005-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| phar php single-file executable PHP extension |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| phar php single-file executable PHP extension |
+----------------------------------------------------------------------+
| Copyright (c) 2005-2012 The PHP Group |
| Copyright (c) 2005-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| phar php single-file executable PHP extension |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| phar php single-file executable PHP extension |
+----------------------------------------------------------------------+
| Copyright (c) 2005-2012 The PHP Group |
| Copyright (c) 2005-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -4,7 +4,7 @@
+----------------------------------------------------------------------+
| phar php single-file executable PHP extension |
+----------------------------------------------------------------------+
| Copyright (c) 2007-2012 The PHP Group |
| Copyright (c) 2007-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| phar php single-file executable PHP extension |
+----------------------------------------------------------------------+
| Copyright (c) 2007-2012 The PHP Group |
| Copyright (c) 2007-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| phar php single-file executable PHP extension |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| phar php single-file executable PHP extension |
+----------------------------------------------------------------------+
| Copyright (c) 2005-2012 The PHP Group |
| Copyright (c) 2005-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+6 -3
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| phar:// stream wrapper support |
+----------------------------------------------------------------------+
| Copyright (c) 2005-2012 The PHP Group |
| Copyright (c) 2005-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -458,8 +458,11 @@ static int phar_stream_flush(php_stream *stream TSRMLS_DC) /* {{{ */
{
char *error;
int ret;
if (stream->mode[0] == 'w' || (stream->mode[0] == 'r' && stream->mode[1] == '+')) {
ret = phar_flush(((phar_entry_data *)stream->abstract)->phar, 0, 0, 0, &error TSRMLS_CC);
phar_entry_data *data = (phar_entry_data *) stream->abstract;
if (data->internal_file->is_modified) {
data->internal_file->timestamp = time(0);
ret = phar_flush(data->phar, 0, 0, 0, &error TSRMLS_CC);
if (error) {
php_stream_wrapper_log_error(stream->wrapper, REPORT_ERRORS TSRMLS_CC, "%s", error);
efree(error);
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| phar php single-file executable PHP extension |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| phar php single-file executable PHP extension generated stub |
+----------------------------------------------------------------------+
| Copyright (c) 2005-2012 The PHP Group |
| Copyright (c) 2005-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| TAR archive support for Phar |
+----------------------------------------------------------------------+
| Copyright (c) 2005-2012 The PHP Group |
| Copyright (c) 2005-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
Loaded 100 of 152 files, more files were not shown because too many files have changed in this diff. Show more