Compare commits

...
Author SHA1 Message Date
SVN Migration 7648ebfbde This commit was manufactured by cvs2svn to create tag 'php_5_2_7RC1'. 2008-10-09 23:12:21 +00:00
Ilia Alshanetsky 3e92d040f6 5.2.7RC1 2008-10-09 23:12:20 +00:00
Felipe Pena b66673da7d - MFH: Fixed bug pecl#9641 (Unable to add driver specific methods to PDOStatement) (patch by Christopher Jones) 2008-10-09 13:01:40 +00:00
Felipe Pena 4237bea6fe - MFH: Fixed bug #45575 (Segfault with invalid non-string as event handler callback)
patch by Christian seiler
2008-10-07 18:23:05 +00:00
Felipe Pena afc82532cc - MFH: Fixed bug #46247 (ibase_set_event_handler() is allowing to pass callback without event) 2008-10-07 15:31:48 +00:00
Ilia Alshanetsky bef0a451e3 MFB:
Fixed bug #46042 (memory leaks with reflection of mb_convert_encoding())
 Fixed bug #46110 (XMLWriter - openmemory() and openuri() leak memory on
  multiple calls).
 Fixed bug #46206 (pg_query_params/pg_execute convert passed values to
  strings).
2008-10-07 14:35:04 +00:00
Felipe Pena 73042afe10 - MFH: Fixed code ("Division by zero" anymore) 2008-10-07 12:53:08 +00:00
Felipe Pena 2f2a0d8259 - MFH: Fixed compiler warning 2008-10-06 15:14:17 +00:00
Felipe Pena 8b603dfa07 - BFN #45373 2008-10-06 15:11:43 +00:00
Felipe Pena 32f7c6a42d - MFH: Fixed bug #45373 (php crash on query with errors in params) 2008-10-06 14:37:13 +00:00
Derick Rethans 5bade4dcab - Updated to version 2008.7 (2008g) 2008-10-06 14:27:51 +00:00
Etienne Kneuss af17616e0e MFH: bug #46115 (Fixes nothing in 5.2, but sync code) 2008-10-06 13:45:42 +00:00
Etienne Kneuss 47d935664a Fix #46222 (Allow indirect modifications of Arrays inside ArrayObject + fix EG(uninitialized_zval_ptr) overwrite) 2008-10-05 14:49:25 +00:00
Arnaud Le Blanc 487e14d89c MFH: Fixed #46164 (stream_filter_remove() closes the stream) 2008-10-05 01:40:38 +00:00
Felipe Pena e5a7ea3293 MFH:
- Fixed bug #44991 (Compile Failure With freetds0.82)
  patch by:
  - jklowden at freetds dot org (ext/mssql)
  - matthias at dsx dot at (ext/pdo_dblib)
2008-10-04 13:19:22 +00:00
Felipe Pena 5e95dc593a - Fixed compiler warning 2008-10-04 13:11:36 +00:00
Jani Taskinen 619b8bb5ea reorder 2008-10-03 14:52:52 +00:00
Mikko Koppanen 4273a9b4dc Adds signal handling around popen/pclose in mail.c.
Related information on bugs #8992 and #14032
Original patch by D. Parthey
2008-10-03 13:59:33 +00:00
Felipe Pena df9dc12b1e - MFH: Fixed bug #46215 (json_encode mutates its parameter and has some class-specific state) 2008-10-02 03:41:24 +00:00
Antony Dovgal 3a4b2c8437 remove BOM 2008-10-01 12:37:15 +00:00
Kalle Sommer Nielsen 9cd9d67790 Fix bugs order 2008-10-01 11:09:02 +00:00
Scott MacVicar 33addf0ac5 MFH: Fix bug #46209 - Remove license condition that is no longer required. 2008-10-01 11:04:27 +00:00
Dmitry Stogov f289abf4d7 Fixed bug #43045 (SOAP encoding violation on "INF" for type double/float) 2008-10-01 08:42:26 +00:00
Rob Richards 9370d047ef BFN 2008-09-28 12:02:59 +00:00
Rob Richards 87ddfb9fbd MFH: fix bug #46191 (BC break: DOMDocument saveXML() doesn't accept null) 2008-09-28 12:01:21 +00:00
Antony Dovgal 763eda2f57 fix test 2008-09-24 13:13:26 +00:00
Felipe Pena eff8a93ded - MFH: Fixed bug #46157 (PDOStatement::fetchObject prototype error) 2008-09-23 23:10:01 +00:00
Rob Richards 842b350891 MFH: fix hints causing phpdoc crash 2008-09-22 15:10:24 +00:00
Felipe Pena d7064d84cb - BFN #46088 2008-09-22 13:17:58 +00:00
Felipe Pena c1b5abf605 - MFH: Fixed bug #46088 (RegexIterator::accept - segfault) 2008-09-22 13:15:16 +00:00
Greg Beaver e6f7b32deb fix Bug #46147: after stream seek, appending stream filter reads incorrect data 2008-09-22 01:25:44 +00:00
Arnaud Le Blanc fe49acfcb9 MFH: Fixed #46059 (Compile failure under IRIX 6.5.30 building posix.c) 2008-09-20 22:12:59 +00:00
Antony Dovgal 10b69e0f0f fix test 2008-09-18 13:26:05 +00:00
Antony Dovgal 31458c1a0d fix typo 2008-09-18 13:23:00 +00:00
Antony Dovgal 64125d247f fix test 2008-09-18 08:39:23 +00:00
Johannes Schlüter 0f6e281034 MFH Fix #44424 (Extending PDO/MySQL class with a __call() function doesn't work) 2008-09-16 23:37:35 +00:00
Antony Dovgal 03f74b711e MFH 2008-09-16 14:36:39 +00:00
Derick Rethans 8f037b3fe4 - Updated to version 2008.6 (2008f) 2008-09-15 18:03:10 +00:00
Dmitry Stogov 11900b10a3 Fixed bug #43053 (Regression: some numbers shown in scientific notation). (int-e at gmx dot de)
some 64bit test files may need to be fixed
2008-09-15 11:47:03 +00:00
Ilia Alshanetsky 929a21247c MFB: Fixed bug #45580 (levenshtein() crashes with invalid argument) 2008-09-14 05:15:15 +00:00
Moriyoshi Koizumi 772cf98e95 - MFH: Reenable ini_set("mbstring.internal_encoding", VALUE) to work on runtime.
(noticed by Antony. Thanks!)
2008-09-13 19:53:53 +00:00
Moriyoshi Koizumi 6a4057d932 - MFH: Properly initialize/finalize the library. This plugs the leaks caused by
onig_new().
2008-09-13 02:34:23 +00:00
Moriyoshi Koizumi a86756745c - MFH: WS 2008-09-13 00:24:12 +00:00
Moriyoshi Koizumi 0caab530d5 - MFH: Add missing =DIR 2008-09-13 00:14:49 +00:00
Moriyoshi Koizumi 1d7f071044 - Remove unexposed functions. 2008-09-12 23:56:06 +00:00
Moriyoshi Koizumi 2dd8e6ec27 - MFH: Use memcmp() for binary safety. 2008-09-12 23:37:21 +00:00
Felipe Pena 071deec12a - MFH: Fixed unexpected zval changes 2008-09-12 01:16:55 +00:00
Arnaud Le Blanc 114982b068 MFH: Fixed #46053 (SplFileObject::seek - Endless loop) 2008-09-11 15:32:15 +00:00
Arnaud Le Blanc 9b04ebc3c8 MFH: Fixed #46051 (SplFileInfo::openFile - memory overlap) 2008-09-11 15:24:12 +00:00
Rob Richards 914437fd97 BFN 2008-09-11 14:24:28 +00:00
Rob Richards 7d5fe7701b MFH: fix bug #46047 (SimpleXML converts empty nodes into object with nested array)
add test
2008-09-11 14:23:33 +00:00
Rob Richards 88bce658af MFH: fix bug #45901 (wddx_serialize_value crash with SimpleXMLElement object)
add test
2008-09-11 14:18:27 +00:00
Rob Richards 6a2daa2673 BFN 2008-09-10 16:29:42 +00:00
Rob Richards 01d4ee611e MFH: fix bug #46003 (isset on nonexisting node return unexpected results)
add test
2008-09-10 16:29:18 +00:00
Rob Richards 972a2192f4 BFN 2008-09-10 15:41:04 +00:00
Rob Richards 77494520a4 MFH: fix bug #46029 (Segfault in DOMText when using with Reflection) 2008-09-10 15:40:34 +00:00
Felipe Pena 56ed148d64 - MFB: Fixed mem. leak 2008-09-10 13:48:14 +00:00
Felipe Pena 098c1b5397 - Union #45226 + #18916 2008-09-10 13:26:38 +00:00
Rob Richards c5ff10fdc9 BFN
fix order
2008-09-10 11:22:40 +00:00
Rob Richards 6dc4be7100 MFH: fix bug #45553 (Using XPath for attributes with a namespace does not work)
add test
2008-09-10 11:21:48 +00:00
Arnaud Le Blanc 667a563da0 MFH: Fix test 2008-09-10 11:12:38 +00:00
Felipe Pena e4c744789d BFN #45226, #18916 2008-09-10 00:20:49 +00:00
Felipe Pena da2f2ab130 MFH:
- Merged fix from SF project (Import Jeff Lawsons patches for XML datetime bug fixes)
  Fixed bugs:
  #45226 (xmlrpc_set_type() segfaults with valid ISO8601 date string)
  #18916 (xmlrpc_set_type() "not working")
2008-09-10 00:09:04 +00:00
Arnaud Le Blanc fe30db5faf MFH: Fixed bug #46031 (Segfault in AppendIterator::next) 2008-09-09 19:44:25 +00:00
Antony Dovgal b1b7471f73 add missing file 2008-09-08 10:24:38 +00:00
Felipe Pena d4979adb80 BFN #46010 2008-09-07 23:10:07 +00:00
Felipe Pena b886771f69 - MFH: Fixed bug #46010 (warnings incorrectly generated for iv in ecb mode) 2008-09-07 23:00:31 +00:00
Johannes Schlüter 7b668c6a7d - MFH: The exact error message might differ (it's "Not owner" on Solaris) 2008-09-07 22:35:15 +00:00
Arnaud Le Blanc 21482dd1e6 MFH: More accurate max_file_size / upload_max_filesize (fixes #45124) 2008-09-07 14:18:11 +00:00
Arnaud Le Blanc 3062692e49 MFH: Fixed #43540 (rfc1867 handler newlength problem) 2008-09-06 17:19:15 +00:00
Alexey Zakhlestin 2450cf4c0f MFB: Fixed bug #45405 (snmp extension memory leak) 2008-09-06 08:18:38 +00:00
Dmitry Stogov f45b732abf Fixed bug #45860 (header() function fails to correctly replace all Status lines) 2008-09-02 13:22:00 +00:00
Dmitry Stogov bc053b7628 Fixed Bug #43958 (class name added into the error message) 2008-09-02 09:45:36 +00:00
Jani Taskinen 42eaadd128 - Fixed bug entries 2008-09-02 08:58:00 +00:00
Patrick van Kleef 331c423dbe MFH: - Added odbc.default_cursortype to control the ODBC cursormodel
(bug #43668)
2008-09-01 15:48:09 +00:00
Patrick van Kleef e624492e40 MFH: - Fixed code to use ODBC 3.52 datatypes for 64bit systems (bug #43666) 2008-09-01 15:36:56 +00:00
Dmitry Stogov 70063c1195 Fixed bug #42318 (problem with nm on AIX, not finding object files) 2008-09-01 13:15:15 +00:00
Jani Taskinen 69378b449c [DOC]- Fixed bug #45956 (parse_ini_file() does not return false with syntax errors in parsed file)
[DOC] note: change will be in since 5.2.7
2008-08-31 00:21:19 +00:00
Rasmus Lerdorf 6e1fad3505 Fix the assert 2008-08-30 18:28:01 +00:00
Rasmus Lerdorf a1ee496a50 Fix for bugs 13961, 39927 and 45947 2008-08-30 16:50:24 +00:00
David Soria Parra 8555d34ba5 MFH: Fixed bug #43782 (feof() does not detect timeout on socket) 2008-08-27 07:48:37 +00:00
Jani Taskinen 77e07a631a MFH 2008-08-26 23:26:27 +00:00
Jani Taskinen e83e18b8f8 MFH: sendmail mess cleared (PHP_PROG_SENDMAIL was not used at all, see also bug #42946) 2008-08-26 23:19:22 +00:00
Dmitry Stogov 9a4918af76 Fixed destruction of dl() loaded extensions 2008-08-22 15:31:38 +00:00
Antony Dovgal 72daf80c47 MFH: fix zend_register_functions() not displaying duplicate functions (reported by Gopal) 2008-08-22 14:52:47 +00:00
Felipe Pena 500d715ed3 - New tests 2008-08-22 13:40:54 +00:00
Sebastian Bergmann 20cc5b498f Fix ZTS build. 2008-08-22 08:17:02 +00:00
Felipe Pena ebdf8d3637 MFH:
- Fixed bug #45862 (get_class_vars is inconsistent with 'protected' and 'private' variables)
- Added some tests
2008-08-22 01:06:55 +00:00
Stanislav Malyshev 55612e2b06 report merged fix 2008-08-21 18:11:49 +00:00
Stanislav Malyshev 279f79570d merge fix for #43941 2008-08-21 18:10:48 +00:00
Dmitry Stogov a1672ca3e2 Fixed bug #45751 (Using auto_prepend_file crashes (out of scope stack address use)). (basant dot kukreja at sun dot com) 2008-08-21 13:42:36 +00:00
Dmitry Stogov d0c05b2643 Adder error code into error message 2008-08-21 11:27:42 +00:00
Rasmus Lerdorf b94207ccb8 Fix OSX build problem in this branch as well 2008-08-20 20:04:52 +00:00
Jani Taskinen 3a6cac2e6c MFH: - Fixed bug #44925 (preg_grep() modifies input array). (Nuno) 2008-08-20 01:21:47 +00:00
Jani Taskinen 244b57f272 MFH: test for bug #42737 2008-08-20 01:11:06 +00:00
Jani Taskinen 81d5bba936 MFH: Fix for bug #42737 (and #45850) 2008-08-20 00:52:13 +00:00
Felipe Pena 5b9e18dd61 - New test 2008-08-18 17:52:35 +00:00
Antony Dovgal 79b6a241ab MFH: fix bug #45028 (CRC32 output endianness is different between crc32() and hash()) 2008-08-18 14:33:00 +00:00
Jani Taskinen 1fd9b3f536 MFH: fix include 2008-08-18 10:50:10 +00:00
Antony Dovgal 2781ddf65e reverted because of test failures 2008-08-18 07:47:04 +00:00
Arnaud Le Blanc 42a2c5308e MFH: Fix tests (closes #45841) 2008-08-18 04:46:05 +00:00
Arnaud Le Blanc 6f44413558 MFH: Fixed bug #45392 (ob_start()/ob_end_clean() and memory_limit). 2008-08-18 04:09:38 +00:00
Moriyoshi Koizumi 6d8afbca87 - MFH: beware of signedness 2008-08-18 03:26:40 +00:00
Dmitry Stogov 16e6e2f04a Fixed double call to MSHUTDOWN in case of php-cgi -m 2008-08-15 07:30:31 +00:00
Felipe Pena 345ae37686 - Fixed tests (synced with 5_3 and HEAD) 2008-08-15 02:26:56 +00:00
Jani Taskinen 0e8700167a MFH: fix skipifs 2008-08-14 23:46:55 +00:00
Jani Taskinen 2712eb9b31 MFH 2008-08-14 23:45:22 +00:00
Jani Taskinen c901678ab1 MFH: fix tests 2008-08-14 23:42:01 +00:00
Jani Taskinen cb2b9fcf8b MFH 2008-08-14 22:51:50 +00:00
Jani Taskinen 26d7d2519d MFH:fix test 2008-08-14 21:56:13 +00:00
Jani Taskinen 1cd7ce6cf8 MFH: fix tests, add missing test 2008-08-14 20:57:13 +00:00
Jani Taskinen 8b0cd10768 do not leave crap behind 2008-08-14 20:55:31 +00:00
Jani Taskinen 84c5066dec MFH: fix tests 2008-08-14 20:53:31 +00:00
Jani Taskinen 7489a81e38 - Nuke annoying errors already silenced elsewhere too 2008-08-14 20:53:00 +00:00
Felipe Pena f26f786362 - New test 2008-08-14 19:17:13 +00:00
Felipe Pena 9915046344 - MFH: move declaration on top and fix build error 2008-08-14 16:34:30 +00:00
Jani Taskinen 85b00d1dd4 typoh 2008-08-13 19:43:48 +00:00
Antony Dovgal 02f8e3770d MFH: fix compile warnings (patch by Phil Oleson) 2008-08-13 08:09:55 +00:00
Dmitry Stogov fbb885cd6c Fixed bug #45805 (Crach on throwing exception from error handler) 2008-08-13 07:19:43 +00:00
Jani Taskinen 26f13b4b70 MFH: [DOC]- Added methods to change/disable --with-config-file-scan-dir=PATH at
MFH: [DOC]  startup:
MFH: [DOC]
MFH: [DOC]  To disable: Override default php.ini by using both -c and -n with
MFH: [DOC]              CGI/CLI or set "PHP_INI_SCAN_DIR" environment variable
MFH: [DOC]              to an empty string.
MFH: [DOC]
MFH: [DOC]  To change: Simply set "PHP_INI_SCAN_DIR" environment variable to point
MFH: [DOC]             to another path.
MFH: - Fixed bug #42604 ("make test" fails with  --with-config-file-scan-dir=/some/path)
MFH: - Implemented FR #45114 (Option to change --with-config-file-scan-dir)
2008-08-13 01:01:29 +00:00
Christian Seiler e08c90c68d - News: http://news.php.net/php.cvs/52239 2008-08-12 21:03:35 +00:00
Arnaud Le Blanc 43709499f9 MFH: clear stat cache in chroot() 2008-08-11 23:16:41 +00:00
Arnaud Le Blanc 6057b04dd0 news 2008-08-11 22:40:02 +00:00
Arnaud Le Blanc a1311b8bc2 MFH: Fixed #45181 (chdir() should clear relative entries in stat cache) 2008-08-11 22:39:42 +00:00
Christian Seiler b9ab70c0d2 - Fixed segmentation fault (test added) 2008-08-11 22:08:58 +00:00
Arnaud Le Blanc b28b6977bf MFH: Missing files in previous commit (Check the relevant path for open_basedir
in symlink())
2008-08-11 15:33:14 +00:00
Arnaud Le Blanc cf273715fb MFH: Check the relevant path for open_basedir in symlink() 2008-08-11 15:31:01 +00:00
Felipe Pena e249e02481 - BFN: #45765 2008-08-11 00:52:41 +00:00
Felipe Pena e0e1648359 - MFH: Fixed bug #45765 (ReflectionObject with default parameters of self::xxx cause an error) 2008-08-11 00:50:03 +00:00
Arnaud Le Blanc 02fc0f0255 MFH: Fixed bug #45581 (htmlspecialchars() double encoding &#x hex items) 2008-08-10 13:26:25 +00:00
Arnaud Le Blanc 969e64ad33 MFH:
Do not expand $target in symlink(). This made it impossible to symlink to a
symlink. This also caused the target to be wrongly expanded relatively to
the CWD when target was not an absolute path.
2008-08-10 11:55:26 +00:00
Felipe Pena 8df7dc9693 - Fixed test (LF) 2008-08-10 00:44:55 +00:00
Antony Dovgal 476aa6b90d disable the test on AIX 2008-08-09 22:35:34 +00:00
Antony Dovgal 1dd367b62d MFH: do not fail & segfault if malloc(0) returns NULL, that's expected 2008-08-09 22:01:35 +00:00
Arnaud Le Blanc 23cea0a4df *** empty log message *** 2008-08-08 09:34:08 +00:00
Antony Dovgal 5dd6078c14 not experimental anymore 2008-08-07 13:11:28 +00:00
Antony Dovgal ec9c01b2b2 remove EXPERIMENTAL flag 2008-08-07 13:07:33 +00:00
Antony Dovgal 78acd746d4 fix test
NaN != NaN
2008-08-07 08:52:11 +00:00
Kalle Sommer Nielsen 718da04673 Backport #45406 (session.serialize_handler declared by shared extension fails) to PHP_5_2 2008-08-06 21:33:13 +00:00
Kalle Sommer Nielsen b6c6759799 Backport fix for #45406 - Patch by oleg dot grenrus at dynamoid dot com 2008-08-06 21:28:38 +00:00
Jani Taskinen d9535fbf69 useless entry 2008-08-05 21:48:18 +00:00
Stanislav Malyshev dda8d74cb5 ok, clarify :) 2008-08-05 21:40:48 +00:00
Stanislav Malyshev 1ce390f2c2 add bugfix 2008-08-05 21:24:42 +00:00
Stanislav Malyshev adf6be4bfb fix memnstr bug, by Laurent Gaffie 2008-08-05 20:11:17 +00:00
Jani Taskinen ddcb5042f5 MFH:- Add test for bug #45712 2008-08-05 12:37:09 +00:00
Jani Taskinen c078127291 MFH:- Fixed bug #45705 (rfc822_parse_adrlist() modifies passed address parameter) 2008-08-04 21:16:22 +00:00
Moriyoshi Koizumi fecf5bc681 - MFH: Added .libs to .cvsignore 2008-08-04 21:11:19 +00:00
Moriyoshi Koizumi 108d9dd8e7 - MFH: More fixes for bug #45691 2008-08-04 21:06:50 +00:00
Jani Taskinen 09eebe78d8 MFH: proper version check 2008-08-04 20:54:20 +00:00
Jani Taskinen 59b98545e8 MFH 2008-08-03 12:11:13 +00:00
Jani Taskinen 843d6eecc3 MFH: no c++ comments in c files 2008-08-03 11:59:00 +00:00
Moriyoshi Koizumi cf4e80bd50 - MFH:Forgot to take account of the case when mbstring.language is processed
afterwards.
2008-08-03 00:04:30 +00:00
Moriyoshi Koizumi 2184c092d4 - MFH: Fixed bug #45691 (Some per-dir or runtime settings may leak into other requests). 2008-08-02 20:49:48 +00:00
Arnaud Le Blanc 70143b88a2 MFH: Avoid leaks when zlib streams can not be closed properly. 2008-08-02 02:36:59 +00:00
Moriyoshi Koizumi 840e508dc6 - MFH: Fixed bug #43993 (mb_substr_count() behaves differently to substr_count() with overlapping needles) 2008-08-01 22:58:20 +00:00
Moriyoshi Koizumi c530921598 - Move finalization code to the proper place 2008-08-01 22:53:20 +00:00
Moriyoshi Koizumi 22a0734469 - MFH: Fixed bug #44617 (wrong HTML entity output when substitute_character=entity). 2008-07-31 17:39:14 +00:00
Jani Taskinen ecc135ae21 MFH:- fix test 2008-07-31 11:50:54 +00:00
Rasmus Lerdorf 17d4ecdbb1 Fix test to test higher nesting level 2008-07-31 11:49:55 +00:00
Rasmus Lerdorf 7305654b69 Fix for bug #45030 2008-07-31 09:22:17 +00:00
Jani Taskinen 51a01a9a6d typo 2008-07-31 00:51:06 +00:00
Jani Taskinen 874a609723 MFH:- Fixed bug #45568 (ISAPI does not property clear auth_digest in header). 2008-07-31 00:49:16 +00:00
Jani Taskinen 461e12bb47 MFH:- Applied the missing parts to phpize.m4 for zend extension builds 2008-07-31 00:45:46 +00:00
Jani Taskinen d235cfb948 MFH: sync build stuff 2008-07-30 23:57:14 +00:00
Jani Taskinen fbca704073 MFH: sync 2008-07-30 23:27:26 +00:00
Rasmus Lerdorf a948a2605d We can afford a larger stack here and other json parsers out there
go deeper than 128.
2008-07-30 13:55:27 +00:00
Antony Dovgal 9ce5ea020f MFH: fix copy/paste error (patch by Mikko) 2008-07-29 10:42:59 +00:00
Antony Dovgal 635ce992a6 this shouldn't have been backported 2008-07-29 08:33:52 +00:00
Derick Rethans 7d8a27b3d1 - Updated to version 2008.5 (2008e) 2008-07-28 19:32:08 +00:00
David Soria Parra 4331f57597 - Fixed the fix for not requiring C++ always 2008-07-27 20:42:56 +00:00
Jani Taskinen e36ce120ae MFH:- Fixed the fix for not requiring C++ always 2008-07-27 15:05:48 +00:00
Jani Taskinen 68fb7a1252 MFH: Partial sync 2008-07-27 15:01:41 +00:00
Dmitry Stogov d3aa5682b1 Fix for bug #43487 (Wrong conversion of float to string) 2008-07-27 11:28:53 +00:00
Jani Taskinen 96fe692335 MFH: Fixed a minor problem in not enabling c++/g++ when not needed. 2008-07-25 12:36:59 +00:00
Felipe Pena 9c51f3c841 - MFB: Removed unused variable. 2008-07-24 16:01:59 +00:00
Dmitry Stogov d2f478af6a Fixed bug #45178 (memory corruption on assignment result of "new" by reference) 2008-07-24 11:47:14 +00:00
Dmitry Stogov ec1e964f5c Fixed test 2008-07-24 11:23:57 +00:00
Jani Taskinen 2b667e86f2 MFH: Fix test (bug #44985) 2008-07-23 14:15:37 +00:00
Jani Taskinen 4fafb9bddc MFH: some fixes to allow certain tests to pass regardless of system php.ini settins 2008-07-23 13:43:05 +00:00
Felipe Pena 99487f9ce3 - Change credits for #44246 2008-07-23 12:05:21 +00:00
Antony Dovgal 990de890fa MFH: invert the logics - FLAG_FCLOSE -> FLAG_NO_FCLOSE 2008-07-23 11:25:50 +00:00
Jani Taskinen 41e64a728c MFH: missing test 2008-07-23 10:30:41 +00:00
Antony Dovgal 8673660619 fix test 2008-07-23 10:26:55 +00:00
Antony Dovgal c7b3bc0d99 fix test 2008-07-23 09:29:32 +00:00
Antony Dovgal b54305bc7d MFH: add PHP_STREAM_FLAG_FCLOSE to zip streams 2008-07-23 09:09:20 +00:00
Antony Dovgal cffe7a2d3c MFH: add PHP_STREAM_FLAG_FCLOSE, bz2 streams can be closed with fclose() 2008-07-23 08:56:37 +00:00
Felipe Pena 20de4ba98f - BFN: #44246 2008-07-22 14:12:54 +00:00
Felipe Pena 4ca3f3b99a - MFH: Fixed bug #44246 (closedir() accepts a file resource opened by fopen()) 2008-07-22 14:11:25 +00:00
Jani Taskinen fbc897f4bb Tidy language and order 2008-07-21 20:02:34 +00:00
Felipe Pena 16fb63384c - MFB: Fixed securities issue detailed in CVE-2008-2665 and CVE-2008-2666.
(patch by Christian Hoffmann)
2008-07-21 19:34:45 +00:00
Dmitry Stogov 69bbae848e Added check for small ZEMD_MM_SEG_SIZE 2008-07-21 17:06:55 +00:00
Felipe Pena 71a5d27676 - BFN: #45556, #45555 2008-07-18 17:41:59 +00:00
Felipe Pena e6087a0548 - New test 2008-07-18 17:35:18 +00:00
Felipe Pena 157856f0d0 - Fixed bug #45556 (Return value from callback isn't freed) 2008-07-18 17:34:07 +00:00
Felipe Pena f3549c2276 - Fixed bug #45555 (Segfault with invalid non-string as register_introspection_callback)
(patch by chris_se at gmx dot ne)
2008-07-18 15:52:38 +00:00
Felipe Pena 721be7f87c - MFB: Fix ws 2008-07-18 14:56:58 +00:00
Derick Rethans 8a1172fe8f - Updated to version 2008.4.1 (2008d) 2008-07-18 13:46:15 +00:00
Pierre Joye 9df7af2326 - MFB: fix crash when some crafted font are given 2008-07-17 22:58:23 +00:00
Jani Taskinen e1fdf15fee -nuke weird char 2008-07-16 16:30:04 +00:00
Jani Taskinen 00fb7be378 MFH:- Prevent errors in CVS builds when bison is not there (for Sean :) 2008-07-16 16:23:59 +00:00
Jani Taskinen 273b3b8ac0 - Regenerated using more recent re2c 2008-07-16 14:26:30 +00:00
Jani Taskinen 65c908dcfe MFH:- Fixed bug #44127 (UNIX abstract namespace socket connect does not work) 2008-07-16 14:10:50 +00:00
Moriyoshi Koizumi 5b603fb1b7 * MFH: indentation fix only. 2008-07-15 18:07:42 +00:00
Jani Taskinen 2975bbb347 MFH: Fixed potentially confusing error message on failure when no errors are logged 2008-07-15 16:10:32 +00:00
Scott MacVicar 56f7e28f5d MFH: Fix bug when < is used within attribute. 2008-07-15 14:58:58 +00:00
Dmitry Stogov f4617349f8 Fixed bug #45151 (Crash with URI/file..php (filename contains 2 dots)) 2008-07-15 13:38:29 +00:00
Jani Taskinen 8fc55787d5 Fix news 2008-07-15 13:16:25 +00:00
Dmitry Stogov 51619fa391 Fixed bug #45423 (fastcgi parent process doesn't invoke php_module_shutdown before shutdown) (basant dot kukreja at sun dot com) 2008-07-15 13:10:07 +00:00
Felipe Pena 0bccc60ec2 - Reverted fix for #44197 (unsuitable for minor versions) 2008-07-15 11:20:06 +00:00
Jani Taskinen 9f0c8398d6 MFH: fix test 2008-07-15 01:57:37 +00:00
Jani Taskinen 02c937c251 MFH:- Fix tests (do NOT assume things in php.ini always to be same...or sane) 2008-07-15 01:00:17 +00:00
Rui Hirokawa 9609669572 MFPHP5_3 2008-07-13 01:36:15 +00:00
Felipe Pena b56b2d3013 BFN: #45220 2008-07-12 21:14:57 +00:00
Felipe Pena 0a0f24f8bf - Fixed bug #45220 (curl_read callback returns -1 when needs to return size_t (unsigned)) 2008-07-12 21:11:56 +00:00
Felipe Pena a256d977ff BFN: #45485 2008-07-12 01:44:04 +00:00
Felipe Pena 198a9af479 - BFN: #45449, #45486 2008-07-11 18:31:56 +00:00
Felipe Pena 6074163f74 - Fixed bug #45449 (filesize() regression using ftp wrapper) (patch by crrodriguez at suse dot de) 2008-07-11 18:28:25 +00:00
Felipe Pena 9a58cb0b3c - Fixed bug #45486 (mb_send_mail(); header 'Content-Type: text/plain; charset=' parsing incorrect) 2008-07-11 13:48:11 +00:00
Jani Taskinen 596f8bf885 MFH: silence warning 2008-07-11 13:12:18 +00:00
Felipe Pena fc2cf6e19f - Fixed bug #45485 (strip_tags and <?XML tag) 2008-07-11 12:16:06 +00:00
Felipe Pena b2f1de8924 - BFN: #45460 2008-07-11 11:18:58 +00:00
Felipe Pena a8c4bc3257 - Fixed the string sizes in imap_headerinfo 2008-07-11 11:09:05 +00:00
Felipe Pena 26da69af35 - Fixed bug #45460 (imap patch for fromlength fix in imap_headerinfo doesn't accept lengths of 1024) 2008-07-10 17:44:09 +00:00
Derick Rethans 72c5f9c02d - MFH: Memory issues
- MFH: // style comments
2008-07-08 18:02:32 +00:00
Scott MacVicar 6732d3f170 This change was backed out of 5.2 and is now in 5.3+ 2008-07-08 10:31:34 +00:00
Derick Rethans 5a70cfb8d7 - Updated to version 2008.4 (2008d) 2008-07-07 14:36:26 +00:00
Etienne Kneuss 1cd238a5df Avoid a leak on return_value 2008-07-07 00:02:22 +00:00
Dmitry Stogov 9132607dc7 Fixed bug #45352 (Segmentation fault because of tick function on second request) 2008-06-25 12:18:22 +00:00
Uwe Schindler c1bb953c71 MFH: Response to: [PHP-DEV] cleaning up the functions - any volunteers? :) 2008-06-22 18:10:33 +00:00
Christopher Jones 79301a3677 MFH:
Fix bug #45266 (Fix build with BDB 4)
Fix bug #45267 (Revert invalid assumption about BDB 4 locking; let DBA handle locking)
Fix bug #45268 (Fix error callback prototype)
2008-06-19 22:41:33 +00:00
Dmitry Stogov 764f6144d3 Fixed bug #45312 (Segmentation fault on second request for array functions). 2008-06-19 12:09:22 +00:00
Dmitry Stogov c55fc5cfa4 Fixed SOAP binding selection 2008-06-18 07:23:42 +00:00
Philip Olson cf6ae88c42 MFH: updated website team info 2008-06-18 05:21:08 +00:00
Felipe Pena c4bc06b480 - MF5.3: Improved warning message to call-time pass-by-reference when used with internal function
(http://news.php.net/php.internals/38252)
2008-06-15 18:31:10 +00:00
Rob Richards 4c65f7b0a2 BFN
fix ordering
2008-06-14 11:25:52 +00:00
Rob Richards b3a2fffb83 MFH: fixed bug #45251 (double free or corruption with setAttributeNode())
add test
2008-06-14 11:24:00 +00:00
Rui Hirokawa d2f21677d5 MFH 2008-06-13 14:49:19 +00:00
Steve Seear a640702789 Filesystem tests. 2008-06-11 12:38:16 +00:00
Dmitry Stogov 6cd3a97ce2 closeder/readdir/rewinddir must work only with directories 2008-06-11 09:02:09 +00:00
Dmitry Stogov 32b6c60dea Fixed memory leaks 2008-06-11 07:46:43 +00:00
Dmitry Stogov d3d8886e3e Fixed test (5.2 doesn't contain GC) 2008-06-11 07:46:28 +00:00
Philip Olson 4b898c5e57 MFH: fixed imap_listscan() proto 2008-06-11 02:32:22 +00:00
Antony Dovgal 26e2d61588 fix typo 2008-06-10 08:14:59 +00:00
Rasmus Lerdorf a583cad157 Merge from 5.3 branch - no point in echoeing the raw values here 2008-06-09 14:03:44 +00:00
Scott MacVicar c4fa4d5361 Backout fix for spaces in both the program name and argument name, this will be fixed in PHP 5.3+ only 2008-06-06 23:05:37 +00:00
Christopher Jones 50db74684d Update 2008-06-06 01:00:20 +00:00
Christopher Jones 8c9e028a76 (Bugs 41348, 41563, 42456, 42939) Appease the masses and fix
compilation with Oracle 8.1.  This gives cleaner support for older
releases now that PHP 5.3 is firmly Oracle 9.2+ only.  No plans to
MTH.
2008-06-06 00:59:44 +00:00
Christopher Jones 44e82f5789 Sync for PECL OCI8 1.2.5 release 2008-06-05 23:26:01 +00:00
Felipe Pena fba1e9d0c5 - Fixed bug #45139 (ReflectionProperty returns incorrect declaring class) 2008-06-01 03:08:59 +00:00
Matt Wilmas b3abcd8a34 MFH: Only check args once in php_array_diff_key/intersect_key, not on each iteration. This also makes sure ALL args are checked (pre-5.2.5 behavior) 2008-05-30 10:55:44 +00:00
Matt Wilmas 76a95184ef MFH: Fixed overflow crash (at least on Windows) in div_function with LONG_MIN / -1 2008-05-29 11:45:28 +00:00
Scott MacVicar 8063c11142 MFH: Fix a bug when command is quoted and parameters are quoted during call to exec, the result is that cmd.exe /c strips the first and last quote. 2008-05-29 11:41:50 +00:00
Matt Wilmas 70c5d7fcb5 Fixed tests on Windows 2008-05-29 07:33:03 +00:00
Ant Phillips 6e79f8f999 DOM tests from TestFest 2008-05-27 12:44:52 +00:00
Derick Rethans 8df7662306 - Updated to version 2008.3 (2008c) 2008-05-27 12:20:02 +00:00
Ilia Alshanetsky c29dac2f32 When dumping entire document to file via asXml() don't lose the encoding 2008-05-23 15:46:54 +00:00
Antony Dovgal fa6c5d5429 MFH 2008-05-21 12:31:31 +00:00
Dmitry Stogov e9b91783c2 proper fix 2008-05-20 07:41:23 +00:00
Ilia Alshanetsky 92512da2b0 MFB: Fixed bug #45004 (pg_insert() does not accept 4 digit timezone format) 2008-05-19 15:18:39 +00:00
Dmitry Stogov a806380376 Fixed win32 related realpath cache bug 2008-05-19 10:49:13 +00:00
Felipe Pena a0e34ecfee - Reverted the accidental previous commit 2008-05-18 22:32:33 +00:00
Felipe Pena 0f3bde23fd - MFB: Making compatible with 64bit platform 2008-05-18 21:50:58 +00:00
Ilia Alshanetsky 9d3385ff08 MFB: Added missing INI handler 2008-05-18 14:36:59 +00:00
David Soria Parra bb1840dcf9 Wrong file 2008-05-18 14:27:52 +00:00
David Soria Parra e3fbf25a02 MFH: Tests from Munich PHP Testfest 2008 2008-05-17 23:31:31 +00:00
Ilia Alshanetsky 4b7d16ec33 BFn 2008-05-14 23:53:54 +00:00
Antony Dovgal c7d2788311 fixed more titles 2008-05-14 13:10:30 +00:00
Antony Dovgal d01d7450a7 fix test titles 2008-05-14 13:07:17 +00:00
Felipe Pena 908b6e7808 - MFH: Add check for avoid segfault when trying instantiate PDORow manually 2008-05-14 12:34:10 +00:00
Christopher Jones 20eb83c3fe MFH: PECL #13523 (x86_64 build) 2008-05-13 16:06:55 +00:00
Christopher Jones d89a570ad0 MFH: new test 2008-05-13 00:17:59 +00:00
Antony Dovgal cafbf45c13 MFH 2008-05-12 15:31:20 +00:00
Felipe Pena 670ed18df4 - Fixed test 2008-05-12 11:24:07 +00:00
Antony Dovgal 86cf005ca2 MFH: revert patch that causes invalid reads/crashes on Linux 2008-05-12 08:47:29 +00:00
Matt Wilmas 1d30a554a4 MFH: Fixed test after fixing bug #44830 2008-05-12 05:09:28 +00:00
Matt Wilmas e4f6cab2c3 MFH: Fixed error message typo 2008-05-11 11:47:01 +00:00
Sebastian Bergmann 3bf703845f MFH: Add tests for ReflectionFunction::getExtension*(). 2008-05-11 04:57:27 +00:00
Sebastian Bergmann 032d0355e7 MFH: dos2unix *.phpt 2008-05-11 04:53:26 +00:00
Matt Wilmas e8d5d67ff2 MFH: Restore end check for "escape" strings 2008-05-10 09:18:27 +00:00
Matt Wilmas fcef7403cf MFH 2008-05-09 14:41:31 +00:00
Felipe Pena daf04269f5 - New tests 2008-05-09 14:17:42 +00:00
Scott MacVicar f73f5c1aa5 MFH: Fix compile error if _GNU_SOURCE is defined 2008-05-09 12:59:41 +00:00
Matt Wilmas 6c7ae8825d MFH: Test for loss of backslash at end of heredoc; For bug #44830 (Very minor issue with backslash in heredoc) 2008-05-09 11:06:45 +00:00
Matt Wilmas 4d478c9b67 MFH: Fix loss of backslash at end of heredoc; For bug #44830 (Very minor issue with backslash in heredoc) 2008-05-09 10:29:01 +00:00
Ant Phillips c6822cd936 Collect all the open_basedir security tests into one place 2008-05-09 08:36:41 +00:00
Ant Phillips f6b00dcf5b open_basedir tests for error_log 2008-05-09 08:33:55 +00:00
Dmitry Stogov c36ea5eb07 Fixed test 2008-05-08 09:15:49 +00:00
Antony Dovgal 9af8ebe9c7 fix test 2008-05-08 07:09:17 +00:00
Hannes Magnusson 88d4da5097 BFN 2008-05-07 20:03:26 +00:00
Hannes Magnusson 58be64ce2b MFH: Fixed bug #44712 (stream_context_set_params segfaults on invalid
arguments).
2008-05-07 20:02:42 +00:00
Hannes Magnusson fa6ab4ca82 MFH: Fixed bug #44716 (Progress notifications incorrect) 2008-05-07 20:01:56 +00:00
Christopher Jones fc4cfc3c83 MFH: new tests and test cleanup 2008-05-07 15:29:27 +00:00
Antony Dovgal fbbbd2b334 fix test title 2008-05-07 15:23:11 +00:00
Antony Dovgal 845e9001b3 reorder 2008-05-07 15:08:42 +00:00
David Coallier e5f281acf1 - Added NEWS item for fixation of bug 44811 2008-05-07 15:03:17 +00:00
David Coallier 3a37e3f5eb - Fixed Bug #44811: Improved error message when creating a new
SoapClient has invalid data.
2008-05-07 14:57:56 +00:00
David Coallier 8a346e1257 - Test for bug #44811 (Improve error message when new SoapClient has invalid data) 2008-05-07 14:56:37 +00:00
Ilia Alshanetsky fe5e6c081e MFB: Fixed bug #44836 (putenv() crashes, avoid direct reference of environ
in POSIX systems).
2008-05-06 18:03:52 +00:00
Ilia Alshanetsky 3ffd3e8b8c MFB: Specify the necessary precision 2008-05-05 23:05:06 +00:00
Ilia Alshanetsky 8fde9d7701 MFB: Fixed bug #44798 (Memory leak assigning value to attribute). 2008-05-05 23:00:13 +00:00
Andrey Hristov 05b2a03297 Fix build with libmysql 6.0.x 2008-05-05 12:30:38 +00:00
Etienne Kneuss c54c42dcf3 MFH: Fix protos 2008-05-04 21:19:18 +00:00
Rob Richards 029a4c8213 BFN 2008-05-04 15:26:25 +00:00
Rob Richards f5bf8c94f7 MFH: fix bug #44891 Memory leak using registerPHPFunctions and XSLT Variable 2008-05-04 15:15:01 +00:00
Zoe Slattery 8e23d68942 Committing corrected test from Eric Stewart 2008-05-03 20:34:16 +00:00
Etienne Kneuss b6e7b8e09a MFB: Fix #44838 (static class reference restricting overwriting) 2008-05-03 16:00:40 +00:00
Derick Rethans 0685a79356 - Fixed an issue in date() where a : was printed for the O modifier after a P
modifier was used.
2008-05-02 21:36:00 +00:00
Ant Phillips 6bec04b0a3 open_basedir tests for directory functions 2008-05-01 12:36:45 +00:00
Ant Phillips 18da1a2ff4 open_basedir tests for directory functions 2008-05-01 11:46:20 +00:00
Ilia Alshanetsky ba307b2aff Back to dev 2008-04-30 18:33:33 +00:00
Ilia Alshanetsky 6a7f02001d 5.2.6 2008-04-30 18:27:56 +00:00
Ant Phillips ab211d72a3 Fix session test failures as reported by Antony Dovgal.
These were caused by the tests assuming default values for some session
configuration settings, in particular session.save_path and session.name.
The tests now explicitly set these settings in the --INI-- section.
2008-04-30 15:20:16 +00:00
Ant Phillips 3946b4727b Break up complicated rename tests into some smaller more consumable chunks 2008-04-30 13:53:49 +00:00
Ant Phillips 3a30d703c0 Fix session test failures as reported by Antony Dovgal.
These were caused by the tests assuming default values for some session
configuration settings, in particular session.save_path and session.name.
The tests now explicitly set these settings in the --INI-- section.
2008-04-30 09:27:59 +00:00
Scott MacVicar ad86c485cd MFH Fixed bug #44720 (Prevent infinite recursion within session_register) 2008-04-29 14:42:38 +00:00
Ant Phillips 597adbfef1 More session tests to improve code coverage for untested extension code 2008-04-29 09:24:17 +00:00
Ant Phillips 2d2ad8e8d3 More session tests to improve code coverage for untested extension code 2008-04-29 08:57:12 +00:00
Jani Taskinen f2c9167ebb MFH 2008-04-28 12:30:33 +00:00
Ant Phillips 0ccb772f10 Extra open_basedir tests 2008-04-24 16:40:53 +00:00
Ant Phillips 138a1160ab Allow for chmod() to fail on symbolic links 2008-04-24 13:58:29 +00:00
Ant Phillips e9da49eaf5 open_basedir tests for file system functions (v5.2, 5.3 and 6.0 branches) 2008-04-23 14:10:23 +00:00
Ant Phillips 64de2d2d45 New set of session extension tests for PHP 5.2 branch.
These hopefully test a reasonable set of basic, error and variations for
the twenty or so session functions. Note however that they do not
test all the session configuration settings, nor do they test anything
with register_globals enabled.
2008-04-22 16:04:00 +00:00
Ant Phillips 1f4fa0ba1f These tests were backported from the PHP 6.0 branch, which in turn were ported from this branch and then updated to remove any dependencies on register_globals. With register_globals removed they are useful tests to run against the 5.X branches. 2008-04-22 15:58:34 +00:00
Robin Fernandes 1d943ee85e Fix some ereg tests for 64bit platforms. 2008-04-22 15:31:56 +00:00
Felipe Pena 5c605854b8 - Fixed tests 2008-04-20 01:55:05 +00:00
Felipe Pena 11d09ac646 - Better error message 2008-04-20 01:43:18 +00:00
Antony Dovgal 269aac9ee9 fix test 2008-04-18 08:22:01 +00:00
Ilia Alshanetsky 7204e7ba5a BFN 2008-04-18 01:00:56 +00:00
Antony Dovgal 59dde7cbeb make Matt happy =) 2008-04-17 11:48:53 +00:00
Felipe Pena 11a13337ff - Fix typo 2008-04-17 11:04:49 +00:00
Derick Rethans 8649483a69 - Fixed bug #44703 (htmlspecialchars() does not detect bad character set
argument).
2008-04-16 17:21:46 +00:00
Antony Dovgal d9b443095f change %d to %ld and silence the warning 2008-04-16 08:54:44 +00:00
Felipe Pena 9db0be61ad Fixed bug #44703 (htmlspecialchars() does not detect bad character set argument) (patch by Andy Wharmby) 2008-04-11 19:01:25 +00:00
Robin Fernandes 29c12bd254 Fix test parse_url_variation_002.phpt for 64bit platforms. 2008-04-11 14:35:04 +00:00
Antony Dovgal ef1f2c1b7b fix tests 2008-04-11 11:06:18 +00:00
Antony Dovgal 1e20b1ed7d MFH: fix 2 segfaults in ZTS mode 2008-04-11 11:00:24 +00:00
Steve Seear 9d700f942f POSIX extension error tests 2008-04-11 09:32:32 +00:00
Steve Seear 35ca4a5cb4 POSIX extension variation tests 2008-04-11 09:27:42 +00:00
Robin Fernandes fdb9b9d8c8 Adding some tests for ereg and url functions. 2008-04-11 08:57:11 +00:00
Ilia Alshanetsky a1f0e80436 Back to dev 2008-04-10 22:31:09 +00:00
670 changed files with 43230 additions and 5657 deletions

No files matched your search

+15 -37
View File
@@ -11,7 +11,7 @@ all: $(all_targets)
@echo "Don't forget to run 'make test'."
@echo
build-modules: $(PHP_MODULES)
build-modules: $(PHP_MODULES) $(PHP_ZEND_EX)
libphp$(PHP_MAJOR_VERSION).la: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
$(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -rpath $(phptempdir) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@
@@ -73,6 +73,11 @@ PHP_TEST_SHARED_EXTENSIONS = ` \
for i in $(PHP_MODULES)""; do \
. $$i; $(top_srcdir)/build/shtool echo -n -- " -d extension=$$dlname"; \
done; \
fi; \
if test "x$(PHP_ZEND_EX)" != "x"; then \
for i in $(PHP_ZEND_EX)""; do \
. $$i; $(top_srcdir)/build/shtool echo -n -- " -d $(ZEND_EXT_TYPE)=$(top_builddir)/modules/$$dlname"; \
done; \
fi`
test: all
@@ -80,50 +85,23 @@ test: all
TEST_PHP_EXECUTABLE=$(PHP_EXECUTABLE) \
TEST_PHP_SRCDIR=$(top_srcdir) \
CC="$(CC)" \
$(PHP_EXECUTABLE) $(PHP_TEST_SETTINGS) $(top_srcdir)/run-tests.php -U -d extension_dir=modules/ $(PHP_TEST_SHARED_EXTENSIONS) tests/; \
$(PHP_EXECUTABLE) $(PHP_TEST_SETTINGS) $(top_srcdir)/run-tests.php -d extension_dir=modules/ $(PHP_TEST_SHARED_EXTENSIONS) tests/; \
elif test ! -z "$(SAPI_CLI_PATH)" && test -x "$(SAPI_CLI_PATH)"; then \
INI_FILE=`$(top_builddir)/$(SAPI_CLI_PATH) -r 'echo php_ini_loaded_file();'`; \
INI_FILE=`$(top_builddir)/$(SAPI_CLI_PATH) -d 'display_errors=stderr' -r 'echo php_ini_loaded_file();' 2> /dev/null`; \
if test "$$INI_FILE"; then \
$(EGREP) -v '^extension[\t\ ]*=' "$$INI_FILE" > $(top_builddir)/tmp-php.ini; \
$(EGREP) -v '^(zend_)?extension(_debug)?(_ts)?[\t\ ]*=' "$$INI_FILE" > $(top_builddir)/tmp-php.ini; \
else \
echo > $(top_builddir)/tmp-php.ini; \
fi; \
INI_SCANNED_PATH=`$(top_builddir)/$(SAPI_CLI_PATH) -d 'display_errors=stderr' -r '$$a = explode(",\n", trim(php_ini_scanned_files())); echo $$a[0];' 2> /dev/null`; \
if test "$$INI_SCANNED_PATH"; then \
INI_SCANNED_PATH=`$(top_srcdir)/build/shtool path -d $$INI_SCANNED_PATH`; \
$(EGREP) -h -v '^(zend_)?extension(_debug)?(_ts)?[\t\ ]*=' "$$INI_SCANNED_PATH"/*.ini >> $(top_builddir)/tmp-php.ini; \
fi; \
TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \
TEST_PHP_SRCDIR=$(top_srcdir) \
CC="$(CC)" \
$(top_builddir)/$(SAPI_CLI_PATH) $(PHP_TEST_SETTINGS) $(top_srcdir)/run-tests.php -c $(top_builddir)/tmp-php.ini -U -d extension_dir=$(top_builddir)/modules/ $(PHP_TEST_SHARED_EXTENSIONS) $(TESTS); \
else \
echo "ERROR: Cannot run tests without CLI sapi."; \
fi
utest: all
-@if test ! -z "$(SAPI_CLI_PATH)" && test -x "$(SAPI_CLI_PATH)"; then \
INI_FILE=`$(top_builddir)/$(SAPI_CLI_PATH) -r 'echo php_ini_loaded_file();'`; \
if test "$$INI_FILE"; then \
$(EGREP) -v '^extension[\t\ ]*=' "$$INI_FILE" > $(top_builddir)/tmp-php.ini; \
else \
echo > $(top_builddir)/tmp-php.ini; \
fi; \
TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \
TEST_PHP_SRCDIR=$(top_srcdir) \
CC="$(CC)" \
$(top_builddir)/$(SAPI_CLI_PATH) $(PHP_TEST_SETTINGS) $(top_srcdir)/run-tests.php -c $(top_builddir)/tmp-php.ini -u -d extension_dir=$(top_builddir)/modules/ $(PHP_TEST_SHARED_EXTENSIONS) $(TESTS); \
else \
echo "ERROR: Cannot run tests without CLI sapi."; \
fi
ntest: all
-@if test ! -z "$(SAPI_CLI_PATH)" && test -x "$(SAPI_CLI_PATH)"; then \
INI_FILE=`$(top_builddir)/$(SAPI_CLI_PATH) -r 'echo php_ini_loaded_file();'`; \
if test "$$INI_FILE"; then \
$(EGREP) -v '^extension[\t\ ]*=' "$$INI_FILE" > $(top_builddir)/tmp-php.ini; \
else \
echo > $(top_builddir)/tmp-php.ini; \
fi; \
TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \
TEST_PHP_SRCDIR=$(top_srcdir) \
CC="$(CC)" \
$(top_builddir)/$(SAPI_CLI_PATH) $(PHP_TEST_SETTINGS) $(top_srcdir)/run-tests.php -c $(top_builddir)/tmp-php.ini -N -d extension_dir=$(top_builddir)/modules/ $(PHP_TEST_SHARED_EXTENSIONS) $(TESTS); \
$(top_builddir)/$(SAPI_CLI_PATH) -n -c $(top_builddir)/tmp-php.ini $(PHP_TEST_SETTINGS) $(top_srcdir)/run-tests.php -n -c $(top_builddir)/tmp-php.ini -d extension_dir=$(top_builddir)/modules/ $(PHP_TEST_SHARED_EXTENSIONS) $(TESTS); \
else \
echo "ERROR: Cannot run tests without CLI sapi."; \
fi
+246 -171
View File
@@ -1,66 +1,168 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
10 Apr 2008, PHP 5.2.6RC5
- Fixed incorrect heredoc handling when label is used within the block.
(Matt Wilmas)
- Fixed bug #44673 (With CGI argv/argc starts from arguments, not from script)
(Dmitry)
- Fixed bug #44667 (proc_open() does not handle pipes with the mode 'wb'
correctly). (Jani)
- Fixed bug #44650 (escaepshellscmd() does not check arg count). (Ilia)
- Fixed bug #44591 (imagegif's filename parameter). (Felipe)
- Fixed bug #32979 (OpenSSL stream->fd casts broken in 64-bit build)
(stotty at tvnet dot hu)
03 Apr 2008, PHP 5.2.6RC4
- Fixed possible stack buffer overflow in FastCGI SAPI. (Andrei Nigmatulin)
- Fixed sending of uninitialized paddings which may contain some information.
(Andrei Nigmatulin)
- Fixed bug #44663 (Crash in imap_mail_compose if "body" parameter invalid).
(Ilia)
- Fixed bug #44613 (Crash inside imap_headerinfo()). (Ilia, jmessa)
- Fixed bug #44603 (Order issues with Content-Type/Length headers on
POST). (Ilia)
- Fixed bug #44594 (imap_open() does not validate # of retries parameter).
(Ilia)
- Fixed bug #44557 (Crash in imap_setacl when supplied integer as username)
(Thomas Jarosch)
27 Mar 2008, PHP 5.2.6RC3
- Properly address incomplete multibyte chars inside escapeshellcmd() (Ilia,
Stefan Esser)
- Fix integer overflow in printf(). (Stas, Maksymilian Aciemowicz)
- Fixed bug #44487 (call_user_method_array issues a warning when throwing
an exception). (David Soria Parra)
- Fixed bug #44478 (Inconsistent behaviour when assigning new nodes).
(Rob, Felipe)
- Fixed bug #44445 (email validator does not handle domains starting/ending
with a -). (Ilia)
- Fixed bug #44440 (st_blocks undefined under BeOS). (Felipe)
- Fixed bug #44394 (Last two bytes missing from output). (Felipe)
- Fixed bug #44388 (Crash inside exif_read_data() on invalid images) (Ilia)
- Fixed bug #44373 (PDO_OCI extension compile failed). (Felipe)
- Fixed bug #43677 (Inconsistent behaviour of include_path set with
php_value). (manuel at mausz dot at)
- Fixed bug #43614 (incorrect processing of numerical string keys of array in
arbitrary serialized data). (Dmitriy Buldakov, Felipe)
- Fixed bug #42177 (Warning "array_merge_recursive(): recursion detected" comes
again...). (Felipe)
- Fixed bug #41828 (Failing to call RecursiveIteratorIterator::__construct()
causes a sefault). (Etienne)
06 Mar 2008, PHP 5.2.6RC2
- Fixed bug #44333 (SEGFAULT when using mysql_pconnect() with client_flags).
09 Oct 2008, PHP 5.2.7RC1
- Reverted fix for bug #44197 due to behaviour change in minor version.
(Felipe)
- Fixed bug #44306 (Better detection of MIPS processors on Windows). (Ilia)
- Fixed bug #44166 (Parameter handling flaw in PDO::getAvailableDrivers()).
(Ilia)
- Fixed bug #42505 (new sendmail default breaks on Netware platform)
(Guenter Knauf)
- Fixed bug #40013 (php_uname() does not return nodename on Netware
(Guenter Knauf)
27 Feb 2008, PHP 5.2.6RC1
- Added "PHP_INI_SCAN_DIR" environment variable which can be used to either
disable or change the compile time ini scan directory (FR #45114). (Jani)
- Fixed security issues detailed in CVE-2008-2665 and CVE-2008-2666.
(Christian Hoffmann)
- Fixed simplexml asXML() not to lose encoding when dumping entire document
to file. (Ilia)
- Fixed a crash inside PDO when trying instantiate PDORow manually. (Felipe)
- Fixed build failure of ext/mysqli with libmysql 6.0 - missing rpl
functions. (Andrey)
- Fixed a regression when using strip_tags() and < is within an attribute.
(Scott)
- Fixed a crash on invalid method in ReflectionParameter constructor.
(Christian Seiler)
- Fixed bug #46247 (ibase_set_event_handler() is allowing to pass callback
without event). (Felipe)
- Fixed bug #46215 (json_encode mutates its parameter and has some
class-specific state). (Felipe)
- Fixed bug #46206 (pg_query_params/pg_execute convert passed values to
strings). (Ilia)
- Fixed bug #46191 (BC break: DOMDocument saveXML() doesn't accept null). (Rob)
- Fixed bug #46164 (stream_filter_remove() closes the stream). (Arnaud)
- Fixed bug #46157 (PDOStatement::fetchObject prototype error). (Felipe)
- Fixed bug #46147 (after stream seek, appending stream filter reads
incorrect data). (Greg)
- Fixed bug #46110 (XMLWriter - openmemory() and openuri() leak memory on
multiple calls). (Ilia)
- Fixed bug #46088 (RegexIterator::accept - segfault). (Felipe)
- Fixed bug #46059 (Compile failure under IRIX 6.5.30 building posix.c).
(Arnaud)
- Fixed bug #46053 (SplFileObject::seek - Endless loop). (Arnaud)
- Fixed bug #46051 (SplFileInfo::openFile - memory overlap). (Arnaud)
- Fixed bug #46047 (SimpleXML converts empty nodes into object with nested
array). (Rob)
- Fixed bug #46031 (Segfault in AppendIterator::next). (Arnaud)
- Fixed bug #46029 (Segfault in DOMText when using with Reflection). (Rob)
- Fixed bug #46010 (warnings incorrectly generated for iv in ecb mode).
(Felipe)
- Fixed bug #46003 (isset on nonexisting node return unexpected results). (Rob)
- Fixed bug #45956 (parse_ini_file() does not return false with syntax errors
in parsed file). (Jani)
- Fixed bug #45901 (wddx_serialize_value crash with SimpleXMLElement object).
(Rob)
- Fixed bug #45862 (get_class_vars is inconsistent with 'protected' and
'private' variables). (ilewis at uk dot ibm dot com, Felipe)
- Fixed bug #45860 (header() function fails to correctly replace all Status
lines). (Dmitry)
- Fixed bug #45805 (Crash on throwing exception from error handler). (Dmitry)
- Fixed bug #45765 (ReflectionObject with default parameters of self::xxx cause
an error). (Felipe)
- Fixed bug #45751 (Using auto_prepend_file crashes (out of scope stack address
use)). (basant dot kukreja at sun dot com)
- Fixed bug #45705 (rfc822_parse_adrlist() modifies passed address parameter).
(Jani)
- Fixed bug #45691 (Some per-dir or runtime settings may leak into other
requests). (Moriyoshi)
- Fixed bug #45581 (htmlspecialchars() double encoding &#x hex items). (Arnaud)
- Fixed bug #45580 (levenshtein() crashes with invalid argument). (Ilia)
- Fixed bug #45575 (Segfault with invalid non-string as event handler callback).
(Christian Seiler)
- Fixed bug #45568 (ISAPI doesn't properly clear auth_digest in header).
(Patch by: navara at emclient dot com)
- Fixed bug #45556 (Return value from callback isn't freed). (Felipe)
- Fixed bug #45555 (Segfault with invalid non-string as
register_introspection_callback). (Christian Seiler)
- Fixed bug #45553 (Using XPath to return values for attributes with a
namespace does not work). (Rob)
- Fixed bug #45486 (mb_send_mail(); header 'Content-Type: text/plain; charset='
parsing incorrect). (Felipe)
- Fixed bug #45485 (strip_tags and <?XML tag). (Felipe)
- Fixed bug #45460 (imap patch for fromlength fix in imap_headerinfo doesn't
accept lengths of 1024). (Felipe, andrew at lifescale dot com)
- Fixed bug #45449 (filesize() regression using ftp wrapper).
(crrodriguez at suse dot de)
- Fixed bug #45423 (fastcgi parent process doesn't invoke php_module_shutdown
before shutdown) (basant dot kukreja at sun dot com)
- Fixed bug #45406 (session.serialize_handler declared by shared extension
fails). (Kalle, oleg dot grenrus at dynamoid dot com)
- Fixed bug #45405 (snmp extension memory leak). (Federico Cuello, Rodrigo
Campos)
- Fixed bug #45392 (ob_start()/ob_end_clean() and memory_limit). (Arnaud)
- Fixed bug #45382 (timeout bug in stream_socket_enable_crypto). (Ilia)
- Fixed bug #45373 (php crash on query with errors in params). (Felipe)
- Fixed bug #45352 (Segmentation fault because of tick function on second
request). (Dmitry)
- Fixed bug #45312 (Segmentation fault on second request for array functions).
(Dmitry)
- Fixed bug #45251 (double free or corruption with setAttributeNode()). (Rob)
- Fixed bug #45226 and #18916 (xmlrpc_set_type() segfaults and wrong behavior
with valid ISO8601 date string). (Jeff Lawsons)
- Fixed bug #45220 (curl_read callback returns -1 when needs to return
size_t (unsigned)). (Felipe)
- Fixed bug #45181 (chdir() should clear relative entries in stat cache).
(Arnaud)
- Fixed bug #45178 (memory corruption on assignment result of "new" by
reference). (Dmitry)
- Fixed bug #45151 (Crash with URI/file..php (filename contains 2 dots)).
(Dmitry)
- Fixed bug #45139 (ReflectionProperty returns incorrect declaring class).
(Felipe)
- Fixed bug #45124 ($_FILES['upload']['size'] sometimes return zero and
sometimes the filesize). (Arnaud)
- Fixed bug #45028 (CRC32 output endianness is different between crc32()
and hash()). (Tony)
- Fixed bug #45004 (pg_insert() does not accept 4 digit timezone format).
(Ilia)
- Fixed bug #44991 (Compile Failure With freetds0.82).
(jklowden at freetds dot org, matthias at dsx dot at)
- Fixed bug #44925 (preg_grep() modifies input array). (Nuno)
- Fixed bug #44891 Memory leak using registerPHPFunctions and XSLT Variable
as function parameter. (Rob)
- Fixed bug #44830 (Very minor issue with backslash in heredoc). (Matt)
- Fixed bug #44811 (Improve error message when creating a new SoapClient that
contains invalid data). (Markus Fischer, David C)
- Fixed bug #44798 (Memory leak assigning value to attribute). (Ilia)
- Fixed bug #44716 (Progress notifications incorrect). (Hannes)
- Fixed bug #44712 (stream_context_set_params segfaults on invalid arguments).
(Hannes)
- Fixed bug #44617 (wrong HTML entity output when substitute_character=entity).
(Moriyoshi)
- Fixed bug #44425 (Extending PDO/MySQL class with a __call() function doesn't
work). (Johannes)
- Fixed bug #44246 (closedir() accepts a file resource opened by fopen()).
(Dmitry, Tony)
- Fixed bug #44127 (UNIX abstract namespace socket connect does not work).
(Jani)
- Fixed bug #43993 (mb_substr_count() behaves differently to substr_count() with
overlapping needles). (Moriyoshi)
- Fixed Bug #43958 (class name added into the error message). (Dmitry)
- Fixed bug #43941 (json_encode silently cuts non-UTF8 strings). (Stas)
- Fixed bug #43782 (feof() does not detect timeout on socket). (David Soria Parra)
- Fixed bug #43668 (Added odbc.default_cursortype to control the ODBC
cursormodel). (Patrick)
- Fixed bug #43666 (Fixed code to use ODBC 3.52 datatypes for 64bit systems).
(Patrick)
- Fixed bug #43540 (rfc1867 handler newlength problem). (Arnaud)
- Fixed bug #43053 (Regression: some numbers shown in scientific notation).
(int-e at gmx dot de)
- Fixed bug #43045 (SOAP encoding violation on "INF" for type double/float).
(Dmitry)
- Fixed bug #42737 (preg_split('//u') triggers a E_NOTICE with newlines).
(Nuno)
- Fixed bug #42604 ("make test" fails with --with-config-file-scan-dir=path).
(Jani)
- Fixed bug #42318 (problem with nm on AIX, not finding object files). (Dmitry)
- Fixed bug #41348 (OCI8: allow compilation with Oracle 8.1). (Chris Jones)
- Fixed bug #14032 (Mail() always returns false but mail is sent). (Mikko)
- Fixed bug #46222 (ArrayObject EG(uninitialized_var_ptr) overwrite).
(Etienne)
01 May 2008, PHP 5.2.6
- Fixed two possible crashes inside posix extension (Tony)
- Fixed incorrect heredoc handling when label is used within the block.
(Matt)
- Fixed possible stack buffer overflow in FastCGI SAPI. (Andrei Nigmatulin)
- Fixed sending of uninitialized paddings which may contain some information. (Andrei Nigmatulin)
- Fixed a bug in formatting timestamps when DST is active in the default timezone (Derick)
- Properly address incomplete multibyte chars inside escapeshellcmd() (Ilia, Stefan Esser)
- Fix integer overflow in printf(). (Stas, Maksymilian Aciemowicz)
- Fixed security issue detailed in CVE-2008-0599. (Rasmus)
- Fixed potential memleak in stream filter parameter for zlib filter. (Greg)
- Added Reflection API metadata for the methods of the DOM classes. (Sebastian)
@@ -71,155 +173,128 @@ PHP NEWS
which to group by data is specified. (Ilia)
- Fixed segfault in filter extension when using callbacks. (Arnar Mar Sig,
Felipe)
- Fixed faulty fix for bug #40189 (endless loop in zlib.inflate stream filter). (Greg)
- Upgraded PCRE to version 7.6 (Nuno)
- Fixed bug #44742 (timezone_offset_get() causes segmentation faults). (Derick)
- Fixed bug #44720 (Prevent crash within session_register()). (Scott)
- Fixed bug #44703 (htmlspecialchars() does not detect bad character set argument). (Andy Wharmby)
- Fixed bug #44673 (With CGI argv/argc starts from arguments, not from script) (Dmitry)
- Fixed bug #44667 (proc_open() does not handle pipes with the mode 'wb' correctly). (Jani)
- Fixed bug #44663 (Crash in imap_mail_compose if "body" parameter invalid). (Ilia)
- Fixed bug #44650 (escaepshellscmd() does not check arg count). (Ilia)
- Fixed bug #44613 (Crash inside imap_headerinfo()). (Ilia, jmessa)
- Fixed bug #44603 (Order issues with Content-Type/Length headers on POST). (Ilia)
- Fixed bug #44594 (imap_open() does not validate # of retries parameter). (Ilia)
- Fixed bug #44591 (imagegif's filename parameter). (Felipe)
- Fixed bug #44557 (Crash in imap_setacl when supplied integer as username) (Thomas Jarosch)
- Fixed bug #44487 (call_user_method_array issues a warning when throwing an exception). (David Soria Parra)
- Fixed bug #44478 (Inconsistent behaviour when assigning new nodes). (Rob, Felipe)
- Fixed bug #44445 (email validator does not handle domains starting/ending with a -). (Ilia)
- Fixed bug #44440 (st_blocks undefined under BeOS). (Felipe)
- Fixed bug #44394 (Last two bytes missing from output). (Felipe)
- Fixed bug #44388 (Crash inside exif_read_data() on invalid images) (Ilia)
- Fixed bug #44373 (PDO_OCI extension compile failed). (Felipe)
- Fixed bug #44333 (SEGFAULT when using mysql_pconnect() with client_flags). (Felipe)
- Fixed bug #44306 (Better detection of MIPS processors on Windows). (Ilia)
- Fixed bug #44242 (metaphone('CMXFXM') crashes PHP). (Felipe)
- Fixed bug #44233 (MSG_PEEK undefined under BeOS R5). (jonathonfreeman at
gmail dot com, Ilia)
- Fixed bug #44233 (MSG_PEEK undefined under BeOS R5). (jonathonfreeman at gmail dot com, Ilia)
- Fixed bug #44216 (strftime segfaults on large negative value). (Derick)
- Fixed bug #44200 (A crash in PDO when no bound targets exists and yet
bound parameters are present). (Ilia)
- Fixed bug #44209 (strtotime() doesn't support 64 bit timestamps on 64 bit
platforms). (Derick)
- Fixed bug #44206 (OCI8 selecting ref cursors leads to ORA-1000 maximum
open cursors reached). (Oracle Corp.)
- Fixed bug #44209 (strtotime() doesn't support 64 bit timestamps on 64 bit platforms). (Derick)
- Fixed bug #44206 (OCI8 selecting ref cursors leads to ORA-1000 maximum open cursors reached). (Oracle Corp.)
- Fixed bug #44200 (A crash in PDO when no bound targets exists and yet bound parameters are present). (Ilia)
- Fixed bug #44197 (socket array keys lost on socket_select). (Felipe)
- Fixed bug #44191 (preg_grep messes up array index). (Felipe)
- Fixed bug #44189 (PDO setAttribute() does not properly validate values for
native numeric options). (Ilia)
- Fixed bug #44189 (PDO setAttribute() does not properly validate values for native numeric options). (Ilia)
- Fixed bug #44184 (Double free of loop-variable on exception). (Dmitry)
- Fixed bug #44171 (Invalid FETCH_COLUMN index does not raise an error). (Ilia)
- Fixed bug #44159 (Crash: $pdo->setAttribute(PDO::STATEMENT_ATTR_CLASS, NULL)).
(Felipe)
- Fixed bug #44166 (Parameter handling flaw in PDO::getAvailableDrivers()). (Ilia)
- Fixed bug #44159 (Crash: $pdo->setAttribute(PDO::STATEMENT_ATTR_CLASS, NULL)). (Felipe)
- Fixed bug #44152 (Possible crash with syslog logging on ZTS builds). (Ilia)
- Fixed bug #44141 (private parent constructor callable through static
function). (Dmitry)
- Fixed bug #44113 (OCI8 new collection creation can fail with OCI-22303).
(Oracle Corp.)
- Fixed bug #44069 (Huge memory usage with concatenation using . instead of
.=). (Dmitry)
- Fixed bug #44046 (crash inside array_slice() function with an invalid
by-ref offset). (Ilia)
- Fixed bug #44028 (crash inside stream_socket_enable_crypto() when enabling
encryption without crypto type). (Ilia)
- Fixed bug #44141 (private parent constructor callable through static function). (Dmitry)
- Fixed bug #44113 (OCI8 new collection creation can fail with OCI-22303). (Oracle Corp.)
- Fixed bug #44069 (Huge memory usage with concatenation using . instead of .=). (Dmitry)
- Fixed bug #44046 (crash inside array_slice() function with an invalid by-ref offset). (Ilia)
- Fixed bug #44028 (crash inside stream_socket_enable_crypto() when enabling encryption without crypto type). (Ilia)
- Fixed bug #44018 (RecursiveDirectoryIterator options inconsistancy). (Marcus)
- Fixed bug #44008 (OCI8 incorrect usage of OCI-Lob->close crashes PHP).
(Oracle Corp.)
- Fixed bug #43998 (Two error messages returned for incorrect encoding for
mb_strto[upper|lower]). (Rui)
- Fixed bug #44008 (OCI8 incorrect usage of OCI-Lob->close crashes PHP). (Oracle Corp.)
- Fixed bug #43998 (Two error messages returned for incorrect encoding for mb_strto[upper|lower]). (Rui)
- Fixed bug #43994 (mb_ereg 'successfully' matching incorrect). (Rui)
- Fixed bug #43954 (Memory leak when sending the same HTTP status code
multiple times). (Scott)
- Fixed bug #43927 (koi8r is missing from html_entity_decode()).
(andy at demos dot su, Tony)
- Fixed faulty fix for bug #40189 (endless loop in zlib.inflate stream filter).
(Greg)
- Fixed bug #43912 (Interbase column names are truncated to 31 characters).
(Ilia)
- Fixed bug #43875 (Two error messages returned for $new and $flag argument
in mysql_connect()). (Hannes)
- Fixed bug #43863 (str_word_count() breaks on cyrillic "ya" in locale cp1251).
(phprus at gmail dot com, Tony)
- Fixed bug #43954 (Memory leak when sending the same HTTP status code multiple times). (Scott)
- Fixed bug #43927 (koi8r is missing from html_entity_decode()). (andy at demos dot su, Tony)
- Fixed bug #43912 (Interbase column names are truncated to 31 characters). (Ilia)
- Fixed bug #43875 (Two error messages returned for $new and $flag argument in mysql_connect()). (Hannes)
- Fixed bug #43863 (str_word_count() breaks on cyrillic "ya" in locale cp1251). (phprus at gmail dot com, Tony)
- Fixed bug #43841 (mb_strrpos offset is byte count for negative values). (Rui)
- Fixed bug #43840 (mb_strpos bounds check is byte count rather than a character
count). (Rui)
- Fixed bug #43840 (mb_strpos bounds check is byte count rather than a character count). (Rui)
- Fixed bug #43808 (date_create never fails (even when it should)). (Derick)
- Fixed bug #43793 (zlib filter is unable to auto-detect gzip/zlib file headers).
(Greg)
- Fixed bug #43793 (zlib filter is unable to auto-detect gzip/zlib file headers). (Greg)
- Fixed bug #43703 (Signature compatibility check broken). (Dmitry)
- Fixed bug #43663 (Extending PDO class with a __call() function doesn't work).
(David Soria Parra)
- Fixed bug #43677 (Inconsistent behaviour of include_path set with php_value). (manuel at mausz dot at)
- Fixed bug #43663 (Extending PDO class with a __call() function doesn't work). (David Soria Parra)
- Fixed bug #43647 (Make FindFile use PATH_SEPARATOR instead of ";"). (Ilia)
- Fixed bug #43635 (mysql extension ingores INI settings on NULL values
passed to mysql_connect()). (Ilia)
- Fixed bug #43620 (Workaround for a bug inside libcurl 7.16.2 that can result
in a crash). (Ilia)
- Fixed bug #43606 (define missing depencies of the exif extension).
(crrodriguez at suse dot de)
- Fixed bug #43635 (mysql extension ingores INI settings on NULL values passed to mysql_connect()). (Ilia)
- Fixed bug #43620 (Workaround for a bug inside libcurl 7.16.2 that can result in a crash). (Ilia)
- Fixed bug #43614 (incorrect processing of numerical string keys of array in arbitrary serialized data). (Dmitriy Buldakov, Felipe)
- Fixed bug #43606 (define missing depencies of the exif extension). (crrodriguez at suse dot de)
- Fixed bug #43589 (a possible infinite loop in bz2_filter.c). (Greg)
- Fixed bug #43580 (removed bogus declaration of a non-existent php_is_url()
function). (Ilia)
- Fixed bug #43559 (array_merge_recursive() doesn't behave as expected with
duplicate NULL values). (Felipe, Tony)
- Fixed bug #43580 (removed bogus declaration of a non-existent php_is_url() function). (Ilia)
- Fixed bug #43559 (array_merge_recursive() doesn't behave as expected with duplicate NULL values). (Felipe, Tony)
- Fixed bug #43533 (escapeshellarg('') returns null). (Ilia)
- Fixed bug #43527 (DateTime created from a timestamp reports environment
timezone). (Derick)
- Fixed bug #43522 (stream_get_line() eats additional characters). (Felipe,
Ilia, Tony)
- Fixed bug #43507 (SOAPFault HTTP Status 500 - would like to be able to set
the HTTP Status). (Dmitry)
- Fixed bug #43527 (DateTime created from a timestamp reports environment timezone). (Derick)
- Fixed bug #43522 (stream_get_line() eats additional characters). (Felipe, Ilia, Tony)
- Fixed bug #43507 (SOAPFault HTTP Status 500 - would like to be able to set the HTTP Status). (Dmitry)
- Fixed bug #43505 (Assign by reference bug). (Dmitry)
- Fixed bug #43497 (OCI8 XML/getClobVal aka temporary LOBs leak UGA memory).
(Chris)
- Fixed bug #43495 (array_merge_recursive() crashes with recursive arrays).
(Ilia)
- Fixed bug #43498 (file_exists() on a proftpd server got SIZE not
allowed in ASCII mode). (Ilia, crrodriguez at suse dot de)
- Fixed bug #43493 (pdo_pgsql does not send username on connect when password
is not available). (Ilia)
- Fixed bug #43491 (Under certain conditions, file_exists() never returns).
(Dmitry)
- Fixed bug #43483 (get_class_methods() does not list all visible methods).
(Dmitry)
- Fixed bug #43482 (array_pad() does not warn on very small pad numbers).
(Ilia)
- Fixed bug #43457 (Prepared statement with incorrect parms doesn't throw
exception with pdo_pgsql driver). (Ilia)
- Fixed bug #43450 (Memory leak on some functions with implicit object
__toString() call). (David C.)
- Fixed bug #43498 (file_exists() on a proftpd server got SIZE not allowed in ASCII mode). (Ilia, crrodriguez at suse dot de)
- Fixed bug #43497 (OCI8 XML/getClobVal aka temporary LOBs leak UGA memory). (Chris)
- Fixed bug #43495 (array_merge_recursive() crashes with recursive arrays). (Ilia)
- Fixed bug #43493 (pdo_pgsql does not send username on connect when password is not available). (Ilia)
- Fixed bug #43491 (Under certain conditions, file_exists() never returns). (Dmitry)
- Fixed bug #43483 (get_class_methods() does not list all visible methods). (Dmitry)
- Fixed bug #43482 (array_pad() does not warn on very small pad numbers). (Ilia)
- Fixed bug #43457 (Prepared statement with incorrect parms doesn't throw exception with pdo_pgsql driver). (Ilia)
- Fixed bug #43450 (Memory leak on some functions with implicit object __toString() call). (David C.)
- Fixed bug #43386 (array_globals not reset to 0 properly on init). (Ilia)
- Fixed bug #43377 (PHP crashes with invalid argument for DateTimeZone). (Ilia)
- Fixed bug #43373 (pcntl_fork() should not raise E_ERROR on error). (Ilia)
- Fixed bug #43364 (recursive xincludes don't remove internal xml nodes
properly). (Rob, patch from ddb@bitxtender.de)
- Fixed bug #43092 (curl_copy_handle() crashes with > 32 chars long URL).
(Jani)
- Fixed bug #43301 (mb_ereg*_replace() crashes when replacement string is
invalid PHP expression and 'e' option is used). (Jani)
- Fixed bug #43003 (Invalid timezone reported for DateTime objects constructed
using a timestamp). (Derick)
- Fixed bug #43295 (crash because of uninitialized SG(sapi_headers).mimetype).
(Dmitry)
- Fixed bug #43364 (recursive xincludes don't remove internal xml nodes properly). (Rob, patch from ddb@bitxtender.de)
- Fixed bug #43301 (mb_ereg*_replace() crashes when replacement string is invalid PHP expression and 'e' option is used). (Jani)
- Fixed bug #43295 (crash because of uninitialized SG(sapi_headers).mimetype). (Dmitry)
- Fixed bug #43293 (Multiple segfaults in getopt()). (Hannes)
- Fixed bug #43279 (pg_send_query_params() converts all elements in 'params'
to strings). (Ilia)
- Fixed bug #43276 (Incomplete fix for bug #42739, mkdir() under safe_mode).
(Ilia)
- Fixed bug #43279 (pg_send_query_params() converts all elements in 'params' to strings). (Ilia)
- Fixed bug #43276 (Incomplete fix for bug #42739, mkdir() under safe_mode). (Ilia)
- Fixed bug #43248 (backward compatibility break in realpath()). (Dmitry)
- Fixed bug #43221 (SimpleXML adding default namespace in addAttribute). (Rob)
- Fixed bug #43216 (stream_is_local() returns false on "file://"). (Dmitry)
- Fixed bug #43201 (Crash on using uninitialized vals and __get/__set). (Dmitry)
- Fixed bug #43182 (file_put_contents() LOCK_EX does not work properly on file
truncation). (Ilia)
- Fixed bug #43175 (__destruct() throwing an exception with __call() causes
segfault). (Dmitry)
- Fixed bug #43182 (file_put_contents() LOCK_EX does not work properly on file truncation). (Ilia)
- Fixed bug #43175 (__destruct() throwing an exception with __call() causes segfault). (Dmitry)
- Fixed bug #43128 (Very long class name causes segfault). (Dmitry)
- Fixed bug #43105 (PHP seems to fail to close open files). (Hannes)
- Fixed bug #42978 (mismatch between number of bound params and values causes
a crash in pdo_pgsql). (Ilia)
- Fixed bug #43092 (curl_copy_handle() crashes with > 32 chars long URL). (Jani)
- Fixed bug #43003 (Invalid timezone reported for DateTime objects constructed using a timestamp). (Derick)
- Fixed bug #42978 (mismatch between number of bound params and values causes a crash in pdo_pgsql). (Ilia)
- Fixed bug #42945 (preg_split() swallows part of the string). (Nuno)
- Fixed bug #42937 (__call() method not invoked when methods are called on
parent from child class). (Dmitry)
- Fixed bug #42937 (__call() method not invoked when methods are called on parent from child class). (Dmitry)
- Fixed bug #42841 (REF CURSOR and oci_new_cursor() crash PHP). (Chris)
- Fixed Bug #42838 (Wrong results in array_diff_uassoc) (Felipe)
- Fixed bug #42779 (Incorrect forcing from HTTP/1.0 request to HTTP/1.1
response). (Ilia)
- Fixed bug #42838 (Wrong results in array_diff_uassoc) (Felipe)
- Fixed bug #42779 (Incorrect forcing from HTTP/1.0 request to HTTP/1.1 response). (Ilia)
- Fixed bug #42736 (xmlrpc_server_call_method() crashes). (Tony)
- Fixed bug #42692 (Procedure 'int1' not present with doc/lit SoapServer).
(Dmitry)
- Fixed bug #42692 (Procedure 'int1' not present with doc/lit SoapServer). (Dmitry)
- Fixed bug #42548 (mysqli PROCEDURE calls can't return result sets). (Hartmut)
- Fixed bug #42369 (Implicit conversion to string leaks memory).
(David C., Rob).
- Fixed bug #42505 (new sendmail default breaks on Netware platform) (Guenter Knauf)
- Fixed bug #42369 (Implicit conversion to string leaks memory). (David C., Rob).
- Fixed bug #42272 (var_export() incorrectly escapes char(0)). (Derick)
- Fixed bug #42261 (Incorrect lengths for date and boolean data types).
(Ilia)
- Fixed bug #42190 (Constructing DateTime with TimeZone Indicator invalidates
DateTimeZone). (Derick)
- Fixed bug #42261 (Incorrect lengths for date and boolean data types). (Ilia)
- Fixed bug #42190 (Constructing DateTime with TimeZone Indicator invalidates DateTimeZone). (Derick)
- Fixed bug #42177 (Warning "array_merge_recursive(): recursion detected" comes again...). (Felipe)
- Fixed bug #41941 (oci8 extension not lib64 savvy). (Chris)
- Fixed bug #41828 (Failing to call RecursiveIteratorIterator::__construct() causes a sefault). (Etienne)
- Fixed bug #41599 (setTime() fails after modify() is used). (Derick)
- Fixed bug #41562 (SimpleXML memory issue). (Rob)
- Fixed bug #40013 (php_uname() does not return nodename on Netware (Guenter Knauf)
- Fixed bug #38468 (Unexpected creation of cycle). (Dmitry)
- Fixed bug #32979 (OpenSSL stream->fd casts broken in 64-bit build) (stotty at tvnet dot hu)
08 Nov 2007, PHP 5.2.5
- Upgraded PCRE to version 7.3 (Nuno)
+8 -3
View File
@@ -491,6 +491,7 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
int use_relative_path = 0;
#ifdef TSRM_WIN32
int is_unc;
int exists;
#endif
TSRMLS_FETCH();
@@ -589,6 +590,7 @@ no_realpath:
CWD_STATE_COPY(&old_state, state);
#ifdef TSRM_WIN32
exists = (use_realpath != CWD_EXPAND);
ret = 0;
is_unc = 0;
if (path_length >= 2 && path[1] == ':') {
@@ -696,13 +698,16 @@ no_realpath:
ptr_length = length;
FindClose(hFind);
ret = 0;
} else if (use_realpath == CWD_REALPATH) {
} else {
if (is_unc) {
/* skip share name */
is_unc--;
ret = 0;
} else {
ret = 1;
exists = 0;
if (use_realpath == CWD_REALPATH) {
ret = 1;
}
}
}
}
@@ -742,7 +747,7 @@ no_realpath:
/* Store existent file in realpath cache. */
#ifdef TSRM_WIN32
if (use_cache && !is_unc) {
if (use_cache && !is_unc && exists) {
#else
if (use_cache && (use_realpath == CWD_REALPATH)) {
#endif
+10 -10
View File
@@ -88,7 +88,7 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
{
if (mode == 1 /*X_OK*/) {
#if 1
/* This code is not supported by Windows 98,
/* This code is not supported by Windows 98,
* but we don't support it anymore */
DWORD type;
@@ -96,7 +96,7 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
#else
SHFILEINFO sfi;
return access(pathname, 0) == 0 &&
return access(pathname, 0) == 0 &&
SHGetFileInfo(pathname, 0, &sfi, sizeof(SHFILEINFO), SHGFI_EXETYPE) != 0 ? 0 : -1;
#endif
} else {
@@ -109,22 +109,22 @@ static process_pair *process_get(FILE *stream TSRMLS_DC)
{
process_pair *ptr;
process_pair *newptr;
for (ptr = TWG(process); ptr < (TWG(process) + TWG(process_size)); ptr++) {
if (ptr->stream == stream) {
break;
}
}
if (ptr < (TWG(process) + TWG(process_size))) {
return ptr;
}
newptr = (process_pair*)realloc((void*)TWG(process), (TWG(process_size)+1)*sizeof(process_pair));
if (newptr == NULL) {
return NULL;
}
TWG(process) = newptr;
ptr = newptr + TWG(process_size);
TWG(process_size)++;
@@ -136,7 +136,7 @@ static shm_pair *shm_get(int key, void *addr)
shm_pair *ptr;
shm_pair *newptr;
TSRMLS_FETCH();
for (ptr = TWG(shm); ptr < (TWG(shm) + TWG(shm_size)); ptr++) {
if (!ptr->descriptor) {
continue;
@@ -151,12 +151,12 @@ static shm_pair *shm_get(int key, void *addr)
if (ptr < (TWG(shm) + TWG(shm_size))) {
return ptr;
}
newptr = (shm_pair*)realloc((void*)TWG(shm), (TWG(shm_size)+1)*sizeof(shm_pair));
if (newptr == NULL) {
return NULL;
}
TWG(shm) = newptr;
ptr = newptr + TWG(shm_size);
TWG(shm_size)++;
@@ -195,7 +195,7 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
if (!str_len || !CreatePipe(&in, &out, &security, 2048L)) {
return NULL;
}
memset(&startup, 0, sizeof(STARTUPINFO));
memset(&process, 0, sizeof(PROCESS_INFORMATION));
+1 -1
View File
@@ -1,5 +1,5 @@
--TEST--
Bug #38469 Unexpected creation of cycle
Bug #38469 (Unexpected creation of cycle)
--FILE--
<?php
$a = array();
+1 -1
View File
@@ -1,5 +1,5 @@
--TEST--
Bug #41372 Internal pointer of source array resets during array copying
Bug #41372 (Internal pointer of source array resets during array copying)
--FILE--
<?php
$Foo = array('val1', 'val2', 'val3');
+1 -1
View File
@@ -8,4 +8,4 @@ $foo[3]->bar[1] = "bang";
echo "ok\n";
?>
--EXPECTF--
Fatal error: Cannot use string offset as an object in %s/bug41919.php on line %d
Fatal error: Cannot use string offset as an object in %sbug41919.php on line %d
+14
View File
@@ -0,0 +1,14 @@
--TEST--
Bug #43053 (Regression: some numbers shown in scientific notation)
--FILE--
<?php
echo 1200000.00."\n";
echo 1300000.00."\n";
echo 1400000.00."\n";
echo 1500000.00."\n";
?>
--EXPECT--
1200000
1300000
1400000
1500000
+1 -1
View File
@@ -1,5 +1,5 @@
--TEST--
Bug #43128 Very long class name causes segfault
Bug #43128 (Very long class name causes segfault)
--FILE--
<?php
+14
View File
@@ -0,0 +1,14 @@
--TEST--
Bug #44830 (Very minor issue with backslash in heredoc)
--FILE--
<?php
$backslash = <<<EOT
\
EOT;
var_dump($backslash);
?>
--EXPECT--
string(1) "\"
+29
View File
@@ -0,0 +1,29 @@
--TEST--
Bug #45178 memory corruption on assignment result of "new" by reference
--FILE--
<?php
class Foo {
function __construct() {
$this->error = array($this,$this);
}
}
$a =& new Foo();
class Bar {
function __construct() {
$this->_rme2 = $this;
}
}
$b =& new Bar();
$b->_rme2 = 0;
var_dump($b);
?>
--EXPECTF--
Strict Standards: Assigning the return value of new by reference is deprecated in %sbug45178.php on line 7
Strict Standards: Assigning the return value of new by reference is deprecated in %sbug45178.php on line 15
object(Bar)#%d (1) {
["_rme2"]=>
int(0)
}
+48
View File
@@ -0,0 +1,48 @@
--TEST--
Bug #45805 (Crash on throwing exception from error handler)
--SKIPIF--
<?php extension_loaded('reflection') or die('skip'); ?>
--FILE--
<?php
class PHPUnit_Util_ErrorHandler
{
public static function handleError($errno, $errstr, $errfile, $errline)
{
throw new RuntimeException;
}
}
class A {
public function getX() {
return NULL;
}
}
class B {
public function foo() {
$obj = new A;
$source = &$obj->getX();
}
public function bar() {
$m = new ReflectionMethod('B', 'foo');
$m->invoke($this);
}
}
set_error_handler(
array('PHPUnit_Util_ErrorHandler', 'handleError'), E_ALL | E_STRICT
);
$o = new B;
$o->bar();
?>
--EXPECTF--
Fatal error: Uncaught exception 'RuntimeException' in %sbug45805.php:%d
Stack trace:
#0 %sbug45805.php(%d): PHPUnit_Util_ErrorHandler::handleError(2048, 'Only variables ...', '%s', %d, Array)
#1 [internal function]: B->foo()
#2 %sbug45805.php(%d): ReflectionMethod->invoke(Object(B))
#3 %sbug45805.php(%d): B->bar()
#4 {main}
thrown in %sbug45805.php on line %d
+43
View File
@@ -0,0 +1,43 @@
--TEST--
Bug #45862 (get_class_vars is inconsistent with 'protected' and 'private' variables)
--FILE--
<?php
class Ancestor {
function test() {
var_dump(get_class_vars("Tester"));
var_dump(Tester::$prot);
}
}
class Tester extends Ancestor {
static protected $prot = "protected var";
static private $priv = "private var";
}
class Child extends Tester {
function test() { var_dump(get_class_vars("Tester")); }
}
echo "\n From parent scope\n";
$parent = new Ancestor();
$parent->test();
echo "\n From child scope\n";
$child = new Child();
$child->test();
?>
--EXPECT--
From parent scope
array(1) {
["prot"]=>
string(13) "protected var"
}
string(13) "protected var"
From child scope
array(1) {
["prot"]=>
string(13) "protected var"
}
+28
View File
@@ -0,0 +1,28 @@
--TEST--
Testing exception properties
--FILE--
<?php
class my_file
{
public function __toString()
{
return "somebuildfilename" ;
}
}
class my_exception extends exception
{
public function __construct()
{
$this->message = new stdclass ;
$this->file = new my_file ;
$this->line = "12" ;
}
}
throw new my_exception;
?>
--EXPECT--
Catchable fatal error: Object of class stdClass could not be converted to string in Unknown on line 0
+55
View File
@@ -0,0 +1,55 @@
--TEST--
get_class_methods(): Testing scope
--FILE--
<?php
abstract class A {
public function a() { }
private function b() { }
protected function c() { }
}
class B extends A {
private function bb() { }
static public function test() {
var_dump(get_class_methods('A'));
var_dump(get_class_methods('B'));
}
}
var_dump(get_class_methods('A'));
var_dump(get_class_methods('B'));
B::test();
?>
--EXPECT--
array(1) {
[0]=>
string(1) "a"
}
array(2) {
[0]=>
string(4) "test"
[1]=>
string(1) "a"
}
array(2) {
[0]=>
string(1) "a"
[1]=>
string(1) "c"
}
array(4) {
[0]=>
string(2) "bb"
[1]=>
string(4) "test"
[2]=>
string(1) "a"
[3]=>
string(1) "c"
}
+43
View File
@@ -0,0 +1,43 @@
--TEST--
get_class_methods(): Testing with interface
--FILE--
<?php
interface A {
function a();
function b();
}
class B implements A {
public function a() { }
public function b() { }
public function __construct() {
var_dump(get_class_methods('A'));
var_dump(get_class_methods('B'));
}
public function __destruct() { }
}
new B;
?>
--EXPECTF--
Strict Standards: Redefining already defined constructor for class B in %s on line %d
array(2) {
[0]=>
string(1) "a"
[1]=>
string(1) "b"
}
array(4) {
[0]=>
string(1) "a"
[1]=>
string(1) "b"
[2]=>
string(11) "__construct"
[3]=>
string(10) "__destruct"
}
+78
View File
@@ -0,0 +1,78 @@
--TEST--
get_class_methods(): Testing scope
--FILE--
<?php
interface A {
function aa();
function bb();
static function cc();
}
class C {
public function a() { }
protected function b() { }
private function c() { }
static public function static_a() { }
static protected function static_b() { }
static private function static_c() { }
}
class B extends C implements A {
public function aa() { }
public function bb() { }
static function cc() { }
public function __construct() {
var_dump(get_class_methods('A'));
var_dump(get_class_methods('B'));
var_dump(get_class_methods('C'));
}
public function __destruct() { }
}
new B;
?>
--EXPECT--
array(3) {
[0]=>
string(2) "aa"
[1]=>
string(2) "bb"
[2]=>
string(2) "cc"
}
array(9) {
[0]=>
string(2) "aa"
[1]=>
string(2) "bb"
[2]=>
string(2) "cc"
[3]=>
string(11) "__construct"
[4]=>
string(10) "__destruct"
[5]=>
string(1) "a"
[6]=>
string(1) "b"
[7]=>
string(8) "static_a"
[8]=>
string(8) "static_b"
}
array(4) {
[0]=>
string(1) "a"
[1]=>
string(1) "b"
[2]=>
string(8) "static_a"
[3]=>
string(8) "static_b"
}
+33
View File
@@ -0,0 +1,33 @@
--TEST--
get_class_vars(): Simple test
--FILE--
<?php
class A {
public $a = 1;
private $b = 2;
private $c = 3;
}
class B extends A {
static public $aa = 4;
static private $bb = 5;
static protected $cc = 6;
}
var_dump(get_class_vars('A'));
var_dump(get_class_vars('B'));
?>
--EXPECT--
array(1) {
["a"]=>
int(1)
}
array(2) {
["a"]=>
int(1)
["aa"]=>
int(4)
}
+49
View File
@@ -0,0 +1,49 @@
--TEST--
get_class_vars(): Testing the scope
--FILE--
<?php
class A {
public $a = 1;
private $b = 2;
private $c = 3;
}
class B extends A {
static public $aa = 4;
static private $bb = 5;
static protected $cc = 6;
}
class C extends B {
public function __construct() {
var_dump(get_class_vars('A'));
var_dump(get_class_vars('B'));
var_dump($this->a, $this->b, $this->c);
}
}
new C;
?>
--EXPECTF--
array(1) {
["a"]=>
int(1)
}
array(3) {
["a"]=>
int(1)
["aa"]=>
int(4)
["cc"]=>
int(6)
}
Notice: Undefined property: C::$b in %s on line %d
Notice: Undefined property: C::$c in %s on line %d
int(1)
NULL
NULL
+47
View File
@@ -0,0 +1,47 @@
--TEST--
get_class_vars(): Testing the scope
--FILE--
<?php
class A {
public $a = 1;
private $b = 2;
private $c = 3;
}
class B extends A {
static public $aa = 4;
static private $bb = 5;
static protected $cc = 6;
protected function __construct() {
var_dump(get_class_vars('C'));
}
}
class C extends B {
public $aaa = 7;
private $bbb = 8;
protected $ccc = 9;
public function __construct() {
parent::__construct();
}
}
new C;
?>
--EXPECT--
array(5) {
["aaa"]=>
int(7)
["ccc"]=>
int(9)
["a"]=>
int(1)
["aa"]=>
int(4)
["cc"]=>
int(6)
}
+67
View File
@@ -0,0 +1,67 @@
--TEST--
get_class_vars(): Testing the scope
--FILE--
<?php
class A {
public $a = 1;
static public $A = 2;
private $b = 3;
static private $B = 4;
protected $c = 5;
static protected $C = 6;
public function __construct() {
var_dump(get_class_vars('A'));
}
static public function test() {
var_dump(get_class_vars('A'));
}
}
var_dump(get_class_vars('A'));
new A;
var_dump(A::test());
?>
--EXPECT--
array(2) {
["a"]=>
int(1)
["A"]=>
int(2)
}
array(6) {
["a"]=>
int(1)
["b"]=>
int(3)
["c"]=>
int(5)
["A"]=>
int(2)
["B"]=>
int(4)
["C"]=>
int(6)
}
array(6) {
["a"]=>
int(1)
["b"]=>
int(3)
["c"]=>
int(5)
["A"]=>
int(2)
["B"]=>
int(4)
["C"]=>
int(6)
}
NULL
+39
View File
@@ -0,0 +1,39 @@
--TEST--
get_class_vars(): Testing visibility
--FILE--
<?php
class A {
protected $a = 1;
private $b = 2;
}
class B extends A {
private $c = 3;
public function __construct() {
var_dump(get_class_vars('A'));
var_dump(get_class_vars('B'));
}
}
var_dump(get_class_vars('A'));
var_dump(get_class_vars('B'));
new B;
?>
--EXPECT--
array(0) {
}
array(0) {
}
array(1) {
["a"]=>
int(1)
}
array(2) {
["c"]=>
int(3)
["a"]=>
int(1)
}
+48
View File
@@ -0,0 +1,48 @@
--TEST--
get_class_vars(): Testing visibility
--FILE--
<?php
class A {
protected $a = 1;
}
class B extends A { }
class C extends B { }
var_dump(get_class_vars('A'));
var_dump(get_class_vars('B'));
var_dump(get_class_vars('C'));
print "---\n";
class D extends B {
public function __construct() {
var_dump(get_class_vars('A'));
var_dump(get_class_vars('B'));
var_dump(get_class_vars('C'));
}
}
new D;
?>
--EXPECT--
array(0) {
}
array(0) {
}
array(0) {
}
---
array(1) {
["a"]=>
int(1)
}
array(1) {
["a"]=>
int(1)
}
array(0) {
}
+41
View File
@@ -0,0 +1,41 @@
--TEST--
get_class_vars(): Testing with static properties
--FILE--
<?php
class A {
static public $a, $aa;
static private $b, $bb;
static protected $c, $cc;
static public function test() {
var_dump(get_class_vars(__CLASS__));
}
}
var_dump(get_class_vars('A'));
var_dump(A::test());
?>
--EXPECT--
array(2) {
["a"]=>
NULL
["aa"]=>
NULL
}
array(6) {
["a"]=>
NULL
["aa"]=>
NULL
["b"]=>
NULL
["bb"]=>
NULL
["c"]=>
NULL
["cc"]=>
NULL
}
NULL
+1 -1
View File
@@ -22,7 +22,7 @@ foreach ($doubles as $d) {
echo "Done\n";
?>
--EXPECTF--
float(4083360297110%d)
float(4.0833602971%dE+14)
float(4.7223664828%dE+21)
float(1.3521606402%dE+31)
float(1.9807040628%dE+27)
+32
View File
@@ -0,0 +1,32 @@
--TEST--
Testing isset and unset with variable variables
--FILE--
<?php
print "- isset ---\n";
$var_name = 'unexisting';
if (isset($$var_name)) {
print "error\n";
}
$test = 'var_name';
if (isset($$$test)) {
print "error\n";
}
print "- unset ---\n";
unset($$var_name);
unset($$$test);
print "done\n";
?>
--EXPECT--
- isset ---
- unset ---
done
+10
View File
@@ -0,0 +1,10 @@
--TEST--
Testing isset with several undefined variables as argument
--FILE--
<?php
var_dump(isset($a, ${$b}, $$c, $$$$d, $e[$f->g]->d));
?>
--EXPECT--
bool(false)
+40
View File
@@ -0,0 +1,40 @@
--TEST--
Testing isset accessing undefined array itens and properties
--FILE--
<?php
$a = 'foo';
$b =& $a;
var_dump(isset($b));
var_dump(isset($a[0], $b[1]));
var_dump(isset($a[0]->a));
var_dump(isset($c[0][1][2]->a->b->c->d));
var_dump(isset(${$a}->{$b->$c[$d]}));
var_dump(isset($GLOBALS));
var_dump(isset($GLOBALS[1]));
var_dump(isset($GLOBALS[1]->$GLOBALS));
?>
--EXPECTF--
bool(true)
bool(true)
bool(false)
bool(false)
Notice: Undefined variable: d in %s on line %d
Notice: Undefined variable: c in %s on line %d
Notice: Trying to get property of non-object in %s on line %d
bool(false)
bool(true)
bool(false)
bool(false)
+74
View File
@@ -0,0 +1,74 @@
--TEST--
Testing method_exists()
--FILE--
<?php
class bar {
static public function stat_a2() {
}
static private function stat_b2() {
}
static protected function stat_c2() {
}
private function method_a() {
}
protected function method_b() {
}
public function method_c() {
}
}
class baz extends bar {
static public function stat_a() {
}
static private function stat_b() {
}
static protected function stat_c() {
}
private function method_a() {
}
protected function method_b() {
}
public function method_c() {
}
}
var_dump(method_exists('baz', 'stat_a'));
var_dump(method_exists('baz', 'stat_b'));
var_dump(method_exists('baz', 'stat_c'));
print "----\n";
var_dump(method_exists('baz', 'stat_a2'));
var_dump(method_exists('baz', 'stat_b2'));
var_dump(method_exists('baz', 'stat_c2'));
print "----\n";
$baz = new baz;
var_dump(method_exists($baz, 'method_a'));
var_dump(method_exists($baz, 'method_b'));
var_dump(method_exists($baz, 'method_c'));
print "----\n";
var_dump(method_exists($baz, 'stat_a'));
var_dump(method_exists($baz, 'stat_b'));
var_dump(method_exists($baz, 'stat_c'));
?>
--EXPECT--
bool(true)
bool(true)
bool(true)
----
bool(true)
bool(true)
bool(true)
----
bool(true)
bool(true)
bool(true)
----
bool(true)
bool(true)
bool(true)
+2
View File
@@ -1,3 +1,5 @@
<?php
unset($x)
?>
+1 -1
View File
@@ -15,5 +15,5 @@ echo "Done\n";
float(-100)
float(808792757210)
float(-4.5646456464565E+27)
float(-11276204760067000)
float(-1.1276204760067E+16)
Done
+5 -1
View File
@@ -1779,9 +1779,13 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr
efree(lc_class_name);
}
while (ptr->fname) {
if (zend_hash_exists(target_function_table, ptr->fname, strlen(ptr->fname)+1)) {
fname_len = strlen(ptr->fname);
lowercase_name = zend_str_tolower_dup(ptr->fname, fname_len);
if (zend_hash_exists(target_function_table, lowercase_name, fname_len+1)) {
efree(lowercase_name);
zend_error(error_type, "Function registration failed - duplicate name - %s%s%s", scope ? scope->name : "", scope ? "::" : "", ptr->fname);
}
efree(lowercase_name);
ptr++;
}
zend_unregister_functions(functions, count, target_function_table TSRMLS_CC);
+4 -1
View File
@@ -1115,7 +1115,10 @@ ZEND_API zend_mm_heap *zend_mm_startup(void)
if (tmp) {
seg_size = zend_atoi(tmp, 0);
if (zend_mm_low_bit(seg_size) != zend_mm_high_bit(seg_size)) {
fprintf(stderr, "ZEND_MM_SEG_SIZE must be a power ow two.\n");
fprintf(stderr, "ZEND_MM_SEG_SIZE must be a power of two\n");
exit(255);
} else if (seg_size < ZEND_MM_ALIGNED_SEGMENT_SIZE + ZEND_MM_ALIGNED_HEADER_SIZE) {
fprintf(stderr, "ZEND_MM_SEG_SIZE is too small\n");
exit(255);
}
} else {
+17 -11
View File
@@ -710,8 +710,6 @@ ZEND_FUNCTION(is_a)
/* {{{ add_class_vars */
static void add_class_vars(zend_class_entry *ce, HashTable *properties, zval *return_value TSRMLS_DC)
{
int instanceof = EG(scope) && instanceof_function(EG(scope), ce TSRMLS_CC);
if (zend_hash_num_elements(properties) > 0) {
HashPosition pos;
zval **prop;
@@ -720,20 +718,28 @@ static void add_class_vars(zend_class_entry *ce, HashTable *properties, zval *re
while (zend_hash_get_current_data_ex(properties, (void **) &prop, &pos) == SUCCESS) {
char *key, *class_name, *prop_name;
uint key_len;
ulong num_index;
ulong num_index, h;
int prop_name_len = 0;
zval *prop_copy;
zend_property_info *property_info;
zend_hash_get_current_key_ex(properties, &key, &key_len, &num_index, 0, &pos);
zend_hash_move_forward_ex(properties, &pos);
zend_unmangle_property_name(key, key_len-1, &class_name, &prop_name);
if (class_name) {
if (class_name[0] != '*' && strcmp(class_name, ce->name)) {
/* filter privates from base classes */
continue;
} else if (!instanceof) {
/* filter protected if not inside class */
continue;
}
prop_name_len = strlen(prop_name);
h = zend_get_hash_value(prop_name, prop_name_len+1);
if (zend_hash_quick_find(&ce->properties_info, prop_name, prop_name_len+1, h, (void **) &property_info) == FAILURE) {
continue;
}
if (property_info->flags & ZEND_ACC_SHADOW) {
continue;
} else if ((property_info->flags & ZEND_ACC_PRIVATE) && EG(scope) != ce) {
continue;
} else if ((property_info->flags & ZEND_ACC_PROTECTED) && zend_check_protected(ce, EG(scope)) == 0) {
continue;
}
/* copy: enforce read only access */
+15 -8
View File
@@ -655,6 +655,8 @@ void zend_do_assign_ref(znode *result, znode *lvar, znode *rvar TSRMLS_DC)
opline->opcode = ZEND_ASSIGN_REF;
if (zend_is_function_or_method_call(rvar)) {
opline->extended_value = ZEND_RETURNS_FUNCTION;
} else if (rvar->u.EA.type & ZEND_PARSED_NEW) {
opline->extended_value = ZEND_RETURNS_NEW;
} else {
opline->extended_value = 0;
}
@@ -1587,14 +1589,19 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC)
zend_stack_top(&CG(function_call_stack), (void **) &function_ptr_ptr);
function_ptr = *function_ptr_ptr;
if (original_op==ZEND_SEND_REF
&& !CG(allow_call_time_pass_reference)) {
zend_error(E_COMPILE_WARNING,
"Call-time pass-by-reference has been deprecated; "
"If you would like to pass it by reference, modify the declaration of %s(). "
"If you would like to enable call-time pass-by-reference, you can set "
"allow_call_time_pass_reference to true in your INI file",
(function_ptr ? function_ptr->common.function_name : "[runtime function name]"));
if (original_op == ZEND_SEND_REF && !CG(allow_call_time_pass_reference)) {
if (function_ptr &&
function_ptr->common.function_name &&
function_ptr->common.type == ZEND_USER_FUNCTION &&
!ARG_SHOULD_BE_SENT_BY_REF(function_ptr, (zend_uint) offset)) {
zend_error(E_COMPILE_WARNING,
"Call-time pass-by-reference has been deprecated; "
"If you would like to pass it by reference, modify the declaration of %s(). "
"If you would like to enable call-time pass-by-reference, you can set "
"allow_call_time_pass_reference to true in your INI file", function_ptr->common.function_name);
} else {
zend_error(E_COMPILE_WARNING, "Call-time pass-by-reference has been deprecated");
}
}
if (function_ptr) {
+2
View File
@@ -600,6 +600,7 @@ int zendlex(znode *zendlval TSRMLS_DC);
#define ZEND_PARSED_FUNCTION_CALL (1<<3)
#define ZEND_PARSED_VARIABLE (1<<4)
#define ZEND_PARSED_REFERENCE_VARIABLE (1<<5)
#define ZEND_PARSED_NEW (1<<6)
/* unset types */
@@ -685,6 +686,7 @@ int zendlex(znode *zendlval TSRMLS_DC);
#define ZEND_RETURNS_FUNCTION 1<<0
#define ZEND_RETURNS_NEW 1<<1
END_EXTERN_C()
+1
View File
@@ -1402,6 +1402,7 @@ ZEND_API void execute_internal(zend_execute_data *execute_data_ptr, int return_v
} \
EG(in_execution) = EX(original_in_execution); \
EG(current_execute_data) = EX(prev_execute_data); \
EG(opline_ptr) = NULL; \
ZEND_VM_RETURN()
#include "zend_vm_execute.h"
+1 -1
View File
@@ -553,7 +553,7 @@ expr_without_variable:
T_LIST '(' { zend_do_list_init(TSRMLS_C); } assignment_list ')' '=' expr { zend_do_list_end(&$$, &$7 TSRMLS_CC); }
| variable '=' expr { zend_check_writable_variable(&$1); zend_do_assign(&$$, &$1, &$3 TSRMLS_CC); }
| variable '=' '&' variable { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC); zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC); zend_do_assign_ref(&$$, &$1, &$4 TSRMLS_CC); }
| variable '=' '&' T_NEW class_name_reference { zend_error(E_STRICT, "Assigning the return value of new by reference is deprecated"); zend_check_writable_variable(&$1); zend_do_extended_fcall_begin(TSRMLS_C); zend_do_begin_new_object(&$4, &$5 TSRMLS_CC); } ctor_arguments { zend_do_end_new_object(&$3, &$4, &$7 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC); zend_do_assign_ref(&$$, &$1, &$3 TSRMLS_CC); }
| variable '=' '&' T_NEW class_name_reference { zend_error(E_STRICT, "Assigning the return value of new by reference is deprecated"); zend_check_writable_variable(&$1); zend_do_extended_fcall_begin(TSRMLS_C); zend_do_begin_new_object(&$4, &$5 TSRMLS_CC); } ctor_arguments { zend_do_end_new_object(&$3, &$4, &$7 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC); $3.u.EA.type = ZEND_PARSED_NEW; zend_do_assign_ref(&$$, &$1, &$3 TSRMLS_CC); }
| T_NEW class_name_reference { zend_do_extended_fcall_begin(TSRMLS_C); zend_do_begin_new_object(&$1, &$2 TSRMLS_CC); } ctor_arguments { zend_do_end_new_object(&$$, &$1, &$4 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
| T_CLONE expr { zend_do_clone(&$$, &$2 TSRMLS_CC); }
| variable T_PLUS_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_ADD, &$$, &$1, &$3 TSRMLS_CC); }
+5 -5
View File
@@ -792,9 +792,11 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo
while (s<end) {
if (*s=='\\') {
s++;
if (s>=end) {
continue;
if (s >= end) {
*t++ = '\\';
break;
}
switch(*s) {
case 'n':
*t++ = '\n';
@@ -1808,9 +1810,7 @@ HEREDOC_CHARS ("{"*([^$\n\r\\{]|("\\"[^\n\r]))|{HEREDOC_LITERAL_DOLLAR}|({
while (s<end) {
if (*s=='\\') {
s++;
if (s>=end) {
continue;
}
switch(*s) {
case '\\':
case '\'':
-1
View File
@@ -253,7 +253,6 @@ static int clean_module_resource(zend_rsrc_list_entry *le, int *resource_id TSRM
static int zend_clean_module_rsrc_dtors_cb(zend_rsrc_list_dtors_entry *ld, int *module_number TSRMLS_DC)
{
if (ld->module_number == *module_number) {
zend_hash_apply_with_argument(&EG(regular_list), (apply_func_arg_t) clean_module_resource, (void *) &(ld->resource_id) TSRMLS_CC);
zend_hash_apply_with_argument(&EG(persistent_list), (apply_func_arg_t) clean_module_resource, (void *) &(ld->resource_id) TSRMLS_CC);
return 1;
} else {
+5
View File
@@ -891,6 +891,11 @@ ZEND_API int div_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
return FAILURE; /* division by zero */
}
if (op1->type == IS_LONG && op2->type == IS_LONG) {
if (Z_LVAL_P(op2) == -1 && Z_LVAL_P(op1) == LONG_MIN) {
/* Prevent overflow error/crash */
ZVAL_DOUBLE(result, (double) LONG_MIN / -1);
return SUCCESS;
}
if (op1->value.lval % op2->value.lval == 0) { /* integer */
result->type = IS_LONG;
result->value.lval = op1->value.lval / op2->value.lval;
+3
View File
@@ -220,6 +220,9 @@ zend_memnstr(char *haystack, char *needle, int needle_len, char *end)
char *p = haystack;
char ne = needle[needle_len-1];
if(needle_len > end-haystack) {
return NULL;
}
end -= needle_len;
while (p <= end) {
+8 -15
View File
@@ -984,9 +984,9 @@ static Bigint * diff(Bigint *a, Bigint *b)
static double ulp (double _x)
{
_double x;
volatile _double x;
register Long L;
_double a;
volatile _double a;
value(x) = _x;
L = (word0(x) & Exp_mask) - (P-1)*Exp_msk1;
@@ -1026,7 +1026,7 @@ b2d
{
ULong *xa, *xa0, w, y, z;
int k;
_double d;
volatile _double d;
#ifdef VAX
ULong d0, d1;
#else
@@ -1092,7 +1092,7 @@ static Bigint * d2b(double _d, int *e, int *bits)
Bigint *b;
int de, i, k;
ULong *x, y, z;
_double d;
volatile _double d;
#ifdef VAX
ULong d0, d1;
#endif
@@ -1213,7 +1213,7 @@ static Bigint * d2b(double _d, int *e, int *bits)
static double ratio (Bigint *a, Bigint *b)
{
_double da, db;
volatile _double da, db;
int k, ka, kb;
value(da) = b2d(a, &ka);
@@ -1480,7 +1480,7 @@ ZEND_API char * zend_dtoa(double _d, int mode, int ndigits, int *decpt, int *sig
Bigint *b, *b1, *delta, *mlo, *mhi, *S, *tmp;
double ds;
char *s, *s0;
_double d, d2, eps;
volatile _double d, d2, eps;
value(d) = _d;
@@ -1720,14 +1720,7 @@ ZEND_API char * zend_dtoa(double _d, int mode, int ndigits, int *decpt, int *sig
if (value(d) > 0.5 + value(eps))
goto bump_up;
else if (value(d) < 0.5 - value(eps)) {
/* cut ALL traling zeros only if the number of chars is greater than precision
* otherwise cut only extra zeros
*/
if (k < ndigits) {
while(*--s == '0' && (s - s0) > k);
} else {
while(*--s == '0');
}
while(*--s == '0');
s++;
goto ret1;
}
@@ -2043,7 +2036,7 @@ ZEND_API double zend_strtod (CONST char *s00, char **se)
e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0, sign;
CONST char *s, *s0, *s1;
double aadj, aadj1, adj;
_double rv, rv0;
volatile _double rv, rv0;
Long L;
ULong y, z;
Bigint *bb, *bb1, *bd, *bd0, *bs, *delta, *tmp;
+10
View File
@@ -1482,7 +1482,13 @@ ZEND_VM_HANDLER(39, ZEND_ASSIGN_REF, VAR|CV, VAR|CV)
PZVAL_LOCK(*value_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */
}
zend_error(E_STRICT, "Only variables should be assigned by reference");
if (EG(exception)) {
FREE_OP2_VAR_PTR();
ZEND_VM_NEXT_OPCODE();
}
ZEND_VM_DISPATCH_TO_HANDLER(ZEND_ASSIGN);
} else if (OP2_TYPE == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
PZVAL_LOCK(*value_ptr_ptr);
}
if (OP1_TYPE == IS_VAR && EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) {
zend_error(E_ERROR, "Cannot assign by reference to overloaded object");
@@ -1491,6 +1497,10 @@ ZEND_VM_HANDLER(39, ZEND_ASSIGN_REF, VAR|CV, VAR|CV)
variable_ptr_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W);
zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC);
if (OP2_TYPE == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
(*variable_ptr_ptr)->refcount--;
}
if (!RETURN_VALUE_UNUSED(&opline->result)) {
EX_T(opline->result.u.var).var.ptr_ptr = variable_ptr_ptr;
PZVAL_LOCK(*variable_ptr_ptr);
+40
View File
@@ -12385,7 +12385,13 @@ static int ZEND_ASSIGN_REF_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
PZVAL_LOCK(*value_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */
}
zend_error(E_STRICT, "Only variables should be assigned by reference");
if (EG(exception)) {
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
ZEND_VM_NEXT_OPCODE();
}
return ZEND_ASSIGN_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
} else if (IS_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
PZVAL_LOCK(*value_ptr_ptr);
}
if (IS_VAR == IS_VAR && EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) {
zend_error(E_ERROR, "Cannot assign by reference to overloaded object");
@@ -12394,6 +12400,10 @@ static int ZEND_ASSIGN_REF_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
variable_ptr_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC);
if (IS_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
(*variable_ptr_ptr)->refcount--;
}
if (!RETURN_VALUE_UNUSED(&opline->result)) {
EX_T(opline->result.u.var).var.ptr_ptr = variable_ptr_ptr;
PZVAL_LOCK(*variable_ptr_ptr);
@@ -14387,7 +14397,13 @@ static int ZEND_ASSIGN_REF_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
PZVAL_LOCK(*value_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */
}
zend_error(E_STRICT, "Only variables should be assigned by reference");
if (EG(exception)) {
ZEND_VM_NEXT_OPCODE();
}
return ZEND_ASSIGN_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
} else if (IS_CV == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
PZVAL_LOCK(*value_ptr_ptr);
}
if (IS_VAR == IS_VAR && EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) {
zend_error(E_ERROR, "Cannot assign by reference to overloaded object");
@@ -14396,6 +14412,10 @@ static int ZEND_ASSIGN_REF_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
variable_ptr_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC);
if (IS_CV == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
(*variable_ptr_ptr)->refcount--;
}
if (!RETURN_VALUE_UNUSED(&opline->result)) {
EX_T(opline->result.u.var).var.ptr_ptr = variable_ptr_ptr;
PZVAL_LOCK(*variable_ptr_ptr);
@@ -24494,7 +24514,13 @@ static int ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
PZVAL_LOCK(*value_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */
}
zend_error(E_STRICT, "Only variables should be assigned by reference");
if (EG(exception)) {
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
ZEND_VM_NEXT_OPCODE();
}
return ZEND_ASSIGN_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
} else if (IS_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
PZVAL_LOCK(*value_ptr_ptr);
}
if (IS_CV == IS_VAR && EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) {
zend_error(E_ERROR, "Cannot assign by reference to overloaded object");
@@ -24503,6 +24529,10 @@ static int ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
variable_ptr_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC);
zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC);
if (IS_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
(*variable_ptr_ptr)->refcount--;
}
if (!RETURN_VALUE_UNUSED(&opline->result)) {
EX_T(opline->result.u.var).var.ptr_ptr = variable_ptr_ptr;
PZVAL_LOCK(*variable_ptr_ptr);
@@ -26486,7 +26516,13 @@ static int ZEND_ASSIGN_REF_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
PZVAL_LOCK(*value_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */
}
zend_error(E_STRICT, "Only variables should be assigned by reference");
if (EG(exception)) {
ZEND_VM_NEXT_OPCODE();
}
return ZEND_ASSIGN_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
} else if (IS_CV == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
PZVAL_LOCK(*value_ptr_ptr);
}
if (IS_CV == IS_VAR && EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) {
zend_error(E_ERROR, "Cannot assign by reference to overloaded object");
@@ -26495,6 +26531,10 @@ static int ZEND_ASSIGN_REF_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
variable_ptr_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC);
zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC);
if (IS_CV == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
(*variable_ptr_ptr)->refcount--;
}
if (!RETURN_VALUE_UNUSED(&opline->result)) {
EX_T(opline->result.u.var).var.ptr_ptr = variable_ptr_ptr;
PZVAL_LOCK(*variable_ptr_ptr);
+19 -10
View File
@@ -837,7 +837,7 @@ AC_DEFUN([PHP_BUILD_PROGRAM],[
])
dnl
dnl PHP_SHARED_MODULE(module-name, object-var, build-dir, cxx)
dnl PHP_SHARED_MODULE(module-name, object-var, build-dir, cxx, zend_ext)
dnl
dnl Basically sets up the link-stage for building module-name
dnl from object_var in build-dir.
@@ -860,7 +860,11 @@ AC_DEFUN([PHP_SHARED_MODULE],[
;;
esac
PHP_MODULES="$PHP_MODULES \$(phplibdir)/$1.$suffix"
if test "x$5" = "xyes"; then
PHP_ZEND_EX="$PHP_ZEND_EX \$(phplibdir)/$1.$suffix"
else
PHP_MODULES="$PHP_MODULES \$(phplibdir)/$1.$suffix"
fi
PHP_SUBST($2)
cat >>Makefile.objects<<EOF
\$(phplibdir)/$1.$suffix: $3/$1.$suffix
@@ -916,7 +920,7 @@ AC_DEFUN([PHP_GEN_BUILD_DIRS],[
])
dnl
dnl PHP_NEW_EXTENSION(extname, sources [, shared [,sapi_class[, extra-cflags[, cxx]]]])
dnl PHP_NEW_EXTENSION(extname, sources [, shared [,sapi_class[, extra-cflags[, cxx[, zend_ext]]]]])
dnl
dnl Includes an extension in the build.
dnl
@@ -928,6 +932,8 @@ dnl a dynamically loadable library. Optional parameter "sapi_class" can
dnl be set to "cli" to mark extension build only with CLI or CGI sapi's.
dnl "extra-cflags" are passed to the compiler, with
dnl @ext_srcdir@ and @ext_builddir@ being substituted.
dnl "cxx" can be used to indicate that a C++ shared module is desired.
dnl "zend_ext" indicates a zend extension.
AC_DEFUN([PHP_NEW_EXTENSION],[
ext_builddir=[]PHP_EXT_BUILDDIR($1)
ext_srcdir=[]PHP_EXT_SRCDIR($1)
@@ -949,10 +955,10 @@ dnl ---------------------------------------------- Shared module
PHP_ADD_SOURCES_X(PHP_EXT_DIR($1),$2,$ac_extra,shared_objects_$1,yes)
case $host_alias in
*netware*[)]
PHP_SHARED_MODULE(php$1,shared_objects_$1, $ext_builddir, $6)
PHP_SHARED_MODULE(php$1,shared_objects_$1, $ext_builddir, $6, $7)
;;
*[)]
PHP_SHARED_MODULE($1,shared_objects_$1, $ext_builddir, $6)
PHP_SHARED_MODULE($1,shared_objects_$1, $ext_builddir, $6, $7)
;;
esac
AC_DEFINE_UNQUOTED([COMPILE_DL_]translit($1,a-z_-,A-Z__), 1, Whether to build $1 as dynamic module)
@@ -2149,17 +2155,17 @@ AC_DEFUN([PHP_PROG_RE2C],[
AC_CHECK_PROG(RE2C, re2c, re2c)
if test -n "$RE2C"; then
AC_CACHE_CHECK([for re2c version], php_cv_re2c_version, [
re2c_vernum=`re2c --vernum 2>/dev/null`
if test -z "$re2c_vernum" || test "$re2c_vernum" -lt "1200"; then
re2c_vernum=`$RE2C --vernum 2>/dev/null`
if test -z "$re2c_vernum" || test "$re2c_vernum" -lt "1304"; then
php_cv_re2c_version=invalid
else
php_cv_re2c_version="`re2c --version | cut -d ' ' -f 2 2>/dev/null` (ok)"
php_cv_re2c_version="`$RE2C --version | cut -d ' ' -f 2 2>/dev/null` (ok)"
fi
])
fi
case $php_cv_re2c_version in
""|invalid[)]
AC_MSG_WARN([You will need re2c 0.12.0 or later if you want to regenerate PHP parsers.])
AC_MSG_WARN([You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.])
RE2C="exit 0;"
;;
esac
@@ -2410,6 +2416,7 @@ AC_DEFUN([PHP_SETUP_ICONV], [
$php_shtool mkdir -p ext/iconv
echo > ext/iconv/php_have_bsd_iconv.h
echo > ext/iconv/php_have_ibm_iconv.h
echo > ext/iconv/php_have_glibc_iconv.h
echo > ext/iconv/php_have_libiconv.h
echo > ext/iconv/php_have_iconv.h
@@ -2711,6 +2718,7 @@ AC_DEFUN([PHP_CHECK_CONFIGURE_OPTIONS],[
enable-zend-multibyte[)] continue;;
esac
fi
is_arg_set=php_[]`echo [$]arg_name | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ-' 'abcdefghijklmnopqrstuvwxyz_'`
if eval test "x\$$is_arg_set" = "x"; then
PHP_UNKNOWN_CONFIGURE_OPTIONS="$PHP_UNKNOWN_CONFIGURE_OPTIONS
@@ -2744,7 +2752,7 @@ ifelse([$2],[],[AC_MSG_ERROR([Cannot find php_pdo_driver.h.])],[$2])
dnl
dnl PHP_DETECT_ICC
dnl
dnl Detect Intel C++ Compiler and unset $GCC if ICC found
AC_DEFUN([PHP_DETECT_ICC],
[
ICC="no"
@@ -2753,6 +2761,7 @@ AC_DEFUN([PHP_DETECT_ICC],
ICC="no"
AC_MSG_RESULT([no]),
ICC="yes"
GCC="no"
AC_MSG_RESULT([yes])
)
])
+115 -57
View File
@@ -11,8 +11,8 @@ dnl ## Diversion 2 is the initial checking of OS features, programs,
dnl ## libraries and so on.
dnl ## In diversion 3 we check for compile-time options to the PHP
dnl ## core and how to deal with different system dependencies. This
dnl ## includes what regex library is used and whether debugging or short
dnl ## core and how to deal with different system dependencies.
dnl ## This includes what regex library is used and whether debugging or short
dnl ## tags are enabled, and the default behaviour of php.ini options.
dnl ## This is also where an SAPI interface is selected (choosing between
dnl ## Apache module, CGI etc.)
@@ -41,8 +41,8 @@ AC_CONFIG_HEADER(main/php_config.h)
PHP_MAJOR_VERSION=5
PHP_MINOR_VERSION=2
PHP_RELEASE_VERSION=6
PHP_EXTRA_VERSION="RC5"
PHP_RELEASE_VERSION=7
PHP_EXTRA_VERSION="RC1"
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`
@@ -71,10 +71,10 @@ echo "#define PHP_VERSION \"$PHP_VERSION\"" >> php_version.h.new
echo "#define PHP_VERSION_ID $PHP_VERSION_ID" >> php_version.h.new
cmp php_version.h.new $srcdir/main/php_version.h >/dev/null 2>&1
if test $? -ne 0 ; then
rm -f $srcdir/main/php_version.h && mv php_version.h.new $srcdir/main/php_version.h && \
echo 'Updated main/php_version.h'
rm -f $srcdir/main/php_version.h && mv php_version.h.new $srcdir/main/php_version.h && \
echo 'Updated main/php_version.h'
else
rm -f php_version.h.new
rm -f php_version.h.new
fi
@@ -122,6 +122,21 @@ dnl or the contents of libs.
$php_shtool mkdir -p libs
rm -f libs/*
dnl Darwin 9 hack
dnl Because the default debugging format used by Apple's GCC on Mac OS 10.5
dnl causes errors in all current and past versions of Autoconf, we do a little
dnl messing with the CFLAGS here to trick it.
php_did_darwin9_cheat=0
case $host_alias in
*darwin9*)
hasg=`echo $CFLAGS | grep -E '(^-g)|([[:space:]]-g)'`
if test x"$hasg" = "x"; then
php_did_darwin9_cheat=1
CFLAGS="$CFLAGS -gstabs"
fi
;;
esac
dnl Checks for programs.
dnl -------------------------------------------------------------------------
@@ -146,17 +161,26 @@ dnl check for -R, etc. switch
PHP_RUNPATH_SWITCH
dnl Checks for some support/generator progs
PHP_PROG_RE2C
PHP_PROG_AWK
PHP_PROG_BISON
PHP_PROG_LEX
PHP_PROG_RE2C
dnl Check if bison generated files exist when bison does not..
case $php_cv_bison_version in
""|invalid[)]
if ! test -f "$abs_srcdir/Zend/zend_language_parser.h" || ! test -f "$abs_srcdir/Zend/zend_language_parser.c" ; then
AC_MSG_ERROR([bison is required to build PHP/Zend when building a CVS checkout!])
fi
;;
esac
dnl Platform-specific compile settings.
dnl -------------------------------------------------------------------------
dnl See bug #28605
case $host_cpu in
alpha*)
alpha*)
if test "$GCC" = "yes"; then
CFLAGS="$CFLAGS -mieee"
else
@@ -166,15 +190,16 @@ alpha*)
esac
case $host_alias in
*solaris*)
*solaris*)
CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
if test "${enable_libgcc+set}" != "set" && test "$GCC" = "yes"; then
enable_libgcc=yes
fi
;;
*dgux*)
CPPFLAGS="$CPPFLAGS -D_BSD_TIMEOFDAY_FLAVOR";;
*darwin*|*rhapsody*)
*dgux*)
CPPFLAGS="$CPPFLAGS -D_BSD_TIMEOFDAY_FLAVOR"
;;
*darwin*|*rhapsody*)
if test -n "$GCC"; then
PHP_CHECK_GCC_ARG(-no-cpp-precomp, gcc_no_cpp_precomp=yes)
if test "$gcc_no_cpp_precomp" = "yes"; then
@@ -182,18 +207,21 @@ case $host_alias in
fi
fi
AC_DEFINE(BIND_8_COMPAT, 1, [Enabling BIND8 compatibility for Panther])
php_multiple_shlib_versions_ok=yes;;
*beos*)
php_multiple_shlib_versions_ok=yes
;;
*beos*)
beos_threads=1
LIBS="$LIBS -lbe -lroot";;
*mips*)
CPPFLAGS="$CPPFLAGS -D_XPG_IV";;
*hpux*)
LIBS="$LIBS -lbe -lroot"
;;
*mips*)
CPPFLAGS="$CPPFLAGS -D_XPG_IV"
;;
*hpux*)
if test "$GCC" = "yes"; then
CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
fi
;;
*netware*)
*netware*)
PHP_BUILD_PROGRAM
PHP_ADD_SOURCES(/main, internal_functions.c,,PHP_GLOBAL_OBJS)
PHP_ADD_SOURCES(win32, sendmail.c, -I$CFLAGS, PHP_GLOBAL_OBJS)
@@ -208,7 +236,7 @@ esac
# to avoid the performance hit from the lost register
AC_MSG_CHECKING([whether to force non-PIC code in shared modules])
case $host_alias in
i?86-*-linux*|i?86-*-freebsd*)
i?86-*-linux*|i?86-*-freebsd*)
if test "${with_pic+set}" != "set" || test "$with_pic" = "no"; then
with_pic=no
AC_MSG_RESULT(yes)
@@ -216,7 +244,9 @@ i?86-*-linux*|i?86-*-freebsd*)
AC_MSG_RESULT(no)
fi
;;
*) AC_MSG_RESULT(no) ;;
*)
AC_MSG_RESULT(no)
;;
esac
@@ -270,11 +300,10 @@ fi
divert(3)
dnl ## In diversion 3 we check for compile-time options to the PHP
dnl ## core and how to deal with different system dependencies. This
dnl ## includes what regex library is used and whether debugging or short
dnl ## core and how to deal with different system dependencies.
dnl ## This includes what regex library is used and whether debugging or short
dnl ## tags are enabled, and the default behaviour of php.ini options.
dnl Starting system checks.
dnl -------------------------------------------------------------------------
@@ -295,8 +324,8 @@ PHP_TEST_WRITE_STDOUT
dnl Check for /usr/pkg/{lib,include} which is where NetBSD puts binary
dnl and source packages. This should be harmless on other OSs.
if test -d /usr/pkg/include -a -d /usr/pkg/lib ; then
CPPFLAGS="$CPPFLAGS -I/usr/pkg/include"
LDFLAGS="$LDFLAGS -L/usr/pkg/lib"
CPPFLAGS="$CPPFLAGS -I/usr/pkg/include"
LDFLAGS="$LDFLAGS -L/usr/pkg/lib"
fi
test -d /usr/ucblib && PHP_ADD_LIBPATH(/usr/ucblib)
@@ -362,7 +391,6 @@ langinfo.h \
limits.h \
locale.h \
monetary.h \
mach-o/dyld.h \
netdb.h \
pwd.h \
resolv.h \
@@ -414,6 +442,16 @@ assert.h
#endif
])
dnl Don't use mach-o/dyld.h on Darwin 8+, dl* is recommended by Apple from there on
dnl See http://developer.apple.com/documentation/DeveloperTools/Conceptual/MachOTopics/Articles/loading_code.html
case $host_alias in
*darwin[[89]]*)
;;
*)
AC_CHECK_HEADERS([mach-o/dyld.h],[],[],[])
;;
esac
PHP_FOPENCOOKIE
PHP_BROKEN_GETCWD
PHP_BROKEN_GLIBC_FOPEN_APPEND
@@ -891,20 +929,24 @@ enable_shared=yes
enable_static=yes
case $php_build_target in
program|static)
program|static)
standard_libtool_flag='-prefer-non-pic -static'
if test -z "$PHP_MODULES"; then
if test -z "$PHP_MODULES" && test -z "$PHP_ZEND_EX"; then
enable_shared=no
fi
;;
shared)
;;
shared)
enable_static=no
case $with_pic in
yes) standard_libtool_flag='-prefer-pic';;
no) standard_libtool_flag='-prefer-non-pic';;
yes)
standard_libtool_flag='-prefer-pic'
;;
no)
standard_libtool_flag='-prefer-non-pic'
;;
esac
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -avoid-version -module"
;;
;;
esac
EXTRA_LIBS="$EXTRA_LIBS $DLIBS $LIBS"
@@ -1030,7 +1072,6 @@ case $datadir in
'${prefix}/share')
datadir=$datadir/php
;;
*) ;;
esac
phplibdir=`pwd`/modules
@@ -1160,6 +1201,7 @@ PHP_SUBST(PHP_CLI_OBJS)
PHP_SUBST(PHP_GLOBAL_OBJS)
PHP_SUBST(PHP_MODULES)
PHP_SUBST(PHP_ZEND_EX)
PHP_SUBST(EXT_LIBS)
@@ -1241,6 +1283,17 @@ if test "$PHP_THREAD_SAFETY" = "yes" && test "$PHP_MYSQL" = "yes"; then
CPPFLAGS="$CPPFLAGS -DTHREAD=1"
fi
if test "$PHP_DEBUG" = "yes" && test "$PHP_THREAD_SAFETY" = "yes; then
ZEND_EXT_TYPE="zend_extension_debug_ts"
elif test "$PHP_DEBUG" = "yes"; then
ZEND_EXT_TYPE="zend_extension_debug"
elif test "$PHP_THREAD_SAFETY" = "yes; then
ZEND_EXT_TYPE="zend_extension_ts"
else
ZEND_EXT_TYPE="zend_extension"
fi
PHP_SUBST(ZEND_EXT_TYPE)
dnl
dnl Libtool creation
dnl
@@ -1250,10 +1303,14 @@ PHP_CONFIGURE_PART(Configuring libtool)
LDFLAGS="$LDFLAGS $PHP_AIX_LDFLAGS"
dnl Only allow AC_PROG_CXX if it's explicitly called (by PHP_REQUIRE_CXX)
dnl otherwise AC_PROG_LIBTOOL fails if there is no working C++ compiler
AC_PROVIDE_IFELSE([PHP_REQUIRE_CXX], [AC_PROG_CXX], [undefine([AC_PROG_CXX])
AC_DEFUN([AC_PROG_CXX], [])])
dnl Only allow AC_PROG_CXX and AC_PROG_CXXCPP if they are explicitly called (by PHP_REQUIRE_CXX).
dnl Otherwise AC_PROG_LIBTOOL fails if there is no working C++ compiler.
AC_PROVIDE_IFELSE([PHP_REQUIRE_CXX], [], [
undefine([AC_PROG_CXX])
AC_DEFUN([AC_PROG_CXX], [])
undefine([AC_PROG_CXXCPP])
AC_DEFUN([AC_PROG_CXXCPP], [php_prog_cxxcpp=disabled])
])
AC_PROG_LIBTOOL
if test "$enable_debug" != "yes"; then
@@ -1269,6 +1326,15 @@ SHARED_LIBTOOL='$(LIBTOOL)'
CC=$old_CC
dnl Finish the Darwin hack
if test "$php_did_darwin9_cheat" -eq 1; then
if test "$PHP_DEBUG" = "yes"; then
CFLAGS=`echo "$CFLAGS" | $SED -e 's/-gstabs/-g/g'`
else
CFLAGS=`echo "-O2 $CFLAGS" | $SED -e 's/-gstabs//g'`
fi
fi
PHP_CONFIGURE_PART(Generating files)
CXXFLAGS_CLEAN=$CXXFLAGS
@@ -1277,7 +1343,7 @@ CFLAGS="\$(CFLAGS_CLEAN) $standard_libtool_flag"
INLINE_CFLAGS="$INLINE_CFLAGS $standard_libtool_flag"
CXXFLAGS="$CXXFLAGS $standard_libtool_flag"
all_targets="$lcov_target \$(OVERALL_TARGET) \$(PHP_MODULES) \$(PHP_CLI_TARGET)"
all_targets="$lcov_target \$(OVERALL_TARGET) \$(PHP_MODULES) \$(PHP_ZEND_EX) \$(PHP_CLI_TARGET)"
install_targets="$install_modules install-build install-headers install-programs $install_pear"
case $PHP_SAPI in
@@ -1309,13 +1375,13 @@ PHP_ADD_SOURCES(main/streams, streams.c cast.c memory.c filter.c \
PHP_ADD_SOURCES(/main, internal_functions.c,, sapi)
case $host_alias in
*netware*)
PHP_ADD_BUILD_DIR(win32)
PHP_ADD_BUILD_DIR(netware)
;;
*)
PHP_ADD_SOURCES(/main, internal_functions_cli.c,, cli)
;;
*netware*)
PHP_ADD_BUILD_DIR(win32)
PHP_ADD_BUILD_DIR(netware)
;;
*)
PHP_ADD_SOURCES(/main, internal_functions_cli.c,, cli)
;;
esac
PHP_ADD_SOURCES(Zend, \
@@ -1330,8 +1396,7 @@ PHP_ADD_SOURCES(Zend, \
zend_iterators.c zend_interfaces.c zend_exceptions.c zend_strtod.c)
if test -r "$abs_srcdir/Zend/zend_objects.c"; then
PHP_ADD_SOURCES(Zend, zend_objects.c zend_object_handlers.c zend_objects_API.c \
zend_default_classes.c)
PHP_ADD_SOURCES(Zend, zend_objects.c zend_object_handlers.c zend_objects_API.c zend_default_classes.c)
fi
dnl Selectively disable optimization due to high RAM usage during
@@ -1411,13 +1476,6 @@ dnl mv -f main/internal_functions.c main/internal_functions.c.old 2>/dev/null
cli_extensions="$EXT_CLI_STATIC"
sh $srcdir/build/genif.sh $srcdir/main/internal_functions.c.in $srcdir "$EXTRA_MODULE_PTRS" $AWK \$cli_extensions > main/internal_functions_cli.c
dnl if cmp main/internal_functions.c.old main/internal_functions.c > /dev/null 2>&1; then
dnl echo "main/internal_functions.c is unchanged"
dnl mv main/internal_functions.c.old main/internal_functions.c
dnl else
dnl rm -f main/internal_functions.c.old
dnl fi
if test "$UNAME" = "FreeBSD" && test "$PHP_SAPI" = "apache2filter" && test "$TSRM_PTH" != "pth-config" ; then
echo "+--------------------------------------------------------------------+"
echo "| *** WARNING *** |"
+1
View File
@@ -248,6 +248,7 @@ PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper,
bz_file = BZ2_bzdopen(fd, mode);
}
}
/* remove the file created by php_stream_open_wrapper(), it is not needed since BZ2 functions
* failed.
*/
+6 -4
View File
@@ -786,7 +786,7 @@ static size_t curl_read(char *data, size_t size, size_t nmemb, void *ctx)
{
php_curl *ch = (php_curl *) ctx;
php_curl_read *t = ch->handlers->read;
int length = -1;
int length = 0;
switch (t->method) {
case PHP_CURL_DIRECT:
@@ -833,7 +833,9 @@ static size_t curl_read(char *data, size_t size, size_t nmemb, void *ctx)
ch->in_callback = 0;
if (error == FAILURE) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot call the CURLOPT_READFUNCTION");
length = -1;
#if LIBCURL_VERSION_NUM >= 0x070c01 /* 7.12.1 */
length = CURL_READFUNC_ABORT;
#endif
} else if (retval_ptr) {
if (Z_TYPE_P(retval_ptr) == IS_STRING) {
length = MIN(size * nmemb, Z_STRLEN_P(retval_ptr));
@@ -1419,7 +1421,7 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
case CURLOPT_READFUNCTION:
if (ch->handlers->read->func_name) {
zval_ptr_dtor(&ch->handlers->read->func_name);
ch->handlers->write->fci_cache = empty_fcall_info_cache;
ch->handlers->read->fci_cache = empty_fcall_info_cache;
}
zval_add_ref(zvalue);
ch->handlers->read->func_name = *zvalue;
@@ -1428,7 +1430,7 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
case CURLOPT_HEADERFUNCTION:
if (ch->handlers->write_header->func_name) {
zval_ptr_dtor(&ch->handlers->write_header->func_name);
ch->handlers->write->fci_cache = empty_fcall_info_cache;
ch->handlers->write_header->fci_cache = empty_fcall_info_cache;
}
zval_add_ref(zvalue);
ch->handlers->write_header->func_name = *zvalue;
+40 -34
View File
@@ -125,46 +125,52 @@ static void read_types(char **tzf, timelib_tzinfo *tz)
memcpy(tz->timezone_abbr, *tzf, sizeof(char) * tz->charcnt);
*tzf += sizeof(char) * tz->charcnt;
leap_buffer = (int32_t *) malloc(tz->leapcnt * 2 * sizeof(int32_t));
if (!leap_buffer) {
return;
}
memcpy(leap_buffer, *tzf, sizeof(int32_t) * tz->leapcnt * 2);
*tzf += sizeof(int32_t) * tz->leapcnt * 2;
if (tz->leapcnt) {
leap_buffer = (int32_t *) malloc(tz->leapcnt * 2 * sizeof(int32_t));
if (!leap_buffer) {
return;
}
memcpy(leap_buffer, *tzf, sizeof(int32_t) * tz->leapcnt * 2);
*tzf += sizeof(int32_t) * tz->leapcnt * 2;
tz->leap_times = (tlinfo*) malloc(tz->leapcnt * sizeof(tlinfo));
if (!tz->leap_times) {
return;
tz->leap_times = (tlinfo*) malloc(tz->leapcnt * sizeof(tlinfo));
if (!tz->leap_times) {
return;
}
for (i = 0; i < tz->leapcnt; i++) {
tz->leap_times[i].trans = timelib_conv_int(leap_buffer[i * 2]);
tz->leap_times[i].offset = timelib_conv_int(leap_buffer[i * 2 + 1]);
}
free(leap_buffer);
}
for (i = 0; i < tz->leapcnt; i++) {
tz->leap_times[i].trans = timelib_conv_int(leap_buffer[i * 2]);
tz->leap_times[i].offset = timelib_conv_int(leap_buffer[i * 2 + 1]);
}
free(leap_buffer);
buffer = (unsigned char*) malloc(tz->ttisstdcnt * sizeof(unsigned char));
if (!buffer) {
return;
}
memcpy(buffer, *tzf, sizeof(unsigned char) * tz->ttisstdcnt);
*tzf += sizeof(unsigned char) * tz->ttisstdcnt;
for (i = 0; i < tz->ttisstdcnt; i++) {
tz->type[i].isstdcnt = buffer[i];
}
free(buffer);
if (tz->ttisstdcnt) {
buffer = (unsigned char*) malloc(tz->ttisstdcnt * sizeof(unsigned char));
if (!buffer) {
return;
}
memcpy(buffer, *tzf, sizeof(unsigned char) * tz->ttisstdcnt);
*tzf += sizeof(unsigned char) * tz->ttisstdcnt;
buffer = (unsigned char*) malloc(tz->ttisgmtcnt * sizeof(unsigned char));
if (!buffer) {
return;
for (i = 0; i < tz->ttisstdcnt; i++) {
tz->type[i].isstdcnt = buffer[i];
}
free(buffer);
}
memcpy(buffer, *tzf, sizeof(unsigned char) * tz->ttisgmtcnt);
*tzf += sizeof(unsigned char) * tz->ttisgmtcnt;
for (i = 0; i < tz->ttisgmtcnt; i++) {
tz->type[i].isgmtcnt = buffer[i];
if (tz->ttisgmtcnt) {
buffer = (unsigned char*) malloc(tz->ttisgmtcnt * sizeof(unsigned char));
if (!buffer) {
return;
}
memcpy(buffer, *tzf, sizeof(unsigned char) * tz->ttisgmtcnt);
*tzf += sizeof(unsigned char) * tz->ttisgmtcnt;
for (i = 0; i < tz->ttisgmtcnt; i++) {
tz->type[i].isgmtcnt = buffer[i];
}
free(buffer);
}
free(buffer);
}
void timelib_dump_tzinfo(timelib_tzinfo *tz)
@@ -391,7 +397,7 @@ timelib_sll timelib_get_current_offset(timelib_time *t)
switch (t->zone_type) {
case TIMELIB_ZONETYPE_ABBR:
case TIMELIB_ZONETYPE_OFFSET:
return t->z * 60;
return (t->z + t->dst) * 60;
case TIMELIB_ZONETYPE_ID:
gmt_offset = timelib_get_time_zone_info(t->sse, t->tz_info);
+3320 -2524
View File
File diff suppressed because it is too large. Load diff
+3 -3
View File
@@ -186,10 +186,10 @@ static timelib_sll do_years(timelib_sll year)
timelib_sll res = 0;
timelib_sll eras;
eras = (year - 1970) / 400;
eras = (year - 1970) / 40000;
if (eras != 0) {
year = year - (eras * 400);
res += (SECS_PER_ERA * eras);
year = year - (eras * 40000);
res += (SECS_PER_ERA * eras * 100);
}
if (year >= 1970) {
+23 -37
View File
@@ -269,9 +269,9 @@ struct _php_timezone_obj {
int initialized;
int type;
union {
timelib_tzinfo *tz; // TIMELIB_ZONETYPE_ID;
timelib_sll utc_offset; // TIMELIB_ZONETYPE_OFFSET
struct // TIMELIB_ZONETYPE_ABBR
timelib_tzinfo *tz; /* TIMELIB_ZONETYPE_ID; */
timelib_sll utc_offset; /* TIMELIB_ZONETYPE_OFFSET */
struct /* TIMELIB_ZONETYPE_ABBR */
{
timelib_sll utc_offset;
char *abbr;
@@ -731,7 +731,7 @@ static char *date_format(char *format, int format_len, timelib_time *t, int loca
char buffer[33];
timelib_time_offset *offset = NULL;
timelib_sll isoweek, isoyear;
int rfc_colon = 0;
int rfc_colon;
if (!format_len) {
return estrdup("");
@@ -761,6 +761,7 @@ static char *date_format(char *format, int format_len, timelib_time *t, int loca
timelib_isoweek_from_date(t->y, t->m, t->d, &isoweek, &isoyear);
for (i = 0; i < format_len; i++) {
rfc_colon = 0;
switch (format[i]) {
/* day */
case 'd': length = slprintf(buffer, 32, "%02d", (int) t->d); break;
@@ -1146,14 +1147,6 @@ PHP_FUNCTION(strtotime)
timelib_update_ts(t, tzi);
ts = timelib_date_to_int(t, &error2);
/* if tz_info is not a copy, avoid double free */
if (now->tz_info != tzi && now->tz_info) {
timelib_tzinfo_dtor(now->tz_info);
}
if (t->tz_info != tzi) {
timelib_tzinfo_dtor(t->tz_info);
}
timelib_time_dtor(now);
timelib_time_dtor(t);
@@ -1560,7 +1553,7 @@ static zend_object_value date_object_clone_date(zval *this_ptr TSRMLS_DC)
new_obj->time->tz_abbr = strdup(old_obj->time->tz_abbr);
}
if (old_obj->time->tz_info) {
new_obj->time->tz_info = timelib_tzinfo_clone(old_obj->time->tz_info);
new_obj->time->tz_info = old_obj->time->tz_info;
}
return new_ov;
@@ -1644,9 +1637,6 @@ static void date_object_free_storage_date(void *object TSRMLS_DC)
php_date_obj *intern = (php_date_obj *)object;
if (intern->time) {
if (intern->time->tz_info) {
timelib_tzinfo_dtor(intern->time->tz_info);
}
timelib_time_dtor(intern->time);
}
@@ -1684,14 +1674,11 @@ static int date_initialize(php_date_obj *dateobj, /*const*/ char *time_str, int
timelib_time *now;
timelib_tzinfo *tzi;
timelib_error_container *err = NULL;
int free_tzi = 0, type = TIMELIB_ZONETYPE_ID, new_dst, errors_found = 0;
int type = TIMELIB_ZONETYPE_ID, new_dst, errors_found = 0;
char *new_abbr;
timelib_sll new_offset;
if (dateobj->time) {
if (dateobj->time->tz_info) {
timelib_tzinfo_dtor(dateobj->time->tz_info);
}
timelib_time_dtor(dateobj->time);
}
dateobj->time = timelib_strtotime(time_str_len ? time_str : "now", time_str_len ? time_str_len : sizeof("now") -1, &err, DATE_TIMEZONEDB);
@@ -1715,8 +1702,7 @@ static int date_initialize(php_date_obj *dateobj, /*const*/ char *time_str, int
tzobj = (php_timezone_obj *) zend_object_store_get_object(timezone_object TSRMLS_CC);
switch (tzobj->type) {
case TIMELIB_ZONETYPE_ID:
tzi = timelib_tzinfo_clone(tzobj->tzi.tz);
free_tzi = 1;
tzi = tzobj->tzi.tz;
break;
case TIMELIB_ZONETYPE_OFFSET:
new_offset = tzobj->tzi.utc_offset;
@@ -1729,8 +1715,7 @@ static int date_initialize(php_date_obj *dateobj, /*const*/ char *time_str, int
}
type = tzobj->type;
} else if (dateobj->time->tz_info) {
tzi = timelib_tzinfo_clone(dateobj->time->tz_info);
free_tzi = 1;
tzi = dateobj->time->tz_info;
} else {
tzi = get_timezone_info(TSRMLS_C);
}
@@ -1757,12 +1742,6 @@ static int date_initialize(php_date_obj *dateobj, /*const*/ char *time_str, int
dateobj->time->have_weekday_relative = dateobj->time->have_relative = 0;
if (type == TIMELIB_ZONETYPE_ID && now->tz_info != tzi) {
timelib_tzinfo_dtor(now->tz_info);
}
if (free_tzi) {
timelib_tzinfo_dtor(tzi);
}
timelib_time_dtor(now);
return 1;
@@ -2015,10 +1994,7 @@ PHP_FUNCTION(date_timezone_set)
if (tzobj->type != TIMELIB_ZONETYPE_ID) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can only do this for zones with ID for now");
}
if (dateobj->time->tz_info) {
timelib_tzinfo_dtor(dateobj->time->tz_info);
}
timelib_set_timezone(dateobj->time, timelib_tzinfo_clone(tzobj->tzi.tz));
timelib_set_timezone(dateobj->time, tzobj->tzi.tz);
timelib_unixtime2local(dateobj->time, dateobj->time->sse);
}
/* }}} */
@@ -2271,9 +2247,19 @@ PHP_FUNCTION(timezone_offset_get)
dateobj = (php_date_obj *) zend_object_store_get_object(dateobject TSRMLS_CC);
DATE_CHECK_INITIALIZED(dateobj->time, DateTime);
offset = timelib_get_time_zone_info(dateobj->time->sse, tzobj->tzi.tz);
RETVAL_LONG(offset->offset);
timelib_time_offset_dtor(offset);
switch (tzobj->type) {
case TIMELIB_ZONETYPE_ID:
offset = timelib_get_time_zone_info(dateobj->time->sse, tzobj->tzi.tz);
RETVAL_LONG(offset->offset);
timelib_time_offset_dtor(offset);
break;
case TIMELIB_ZONETYPE_OFFSET:
RETURN_LONG(tzobj->tzi.utc_offset * -60);
break;
case TIMELIB_ZONETYPE_ABBR:
RETURN_LONG((tzobj->tzi.z.utc_offset - (tzobj->tzi.z.dst*60)) * -60);
break;
}
}
/* }}} */
+36
View File
@@ -0,0 +1,36 @@
--TEST--
Bug #44742 (timezone_offset_get() causes segmentation faults)
--FILE--
<?php
date_default_timezone_set('Europe/London');
$dates = array(
"2008-04-11 00:00:00+0000",
"2008-04-11 00:00:00+0200",
"2008-04-11 00:00:00+0330",
"2008-04-11 00:00:00-0500",
"2008-04-11 00:00:00-1130",
"2008-04-11 00:00:00 CEST",
"2008-04-11 00:00:00 CET",
"2008-04-11 00:00:00 UTC",
"2008-04-11 00:00:00 America/New_York",
"2008-04-11 00:00:00 Europe/Oslo",
"2008-04-11 00:00:00 Asia/Singapore",
);
foreach ($dates as $date)
{
$date = date_create($date);
var_dump(timezone_offset_get(date_timezone_get($date), $date));
}
?>
--EXPECT--
int(0)
int(7200)
int(12600)
int(-18000)
int(-41400)
int(7200)
int(3600)
int(0)
int(-14400)
int(7200)
int(28800)
+1 -1
View File
@@ -360,7 +360,7 @@ static dba_handler handler[] = {
DBA_HND(db3, DBA_LOCK_ALL) /* No lock in lib */
#endif
#if DBA_DB4
DBA_HND(db4, DBA_LOCK_EXT) /* Locking done in library itself */
DBA_HND(db4, DBA_LOCK_ALL) /* No lock in lib */
#endif
#if DBA_INIFILE
DBA_HND(inifile, DBA_STREAM_OPEN|DBA_LOCK_ALL|DBA_CAST_AS_FD) /* No lock in lib */
+5 -6
View File
@@ -36,7 +36,11 @@
#include <db.h>
#endif
static void php_dba_db4_errcall_fcn(const char *errpfx, char *msg)
static void php_dba_db4_errcall_fcn(
#if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3)
const DB_ENV *dbenv,
#endif
const char *errpfx, const char *msg)
{
TSRMLS_FETCH();
@@ -81,7 +85,6 @@ DBA_OPEN_FUNC(db4)
return FAILURE; /* not possible */
}
gmode |= DB_INIT_LOCK;
if (info->flags & DBA_PERSISTENT) {
gmode |= DB_THREAD;
}
@@ -91,10 +94,6 @@ DBA_OPEN_FUNC(db4)
filemode = Z_LVAL_PP(info->argv[0]);
}
#ifdef DB_FCNTL_LOCKING
gmode |= DB_FCNTL_LOCKING;
#endif
if ((err=db_create(&dbp, NULL, 0)) == 0) {
dbp->set_errcall(dbp, php_dba_db4_errcall_fcn);
if (
+16 -2
View File
@@ -9,7 +9,6 @@ DBA DB4 handler test
<?php
$handler = 'db4';
require_once('test.inc');
$lock_flag = ''; // lock in library
require_once('dba_handler.inc');
?>
===DONE===
@@ -18,7 +17,22 @@ database handler: db4
3NYNYY
Content String 2
Content 2 replaced
Read during write: allowed
Read during write: not allowed
Content 2 replaced 2nd time
The 6th value
array(3) {
["key number 6"]=>
string(13) "The 6th value"
["key2"]=>
string(27) "Content 2 replaced 2nd time"
["key5"]=>
string(23) "The last content string"
}
--NO-LOCK--
3NYNYY
Content String 2
Content 2 replaced
Read during write: not allowed
Content 2 replaced 2nd time
The 6th value
array(3) {
+1 -1
View File
@@ -73,7 +73,7 @@ PHP_METHOD(domcdatasection, __construct)
intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC);
if (intern != NULL) {
oldnode = (xmlNodePtr)intern->ptr;
oldnode = dom_object_get_node(intern);
if (oldnode != NULL) {
php_libxml_node_free_resource(oldnode TSRMLS_CC);
}
+1 -1
View File
@@ -73,7 +73,7 @@ PHP_METHOD(domcomment, __construct)
intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC);
if (intern != NULL) {
oldnode = (xmlNodePtr)intern->ptr;
oldnode = dom_object_get_node(intern);
if (oldnode != NULL) {
php_libxml_node_free_resource(oldnode TSRMLS_CC);
}
+1 -1
View File
@@ -153,7 +153,7 @@ ZEND_END_ARG_INFO();
static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_savexml, 0, 0, 0)
ZEND_ARG_OBJ_INFO(0, node, DOMNode, 0)
ZEND_ARG_OBJ_INFO(0, node, DOMNode, 1)
ZEND_END_ARG_INFO();
static
+1 -1
View File
@@ -76,7 +76,7 @@ PHP_METHOD(domdocumentfragment, __construct)
intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC);
if (intern != NULL) {
oldnode = (xmlNodePtr)intern->ptr;
oldnode = dom_object_get_node(intern);
if (oldnode != NULL) {
php_libxml_node_free_resource(oldnode TSRMLS_CC);
}
+2 -2
View File
@@ -32,7 +32,7 @@
static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_configuration_set_parameter, 0, 0, 2)
ZEND_ARG_INFO(0, name)
ZEND_ARG_OBJ_INFO(0, value, DOMUserData, 0)
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO();
static
@@ -43,7 +43,7 @@ ZEND_END_ARG_INFO();
static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_configuration_can_set_parameter, 0, 0, 0)
ZEND_ARG_INFO(0, name)
ZEND_ARG_OBJ_INFO(0, value, DOMUserData, 0)
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO();
/* }}} */
+8
View File
@@ -585,6 +585,10 @@ PHP_FUNCTION(dom_element_set_attribute_node)
xmlUnlinkNode((xmlNodePtr) existattrp);
}
if (attrp->parent != NULL) {
xmlUnlinkNode((xmlNodePtr) attrp);
}
if (attrp->doc == NULL && nodep->doc != NULL) {
attrobj->document = intern->document;
php_libxml_increment_doc_ref((php_libxml_node_object *)attrobj, NULL TSRMLS_CC);
@@ -998,6 +1002,10 @@ PHP_FUNCTION(dom_element_set_attribute_node_ns)
xmlUnlinkNode((xmlNodePtr) existattrp);
}
if (attrp->parent != NULL) {
xmlUnlinkNode((xmlNodePtr) attrp);
}
if (attrp->doc == NULL && nodep->doc != NULL) {
attrobj->document = intern->document;
php_libxml_increment_doc_ref((php_libxml_node_object *)attrobj, NULL TSRMLS_CC);
+1 -1
View File
@@ -112,7 +112,7 @@ ZEND_END_ARG_INFO();
static
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_set_user_data, 0, 0, 3)
ZEND_ARG_INFO(0, key)
ZEND_ARG_OBJ_INFO(0, data, DOMUserData, 0)
ZEND_ARG_INFO(0, data)
ZEND_ARG_INFO(0, handler)
ZEND_END_ARG_INFO();
+1 -1
View File
@@ -81,7 +81,7 @@ PHP_METHOD(domprocessinginstruction, __construct)
intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC);
if (intern != NULL) {
oldnode = (xmlNodePtr)intern->ptr;
oldnode = dom_object_get_node(intern);
if (oldnode != NULL) {
php_libxml_node_free_resource(oldnode TSRMLS_CC);
}
+1 -1
View File
@@ -1,5 +1,5 @@
--TEST--
Bug #34276 setAttributeNS and default namespace
Bug #34276 (setAttributeNS and default namespace)
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
+1 -1
View File
@@ -1,5 +1,5 @@
--TEST--
Bug #35342 isset(DOMNodeList->length) returns false
Bug #35342 (isset(DOMNodeList->length) returns false)
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
+2 -2
View File
@@ -8,7 +8,7 @@ $nodes = $xpath->query('*');
var_dump($nodes);
var_dump($nodes->length);
$length = $nodes->length;
var_dump(empty($nodes->length), empty($lenght));
var_dump(empty($nodes->length), empty($length));
$doc->loadXML("<element></element>");
var_dump($doc->firstChild->nodeValue, empty($doc->firstChild->nodeValue), isset($doc->firstChild->nodeValue));
@@ -24,4 +24,4 @@ string(0) ""
bool(true)
bool(true)
bool(false)
bool(false)
bool(false)
+30
View File
@@ -0,0 +1,30 @@
--TEST--
Bug #45251 (double free or corruption with setAttributeNode())
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$doc = new DOMDocument;
$doc->loadXml(<<<EOF
<?xml version="1.0" encoding="utf-8" ?>
<aaa>
<bbb foo="bar"/>
</aaa>
EOF
);
$xpath = new DOMXPath($doc);
$bbb = $xpath->query('bbb', $doc->documentElement)->item(0);
$ccc = $doc->createElement('ccc');
foreach ($bbb->attributes as $attr)
{
$ccc->setAttributeNode($attr);
}
echo $attr->parentNode->localName;
?>
--EXPECT--
ccc
+46
View File
@@ -0,0 +1,46 @@
--TEST--
DOM Comment : Basic Functionality
--SKIPIF--
<?php
require_once('skipif.inc');
?>
--FILE--
<?php
$xml = <<< EOXML
<?xml version="1.0" encoding="ISO-8859-1"?>
<courses>
<!-- Hello World! -->
</courses>
EOXML;
$dom = new DOMDocument();
$dom->loadXML($xml);
$root = $dom->documentElement;
var_dump($root->hasChildNodes());
$children = $root->childNodes;
for ($index = 0; $index < $children->length; $index++) {
echo "--- child $index ---\n";
$current = $children->item($index);
var_dump($current);
var_dump($current->textContent);
}
--EXPECTF--
bool(true)
--- child 0 ---
object(DOMText)#%d (0) {
}
string(2) "
"
--- child 1 ---
object(DOMComment)#%d (0) {
}
string(14) " Hello World! "
--- child 2 ---
object(DOMText)#%d (0) {
}
string(1) "
"
+33
View File
@@ -0,0 +1,33 @@
--TEST--
DOM Comment : Variation
--SKIPIF--
<?php
require_once('skipif.inc');
?>
--FILE--
<?php
$xml = <<< EOXML
<?xml version="1.0" encoding="ISO-8859-1"?><courses><!-- Hello World! --></courses>
EOXML;
$dom = new DOMDocument();
$dom->loadXML($xml);
$root = $dom->documentElement;
var_dump($root->hasChildNodes());
$children = $root->childNodes;
for ($index = 0; $index < $children->length; $index++) {
echo "--- child $index ---\n";
$current = $children->item($index);
var_dump($current);
var_dump($current->textContent);
}
--EXPECTF--
bool(true)
--- child 0 ---
object(DOMComment)#%d (0) {
}
string(14) " Hello World! "
+1 -1
View File
@@ -91,7 +91,7 @@ PHP_METHOD(domtext, __construct)
intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC);
if (intern != NULL) {
oldnode = (xmlNodePtr)intern->ptr;
oldnode = dom_object_get_node(intern);
if (oldnode != NULL) {
php_libxml_node_free_resource(oldnode TSRMLS_CC);
}
+8 -12
View File
@@ -2862,11 +2862,9 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* If its bigger than 4 bytes, the dir entry contains an offset. */
value_ptr = offset_base+offset_val;
if (offset_val+byte_count > IFDlength || value_ptr < dir_entry) {
/*
// It is important to check for IMAGE_FILETYPE_TIFF
// JPEG does not use absolute pointers instead its pointers are relative to the start
// of the TIFF header in APP1 section.
*/
/* It is important to check for IMAGE_FILETYPE_TIFF
* JPEG does not use absolute pointers instead its pointers are
* relative to the start of the TIFF header in APP1 section. */
if (offset_val+byte_count>ImageInfo->FileSize || (ImageInfo->FileType!=IMAGE_FILETYPE_TIFF_II && ImageInfo->FileType!=IMAGE_FILETYPE_TIFF_MM && ImageInfo->FileType!=IMAGE_FILETYPE_JPEG)) {
if (value_ptr < dir_entry) {
/* we can read this if offset_val > 0 */
@@ -2884,13 +2882,11 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
value_ptr = safe_emalloc(byte_count, 1, 0);
outside = value_ptr;
} else {
/*
// in most cases we only access a small range so
// it is faster to use a static buffer there
// BUT it offers also the possibility to have
// pointers read without the need to free them
// explicitley before returning.
*/
/* In most cases we only access a small range so
* it is faster to use a static buffer there
* BUT it offers also the possibility to have
* pointers read without the need to free them
* explicitley before returning. */
memset(&cbuf, 0, sizeof(cbuf));
value_ptr = cbuf;
}
+17 -1
View File
@@ -1636,6 +1636,22 @@ PHP_FUNCTION(imageloadfont)
font->nchars = FLIPWORD(font->nchars);
body_size = font->w * font->h * font->nchars;
}
if (overflow2(font->nchars, font->h)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error reading font, invalid font header");
efree(font);
php_stream_close(stream);
RETURN_FALSE;
}
if (overflow2(font->nchars * font->h, font->w )) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error reading font, invalid font header");
efree(font);
php_stream_close(stream);
RETURN_FALSE;
}
if (body_size != body_size_check) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error reading font");
@@ -4548,7 +4564,7 @@ PHP_FUNCTION(imagepsslantfont)
}
/* }}} */
/* {{{ proto array imagepstext(resource image, string text, resource font, int size, int foreground, int background, int xcoord, int ycoord [, int space, int tightness, float angle, int antialias])
/* {{{ proto array imagepstext(resource image, string text, resource font, int size, int foreground, int background, int xcoord, int ycoord [, int space [, int tightness [, float angle [, int antialias]]]])
Rasterize a string over an image */
PHP_FUNCTION(imagepstext)
{
+1
View File
@@ -2620,6 +2620,7 @@ void gdImageCopyResampled (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, i
green /= spixels;
blue /= spixels;
alpha /= spixels;
alpha += 0.5;
}
if ( alpha_sum != 0.0f) {
if( contrib_sum != 0.0f) {
+6 -1
View File
@@ -689,7 +689,12 @@ void gdImagePngCtxEx (gdImagePtr im, gdIOCtx * outfile, int level, int basefilte
*/
a = gdTrueColorGetAlpha(thisPixel);
/* Andrew Hull: >> 6, not >> 7! (gd 2.0.5) */
*pOutputRow++ = 255 - ((a << 1) + (a >> 6));
if (a == 127) {
*pOutputRow++ = 0;
} else {
*pOutputRow++ = 255 - ((a << 1) + (a >> 6));
}
}
}
}
+26
View File
@@ -0,0 +1,26 @@
--TEST--
imageloadfont() function crashes
--SKIPIF--
<?php
if (!extension_loaded('gd')) die("skip gd extension not available\n");
if (!GD_BUNDLED) die('skip external GD libraries always fail');
?>
--FILE--
<?php
$filename = dirname(__FILE__) . '/font.gdf';
$bin = "\x41\x41\x41\x41\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00";
$fp = fopen($filename, 'wb');
fwrite($fp, $bin);
fclose($fp);
$image = imagecreatetruecolor(50, 20);
$font = imageloadfont($filename);
$black = imagecolorallocate($image, 0, 0, 0);
imagestring($image, $font, 0, 0, "Hello", $black);
unlink($filename);
?>
--EXPECTF--
Warning: imageloadfont(): gd warning: product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully
in %simageloadfont_invalid.php on line %d
Warning: imageloadfont(): Error reading font, invalid font header in %simageloadfont_invalid.php on line %d
+11 -1
View File
@@ -56,6 +56,16 @@ PHP_HASH_API void PHP_CRC32Final(unsigned char digest[4], PHP_CRC32_CTX *context
context->state = 0;
}
PHP_HASH_API void PHP_CRC32BFinal(unsigned char digest[4], PHP_CRC32_CTX *context)
{
context->state=~context->state;
digest[0] = (unsigned char) ((context->state >> 24) & 0xff);
digest[1] = (unsigned char) ((context->state >> 16) & 0xff);
digest[2] = (unsigned char) ((context->state >> 8) & 0xff);
digest[3] = (unsigned char) (context->state & 0xff);
context->state = 0;
}
const php_hash_ops php_hash_crc32_ops = {
(php_hash_init_func_t) PHP_CRC32Init,
(php_hash_update_func_t) PHP_CRC32Update,
@@ -68,7 +78,7 @@ const php_hash_ops php_hash_crc32_ops = {
const php_hash_ops php_hash_crc32b_ops = {
(php_hash_init_func_t) PHP_CRC32Init,
(php_hash_update_func_t) PHP_CRC32BUpdate,
(php_hash_final_func_t) PHP_CRC32Final,
(php_hash_final_func_t) PHP_CRC32BFinal,
4, /* what to say here? */
4,
sizeof(PHP_CRC32_CTX)
+6 -6
View File
@@ -28,9 +28,9 @@ echo hash('crc32b', '12345678901234567890123456789012345678901234567890123456789
882174a0
96790816
00000000
43beb7e8
c2412435
7f9d1520
bd50274c
d2e6c21f
724aa97c
e8b7be43
352441c2
20159d7f
4c2750bd
1fc2e6d2
7ca94a72
+44 -32
View File
@@ -717,23 +717,26 @@ PHP_RSHUTDOWN_FUNCTION(imap)
}
/* }}} */
#if !defined(CCLIENTVERSION)
#if HAVE_IMAP2004
#define CCLIENTVERSION "2004"
#elif HAVE_IMAP2001
#define CCLIENTVERSION "2001"
#elif HAVE_IMAP2000
#define CCLIENTVERSION "2000"
#elif defined(IMAP41)
#define CCLIENTVERSION "4.1"
#else
#define CCLIENTVERSION "4.0"
#endif
#endif
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(imap)
{
php_info_print_table_start();
#if HAVE_IMAP2004
php_info_print_table_row(2, "IMAP c-Client Version", "2004");
#elif HAVE_IMAP2001
php_info_print_table_row(2, "IMAP c-Client Version", "2001");
#elif HAVE_IMAP2000
php_info_print_table_row(2, "IMAP c-Client Version", "2000");
#elif defined(IMAP41)
php_info_print_table_row(2, "IMAP c-Client Version", "4.1");
#else
php_info_print_table_row(2, "IMAP c-Client Version", "4.0");
#endif
php_info_print_table_row(2, "IMAP c-Client Version", CCLIENTVERSION);
#if HAVE_IMAP_SSL
php_info_print_table_row(2, "SSL Support", "enabled");
#endif
@@ -792,7 +795,7 @@ static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
#ifdef SET_MAXLOGINTRIALS
if (myargc == 5) {
convert_to_long_ex(retries);
if (retries < 0) {
if (Z_LVAL_PP(retries) < 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING ,"Retries must be greater or equal to 0");
} else {
mail_parameters(NIL, SET_MAXLOGINTRIALS, (void *) Z_LVAL_PP(retries));
@@ -1451,7 +1454,7 @@ PHP_FUNCTION(imap_list_full)
}
/* }}} */
/* {{{ proto array imap_scan(resource stream_id, string ref, string pattern, string content)
/* {{{ proto array imap_listscan(resource stream_id, string ref, string pattern, string content)
Read list of mailboxes containing a certain string */
PHP_FUNCTION(imap_listscan)
{
@@ -1575,7 +1578,7 @@ PHP_FUNCTION(imap_headerinfo)
pils *imap_le_struct;
MESSAGECACHE *cache;
ENVELOPE *en;
char dummy[2000], fulladdress[MAILTMPLEN];
char dummy[2000], fulladdress[MAILTMPLEN + 1];
int myargc = ZEND_NUM_ARGS();
if (myargc < 2 || myargc > 5 || zend_get_parameters_ex(myargc, &streamind, &msgno, &fromlength, &subjectlength, &defaulthost) == FAILURE) {
@@ -1587,8 +1590,8 @@ PHP_FUNCTION(imap_headerinfo)
convert_to_long_ex(msgno);
if (myargc >= 3) {
convert_to_long_ex(fromlength);
if (Z_LVAL_PP(fromlength) < 0 || Z_LVAL_PP(fromlength) >= MAILTMPLEN) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "From length has to be between 1 and %i", MAILTMPLEN);
if (Z_LVAL_PP(fromlength) < 0 || Z_LVAL_PP(fromlength) > MAILTMPLEN) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "From length has to be between 0 and %d", MAILTMPLEN);
RETURN_FALSE;
}
} else {
@@ -1596,8 +1599,8 @@ PHP_FUNCTION(imap_headerinfo)
}
if (myargc >= 4) {
convert_to_long_ex(subjectlength);
if (Z_LVAL_PP(subjectlength) < 0 || Z_LVAL_PP(subjectlength) >= MAILTMPLEN) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Subject length has to be between 1 and %i", MAILTMPLEN);
if (Z_LVAL_PP(subjectlength) < 0 || Z_LVAL_PP(subjectlength) > MAILTMPLEN) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Subject length has to be between 0 and %d", MAILTMPLEN);
RETURN_FALSE;
}
} else {
@@ -2154,7 +2157,8 @@ PHP_FUNCTION(imap_rfc822_parse_adrlist)
zval **str, **defaulthost, *tovals;
ADDRESS *addresstmp;
ENVELOPE *env;
char *str_copy;
if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &str, &defaulthost) == FAILURE) {
ZEND_WRONG_PARAM_COUNT();
}
@@ -2165,7 +2169,10 @@ PHP_FUNCTION(imap_rfc822_parse_adrlist)
env = mail_newenvelope();
rfc822_parse_adrlist(&env->to, Z_STRVAL_PP(str), Z_STRVAL_PP(defaulthost));
/* rfc822_parse_adrlist() modifies passed string. Copy it. */
str_copy = estrndup(Z_STRVAL_PP(str), Z_STRLEN_PP(str));
rfc822_parse_adrlist(&env->to, str_copy, defaulthost);
efree(str_copy);
array_init(return_value);
@@ -2961,7 +2968,7 @@ PHP_FUNCTION(imap_mail_compose)
BODY *bod=NULL, *topbod=NULL;
PART *mypart=NULL, *part;
PARAMETER *param, *disp_param = NULL, *custom_headers_param = NULL, *tmp_param = NULL;
char *tmp=NULL, *mystring=NULL, *t=NULL, *tempstring=NULL;
char *tmp=NULL, *mystring=NULL, *t=NULL, *tempstring=NULL, *str_copy = NULL;
int toppart = 0;
if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &envelope, &body) == FAILURE) {
@@ -2978,50 +2985,55 @@ PHP_FUNCTION(imap_mail_compose)
RETURN_FALSE;
}
#define PHP_RFC822_PARSE_ADRLIST(target, value) \
str_copy = estrndup(Z_STRVAL_PP(value), Z_STRLEN_PP(value)); \
rfc822_parse_adrlist(target, str_copy, "NO HOST"); \
efree(str_copy);
env = mail_newenvelope();
if (zend_hash_find(Z_ARRVAL_PP(envelope), "remail", sizeof("remail"), (void **) &pvalue)== SUCCESS) {
convert_to_string_ex(pvalue);
env->remail=cpystr(Z_STRVAL_PP(pvalue));
env->remail = cpystr(Z_STRVAL_PP(pvalue));
}
if (zend_hash_find(Z_ARRVAL_PP(envelope), "return_path", sizeof("return_path"), (void **) &pvalue)== SUCCESS) {
convert_to_string_ex(pvalue)
rfc822_parse_adrlist(&env->return_path, Z_STRVAL_PP(pvalue), "NO HOST");
PHP_RFC822_PARSE_ADRLIST(&env->return_path, pvalue);
}
if (zend_hash_find(Z_ARRVAL_PP(envelope), "date", sizeof("date"), (void **) &pvalue)== SUCCESS) {
convert_to_string_ex(pvalue);
env->date=cpystr(Z_STRVAL_PP(pvalue));
env->date = cpystr(Z_STRVAL_PP(pvalue));
}
if (zend_hash_find(Z_ARRVAL_PP(envelope), "from", sizeof("from"), (void **) &pvalue)== SUCCESS) {
convert_to_string_ex(pvalue);
rfc822_parse_adrlist (&env->from, Z_STRVAL_PP(pvalue), "NO HOST");
PHP_RFC822_PARSE_ADRLIST(&env->from, pvalue);
}
if (zend_hash_find(Z_ARRVAL_PP(envelope), "reply_to", sizeof("reply_to"), (void **) &pvalue)== SUCCESS) {
convert_to_string_ex(pvalue);
rfc822_parse_adrlist (&env->reply_to, Z_STRVAL_PP(pvalue), "NO HOST");
PHP_RFC822_PARSE_ADRLIST(&env->reply_to, pvalue);
}
if (zend_hash_find(Z_ARRVAL_PP(envelope), "in_reply_to", sizeof("in_reply_to"), (void **) &pvalue)== SUCCESS) {
convert_to_string_ex(pvalue);
env->in_reply_to=cpystr(Z_STRVAL_PP(pvalue));
env->in_reply_to = cpystr(Z_STRVAL_PP(pvalue));
}
if (zend_hash_find(Z_ARRVAL_PP(envelope), "subject", sizeof("subject"), (void **) &pvalue)== SUCCESS) {
convert_to_string_ex(pvalue);
env->subject=cpystr(Z_STRVAL_PP(pvalue));
env->subject = cpystr(Z_STRVAL_PP(pvalue));
}
if (zend_hash_find(Z_ARRVAL_PP(envelope), "to", sizeof("to"), (void **) &pvalue)== SUCCESS) {
convert_to_string_ex(pvalue);
rfc822_parse_adrlist (&env->to, Z_STRVAL_PP(pvalue), "NO HOST");
PHP_RFC822_PARSE_ADRLIST(&env->to, pvalue);
}
if (zend_hash_find(Z_ARRVAL_PP(envelope), "cc", sizeof("cc"), (void **) &pvalue)== SUCCESS) {
convert_to_string_ex(pvalue);
rfc822_parse_adrlist (&env->cc, Z_STRVAL_PP(pvalue), "NO HOST");
PHP_RFC822_PARSE_ADRLIST(&env->cc, pvalue);
}
if (zend_hash_find(Z_ARRVAL_PP(envelope), "bcc", sizeof("bcc"), (void **) &pvalue)== SUCCESS) {
convert_to_string_ex(pvalue);
rfc822_parse_adrlist (&env->bcc, Z_STRVAL_PP(pvalue), "NO HOST");
PHP_RFC822_PARSE_ADRLIST(&env->bcc, pvalue);
}
if (zend_hash_find(Z_ARRVAL_PP(envelope), "message_id", sizeof("message_id"), (void **) &pvalue)== SUCCESS) {
convert_to_string_ex(pvalue);
env->message_id=cpystr(Z_STRVAL_PP(pvalue));
env->message_id = cpystr(Z_STRVAL_PP(pvalue));
}
if (zend_hash_find(Z_ARRVAL_PP(envelope), "custom_headers", sizeof("custom_headers"), (void **) &pvalue)== SUCCESS) {
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #45705 test #1 (imap rfc822_parse_adrlist() modifies passed address parameter)
--SKIPIF--
<?php
if (!extension_loaded("imap")) {
die("skip imap extension not available");
}
?>
--FILE--
<?php
$address = 'John Doe <john@example.com>';
var_dump($address);
imap_rfc822_parse_adrlist($address, null);
var_dump($address);
?>
--EXPECT--
string(27) "John Doe <john@example.com>"
string(27) "John Doe <john@example.com>"
+53
View File
@@ -0,0 +1,53 @@
--TEST--
Bug #45705 test #2 (imap rfc822_parse_adrlist() modifies passed address parameter)
--SKIPIF--
<?php
if (!extension_loaded("imap")) {
die("skip imap extension not available");
}
?>
--FILE--
<?php
$envelope = array('return_path' => 'John Doe <john@example.com>',
'from' => 'John Doe <john@example.com>',
'reply_to' => 'John Doe <john@example.com>',
'to' => 'John Doe <john@example.com>',
'cc' => 'John Doe <john@example.com>',
'bcc' => 'John Doe <john@example.com>',
);
var_dump($envelope);
imap_mail_compose($envelope, array(1 => array()));
var_dump($envelope);
?>
--EXPECT--
array(6) {
["return_path"]=>
string(27) "John Doe <john@example.com>"
["from"]=>
string(27) "John Doe <john@example.com>"
["reply_to"]=>
string(27) "John Doe <john@example.com>"
["to"]=>
string(27) "John Doe <john@example.com>"
["cc"]=>
string(27) "John Doe <john@example.com>"
["bcc"]=>
string(27) "John Doe <john@example.com>"
}
array(6) {
["return_path"]=>
string(27) "John Doe <john@example.com>"
["from"]=>
string(27) "John Doe <john@example.com>"
["reply_to"]=>
string(27) "John Doe <john@example.com>"
["to"]=>
string(27) "John Doe <john@example.com>"
["cc"]=>
string(27) "John Doe <john@example.com>"
["bcc"]=>
string(27) "John Doe <john@example.com>"
}
+17 -8
View File
@@ -260,7 +260,7 @@ PHP_FUNCTION(ibase_set_event_handler)
* link resource id (int) as arguments. The value returned from the function is
* used to determine if the event handler should remain set.
*/
char *cb_name;
zval **args[17], **cb_arg;
ibase_db_link *ib_link;
ibase_event *event;
@@ -268,8 +268,8 @@ PHP_FUNCTION(ibase_set_event_handler)
int link_res_id;
RESET_ERRMSG;
/* no more than 15 events */
/* Minimum and maximum number of arguments allowed */
if (ZEND_NUM_ARGS() < 2 || ZEND_NUM_ARGS() > 17) {
WRONG_PARAM_COUNT;
}
@@ -280,6 +280,12 @@ PHP_FUNCTION(ibase_set_event_handler)
/* get a working link */
if (Z_TYPE_PP(args[0]) != IS_STRING) {
/* resource, callback, event_1 [, ... event_15]
* No more than 15 events
*/
if (ZEND_NUM_ARGS() < 3 || ZEND_NUM_ARGS() > 17) {
WRONG_PARAM_COUNT;
}
cb_arg = args[1];
i = 2;
@@ -291,8 +297,10 @@ PHP_FUNCTION(ibase_set_event_handler)
link_res_id = Z_LVAL_PP(args[0]);
} else {
if (ZEND_NUM_ARGS() > 16) {
/* callback, event_1 [, ... event_15]
* No more than 15 events
*/
if (ZEND_NUM_ARGS() < 2 || ZEND_NUM_ARGS() > 16) {
WRONG_PARAM_COUNT;
}
@@ -304,11 +312,12 @@ PHP_FUNCTION(ibase_set_event_handler)
}
/* get the callback */
if (!zend_is_callable(*cb_arg, 0, NULL)) {
_php_ibase_module_error("Callback argument %s is not a callable function"
TSRMLS_CC, Z_STRVAL_PP(cb_arg));
if (!zend_is_callable(*cb_arg, 0, &cb_name)) {
_php_ibase_module_error("Callback argument %s is not a callable function" TSRMLS_CC, cb_name);
efree(cb_name);
RETURN_FALSE;
}
efree(cb_name);
/* allocate the event resource */
event = (ibase_event *) safe_emalloc(sizeof(ibase_event), 1, 0);
+7 -6
View File
@@ -1819,16 +1819,17 @@ PHP_FUNCTION(ibase_execute)
if (bind_n != expected_n) {
php_error_docref(NULL TSRMLS_CC, (bind_n < expected_n) ? E_WARNING : E_NOTICE,
"Statement expects %d arguments, %d given", expected_n, bind_n);
if (bind_n < expected_n) {
break;
}
} else if (bind_n > 0) { /* have variables to bind */
args = (zval ***) do_alloca(ZEND_NUM_ARGS() * sizeof(zval **));
}
/* have variables to bind */
args = (zval ***) do_alloca((expected_n + 1) * sizeof(zval **));
if (FAILURE == zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args)) {
break;
}
if (FAILURE == zend_get_parameters_array_ex((expected_n + 1), args)) {
break;
}
/* Have we used this cursor before and it's still open (exec proc has no cursor) ? */
+3 -6
View File
@@ -229,8 +229,7 @@ PHP_FUNCTION(ibase_service_attach)
user, isc_spb_password, (char)plen, pass, host);
if (spb_len > sizeof(buf) || spb_len == -1) {
_php_ibase_module_error("Internal error: insufficient buffer space for SPB (%ld)"
TSRMLS_CC, spb_len);
_php_ibase_module_error("Internal error: insufficient buffer space for SPB (%d)" TSRMLS_CC, spb_len);
RETURN_FALSE;
}
@@ -451,8 +450,7 @@ static void _php_ibase_backup_restore(INTERNAL_FUNCTION_PARAMETERS, char operati
}
if (spb_len > sizeof(buf) || spb_len <= 0) {
_php_ibase_module_error("Internal error: insufficient buffer space for SPB (%ld)"
TSRMLS_CC, spb_len);
_php_ibase_module_error("Internal error: insufficient buffer space for SPB (%d)" TSRMLS_CC, spb_len);
RETURN_FALSE;
}
@@ -560,8 +558,7 @@ options_argument:
}
if (spb_len > sizeof(buf) || spb_len == -1) {
_php_ibase_module_error("Internal error: insufficient buffer space for SPB (%ld)"
TSRMLS_CC, spb_len);
_php_ibase_module_error("Internal error: insufficient buffer space for SPB (%d)" TSRMLS_CC, spb_len);
RETURN_FALSE;
}
+47
View File
@@ -0,0 +1,47 @@
--TEST--
Bug #45373 (php crash on query with errors in params)
--SKIPIF--
<?php include("skipif.inc"); ?>
--FILE--
<?php
require("interbase.inc");
$db = ibase_connect($test_base);
$sql = "select * from test1 where i = ? and c = ?";
$q = ibase_prepare($db, $sql);
$r = ibase_execute($q, 1, 'test table not created with isql');
var_dump(ibase_fetch_assoc($r));
ibase_free_result($r);
$r = ibase_execute($q, 1, 'test table not created with isql', 1);
var_dump(ibase_fetch_assoc($r));
ibase_free_result($r);
$r = ibase_execute($q, 1);
var_dump(ibase_fetch_assoc($r));
?>
--EXPECTF--
array(2) {
["I"]=>
int(1)
["C"]=>
string(32) "test table not created with isql"
}
Notice: ibase_execute(): Statement expects 2 arguments, 3 given in %sbug45373.php on line %d
array(2) {
["I"]=>
int(1)
["C"]=>
string(32) "test table not created with isql"
}
Warning: ibase_execute(): Statement expects 2 arguments, 1 given in %sbug45373.php on line %d
Warning: ibase_fetch_assoc(): supplied argument is not a valid Firebird/InterBase result resource in %sbug45373.php on line %d
bool(false)
+22
View File
@@ -0,0 +1,22 @@
--TEST--
Bug #45575 (Segfault with invalid non-string as event handler callback)
--SKIPIF--
<?php include("skipif.inc"); ?>
--FILE--
<?php
require("interbase.inc");
$db = ibase_connect($test_base);
function foobar($var) { var_dump($var); return true; }
ibase_set_event_handler($db, null, 'TEST1');
ibase_set_event_handler($db, 1, 'TEST1');
ibase_set_event_handler('foobar', 'TEST1');
?>
--EXPECTF--
Warning: ibase_set_event_handler(): Callback argument is not a callable function in %s on line %d
Warning: ibase_set_event_handler(): Callback argument 1 is not a callable function in %s on line %d
+36
View File
@@ -0,0 +1,36 @@
--TEST--
Bug #46247 (ibase_set_event_handler() is allowing to pass callback without event)
--SKIPIF--
<?php include("skipif.inc"); ?>
--FILE--
<?php
require("interbase.inc");
$db = ibase_connect($test_base);
function test() { }
ibase_set_event_handler();
ibase_set_event_handler('test', 1);
ibase_set_event_handler($db, 'test', 1);
ibase_set_event_handler(NULL, 'test', 1);
ibase_set_event_handler('foo', 1);
ibase_set_event_handler($db, 'foo', 1);
ibase_set_event_handler(NULL, 'foo', 1);
?>
--EXPECTF--
Warning: Wrong parameter count for ibase_set_event_handler() in %s on line %d
Warning: ibase_set_event_handler(): supplied argument is not a valid InterBase link resource in %s on line %d
Warning: ibase_set_event_handler(): Callback argument foo is not a callable function in %s on line %d
Warning: ibase_set_event_handler(): Callback argument foo is not a callable function in %s on line %d
Warning: ibase_set_event_handler(): supplied argument is not a valid InterBase link resource in %s on line %d
+3
View File
@@ -104,6 +104,9 @@ function rand_number($len , $prec = -1, $sign = 1)
}
} else if ($prec == 0) {
$n = substr(rand() . rand(), 0, rand() % $len + 1);
} else if (($prec - $len) == 0) {
$n = substr(rand() . rand(), 0, 1);
$n .= "." . substr(rand(), 0, $prec);
} else {
$n = substr(rand() . rand(), 0, rand() % ($len - $prec) + 1);
$n .= "." . substr(rand(), 0, $prec);
+1 -1
View File
@@ -201,7 +201,7 @@ static const int state_transition_table[30][31] = {
/*29*/ {29,29,-1,-1,-1,-1,-1,-1, 3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}
};
#define JSON_PARSER_MAX_DEPTH 128
#define JSON_PARSER_MAX_DEPTH 512
/*
+15 -6
View File
@@ -84,7 +84,7 @@ static PHP_MINFO_FUNCTION(json)
/* }}} */
static void json_encode_r(smart_str *buf, zval *val TSRMLS_DC);
static void json_escape_string(smart_str *buf, char *s, int len);
static void json_escape_string(smart_str *buf, char *s, int len TSRMLS_DC);
static int json_determine_array_type(zval **val TSRMLS_DC) /* {{{ */
{
@@ -181,6 +181,9 @@ static void json_encode_array(smart_str *buf, zval **val TSRMLS_DC) { /* {{{ */
if (i == HASH_KEY_IS_STRING) {
if (key[0] == '\0' && Z_TYPE_PP(val) == IS_OBJECT) {
/* Skip protected and private members. */
if (tmp_ht) {
tmp_ht->nApplyCount--;
}
continue;
}
@@ -190,7 +193,7 @@ static void json_encode_array(smart_str *buf, zval **val TSRMLS_DC) { /* {{{ */
need_comma = 1;
}
json_escape_string(buf, key, key_len - 1);
json_escape_string(buf, key, key_len - 1 TSRMLS_CC);
smart_str_appendc(buf, ':');
json_encode_r(buf, *data TSRMLS_CC);
@@ -230,7 +233,7 @@ static void json_encode_array(smart_str *buf, zval **val TSRMLS_DC) { /* {{{ */
#define REVERSE16(us) (((us & 0xf) << 12) | (((us >> 4) & 0xf) << 8) | (((us >> 8) & 0xf) << 4) | ((us >> 12) & 0xf))
static void json_escape_string(smart_str *buf, char *s, int len) /* {{{ */
static void json_escape_string(smart_str *buf, char *s, int len TSRMLS_DC) /* {{{ */
{
int pos = 0;
unsigned short us;
@@ -251,8 +254,14 @@ static void json_escape_string(smart_str *buf, char *s, int len) /* {{{ */
{
efree(utf16);
}
smart_str_appendl(buf, "\"\"", 2);
if(len < 0) {
if(!PG(display_errors)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid UTF-8 sequence in argument");
}
smart_str_appendl(buf, "null", 4);
} else {
smart_str_appendl(buf, "\"\"", 2);
}
return;
}
@@ -369,7 +378,7 @@ static void json_encode_r(smart_str *buf, zval *val TSRMLS_DC) /* {{{ */
}
break;
case IS_STRING:
json_escape_string(buf, Z_STRVAL_P(val), Z_STRLEN_P(val));
json_escape_string(buf, Z_STRVAL_P(val), Z_STRLEN_P(val) TSRMLS_CC);
break;
case IS_ARRAY:
case IS_OBJECT:
+21
View File
@@ -0,0 +1,21 @@
--TEST--
Bug #43941 (json_encode() invalid UTF-8)
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
var_dump(json_encode("abc"));
var_dump(json_encode("ab\xE0"));
var_dump(json_encode("ab\xE0c"));
var_dump(json_encode(array("ab\xE0", "ab\xE0c", "abc")));
echo "Done\n";
?>
--EXPECTF--
string(5) ""abc""
string(4) "null"
string(4) "null"
string(17) "[null,null,"abc"]"
Done
+23
View File
@@ -0,0 +1,23 @@
--TEST--
Bug #46215 (json_encode mutates its parameter and has some class-specific state)
--FILE--
<?php
class foo {
protected $a = array();
}
$a = new foo;
$x = json_encode($a);
print_r($a);
?>
--EXPECT--
foo Object
(
[a:protected] => Array
(
)
)
+2 -2
View File
@@ -24,7 +24,7 @@ $tests = array('"A JSON payload should be an object or array, not a string."',
'["Illegal backslash escape: \\x15"]',
'["Illegal backslash escape: \\\'"]',
'["Illegal backslash escape: \\017"]',
'[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]',
'[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]',
'{"Missing colon" null}',
'{"Double colon":: null}',
'{"Comma instead of colon", null}',
@@ -128,7 +128,7 @@ AS OBJECT
NULL
AS ARRAY
NULL
Testing: [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
Testing: [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
AS OBJECT
NULL
AS ARRAY
+1 -1
View File
@@ -40,7 +40,7 @@ utf8_to_utf16(unsigned short w[], char p[], int length)
for (;;) {
c = utf8_decode_next(&utf8);
if (c < 0) {
return UTF8_END ? the_index : UTF8_ERROR;
return (c == UTF8_END) ? the_index : UTF8_ERROR;
}
if (c < 0x10000) {
w[the_index] = (unsigned short)c;
+2 -2
View File
@@ -471,7 +471,7 @@ static int _get_lderrno(LDAP *ldap)
}
/* }}} */
/* {{{ proto bool ldap_bind(resource link [, string dn, string password])
/* {{{ proto bool ldap_bind(resource link [, string dn [, string password]])
Bind to LDAP directory */
PHP_FUNCTION(ldap_bind)
{
@@ -581,7 +581,7 @@ static int _php_sasl_interact(LDAP *ld, unsigned flags, void *defaults, void *in
}
/* }}} */
/* {{{ proto bool ldap_sasl_bind(resource link [, string binddn, string password, string sasl_mech, string sasl_realm, string sasl_authc_id, string sasl_authz_id, string props])
/* {{{ proto bool ldap_sasl_bind(resource link [, string binddn [, string password [, string sasl_mech [, string sasl_realm [, string sasl_authc_id [, string sasl_authz_id [, string props]]]]]]])
Bind to LDAP directory using SASL */
PHP_FUNCTION(ldap_sasl_bind)
{
+11 -14
View File
@@ -72,19 +72,17 @@ int foo(int x, ...) {
return 0;
}
int main() { return foo(10, "", 3.14); }
], [cv_php_mbstring_stdarg=yes], [cv_php_mbstring_stdarg=no],
[
dnl cross-compile needs something here
case $host_alias in
*netware*)
cv_php_mbstring_stdarg=yes
;;
*)
cv_php_mbstring_stdarg=no
;;
esac
]
)
], [cv_php_mbstring_stdarg=yes], [cv_php_mbstring_stdarg=no], [
dnl cross-compile needs something here
case $host_alias in
*netware*)
cv_php_mbstring_stdarg=yes
;;
*)
cv_php_mbstring_stdarg=no
;;
esac
])
])
AC_CHECK_HEADERS([stdlib.h string.h strings.h unistd.h sys/time.h sys/times.h stdarg.h])
@@ -98,7 +96,6 @@ esac
AC_DEFINE([HAVE_MBREGEX], 1, [whether to have multibyte regex support])
if test "$PHP_MBREGEX_BACKTRACK" != "no"; then
AC_DEFINE([USE_COMBINATION_EXPLOSION_CHECK],1,[whether to check multibyte regex backtrack])
fi
+1
View File
@@ -1013,6 +1013,7 @@ mbfl_substr_count(
if (pc.matched_pos >= 0) {
++result;
pc.matched_pos = -1;
pc.needle_pos = 0;
}
n--;
}
+34 -26
View File
@@ -357,22 +357,6 @@ int mbfl_convert_filter_strcat(mbfl_convert_filter *filter, const unsigned char
return 0;
}
#if 0
static int
mbfl_convert_filter_strncat(mbfl_convert_filter *filter, const unsigned char *p,
int n)
{
while (n > 0) {
if ((*filter->filter_function)(*p++, filter) < 0) {
return -1;
}
n--;
}
return n;
}
#endif
/* illegal character output function for conv-filter */
int
mbfl_filt_conv_illegal_output(int c, mbfl_convert_filter *filter)
@@ -387,14 +371,9 @@ mbfl_filt_conv_illegal_output(int c, mbfl_convert_filter *filter)
ret = (*filter->filter_function)(filter->illegal_substchar, filter);
break;
case MBFL_OUTPUTFILTER_ILLEGAL_MODE_LONG:
case MBFL_OUTPUTFILTER_ILLEGAL_MODE_ENTITY:
if (c >= 0) {
if (c < MBFL_WCSGROUP_UCS4MAX) { /* unicode */
if (mode_backup == MBFL_OUTPUTFILTER_ILLEGAL_MODE_LONG) {
ret = mbfl_convert_filter_strcat(filter, (const unsigned char *)"U+");
} else { /* entity */
ret = mbfl_convert_filter_strcat(filter, (const unsigned char *)"&#");
}
ret = mbfl_convert_filter_strcat(filter, (const unsigned char *)"U+");
} else {
if (c < MBFL_WCSGROUP_WCHARMAX) {
m = c & ~MBFL_WCSPLANE_MASK;
@@ -438,9 +417,38 @@ mbfl_filt_conv_illegal_output(int c, mbfl_convert_filter *filter)
if (m == 0 && ret >= 0) {
ret = (*filter->filter_function)(mbfl_hexchar_table[0], filter);
}
if (mode_backup == MBFL_OUTPUTFILTER_ILLEGAL_MODE_ENTITY) {
ret = mbfl_convert_filter_strcat(filter, (const unsigned char *)";");
}
}
break;
case MBFL_OUTPUTFILTER_ILLEGAL_MODE_ENTITY:
if (c >= 0) {
if (c < MBFL_WCSGROUP_UCS4MAX) { /* unicode */
ret = mbfl_convert_filter_strcat(filter, (const unsigned char *)"&#x");
if (ret < 0)
break;
m = 0;
r = 28;
while (r >= 0) {
n = (c >> r) & 0xf;
if (n || m) {
m = 1;
ret = (*filter->filter_function)(mbfl_hexchar_table[n], filter);
if (ret < 0) {
break;
}
}
r -= 4;
}
if (ret < 0) {
break;
}
if (m == 0) {
ret = (*filter->filter_function)(mbfl_hexchar_table[0], filter);
}
ret = mbfl_convert_filter_strcat(filter, (const unsigned char *)";");
} else {
ret = (*filter->filter_function)(filter->illegal_substchar, filter);
}
}
break;
@@ -462,8 +470,8 @@ const struct mbfl_convert_vtbl * mbfl_convert_filter_get_vtbl(enum mbfl_no_encod
to == mbfl_no_encoding_7bit) {
from = mbfl_no_encoding_8bit;
} else if (from == mbfl_no_encoding_base64 ||
from == mbfl_no_encoding_qprint ||
from == mbfl_no_encoding_uuencode) {
from == mbfl_no_encoding_qprint ||
from == mbfl_no_encoding_uuencode) {
to = mbfl_no_encoding_8bit;
}
+201 -284
View File
@@ -89,7 +89,7 @@ static PHP_GSHUTDOWN_FUNCTION(mbstring);
/* {{{ php_mb_default_identify_list */
typedef struct _php_mb_nls_ident_list {
enum mbfl_no_language lang;
enum mbfl_no_encoding* list;
const enum mbfl_no_encoding* list;
int list_size;
} php_mb_nls_ident_list;
@@ -560,7 +560,7 @@ static int php_mb_nls_get_default_detect_order_list(enum mbfl_no_language lang,
for (i = 0; i < sizeof(php_mb_default_identify_list) / sizeof(php_mb_default_identify_list[0]); i++) {
if (php_mb_default_identify_list[i].lang == lang) {
*plist = php_mb_default_identify_list[i].list;
*plist = (enum mbfl_no_encoding *)php_mb_default_identify_list[i].list;
*plist_size = php_mb_default_identify_list[i].list_size;
return 1;
}
@@ -576,6 +576,7 @@ static PHP_INI_MH(OnUpdate_mbstring_language)
no_language = mbfl_name2no_language(new_value);
if (no_language == mbfl_no_language_invalid) {
MBSTRG(language) = mbfl_no_language_neutral;
return FAILURE;
}
MBSTRG(language) = no_language;
@@ -591,12 +592,16 @@ static PHP_INI_MH(OnUpdate_mbstring_detect_order)
int size;
if (php_mb_parse_encoding_list(new_value, new_value_length, &list, &size, 1 TSRMLS_CC)) {
if (MBSTRG(detect_order_list) != NULL) {
if (MBSTRG(detect_order_list)) {
free(MBSTRG(detect_order_list));
}
MBSTRG(detect_order_list) = list;
MBSTRG(detect_order_list_size) = size;
} else {
if (MBSTRG(detect_order_list)) {
free(MBSTRG(detect_order_list));
MBSTRG(detect_order_list) = NULL;
}
return FAILURE;
}
@@ -611,12 +616,17 @@ static PHP_INI_MH(OnUpdate_mbstring_http_input)
int size;
if (php_mb_parse_encoding_list(new_value, new_value_length, &list, &size, 1 TSRMLS_CC)) {
if (MBSTRG(http_input_list) != NULL) {
if (MBSTRG(http_input_list)) {
free(MBSTRG(http_input_list));
}
MBSTRG(http_input_list) = list;
MBSTRG(http_input_list_size) = size;
} else {
if (MBSTRG(http_input_list)) {
free(MBSTRG(http_input_list));
MBSTRG(http_input_list) = NULL;
}
MBSTRG(http_input_list_size) = 0;
return FAILURE;
}
@@ -634,6 +644,8 @@ static PHP_INI_MH(OnUpdate_mbstring_http_output)
MBSTRG(http_output_encoding) = no_encoding;
MBSTRG(current_http_output_encoding) = no_encoding;
} else {
MBSTRG(http_output_encoding) = mbfl_no_encoding_pass;
MBSTRG(current_http_output_encoding) = mbfl_no_encoding_pass;
if (new_value != NULL && new_value_length > 0) {
return FAILURE;
}
@@ -643,38 +655,98 @@ static PHP_INI_MH(OnUpdate_mbstring_http_output)
}
/* }}} */
/* {{{ static _php_mb_ini_mbstring_internal_encoding_set */
static int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, uint new_value_length TSRMLS_DC)
{
enum mbfl_no_encoding no_encoding;
const char *enc_name = NULL;
uint enc_name_len = 0;
no_encoding = new_value ? mbfl_name2no_encoding(new_value):
mbfl_no_encoding_invalid;
if (no_encoding != mbfl_no_encoding_invalid) {
enc_name = new_value;
enc_name_len = new_value_length;
} else {
switch (MBSTRG(language)) {
case mbfl_no_language_uni:
enc_name = "UTF-8";
enc_name_len = sizeof("UTF-8") - 1;
break;
case mbfl_no_language_japanese:
enc_name = "EUC-JP";
enc_name_len = sizeof("EUC-JP") - 1;
break;
case mbfl_no_language_korean:
enc_name = "EUC-KR";
enc_name_len = sizeof("EUC-KR") - 1;
break;
case mbfl_no_language_simplified_chinese:
enc_name = "EUC-CN";
enc_name_len = sizeof("EUC-CN") - 1;
break;
case mbfl_no_language_traditional_chinese:
enc_name = "EUC-TW";
enc_name_len = sizeof("EUC-TW") - 1;
break;
case mbfl_no_language_russian:
enc_name = "KOI8-R";
enc_name_len = sizeof("KOI8-R") - 1;
break;
case mbfl_no_language_german:
enc_name = "ISO-8859-15";
enc_name_len = sizeof("ISO-8859-15") - 1;
break;
case mbfl_no_language_armenian:
enc_name = "ArmSCII-8";
enc_name_len = sizeof("ArmSCII-8") - 1;
break;
case mbfl_no_language_turkish:
enc_name = "ISO-8859-9";
enc_name_len = sizeof("ISO-8859-9") - 1;
break;
default:
enc_name = "ISO-8859-1";
enc_name_len = sizeof("ISO-8859-1") - 1;
break;
}
no_encoding = mbfl_name2no_encoding(enc_name);
}
MBSTRG(internal_encoding) = no_encoding;
MBSTRG(current_internal_encoding) = no_encoding;
#if HAVE_MBREGEX
{
OnigEncoding mbctype;
mbctype = php_mb_regex_name2mbctype(enc_name);
if (mbctype == ONIG_ENCODING_UNDEF) {
mbctype = ONIG_ENCODING_EUC_JP;
}
MBSTRG(current_mbctype) = MBSTRG(default_mbctype) = mbctype;
}
#endif
#ifdef ZEND_MULTIBYTE
zend_multibyte_set_internal_encoding((char *)enc_name, enc_name_len TSRMLS_CC);
#endif /* ZEND_MULTIBYTE */
return SUCCESS;
}
/* }}} */
/* {{{ static PHP_INI_MH(OnUpdate_mbstring_internal_encoding) */
static PHP_INI_MH(OnUpdate_mbstring_internal_encoding)
{
enum mbfl_no_encoding no_encoding;
if (new_value == NULL) {
if (stage == PHP_INI_STAGE_STARTUP || stage == PHP_INI_STAGE_SHUTDOWN
|| stage == PHP_INI_STAGE_RUNTIME) {
return _php_mb_ini_mbstring_internal_encoding_set(new_value, new_value_length TSRMLS_CC);
} else {
/* the corresponding mbstring globals needs to be set according to the
* ini value in the later stage because it never falls back to the
* default value if 1. no value for mbstring.internal_encoding is given,
* 2. mbstring.language directive is processed in per-dir or runtime
* context and 3. call to the handler for mbstring.language is done
* after mbstring.internal_encoding is handled. */
return SUCCESS;
}
no_encoding = mbfl_name2no_encoding(new_value);
if (no_encoding != mbfl_no_encoding_invalid) {
MBSTRG(internal_encoding) = no_encoding;
MBSTRG(current_internal_encoding) = no_encoding;
#if HAVE_MBREGEX
{
OnigEncoding mbctype;
mbctype = php_mb_regex_name2mbctype(new_value);
if (mbctype == ONIG_ENCODING_UNDEF) {
mbctype = ONIG_ENCODING_EUC_JP;
}
MBSTRG(current_mbctype) = MBSTRG(default_mbctype) = mbctype;
}
#endif
#ifdef ZEND_MULTIBYTE
zend_multibyte_set_internal_encoding(new_value, new_value_length TSRMLS_CC);
#endif /* ZEND_MULTIBYTE */
} else {
if (new_value != NULL && new_value_length > 0) {
return FAILURE;
}
}
return SUCCESS;
}
/* }}} */
@@ -691,6 +763,11 @@ static PHP_INI_MH(OnUpdate_mbstring_script_encoding)
MBSTRG(script_encoding_list) = list;
MBSTRG(script_encoding_list_size) = size;
} else {
if (MBSTRG(script_encoding_list) != NULL) {
free(MBSTRG(script_encoding_list));
}
MBSTRG(script_encoding_list) = NULL;
MBSTRG(script_encoding_list_size) = 0;
return FAILURE;
}
@@ -726,6 +803,11 @@ static PHP_INI_MH(OnUpdate_mbstring_substitute_character)
}
}
}
} else {
MBSTRG(filter_illegal_mode) = MBFL_OUTPUTFILTER_ILLEGAL_MODE_CHAR;
MBSTRG(current_filter_illegal_mode) = MBFL_OUTPUTFILTER_ILLEGAL_MODE_CHAR;
MBSTRG(filter_illegal_substchar) = 0x3f; /* '?' */
MBSTRG(current_filter_illegal_substchar) = 0x3f; /* '?' */
}
return SUCCESS;
@@ -756,7 +838,7 @@ static PHP_INI_MH(OnUpdate_mbstring_encoding_translation)
/* {{{ php.ini directive registration */
PHP_INI_BEGIN()
PHP_INI_ENTRY("mbstring.language", "neutral", PHP_INI_SYSTEM | PHP_INI_PERDIR, OnUpdate_mbstring_language)
PHP_INI_ENTRY("mbstring.language", "neutral", PHP_INI_ALL, OnUpdate_mbstring_language)
PHP_INI_ENTRY("mbstring.detect_order", NULL, PHP_INI_ALL, OnUpdate_mbstring_detect_order)
PHP_INI_ENTRY("mbstring.http_input", "pass", PHP_INI_ALL, OnUpdate_mbstring_http_input)
PHP_INI_ENTRY("mbstring.http_output", "pass", PHP_INI_ALL, OnUpdate_mbstring_http_output)
@@ -765,8 +847,8 @@ PHP_INI_BEGIN()
PHP_INI_ENTRY("mbstring.script_encoding", NULL, PHP_INI_ALL, OnUpdate_mbstring_script_encoding)
#endif /* ZEND_MULTIBYTE */
PHP_INI_ENTRY("mbstring.substitute_character", NULL, PHP_INI_ALL, OnUpdate_mbstring_substitute_character)
STD_PHP_INI_ENTRY("mbstring.func_overload", "0", PHP_INI_SYSTEM |
PHP_INI_PERDIR, OnUpdateLong, func_overload, zend_mbstring_globals, mbstring_globals)
STD_PHP_INI_ENTRY("mbstring.func_overload", "0",
PHP_INI_SYSTEM, OnUpdateLong, func_overload, zend_mbstring_globals, mbstring_globals)
STD_PHP_INI_BOOLEAN("mbstring.encoding_translation", "0",
PHP_INI_SYSTEM | PHP_INI_PERDIR, OnUpdate_mbstring_encoding_translation,
@@ -781,7 +863,6 @@ PHP_INI_END()
static PHP_GINIT_FUNCTION(mbstring)
{
mbstring_globals->language = mbfl_no_language_uni;
mbstring_globals->current_language = mbstring_globals->language;
mbstring_globals->internal_encoding = mbfl_no_encoding_invalid;
mbstring_globals->current_internal_encoding = mbstring_globals->internal_encoding;
#ifdef ZEND_MULTIBYTE
@@ -821,6 +902,18 @@ static PHP_GINIT_FUNCTION(mbstring)
/* {{{ PHP_GSHUTDOWN_FUNCTION */
static PHP_GSHUTDOWN_FUNCTION(mbstring)
{
if (mbstring_globals->http_input_list) {
free(mbstring_globals->http_input_list);
}
#ifdef ZEND_MULTIBYTE
if (mbstring_globals->script_encoding_list) {
free(mbstring_globals->script_encoding_list);
}
#endif /* ZEND_MULTIBYTE */
if (mbstring_globals->detect_order_list) {
free(mbstring_globals->detect_order_list);
}
#if HAVE_MBREGEX
_php_mb_regex_globals_dtor(mbstring_globals TSRMLS_CC);
#endif
@@ -859,18 +952,6 @@ PHP_MSHUTDOWN_FUNCTION(mbstring)
{
UNREGISTER_INI_ENTRIES();
if (MBSTRG(http_input_list)) {
free(MBSTRG(http_input_list));
}
#ifdef ZEND_MULTIBYTE
if (MBSTRG(script_encoding_list)) {
free(MBSTRG(script_encoding_list));
}
#endif /* ZEND_MULTIBYTE */
if (MBSTRG(detect_order_list)) {
free(MBSTRG(detect_order_list));
}
#if HAVE_MBREGEX
PHP_MSHUTDOWN(mb_regex) (INIT_FUNC_ARGS_PASSTHRU);
#endif
@@ -887,51 +968,9 @@ PHP_RINIT_FUNCTION(mbstring)
zend_function *func, *orig;
const struct mb_overload_def *p;
MBSTRG(current_language) = MBSTRG(language);
php_mb_nls_get_default_detect_order_list(MBSTRG(language),
&MBSTRG(default_detect_order_list), &MBSTRG(default_detect_order_list_size));
if (MBSTRG(internal_encoding) == mbfl_no_encoding_invalid) {
char *default_enc = NULL;
switch (MBSTRG(current_language)) {
case mbfl_no_language_uni:
default_enc = "UTF-8";
break;
case mbfl_no_language_japanese:
default_enc = "EUC-JP";
break;
case mbfl_no_language_korean:
default_enc = "EUC-KR";
break;
case mbfl_no_language_simplified_chinese:
default_enc = "EUC-CN";
break;
case mbfl_no_language_traditional_chinese:
default_enc = "EUC-TW";
break;
case mbfl_no_language_russian:
default_enc = "KOI8-R";
break;
case mbfl_no_language_german:
default_enc = "ISO-8859-15";
break;
case mbfl_no_language_armenian:
default_enc = "ArmSCII-8";
break;
case mbfl_no_language_turkish:
default_enc = "ISO-8859-9";
break;
case mbfl_no_language_english:
default:
default_enc = "ISO-8859-1";
break;
}
if (default_enc) {
zend_alter_ini_entry("mbstring.internal_encoding",
sizeof("mbstring.internal_encoding"),
default_enc, strlen(default_enc),
PHP_INI_PERDIR, PHP_INI_STAGE_RUNTIME);
}
{
char *value = zend_ini_string("mbstring.internal_encoding", sizeof("mbstring.internal_encoding"), 0);
_php_mb_ini_mbstring_internal_encoding_set(value, value ? strlen(value): 0 TSRMLS_CC);
}
MBSTRG(current_internal_encoding) = MBSTRG(internal_encoding);
@@ -939,9 +978,7 @@ PHP_RINIT_FUNCTION(mbstring)
MBSTRG(current_filter_illegal_mode) = MBSTRG(filter_illegal_mode);
MBSTRG(current_filter_illegal_substchar) = MBSTRG(filter_illegal_substchar);
if (!MBSTRG(encoding_translation)) {
MBSTRG(illegalchars) = 0;
}
MBSTRG(illegalchars) = 0;
n = 0;
if (MBSTRG(detect_order_list)) {
@@ -1025,9 +1062,14 @@ PHP_RSHUTDOWN_FUNCTION(mbstring)
/* clear overloaded function. */
if (MBSTRG(func_overload)){
p = &(mb_ovld[0]);
while (p->type > 0 && zend_hash_find(EG(function_table), p->save_func, strlen(p->save_func)+1 , (void **)&orig) == SUCCESS) {
zend_hash_update(EG(function_table), p->orig_func, strlen(p->orig_func)+1, orig, sizeof(zend_function), NULL);
zend_hash_del(EG(function_table), p->save_func, strlen(p->save_func)+1);
while (p->type > 0) {
if ((MBSTRG(func_overload) & p->type) == p->type &&
zend_hash_find(EG(function_table), p->save_func,
strlen(p->save_func)+1, (void **)&orig) == SUCCESS) {
zend_hash_update(EG(function_table), p->orig_func, strlen(p->orig_func)+1, orig, sizeof(zend_function), NULL);
zend_hash_del(EG(function_table), p->save_func, strlen(p->save_func)+1);
}
p++;
}
}
@@ -1079,22 +1121,20 @@ PHP_FUNCTION(mb_language)
{
char *name = NULL;
int name_len = 0;
enum mbfl_no_language no_language;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &name, &name_len) == FAILURE) {
return;
}
if (name == NULL) {
RETURN_STRING((char *)mbfl_no_language2name(MBSTRG(current_language)), 1);
RETVAL_STRING((char *)mbfl_no_language2name(MBSTRG(language)), 1);
} else {
no_language = mbfl_name2no_language(name);
if (no_language == mbfl_no_language_invalid) {
if (FAILURE == zend_alter_ini_entry(
"mbstring.language", sizeof("mbstring.language"),
name, name_len, PHP_INI_USER, PHP_INI_STAGE_RUNTIME)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown language \"%s\"", name);
RETURN_FALSE;
RETVAL_FALSE;
} else {
php_mb_nls_get_default_detect_order_list(no_language, &MBSTRG(default_detect_order_list), &MBSTRG(default_detect_order_list_size));
MBSTRG(current_language) = no_language;
RETURN_TRUE;
RETVAL_TRUE;
}
}
}
@@ -1436,10 +1476,10 @@ PHP_FUNCTION(mb_parse_str)
info.force_register_globals = (track_vars_array == NULL);
info.report_errors = 1;
info.to_encoding = MBSTRG(current_internal_encoding);
info.to_language = MBSTRG(current_language);
info.to_language = MBSTRG(language);
info.from_encodings = MBSTRG(http_input_list);
info.num_from_encodings = MBSTRG(http_input_list_size);
info.from_language = MBSTRG(current_language);
info.from_language = MBSTRG(language);
detected = _php_mb_encoding_handler_ex(&info, track_vars_array, encstr TSRMLS_CC);
@@ -1527,7 +1567,7 @@ PHP_FUNCTION(mb_output_handler)
/* feed the string */
mbfl_string_init(&string);
string.no_language = MBSTRG(current_language);
string.no_language = MBSTRG(language);
string.no_encoding = MBSTRG(current_internal_encoding);
string.val = (unsigned char *)arg_string;
string.len = arg_string_len;
@@ -1563,7 +1603,7 @@ PHP_FUNCTION(mb_strlen)
RETURN_FALSE;
}
string.no_language = MBSTRG(current_language);
string.no_language = MBSTRG(language);
if (enc_name == NULL) {
string.no_encoding = MBSTRG(current_internal_encoding);
} else {
@@ -1595,9 +1635,9 @@ PHP_FUNCTION(mb_strpos)
mbfl_string_init(&haystack);
mbfl_string_init(&needle);
haystack.no_language = MBSTRG(current_language);
haystack.no_language = MBSTRG(language);
haystack.no_encoding = MBSTRG(current_internal_encoding);
needle.no_language = MBSTRG(current_language);
needle.no_language = MBSTRG(language);
needle.no_encoding = MBSTRG(current_internal_encoding);
offset = 0;
@@ -1662,9 +1702,9 @@ PHP_FUNCTION(mb_strrpos)
mbfl_string_init(&haystack);
mbfl_string_init(&needle);
haystack.no_language = MBSTRG(current_language);
haystack.no_language = MBSTRG(language);
haystack.no_encoding = MBSTRG(current_internal_encoding);
needle.no_language = MBSTRG(current_language);
needle.no_language = MBSTRG(language);
needle.no_encoding = MBSTRG(current_internal_encoding);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|Zs", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &zoffset, &enc_name, &enc_name_len) == FAILURE) {
@@ -1810,9 +1850,9 @@ PHP_FUNCTION(mb_strstr)
mbfl_string_init(&haystack);
mbfl_string_init(&needle);
haystack.no_language = MBSTRG(current_language);
haystack.no_language = MBSTRG(language);
haystack.no_encoding = MBSTRG(current_internal_encoding);
needle.no_language = MBSTRG(current_language);
needle.no_language = MBSTRG(language);
needle.no_encoding = MBSTRG(current_internal_encoding);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|bs", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &part, &enc_name, &enc_name_len) == FAILURE) {
@@ -1868,9 +1908,9 @@ PHP_FUNCTION(mb_strrchr)
mbfl_string_init(&haystack);
mbfl_string_init(&needle);
haystack.no_language = MBSTRG(current_language);
haystack.no_language = MBSTRG(language);
haystack.no_encoding = MBSTRG(current_internal_encoding);
needle.no_language = MBSTRG(current_language);
needle.no_language = MBSTRG(language);
needle.no_encoding = MBSTRG(current_internal_encoding);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|bs", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &part, &enc_name, &enc_name_len) == FAILURE) {
@@ -1926,9 +1966,9 @@ PHP_FUNCTION(mb_stristr)
char *from_encoding = (char*)mbfl_no2preferred_mime_name(MBSTRG(current_internal_encoding));
mbfl_string_init(&haystack);
mbfl_string_init(&needle);
haystack.no_language = MBSTRG(current_language);
haystack.no_language = MBSTRG(language);
haystack.no_encoding = MBSTRG(current_internal_encoding);
needle.no_language = MBSTRG(current_language);
needle.no_language = MBSTRG(language);
needle.no_encoding = MBSTRG(current_internal_encoding);
@@ -1984,9 +2024,9 @@ PHP_FUNCTION(mb_strrichr)
char *from_encoding = (char*)mbfl_no2preferred_mime_name(MBSTRG(current_internal_encoding));
mbfl_string_init(&haystack);
mbfl_string_init(&needle);
haystack.no_language = MBSTRG(current_language);
haystack.no_language = MBSTRG(language);
haystack.no_encoding = MBSTRG(current_internal_encoding);
needle.no_language = MBSTRG(current_language);
needle.no_language = MBSTRG(language);
needle.no_encoding = MBSTRG(current_internal_encoding);
@@ -2038,9 +2078,9 @@ PHP_FUNCTION(mb_substr_count)
mbfl_string_init(&haystack);
mbfl_string_init(&needle);
haystack.no_language = MBSTRG(current_language);
haystack.no_language = MBSTRG(language);
haystack.no_encoding = MBSTRG(current_internal_encoding);
needle.no_language = MBSTRG(current_language);
needle.no_language = MBSTRG(language);
needle.no_encoding = MBSTRG(current_internal_encoding);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|s", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &enc_name, &enc_name_len) == FAILURE) {
@@ -2078,7 +2118,7 @@ PHP_FUNCTION(mb_substr)
mbfl_string string, result, *ret;
mbfl_string_init(&string);
string.no_language = MBSTRG(current_language);
string.no_language = MBSTRG(language);
string.no_encoding = MBSTRG(current_internal_encoding);
argc = ZEND_NUM_ARGS();
@@ -2170,7 +2210,7 @@ PHP_FUNCTION(mb_strcut)
mbfl_string string, result, *ret;
mbfl_string_init(&string);
string.no_language = MBSTRG(current_language);
string.no_language = MBSTRG(language);
string.no_encoding = MBSTRG(current_internal_encoding);
argc = ZEND_NUM_ARGS();
@@ -2260,7 +2300,7 @@ PHP_FUNCTION(mb_strwidth)
mbfl_string_init(&string);
string.no_language = MBSTRG(current_language);
string.no_language = MBSTRG(language);
string.no_encoding = MBSTRG(current_internal_encoding);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", (char **)&string.val, &string.len, &enc_name, &enc_name_len) == FAILURE) {
@@ -2294,9 +2334,9 @@ PHP_FUNCTION(mb_strimwidth)
mbfl_string_init(&string);
mbfl_string_init(&marker);
string.no_language = MBSTRG(current_language);
string.no_language = MBSTRG(language);
string.no_encoding = MBSTRG(current_internal_encoding);
marker.no_language = MBSTRG(current_language);
marker.no_language = MBSTRG(language);
marker.no_encoding = MBSTRG(current_internal_encoding);
marker.val = NULL;
marker.len = 0;
@@ -2392,7 +2432,7 @@ MBSTRING_API char * php_mb_convert_encoding(char *input, size_t length, char *_t
mbfl_string_init(&result);
from_encoding = MBSTRG(current_internal_encoding);
string.no_encoding = from_encoding;
string.no_language = MBSTRG(current_language);
string.no_language = MBSTRG(language);
string.val = (unsigned char *)input;
string.len = length;
@@ -2662,7 +2702,7 @@ PHP_FUNCTION(mb_detect_encoding)
convert_to_string_ex(arg_str);
mbfl_string_init(&string);
string.no_language = MBSTRG(current_language);
string.no_language = MBSTRG(language);
string.val = (unsigned char *)Z_STRVAL_PP(arg_str);
string.len = Z_STRLEN_PP(arg_str);
ret = mbfl_identify_encoding_name(&string, elist, size, strict);
@@ -2694,122 +2734,6 @@ PHP_FUNCTION(mb_list_encodings)
}
/* }}} */
/* {{{ proto array mb_list_encodings_alias_names([string encoding])
Returns an array of all supported alias encodings */
PHP_FUNCTION(mb_list_encodings_alias_names)
{
const mbfl_encoding **encodings;
const mbfl_encoding *encoding;
enum mbfl_no_encoding no_encoding;
int i, j;
zval *row;
char *name = NULL;
int name_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &name, &name_len) == FAILURE) {
RETURN_FALSE;
}
if (name == NULL) {
array_init(return_value);
i = 0;
encodings = mbfl_get_supported_encodings();
while ((encoding = encodings[i++]) != NULL) {
MAKE_STD_ZVAL(row);
array_init(row);
if (encoding->aliases != NULL) {
j = 0;
while ((*encoding->aliases)[j] != NULL) {
add_next_index_string(row, (char *)(*encoding->aliases)[j], 1);
j++;
}
}
add_assoc_zval(return_value, (char *) encoding->name, row);
}
} else {
no_encoding = mbfl_name2no_encoding(name);
if (no_encoding == mbfl_no_encoding_invalid) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", name);
RETURN_FALSE;
}
name = (char *)mbfl_no_encoding2name(no_encoding);
if (name != NULL) {
i = 0;
encodings = mbfl_get_supported_encodings();
while ((encoding = encodings[i++]) != NULL) {
if (strcmp(encoding->name, name) != 0){ continue; }
array_init(return_value);
if (encoding->aliases != NULL) {
j = 0;
while ((*encoding->aliases)[j] != NULL) {
add_next_index_string(return_value, (char *)(*encoding->aliases)[j], 1);
j++;
}
}
break;
}
} else {
RETURN_FALSE;
}
}
}
/* }}} */
/* {{{ proto mixed mb_list_mime_names([string encoding])
Returns an array or string of all supported mime names */
PHP_FUNCTION(mb_list_mime_names)
{
const mbfl_encoding **encodings;
const mbfl_encoding *encoding;
enum mbfl_no_encoding no_encoding;
int i;
char *name = NULL;
int name_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &name, &name_len) == FAILURE) {
RETURN_FALSE;
}
if (name == NULL) {
array_init(return_value);
i = 0;
encodings = mbfl_get_supported_encodings();
while ((encoding = encodings[i++]) != NULL) {
if(encoding->mime_name != NULL) {
add_assoc_string(return_value, (char *) encoding->name, (char *) encoding->mime_name, 1);
} else{
add_assoc_string(return_value, (char *) encoding->name, "", 1);
}
}
} else {
no_encoding = mbfl_name2no_encoding(name);
if (no_encoding == mbfl_no_encoding_invalid) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", name);
RETURN_FALSE;
}
name = (char *)mbfl_no_encoding2name(no_encoding);
if (name != NULL) {
i = 0;
encodings = mbfl_get_supported_encodings();
while ((encoding = encodings[i++]) != NULL) {
if (strcmp(encoding->name, name) != 0){ continue; }
if(encoding->mime_name != NULL) {
RETURN_STRING((char *) encoding->mime_name, 1);
}
break;
}
RETURN_STRING("", 1);
} else {
RETURN_FALSE;
}
}
}
/* }}} */
/* {{{ proto string mb_encode_mimeheader(string str [, string charset [, string transfer-encoding [, string linefeed [, int indent]]]])
Converts the string to MIME "encoded-word" in the format of =?charset?(B|Q)?encoded_string?= */
PHP_FUNCTION(mb_encode_mimeheader)
@@ -2825,7 +2749,7 @@ PHP_FUNCTION(mb_encode_mimeheader)
long indent = 0;
mbfl_string_init(&string);
string.no_language = MBSTRG(current_language);
string.no_language = MBSTRG(language);
string.no_encoding = MBSTRG(current_internal_encoding);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sssl", (char **)&string.val, &string.len, &charset_name, &charset_name_len, &trans_enc_name, &trans_enc_name_len, &linefeed, &linefeed_len, &indent) == FAILURE) {
@@ -2842,7 +2766,7 @@ PHP_FUNCTION(mb_encode_mimeheader)
RETURN_FALSE;
}
} else {
const mbfl_language *lang = mbfl_no2language(MBSTRG(current_language));
const mbfl_language *lang = mbfl_no2language(MBSTRG(language));
if (lang != NULL) {
charset = lang->mail_charset;
transenc = lang->mail_header_encoding;
@@ -2874,7 +2798,7 @@ PHP_FUNCTION(mb_decode_mimeheader)
mbfl_string string, result, *ret;
mbfl_string_init(&string);
string.no_language = MBSTRG(current_language);
string.no_language = MBSTRG(language);
string.no_encoding = MBSTRG(current_internal_encoding);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", (char **)&string.val, &string.len) == FAILURE) {
@@ -2903,7 +2827,7 @@ PHP_FUNCTION(mb_convert_kana)
int encname_len;
mbfl_string_init(&string);
string.no_language = MBSTRG(current_language);
string.no_language = MBSTRG(language);
string.no_encoding = MBSTRG(current_internal_encoding);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ss", (char **)&string.val, &string.len, &optstr, &optstr_len, &encname, &encname_len) == FAILURE) {
@@ -3035,7 +2959,7 @@ PHP_FUNCTION(mb_convert_variables)
mbfl_string_init(&result);
from_encoding = MBSTRG(current_internal_encoding);
string.no_encoding = from_encoding;
string.no_language = MBSTRG(current_language);
string.no_language = MBSTRG(language);
/* pre-conversion encoding */
elist = NULL;
@@ -3239,7 +3163,7 @@ php_mb_numericentity_exec(INTERNAL_FUNCTION_PARAMETERS, int type)
convert_to_string_ex(arg1);
mbfl_string_init(&string);
string.no_language = MBSTRG(current_language);
string.no_language = MBSTRG(language);
string.no_encoding = MBSTRG(current_internal_encoding);
string.val = (unsigned char *)Z_STRVAL_PP(arg1);
string.len = Z_STRLEN_PP(arg1);
@@ -3578,7 +3502,7 @@ PHP_FUNCTION(mb_send_mail)
tran_cs = mbfl_no_encoding_utf8;
head_enc = mbfl_no_encoding_base64;
body_enc = mbfl_no_encoding_base64;
lang = mbfl_no2language(MBSTRG(current_language));
lang = mbfl_no2language(MBSTRG(language));
if (lang != NULL) {
tran_cs = lang->mail_charset;
head_enc = lang->mail_header_encoding;
@@ -3627,7 +3551,7 @@ PHP_FUNCTION(mb_send_mail)
if (strcasecmp(param_name, "charset") == 0) {
enum mbfl_no_encoding _tran_cs = tran_cs;
charset = php_strtok_r(NULL, "= ", &tmp);
charset = php_strtok_r(NULL, "= \"", &tmp);
if (charset != NULL) {
_tran_cs = mbfl_name2no_encoding(charset);
}
@@ -3696,7 +3620,7 @@ PHP_FUNCTION(mb_send_mail)
/* Subject: */
if (subject != NULL && subject_len >= 0) {
orig_str.no_language = MBSTRG(current_language);
orig_str.no_language = MBSTRG(language);
orig_str.val = (unsigned char *)subject;
orig_str.len = subject_len;
orig_str.no_encoding = MBSTRG(current_internal_encoding);
@@ -3715,7 +3639,7 @@ PHP_FUNCTION(mb_send_mail)
/* message body */
if (message != NULL) {
orig_str.no_language = MBSTRG(current_language);
orig_str.no_language = MBSTRG(language);
orig_str.val = message;
orig_str.len = message_len;
orig_str.no_encoding = MBSTRG(current_internal_encoding);
@@ -3832,7 +3756,7 @@ PHP_FUNCTION(mb_get_info)
char *name;
const struct mb_overload_def *over_func;
zval *row1, *row2;
const mbfl_language *lang = mbfl_no2language(MBSTRG(current_language));
const mbfl_language *lang = mbfl_no2language(MBSTRG(language));
enum mbfl_no_encoding *entry;
#ifdef ZEND_MULTIBYTE
zval *row3;
@@ -3885,7 +3809,7 @@ PHP_FUNCTION(mb_get_info)
} else {
add_assoc_string(return_value, "encoding_translation", "Off", 1);
}
if ((name = (char *)mbfl_no_language2name(MBSTRG(current_language))) != NULL) {
if ((name = (char *)mbfl_no_language2name(MBSTRG(language))) != NULL) {
add_assoc_string(return_value, "language", name, 1);
}
n = MBSTRG(current_detect_order_list_size);
@@ -3980,7 +3904,7 @@ PHP_FUNCTION(mb_get_info)
RETVAL_STRING("Off", 1);
}
} else if (!strcasecmp("language", typ)) {
if ((name = (char *)mbfl_no_language2name(MBSTRG(current_language))) != NULL) {
if ((name = (char *)mbfl_no_language2name(MBSTRG(language))) != NULL) {
RETVAL_STRING(name, 1);
}
} else if (!strcasecmp("detect_order", typ)) {
@@ -4071,14 +3995,12 @@ PHP_FUNCTION(mb_check_encoding)
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create converter");
RETURN_FALSE;
}
mbfl_buffer_converter_illegal_mode(convd, MBSTRG(current_filter_illegal_mode));
mbfl_buffer_converter_illegal_substchar(convd, MBSTRG(current_filter_illegal_substchar));
mbfl_buffer_converter_illegal_mode(convd, MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE);
mbfl_buffer_converter_illegal_substchar(convd, 0);
/* initialize string */
mbfl_string_init(&string);
mbfl_string_init_set(&string, mbfl_no_language_neutral, no_encoding);
mbfl_string_init(&result);
string.no_encoding = no_encoding;
string.no_language = MBSTRG(current_language);
string.val = (unsigned char *)var;
string.len = var_len;
@@ -4086,18 +4008,13 @@ PHP_FUNCTION(mb_check_encoding)
illegalchars = mbfl_buffer_illegalchars(convd);
mbfl_buffer_converter_delete(convd);
if (ret != NULL) {
MBSTRG(illegalchars) += illegalchars;
if (illegalchars == 0 && strncmp(string.val, ret->val, string.len) == 0) {
efree(ret->val);
RETURN_TRUE;
} else {
efree(ret->val);
RETURN_FALSE;
}
} else {
RETURN_FALSE;
}
RETVAL_FALSE;
if (ret != NULL) {
if (illegalchars == 0 && string.len == result.len && memcmp(string.val, result.val, string.len) == 0) {
RETVAL_TRUE;
}
mbfl_string_clear(&result);
}
}
/* }}} */
@@ -4240,7 +4157,7 @@ MBSTRING_API int php_mb_gpc_encoding_converter(char **str, int *len, int num, co
mbfl_string_init(&string);
mbfl_string_init(&result);
string.no_encoding = from_encoding;
string.no_language = MBSTRG(current_language);
string.no_language = MBSTRG(language);
for (i=0; i<num; i++){
string.val = (char*)str[i];
@@ -4321,7 +4238,7 @@ MBSTRING_API int php_mb_gpc_encoding_detector(char **arg_string, int *arg_length
}
mbfl_string_init(&string);
string.no_language = MBSTRG(current_language);
string.no_language = MBSTRG(language);
identd = mbfl_encoding_detector_new(elist, size, MBSTRG(strict_detection));
@@ -4359,9 +4276,9 @@ MBSTRING_API int php_mb_stripos(int mode, char *old_haystack, int old_haystack_l
mbfl_string_init(&haystack);
mbfl_string_init(&needle);
haystack.no_language = MBSTRG(current_language);
haystack.no_language = MBSTRG(language);
haystack.no_encoding = MBSTRG(current_internal_encoding);
needle.no_language = MBSTRG(current_language);
needle.no_language = MBSTRG(language);
needle.no_encoding = MBSTRG(current_internal_encoding);
do {
@@ -4487,7 +4404,7 @@ char* php_mb_encoding_detector(const char *arg_string, int arg_length, char *arg
}
mbfl_string_init(&string);
string.no_language = MBSTRG(current_language);
string.no_language = MBSTRG(language);
string.val = (char*)arg_string;
string.len = arg_length;
ret = mbfl_identify_encoding_name(&string, elist, size, 0);
@@ -4525,7 +4442,7 @@ int php_mb_encoding_converter(char **to, int *to_length, const char *from,
mbfl_string_init(&string);
mbfl_string_init(&result);
string.no_encoding = from_encoding;
string.no_language = MBSTRG(current_language);
string.no_language = MBSTRG(language);
string.val = (char*)from;
string.len = from_length;
@@ -4560,7 +4477,7 @@ int php_mb_oddlen(const char *string, int length, const char *encoding TSRMLS_DC
mbfl_string mb_string;
mbfl_string_init(&mb_string);
mb_string.no_language = MBSTRG(current_language);
mb_string.no_language = MBSTRG(language);
mb_string.no_encoding = mbfl_name2no_encoding(encoding);
mb_string.val = (char*)string;
mb_string.len = length;
Loaded 100 of 670 files, more files were not shown because too many files have changed in this diff. Show more