Compare commits

..
Author SHA1 Message Date
SVN Migration aa3cf00c7f This commit was manufactured by cvs2svn to create tag 'php_4_3_9RC3'. 2004-09-14 04:28:48 +00:00
Ilia Alshanetsky b30885d8a3 4.3.9RC3 2004-09-14 04:28:47 +00:00
Rainer Schaaf 4a202474ef undo of removal of these files.
The removal was done because of Bug #29297, but it was the wrong time to do this now.
2004-09-13 17:12:13 +00:00
Stefan Esser a975e43310 MFH 2004-09-13 16:00:50 +00:00
Rainer Schaaf 0abfed95e3 removed PDFlib extension from PHP_4_3 branch too (is available in PECL now). 2004-09-13 15:12:25 +00:00
Stefan Esser 3e7f149be6 MFH 2004-09-12 10:46:49 +00:00
Rasmus Lerdorf 18fdb3b33e Stop at the index on an unmatched [ 2004-09-09 16:07:53 +00:00
Ilia Alshanetsky 5949c3968e MFH: Adjusted input check. 2004-09-03 03:36:21 +00:00
Ilia Alshanetsky ab4433e348 MFH: Fixed bug #29925 (Added a check to prevent illegal characters in
session key).
2004-09-03 00:53:46 +00:00
Stanislav Malyshev d84d278900 this crashed if some of the shutdown handlers called some file stat function 2004-09-02 09:38:56 +00:00
Derick Rethans 8a17d68216 - MFH: Added test for bug #29944. 2004-09-02 06:34:12 +00:00
Sara Golemon 8c9126e101 MFH: Use user_agent ini setting if it's available. 2004-08-31 20:12:56 +00:00
Stanislav Malyshev 3a27e5a0c1 if not using Zend's alloc, don't touch _emalloc 2004-08-31 15:32:09 +00:00
Ilia Alshanetsky 8a12f7d72d back to dev. 2004-08-31 14:27:09 +00:00
Ilia Alshanetsky 54ec8a53d3 4.3.9RC2 2004-08-31 14:05:30 +00:00
Joe Orton 4265c3d6f4 MFH: Do not rely on handling of integers which might be outside the
range of a 32-bit signed long.
2004-08-31 12:13:41 +00:00
Joe Orton 51452106e7 MFH: fix gettimeofday() tests to not fail if the same time is
returned by successive calls.
2004-08-31 10:34:15 +00:00
Antony Dovgal 4ed862d6fb MFH: this file shouldn't be in the repository at all 2004-08-31 08:32:25 +00:00
Ilia Alshanetsky 62a06abf37 MFH: Added missing input validation to dio_write(). 2004-08-30 22:21:18 +00:00
Antony Dovgal 66b8788497 MFH: add testcase for bug #29893 2004-08-30 09:14:55 +00:00
SVN Migration bc7fd9511f This commit was manufactured by cvs2svn to create branch 'PHP_4_3'. 2004-08-30 09:07:18 +00:00
Marcus Boerger 77b928515a MFH: Bugfix #29882 isset crashes on arrays 2004-08-29 16:53:32 +00:00
Sergey Kartashoff 4cebdf96d6 - A fix for building of shared mnogosearch module 2004-08-29 14:18:15 +00:00
Ilia Alshanetsky 92b51bfe9d MFH: Fixed a nasty resource/memory/disk-space leak when opening zlib files
via wrapper stacking ala compress.zlib://http://...
2004-08-26 23:36:11 +00:00
Thies C. Arntzen 5fd50121a2 @- Fixed bug #29838 Memory leak in sprintf argument swapping. (Thies)
# by backporting one line from HEAD.
2004-08-26 13:41:59 +00:00
Andrei Zmievski ef38483ca3 Rewrite cache clean-up using zend_hash_apply_with_argument(). 2004-08-25 20:47:40 +00:00
Ilia Alshanetsky 1efef3488f Fixed operations on remote bzip2 compressed files ala:
compress.bzip2://http://downloads.php.net/ilia/php-4.3.5RC1.tar.bz2

Patch by Wez (MFH from HEAD)
2004-08-25 14:22:48 +00:00
Sara Golemon 0d73873aad MFH (r1.160) TSRM fix 2004-08-25 04:42:54 +00:00
Andrei Zmievski 6c42291ed6 Implement periodic PCRE compiled regexp cache cleanup, to avoid memory
exhaustion.
2004-08-24 20:57:32 +00:00
Frank M. Kromann 70e839b911 Fix a possible crash in fbsql_database() if the function was called before a connection was made. 2004-08-24 18:00:05 +00:00
Ilia Alshanetsky 3bdf8fda7f MFH: Fixed possible crash inside dio_read(). 2004-08-23 17:27:53 +00:00
Ilia Alshanetsky 53b3b33aae Removed unneeded bits. 2004-08-20 13:52:15 +00:00
Ilia Alshanetsky a05ffc841e MFH: Added more missing cURL options. 2004-08-20 00:57:35 +00:00
Ilia Alshanetsky 1b480cd24b MFH: Fixed bug #29753 (mcal_fetch_event() allows 2nd argument to be optional). 2004-08-20 00:46:49 +00:00
Brian France 88e1d65564 [MFH] If you send a post with a content-type header and then the next post without the content-type header, raw_post_data will not be set. This is because SG(request_info).post_entry is set to the first requests function pointer which makes it follow the wrong code path. 2004-08-19 20:35:36 +00:00
Ilia Alshanetsky 64245f3654 MFH: Fixed bug #29727 (Added missing CURL authentication directives). 2004-08-18 21:30:40 +00:00
Antony Dovgal 74bbb513a2 typo in config.m4 (potential configuration problem with Stronghold) 2004-08-18 07:16:46 +00:00
Antony Dovgal 35bf13d97f fix #29625 (no quotes around the shell variable's value cause ./configure to fail) 2004-08-18 05:14:16 +00:00
Antony Dovgal 4d03a6980d MFH: fix more typos in php.ini 2004-08-18 05:05:23 +00:00
Ilia Alshanetsky a0902bfa37 Fixed bug #29719 (fgetcsv() has problem parsing strings ending with escaped
enclosures).
2004-08-17 14:10:03 +00:00
Antony Dovgal 2086644e2b MFH: fix typo 2004-08-17 10:58:34 +00:00
Ilia Alshanetsky 7be45c1573 MFH: Fixed bug #29594 (Use PHP's own tmpfile() implementation). 2004-08-16 23:08:54 +00:00
Zeev Suraski e749e406d8 *** empty log message *** 2004-08-16 12:34:46 +00:00
Zeev Suraski a7a797726e Fix an OLDIE fd leak 2004-08-16 12:23:06 +00:00
Rob Richards 541f96e1b6 BFN 2004-08-13 11:38:48 +00:00
Rob Richards 11d323faae Fixed bug #29599 (domxml_error segfaults another apache module) 2004-08-13 11:38:03 +00:00
Chuck Hagenbuch 61ff34a945 More spaces -> tabs. 2004-08-12 19:32:59 +00:00
Ilia Alshanetsky c6debc5600 MFH: Properly fix the msgno check inside imap_fetchbody(). 2004-08-12 19:20:19 +00:00
Chuck Hagenbuch d6316ebef3 MFH: fix. 2004-08-12 18:02:14 +00:00
Marcus Boerger 0e39d9932a MFH: Change to use md5_file() 2004-08-12 00:38:20 +00:00
Marcus Boerger 4577ef345d MFH: make bison --version independant 2004-08-11 23:56:56 +00:00
Ilia Alshanetsky c38946f838 MFH: Fixed memory leak. 2004-08-11 23:25:54 +00:00
Ilia Alshanetsky 9409252d3f back to dev. 2004-08-11 23:19:44 +00:00
Ilia Alshanetsky 2e63531d77 4.3.9RC1 is a go. 2004-08-11 22:42:47 +00:00
Ilia Alshanetsky 54b5111a98 Bug fixing news. 2004-08-11 22:40:46 +00:00
Sara Golemon bc8dccc7e2 MFH: Fix format specifiers 2004-08-11 04:31:03 +00:00
Andi Gutmans 8592a15028 - MF PHP_5_0 2004-08-10 07:00:11 +00:00
Moriyoshi Koizumi de231c928c - MFH: Bugfix #29493 (extract(array, EXTR_REFS) misbehaves with elements
referred twice or more times)
2004-08-10 06:04:12 +00:00
Ilia Alshanetsky ca19c39b62 MFH: Fixed bug #29581 (Typo inside php.ini comments for mysql.trace_mode). 2004-08-10 00:44:26 +00:00
Andi Gutmans 3dd7a7f8b4 - Update credits for PHP docs 2004-08-09 21:52:45 +00:00
Antony Dovgal 35a2f5306d MFH: remove all references to @ thing, as it's not recommended 2004-08-05 14:18:55 +00:00
Edin Kadribasic c008ca83c4 MFH: make it build on windows 2004-08-04 00:08:16 +00:00
Frank M. Kromann d0bfbece1a Oops. remember to save the project file before commiting. 2004-08-03 22:06:15 +00:00
Frank M. Kromann 1f13e32204 Updating library name to iconv.lib 2004-08-03 22:04:34 +00:00
Greg Beaver bcac9d3773 commit for win32 - binary so line endings are always preserved 2004-08-03 04:31:59 +00:00
Frank M. Kromann 041b586c59 Add missing header for def. of struct timeval. 2004-07-30 17:07:03 +00:00
Frank M. Kromann 77d6edf304 Adding new win32 globals to project 2004-07-30 17:06:07 +00:00
Frank M. Kromann bb1624acd9 Add missing header for win32 builds 2004-07-30 16:52:35 +00:00
Frank M. Kromann e212b6c56c Fix line endings 2004-07-30 16:49:38 +00:00
Wez Furlong 043fdb5fb1 MFH: win32 zts fix 2004-07-30 14:38:29 +00:00
Wez Furlong 429a6bc483 MFH: win32 zts fixes 2004-07-30 14:37:17 +00:00
Ilia Alshanetsky ef6cfdbec3 MFH: Fixed bug #29443 (Sanity check for wbmp detection). 2004-07-30 01:10:46 +00:00
SVN Migration 00f869c0a7 This commit was manufactured by cvs2svn to create branch 'PHP_4_3'. 2004-07-29 03:58:01 +00:00
Ilia Alshanetsky 7869874e5a MFH: Added missing comma. 2004-07-27 12:44:44 +00:00
Ilia Alshanetsky 7456da1533 MFH: Fixed bug #29349 (imagecreatefromstring() crashes with external GD
library).
2004-07-27 00:27:10 +00:00
Ilia Alshanetsky 9cb224eafe MFH: Fixed bug #29369 (Uploaded files with ' or " in their names get their
names truncated at those characters).
2004-07-25 19:19:32 +00:00
Edin Kadribasic cd774e73fb Fix .dsp 2004-07-23 02:43:10 +00:00
Edin Kadribasic 0d1c4f234b MFH: Updated version number 2004-07-23 02:28:51 +00:00
Ilia Alshanetsky 2b73a58a4c MFH: Fixed bug #29333 (output_buffering + trans_sess_id can corrupt output) 2004-07-23 02:05:55 +00:00
Stefan Esser f647379a3d MFH 2004-07-22 23:09:24 +00:00
SVN Migration 098de0df5d This commit was manufactured by cvs2svn to create branch 'PHP_4_3'. 2004-07-22 22:39:00 +00:00
Edin Kadribasic 510a2806b3 MFH 2004-07-21 23:26:47 +00:00
Ilia Alshanetsky cc47667fb0 MFH: Fixed bug #29209 (imap_fetchbody() doesn't check message index). 2004-07-21 21:57:13 +00:00
Stefan Esser 42a50158bc Merge all not yet merged security fixes into the 4_3 branch 2004-07-21 16:25:37 +00:00
Moriyoshi Koizumi 6957c8ab5a - MFH (sapi_apache2.c: 1.41): request_dtor() should be called if a fatal
error occurs during activation phase.
# 4.3.8 patches need to be committed to this branch, otherwise...
2004-07-20 20:48:01 +00:00
Moriyoshi Koizumi 1802b2c9dd - MFH (ctype.c: 1.31): Correct range checks.
- MFH (ctype.c: 1.31): Normalize negative values.
2004-07-20 20:10:04 +00:00
Ilia Alshanetsky e3a480faf8 MFH: Fixed bug #29226 (ctype_* functions missing validation of numeric
string representations).
2004-07-20 01:03:34 +00:00
Ilia Alshanetsky 53cc10e1c2 MFH: Fixed bug #28633 (sprintf incorrectly adding padding to floats). 2004-07-18 17:29:45 +00:00
SVN Migration 619f6faa20 This commit was manufactured by cvs2svn to create branch 'PHP_4_3'. 2004-07-18 17:27:50 +00:00
Sara Golemon 184917eb1f Bugfix# 29114 Potential double free in php_stat 2004-07-16 05:08:15 +00:00
Ilia Alshanetsky 4bed8c9537 MFH: Fixed bug #28800 (strings beginning with "inf" improperly converted). 2004-07-16 02:24:46 +00:00
SVN Migration 235ef76a89 This commit was manufactured by cvs2svn to create branch 'PHP_4_3'. 2004-07-16 02:03:26 +00:00
Ilia Alshanetsky 9638f4c8ff MFH: Fixed Bug #29075 (strnatcmp() incorrectly handles whitespace). 2004-07-15 01:46:28 +00:00
SVN Migration d61681ffe8 This commit was manufactured by cvs2svn to create branch 'PHP_4_3'. 2004-07-15 01:26:04 +00:00
Edin Kadribasic bfe60f6a55 MFH: Made php -m output sorted case-insensitevly 2004-07-14 22:38:18 +00:00
Stefan Esser 53f837720f Ups... CAN-2004-0595 regression test went into wrong branch... 2004-07-14 11:32:47 +00:00
Marcus Boerger 5a3f8c4864 BFN 2004-07-13 19:33:35 +00:00
Marcus Boerger ca71f35892 BFN 2004-07-13 19:30:24 +00:00
Wez Furlong 14e3bbd0ca MFH: add missing break 2004-07-13 17:15:13 +00:00
Derick Rethans 2419d2e170 - Bump version numbers in the PHP_4_3 branch. 2004-07-13 12:58:49 +00:00
Timm Friebe c94734d283 - Fixed bug #29064 (Exact numeric/decimal/money datatypes lose precision)
- Fixed bug #27843 (sybase_query() triggers (spurious?) notices when
  query is a stored procedure)
- Fixed multiple memory leaks with sybase_unbuffered_query()
- Changed sybase_query() to ignore store_results = false in  buffering
  mode, it would yield unpredictable results
- Fixed sybase_unbuffered_query() when used with store_results = false
- Changed sybase_fetch_object() to ignore second argument when passed
  as NULL
- Made sybase_data_seek() error message more verbose
- Fixed memory leak in shutdown when not all rows where selected in an
  unbuffered query
CVS ----------------------------------------------------------------------
2004-07-12 21:07:21 +00:00
Antony Dovgal a47aa0e936 MFH: fix #28978 (multiple OCIBindByName on the same placeholder eats memory) 2004-07-12 07:42:41 +00:00
Andrey Hristov 87631a8713 news stuff 2004-07-11 21:38:56 +00:00
Andrey Hristov 6b2dc66a5b MFH:
fixing bug #29038
2004-07-11 21:30:19 +00:00
Andrey Hristov 9947c89d6e MFH:
fixed bug #28974 : overflow in array_slice()
The same kind of overflow appeared in array_splice(), substr() and
substr_replace()
2004-07-11 21:24:47 +00:00
SVN Migration 0fb6cde415 This commit was manufactured by cvs2svn to create branch 'PHP_4_3'. 2004-07-11 21:15:05 +00:00
Wez Furlong 9fb029f257 MFH: RIP: Greedy read problems 2004-07-10 10:54:27 +00:00
Ilia Alshanetsky aaaa6ce403 MFH: Fixed bug #29049 (array sorting via user function/method does not
validate it).
2004-07-08 17:07:25 +00:00
Ilia Alshanetsky 3e7cb1286f MFH: Fixed bug #29034 (wordwrap() returns a boolean when passed empty
string).
2004-07-06 22:16:47 +00:00
Sascha Schumann ff9097524c add 2004-07-05 11:44:19 +00:00
Sascha Schumann d8e1afab0b - revert to proper behaviour. The environment variable PHP_FCGI_CHILDREN
must be explicitly set to != 0 to make the fastcgi-enabled binary
  act as a standalone fcgi server.
2004-07-05 11:40:28 +00:00
Ilia Alshanetsky fea008a67f MFH: Fixed bug #28963 (Missing space for \0 in address allocation). 2004-07-04 16:53:02 +00:00
Pierre Joye 1857c0d17f - Fix #28984, using full transparent segfauls in imagefill
(NB: imagefill is broken in HEAD, same code)
- Add testcase
2004-07-03 15:32:33 +00:00
Wez Furlong a7067ff166 Fix #28996: unix sockets leak when connection fails 2004-07-02 17:23:07 +00:00
Zeev Suraski 8b504aad98 MFH (more or less) registry-based setting for the location of php.ini 2004-07-01 15:43:40 +00:00
Sterling Hughes 8dfbcec9a6 mfh 2004-07-01 06:51:48 +00:00
Frank M. Kromann 4b40bdbc00 Fix for #28512. news entry 2004-06-30 19:53:13 +00:00
Frank M. Kromann f4c286ce51 MFH: Fix for #28512. Allocate enough space to store data 2004-06-30 19:47:18 +00:00
Ilia Alshanetsky 549b2ae9fe MFH: Another instance where alloca() is not needed. 2004-06-30 13:43:22 +00:00
Ilia Alshanetsky d5edc8497b MFH: Do not use alloca() where it can be abused through user input. 2004-06-30 01:12:09 +00:00
Wez Furlong 8cafde7940 Fix for Bug #28964 fread "greedy" behaviour 2004-06-29 21:51:28 +00:00
Derick Rethans f864a93b00 - MFH: Fixed bug with leap year checking. 2004-06-28 14:35:41 +00:00
Ard Biesheuvel 1556fa2665 BFN 2004-06-28 11:30:03 +00:00
Ard Biesheuvel fe68f62429 Fixed bug #28897 (-1 returned as -0.000 for 64-bit scaled int) 2004-06-28 11:24:55 +00:00
Moriyoshi Koizumi 1d14c2f46f - This one should've been here, not in HEAD. 2004-06-26 17:06:22 +00:00
Uwe Schindler a4b9d8117f MFH: replace strncpy with strlcpy 2004-06-26 10:30:22 +00:00
Stefan Esser e7252868ce MFH 2004-06-26 07:47:30 +00:00
Edin Kadribasic 435da1b34e Memory leak fix (patch by Joe Orton) 2004-06-25 12:51:38 +00:00
Ilia Alshanetsky 0a968e6e62 MFH: Added missing safe_mode & open_basedir checks. 2004-06-24 00:48:56 +00:00
Sara Golemon 78e6f958af BFN and order fix 2004-06-23 23:31:18 +00:00
Moriyoshi Koizumi 384900bd89 - Modify test case for wider coverage. 2004-06-23 22:20:44 +00:00
Moriyoshi Koizumi a3a9ff1309 - Fix buf #28466 (mbstring_convert_variables() problem). 2004-06-23 22:07:01 +00:00
Sascha Schumann 0cc1014ebf - fix logic. if the client already sent us the cookie, we don't
need to send it again.  if the id has been changed, we need to
  update the client side.
2004-06-23 16:29:16 +00:00
Uwe Schindler aed8e18415 Addendum to bug #28878: change ini keys as PHP_INI_SYSTEM
Also: Adding "bucket" parameter to non-ini-keys, Elemination of double CONTENT_TYPE/_LENGTH environment variables
2004-06-23 13:05:12 +00:00
Andrei Zmievski 669897add1 pcre_info() is deprecated. Hence, update to pcre_fullinfo() and do more
rigorous checking of return values.
2004-06-22 22:20:38 +00:00
Ilia Alshanetsky 5584e5ef18 MFH: Fixed possible buffer overflow. 2004-06-22 20:27:50 +00:00
Uwe Schindler a84df36b1e Fix bug #28878: php.ini values in php4_execute 2004-06-22 15:55:05 +00:00
Uwe Schindler de54f321b3 Fix bug #28878: php.ini values in php4_execute 2004-06-22 15:37:55 +00:00
Ilia Alshanetsky cba1c57ac6 MFH: Added missing safe_mode check. 2004-06-21 22:53:59 +00:00
Sara Golemon 4240a5d3cf BFN 2004-06-21 19:34:58 +00:00
Sara Golemon 10a0500ad9 MFH: BugFix#28868 Wrapper hash not thread-safe 2004-06-21 19:33:48 +00:00
Jan Lehnardt 7e965d8661 - MFH (fix for #28847) 2004-06-19 20:37:55 +00:00
Stefan Esser 2d18951de4 Fixed some 64bit and other zend_parse_parameters bugs 2004-06-19 15:09:47 +00:00
Ilia Alshanetsky d2be511ea2 MFH: Fixed possible memory leak. 2004-06-18 00:44:40 +00:00
Ilia Alshanetsky b67e80ea4f MFH: Fixed bug #28818 (Apache 2 sapis do not export st_dev). 2004-06-18 00:37:02 +00:00
Brad House 3b9b9a4bbd merge name change from mcve -> monetra
add compatability layer for v3.2 functionality, so existing scripts
will work without any migration needed.
This patch has been sitting in PHP 5 for some time, and seems to
be working quite well. A quick backport of that patch to php4.
2004-06-17 03:16:59 +00:00
Ilia Alshanetsky 0a766591b8 MFH: Properly handly high ascii values in soundex(). 2004-06-17 00:17:52 +00:00
Ilia Alshanetsky 63dc7bd0ce New & improved strspn() & strcspn(), ~30% in most cases.
# In part based on patch by Alexander Valyalkin
2004-06-16 01:53:59 +00:00
Ilia Alshanetsky d564f6dda8 A faster & more memory efficient php_addslashes() implementation. 2004-06-15 02:02:45 +00:00
Edin Kadribasic 0314e61193 Part of fix for #28745: link agains extension against iconv 2004-06-13 01:02:31 +00:00
Greg Beaver 67d56970b9 MFH bugfixes 2004-06-12 06:16:17 +00:00
Greg Beaver 115ba4988e MFH: Installer and ErrorStack bugfixes/ErrorStack features 2004-06-12 05:50:51 +00:00
Ilia Alshanetsky 06c716589e MFH: hypot() is not experimental. 2004-06-10 19:38:26 +00:00
Derick Rethans 45b4b82fe4 - Fixed bug #28730 (Wrong website in configure output) 2004-06-10 14:48:46 +00:00
Ilia Alshanetsky 323a19116c MFH: Fixed bug #28723 (Fixed mbstring config.m4 to work on OSes where test
command does not support -e parameter).
2004-06-10 14:06:20 +00:00
Frank M. Kromann 1b88577508 MFH: Fix win32 build 2004-06-09 18:12:29 +00:00
Ilia Alshanetsky a7aa47c46d Correct alt text for easter egg logo. 2004-06-09 15:10:19 +00:00
Ilia Alshanetsky eef33e863b MFH: Fixed bug #28175 (Allow bundled GD to compile against freetype 2.1.2). 2004-06-09 14:50:33 +00:00
Ilia Alshanetsky 0f78991ac6 MFH: Fixed bug #28525 (gmp_powm() does not work with hexadecimal string
modulo represented as a string).
2004-06-09 14:39:36 +00:00
Ilia Alshanetsky d6d59e9609 MFH: Fixed memory leak on error in win32's opendir() emulation. 2004-06-09 14:18:16 +00:00
Greg Beaver 0fba197478 MFH partial fix, bug #1163: rpm build doesn't build properly 2004-06-08 18:26:32 +00:00
Greg Beaver eae73713eb MFH fix bug #1550: Builder does not set path to match bin_dir 2004-06-08 18:15:22 +00:00
Greg Beaver f6c1bcfb4d MFH fix bug #1378: user/pass must be urldecoded from parse_url in Remote.php 2004-06-08 18:04:00 +00:00
Greg Beaver d8afde1799 MFH
fix bug #1158
fix bug #1153
2004-06-08 17:56:45 +00:00
Ilia Alshanetsky 70ad496213 MFH: Fixed bug #28692 (\0 in Authenticate header passed via safe_mode). 2004-06-08 13:23:46 +00:00
Ilia Alshanetsky 4d861228c3 MFH: Fixed bug #28668 (glob() does not work with relative paths on Windows) 2004-06-07 18:31:15 +00:00
Ilia Alshanetsky a21f7c4998 MFH: Fixed bug #28670 (WWW-Authentication header mangling with PCRE in
safe_mode adds extra spaces).
2004-06-07 13:51:59 +00:00
Sara Golemon 2080e2fb4a Missing length limit parameter. 2004-06-07 04:42:40 +00:00
Ilia Alshanetsky 80616e818e MFH: Fixed bug #28649 (Proper glob() return value on Linux when there are
no matches).
2004-06-06 16:21:30 +00:00
Ilia Alshanetsky 0b69477a1d MFH: Fixed bug #28632 (Prevent open_basedir bypass in MySQL's LOAD DATA
LOCAL).
2004-06-04 15:27:05 +00:00
Ilia Alshanetsky 08887c2067 MFH: Fixed bug #28627 (When multiple MySQL links are used default link is
leaked).
2004-06-04 13:49:44 +00:00
Sara Golemon 254451337c BugFix# 28626 You can't #ifdef check a typedef. Just give it another name since it's only used once anyway. 2004-06-04 01:02:21 +00:00
Ilia Alshanetsky c5eb0540e0 Back to dev. 2004-06-03 12:42:06 +00:00
Ilia Alshanetsky 2053bc60d2 Prepare for 4.3.7 release. 2004-06-02 13:25:45 +00:00
Ilia Alshanetsky 25f5ea0398 MFH: No need to NULL terminate manually, snprintf() does it for us already. 2004-06-01 21:05:33 +00:00
Ilia Alshanetsky 1618452e53 MFH: Fixed bug #28597 (xmlrpc_encode_request() incorrectly encodes chars in
200-210 range).
2004-06-01 20:16:18 +00:00
Andrei Zmievski 307eedeffe *** empty log message *** 2004-06-01 16:55:55 +00:00
Ard Biesheuvel aad180c93f #28569 2004-06-01 01:12:01 +00:00
Ard Biesheuvel b38423c7f6 MFH: Fixed bug #28569 (connection id is not thread safe) 2004-06-01 00:52:22 +00:00
Ilia Alshanetsky f62069244a MFH: Added missing argument check. 2004-05-31 21:01:38 +00:00
Pierre Joye 6aecc4c6d6 - Missing ';' 2004-05-31 20:59:57 +00:00
Ard Biesheuvel a8d2d22d9b Fix build 2004-05-31 08:33:43 +00:00
Ilia Alshanetsky 8f5c250266 MFH: Fixed memory leak on ifx_error(). 2004-05-30 18:58:49 +00:00
Ilia Alshanetsky 8ee3553aa4 MFH: Fixed bug #28564 (Problem building informix as a shared extension). 2004-05-30 17:57:37 +00:00
Brad House 12e1c89041 Manually check for egrep 2004-05-30 14:33:16 +00:00
Ilia Alshanetsky 40329bff38 MFH: Fixed bug #28311 (Transparency detection code is off by 1). 2004-05-28 13:47:26 +00:00
Stefan Esser b9d3aafe55 MFH 2004-05-28 13:38:19 +00:00
Stefan Esser 7966bb1186 MFH 2004-05-28 11:33:42 +00:00
Ilia Alshanetsky 5e2f6ea744 MFH: Turn off session.auto_start to prevent test failures. 2004-05-26 18:23:23 +00:00
Ilia Alshanetsky 354eff7e1e MFH: Prevent test failure when fi_FI locale is not available. 2004-05-26 18:18:19 +00:00
Ilia Alshanetsky 9a5f0ef61a Fixed test failure due to incorrect library check. 2004-05-26 18:08:32 +00:00
Wez Furlong df0d52bd78 Fix build 2004-05-26 12:29:56 +00:00
Derick Rethans baed8167d6 - MFH: Fixed bug #28523 (Typo in ext/sockets/sockets.c) 2004-05-26 06:54:00 +00:00
Stefan Esser 47b6b1e28a MFH 2004-05-25 22:13:10 +00:00
Brad House a063cc2956 PHP_SETUP_OPENSSL is NOT SNMP_SHARED_LIBADD, it's MCVE_SHARED_LIBADD
requires AC_PROG_EGREP when you phpize
2004-05-25 17:05:57 +00:00
Ilia Alshanetsky 5e5de1960f Back to dev. 2004-05-25 13:52:04 +00:00
Ilia Alshanetsky 893aee30e8 Prepare for 4.3.7RC1. 2004-05-25 13:02:53 +00:00
Pierre Joye 30b2af9511 - MFH: Fix #28506, negative angle returns "random arcs"
while (s < 0) s += 360 is used now
2004-05-24 20:03:08 +00:00
Ilia Alshanetsky 03edfa1677 MFH: Fixed bug #28508 (Do not make hypot() available if not supported by
libc).
2004-05-24 17:02:31 +00:00
Wez Furlong 1a9d759fc4 BFN 2004-05-23 11:05:17 +00:00
Wez Furlong b8a8640846 MFH: Bugfix for #23220: IIS messes up SSL shutdown 2004-05-23 10:43:15 +00:00
Stefan Esser e384ab1666 MFH. 2004-05-23 10:15:24 +00:00
Edin Kadribasic c50ef2e715 The other bit of MFH 2004-05-21 21:00:19 +00:00
Timm Friebe f17eff3a6c - MFH: Fixed bug #28354 2004-05-21 20:30:44 +00:00
Timm Friebe e7e54fccac - MFH: Fixed TSRM build 2004-05-21 19:39:01 +00:00
Derick Rethans 9c488ef4f2 - MFH: Fixed TSRM problem in latest commit. 2004-05-21 08:16:26 +00:00
Derick Rethans 5a3baf610b - MFH: Fixed bug #28456 (Problem with enclosed / in uploaded files). 2004-05-21 08:14:24 +00:00
Ilia Alshanetsky 9dd0472573 MFH: Fixed stream leak on error. 2004-05-20 23:38:05 +00:00
Ilia Alshanetsky 900eaa32f3 MFH: Free vars before calling E_ERROR. 2004-05-20 00:11:33 +00:00
Ilia Alshanetsky 8635889231 MFH: Fixed possible memory leak. 2004-05-18 23:27:03 +00:00
Ilia Alshanetsky c0cea96139 MFH: Fixed command line escaping routines for win32. 2004-05-18 13:43:33 +00:00
Edin Kadribasic 45fa60d315 MFH 2004-05-18 12:17:40 +00:00
Ilia Alshanetsky b7479f6c29 MFH: Correct output. 2004-05-17 20:59:07 +00:00
Derick Rethans 27c3401da5 - MFH: Document the smtp_post setting in php.ini* 2004-05-17 16:31:14 +00:00
Marcus Boerger 8761f766d4 MFH: Fix printf with floats 2004-05-16 21:20:30 +00:00
Timm Friebe 22214bc11e - MFH: Fixed auto-conversion from long to double when LONG_MAX /
LONG_MIN where overflown
2004-05-16 20:36:41 +00:00
Ilia Alshanetsky 5eaf82b6eb MFH: Do not allocate error buffer at the start of every request. 2004-05-16 15:34:56 +00:00
SVN Migration f93672da8e This commit was manufactured by cvs2svn to create branch 'PHP_4_3'. 2004-05-16 14:48:46 +00:00
Ilia Alshanetsky 7be44d2b6d MFH: Added missing safe_mode & open_basedir checks. 2004-05-16 14:38:26 +00:00
Brad House e864dc5b13 update config.m4 for libmonetra 4.0 compatability.
Library no longer has MCVE_ symbols, the header file has #define\'s to
convert MCVE_ -> M_ to reflect the Monetra name change from MCVE.
More updates to follow.
2004-05-16 03:01:38 +00:00
Ilia Alshanetsky 41da69f20f MFH: Fixed possible memory leak inside popen(). 2004-05-14 16:12:06 +00:00
Ilia Alshanetsky 879cbe7961 MFH: Fixed bug #28386 (wordwrap() wraps lines 1 character too soon). 2004-05-13 17:44:33 +00:00
SVN Migration 739846a6a8 This commit was manufactured by cvs2svn to create branch 'PHP_4_3'. 2004-05-13 17:44:24 +00:00
Ilia Alshanetsky e5d7aef143 MFH: Make isapi more compatible with apache sapis as far as the creation
$_COOKIE super-global and various $_SERVER values.
2004-05-13 17:21:42 +00:00
Edin Kadribasic 47692de95f Make curl compile with the latest win32 libcurl 2004-05-13 16:54:45 +00:00
Ilia Alshanetsky 6be3e2d751 MFH: Skip session tests if session.save_path is not writable. 2004-05-13 12:53:49 +00:00
Ilia Alshanetsky e69edbeac2 MFH: Fixed various possible memory leaks. 2004-05-12 20:17:21 +00:00
Ilia Alshanetsky 86b31b56de MFH: Fixed bug #28374 (Possible unterminated loop inside
_php_pgsql_trim_message()).
2004-05-12 16:49:56 +00:00
Wez Furlong efb6da662d Avoid Bug #28363 by not seeking if we don't have a read buffer 2004-05-12 10:46:30 +00:00
Ilia Alshanetsky 7f8bbde609 MFH: Make vprintf() and printf() return the length of the string printed. 2004-05-11 19:51:50 +00:00
Ilia Alshanetsky 338de41cf9 MFH: Fixed bug #28355 (glob() does not return error on Linux when it does
not have permission to open the directory).
2004-05-11 13:34:31 +00:00
Ilia Alshanetsky 139deb5ddb MFH: Fixed crash inside cpdf_place_inline_image() when working with
truecolor images.
2004-05-10 22:13:39 +00:00
Marcus Boerger 6d859da0da MFH Decouple NAN and INF 2004-05-10 07:25:11 +00:00
Ilia Alshanetsky 8f242bb48b Added missing upgrade bit. 2004-05-10 02:19:22 +00:00
Marcus Boerger 7afbc02392 BFN 2004-05-10 02:12:17 +00:00
Marcus Boerger e3aa91d3f3 MFH Fix problems with c mode 2004-05-10 01:47:51 +00:00
Ilia Alshanetsky 8838b0f114 MFH: Fixed bug #28289 (incorrect resolving of relative paths by glob() in
windows).
2004-05-09 19:01:27 +00:00
Ilia Alshanetsky 349514ed2d MFH:
Upgrade bundled GD library to 2.0.23.
Fixed bug #28175 (build problem for people using FreeType 2.1.0-2.1.2).
2004-05-09 17:34:02 +00:00
Sara Golemon d676db7541 MFH: if statement logic would never eval to false. 2004-05-08 06:01:11 +00:00
Ard Biesheuvel b7c800e6fb MFH: fixed unregistered pointer juggling bug 2004-05-07 15:17:12 +00:00
Uwe Schindler ba9faa42a0 Security fix: Put '\0' string termination before loop 2004-05-03 12:22:54 +00:00
Stefan Esser 164703f306 MFH 2004-05-02 10:17:36 +00:00
Marcus Boerger a9d700c5c7 MFH Bugfix #28229 (PATCH run-tests tripped up by spaces in names) 2004-04-30 17:54:45 +00:00
Greg Beaver a750e94013 MFH fix included files and put error messages in PEAR_Downloader where they are needed 2004-04-30 16:37:41 +00:00
Ilia Alshanetsky bbf5e08fa3 MFH: Fixed bug #28228 (number_format() does not allow empty decimal
separator).
2004-04-30 13:26:06 +00:00
SVN Migration 1be1a0b472 This commit was manufactured by cvs2svn to create branch 'PHP_4_3'. 2004-04-30 13:26:02 +00:00
Greg Beaver 072961be7b MFH update to begin process for next release (release is not imminent) 2004-04-30 02:09:01 +00:00
Greg Beaver 9f7829fb47 MFH fix 1186: notice in PEAR_Common undeclared $_packageName 2004-04-30 02:05:47 +00:00
Ilia Alshanetsky 80dfa0ba37 MFH: Fixed bug #28196 (missing error constants in cURL extension). 2004-04-29 16:25:54 +00:00
Sara Golemon d1be87446b MFH Don't strip off those []s, it'll only create problems in wrappers and elsewhere. 2004-04-27 19:28:21 +00:00
Sara Golemon 4c9527044b MFH BugFix 28187 parse_url does not handle scheme://[0123:4567::89]:12345/etc style IPv6 embedded address URLs 2004-04-27 19:21:36 +00:00
Ilia Alshanetsky 7de0f803d1 MFH: Removed C++ style comments. 2004-04-27 17:34:05 +00:00
Ilia Alshanetsky 208a735a85 MFH: Fixed bug #28184 (C++ comments in GD library sources). 2004-04-27 14:59:25 +00:00
Derick Rethans 58466f957f - Fixed bug #28147 (Crash with drawing anti-aliased lines) 2004-04-25 19:43:30 +00:00
Derick Rethans 06fd453fb9 Reorder NEWS 2004-04-23 18:20:39 +00:00
Rasmus Lerdorf 2d9549455d bug #27810 from Joe Orton 2004-04-23 17:51:39 +00:00
Ilia Alshanetsky 7aa63c6209 MFH: Fixed bug #28087 (Do not force mysql.trace_mode to 0 on every request) 2004-04-23 17:04:36 +00:00
Marcus Boerger bc594f1506 BFN 2004-04-22 22:53:18 +00:00
Ilia Alshanetsky b5d2a4aa12 MFH: Fixed possible crash inside pg_copy_(to|from) function if delimiter is
more then 1 character long.
2004-04-22 00:32:07 +00:00
Ilia Alshanetsky a20b67c30f Correct news entry order. 2004-04-21 00:12:12 +00:00
Ilia Alshanetsky 1aad1b4291 MFH:
Fixed possible memory leaks.
	Prevent shm_attach() from destroying non-shm resources.
2004-04-21 00:11:30 +00:00
Frank M. Kromann 6fc504ce16 mssql related fixes 2004-04-20 23:54:20 +00:00
Frank M. Kromann b24de2d58a MFH: Fix #28007. Compile fails when the SHORT type is undefined (older versions of FreeTDS) 2004-04-20 23:37:26 +00:00
Frank M. Kromann 4c5521ad81 MFH: Fix problem getting return value from stored procedure when it returns multiple results 2004-04-20 23:31:39 +00:00
Wez Furlong 808dee23d7 news! 2004-04-19 13:37:43 +00:00
Wez Furlong 4c722bee9c MFH: timeout duration too long in liveness checks for sockets.
Fixes Bug #28055
2004-04-19 12:43:26 +00:00
Derick Rethans 19db79ff1d - Fix for bug #28042 (greek letters in html to entitity mapping not correct) 2004-04-17 23:07:27 +00:00
Uwe Schindler e3727d1061 MFH: set Sybase default APPNAME to ("PHP " PHP_VERSION) 2004-04-16 16:28:01 +00:00
Ilia Alshanetsky 43d81b700a MFH: Fixed test failure if session.use_trans_sid is enabled. 2004-04-15 13:37:58 +00:00
Ilia Alshanetsky a6ea6cc87c Fixed bug #27995 (imagefilltoborder() stops the fill process prematurely).
# Already in PHP5
2004-04-14 22:40:16 +00:00
Ilia Alshanetsky 9f6f2471f0 Back to dev. 2004-04-14 16:39:03 +00:00
Ilia Alshanetsky 90adf3ec54 Prepare for 4.3.6 2004-04-14 15:00:36 +00:00
Edin Kadribasic de83567151 News update 2004-04-14 14:51:24 +00:00
Ilia Alshanetsky c6af3e463a MFH: Fixed bug #27963 (Session lifetime setting may leak between requests). 2004-04-13 18:23:10 +00:00
Derick Rethans 09d9532952 - MFH: Add default fontpath for win98/xp 2004-04-12 21:43:19 +00:00
Greg Beaver 4e9e5c1913 re-organize as per PEAR-Core discussion 2004-04-09 07:43:52 +00:00
SVN Migration 9a9864a0e9 This commit was manufactured by cvs2svn to create branch 'PHP_4_3'. 2004-04-09 07:38:49 +00:00
foobar 065d0986aa fix typo 2004-04-08 23:56:45 +00:00
foobar 8a088529c9 PHP_ADD_LIBPATH checks that the path is not /usr/lib.. 2004-04-08 23:54:10 +00:00
Andi Gutmans 908f37b08b - News 2004-04-08 21:23:31 +00:00
Derick Rethans ea2fa14acb - Added missing CEST zone 2004-04-08 19:21:46 +00:00
Ilia Alshanetsky ebf7a4f847 Back to dev. 2004-04-08 19:15:13 +00:00
Ilia Alshanetsky 46d273a2b9 4.3.6RC3 2004-04-08 19:13:58 +00:00
Ilia Alshanetsky 4293672558 Prepare news file for release. 2004-04-08 12:42:29 +00:00
Ilia Alshanetsky f5865d02d0 Missing news entries. 2004-04-07 22:44:07 +00:00
Edin Kadribasic cf3d459815 Merged wrongly s/#ifdef/#if/ 2004-04-07 22:31:29 +00:00
Edin Kadribasic fcfe6ff818 MFH: Allow compilation with gdlib 1.8 2004-04-07 22:28:29 +00:00
Ilia Alshanetsky 88b30630b2 Removed test for a problem inside the GD library. 2004-04-07 20:52:44 +00:00
Adam Dickmeiss 9d4bd52adf Fixed bug #27803 (YAZ lib path) 2004-04-07 19:37:22 +00:00
foobar bf45f6d5ba MFH: Revert the patch to "fix" #27664 and added more informal error msg. 2004-04-07 13:56:48 +00:00
Greg Beaver 76c42836b2 developer -> lead for cellog 2004-04-07 00:29:46 +00:00
Greg Beaver fd4dea3500 MFH 2004-04-06 23:22:16 +00:00
Greg Beaver c1134d6bb9 change release date 2004-04-06 22:09:05 +00:00
Derick Rethans 9166d10260 - Update NEWS with fugbix. 2004-04-06 18:12:03 +00:00
Rob Richards fa843198d4 Fix Bug #27769 crash using domxml_xmltree 2004-04-06 17:56:11 +00:00
foobar e5a94e640e update credits 2004-04-06 10:10:41 +00:00
foobar 3a95b4b173 rtd 2004-04-06 09:38:27 +00:00
Ilia Alshanetsky 8a6f9ab5c0 Back to dev. 2004-04-05 15:43:52 +00:00
176 changed files with 7759 additions and 3565 deletions

No files matched your search

+1297 -378
View File
File diff suppressed because it is too large. Load diff
+160 -10
View File
@@ -1,12 +1,160 @@
PHP 4 NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
05 Apr 2004, Version 4.3.6RC2
- Fixed a bug that prevented building of the GD extension against external GD
lib 1.X. (Ilia, Nick Talbott).
- Fixed bug #27849 (configure craps out on trivial syntax error). (Derick)
14 Sep 2004, Version 4.3.9RC3
- GPC input processing fixes (Rasmus, Stefan)
01 Apr 2004, Version 4.3.6RC1
31 Aug 2004, Version 4.3.9RC2
- Implemented periodic PCRE compiled regexp cache cleanup, to avoid memory
exhaustion. (Andrei)
- Fixed bug with raw_post_data not getting set (Brian)
- Fixed a file-descriptor leak with phpinfo() and other 'special' URLs (Zeev)
- Fixed bug #29753 (mcal_fetch_event() allows 2nd argument to be optional).
(Ilia, Vrana)
- Fixed bug #29727 (Added missing CURL authentication directives). (Ilia)
- Fixed bug #29719 (fgetcsv() has problem parsing strings ending with escaped
enclosures). (Ilia)
- Fixed bug #29599 (domxml_error segfaults another apache module). (Rob)
- Fixed bug #29594 (Use PHP's own tmpfile() implementation). (Ilia)
11 Aug 2004, Version 4.3.9RC1
- Rewritten UNIX and Windows install help files. (Documentation Team)
- Updated PCRE to provide better error handling in certain cases. (Andrei)
- NSAPI: added "bucket" parameter to list of non-php.ini-keys of php4_execute
for doing performance stats without warnings in server-log. (Uwe Schindler)
- Fixed bug #29882 (isset crashes on arrays). (Marcus)
- Fixed bug #29607 (highlighting code with HEREDOC produces invalid
output). (Ilia)
- Fixed bug #29581 (Typo inside php.ini comments for mysql.trace_mode). (Ilia)
- Fixed bug #29493 (extract(array, EXTR_REFS) misbehaves with elements
referred twice or more times). (Moriyoshi)
- Fixed bug #29443 (Sanity check for wbmp detection). (Ilia)
- Fixed bug #29369 (Uploaded files with ' or " in their names get their names
truncated at those characters). (Ilia)
- Fixed bug #29349 (imagecreatefromstring() crashes with external GD library).
(Ilia, adconrad at debian dot org)
- Fixed bug #29333 (output_buffering+trans_sess_id can corrupt output). (Ilia)
- Fixed bug #29226 (ctype_* functions missing validation of numeric string
representations). (Ilia)
- Fixed bug #29209 (imap_fetchbody() doesn't check message index). (Ilia,
tony2001 at phpclub dot net)
- Fixed bug #29116 (Zend constant warning uses memory after free). (Marcus,
jdolecek at NetBSD dot org)
- Fixed bug #29114 (Potential double free in php_stat). (Sara)
- Fixed bug #29075 (strnatcmp() incorrectly handles whitespace). (Curt, Ilia)
- Fixed bug #29049 (array sorting via user function/method does not validate
it). (Ilia)
- Fixed bug #29038 (extract() with EXTR_PREFIX_SAME prefixes empty strings).
(Andrey)
- Fixed bug #29034 (wordwrap() returns a boolean when passed empty string).
(Ilia)
- Fixed bug #28974 (overflow in array_slice(), array_splice(), substr,
substr_replace(), strspn(), strcspn()). (Andrey)
- Fixed bug #28897 (ibase: -1 returned as -0.000 for 64-bit scaled int). (Ard)
- Fixed bug #28879 (Implicit/Explicit array creation inconsistency when using
Resources, Arrays, or Objects as indices). (Sara)
- Fixed bug #28878 (Setting of inikey's in obj.conf fails). (Uwe Schindler)
- Fixed bug #28868 (Internal wrapper registry not thread safe). (Sara)
- Fixed bug #28818 (Apache 2 sapis do not export st_dev).
(xuefer at 21cn dot com, Ilia).
- Fixed bug #28800 (strings beginning with "inf" improperly converted). (Ilia)
- Fixed bug #28723 (Fixed mbstring config.m4 to work on OSes where test
command does not support -e parameter). (Ilia)
- Fixed bug #28692 (\0 in Authenticate header passed via safe_mode). (Ilia)
- Fixed bug #28670 (WWW-Authentication header mangling with PCRE in safe_mode
adds extra spaces). (Ilia)
- Fixed bug #28668 (glob() does not work with relative paths on Windows).
(Ilia)
- Fixed bug #28649 (Proper glob() return value on Linux when there are no
matches). (Ilia)
- Fixed bug #28633 (sprintf incorrectly adding padding to floats). (Ilia)
- Fixed bug #28627 (When multiple MySQL links are used default link is leaked).
(gavin at ipalsoftware dot com, Ilia)
- Fixed bug #28525 (gmp_powm() does not work with hexadecimal string modulo
represented as a string). (pickett at sumu dot org, Ilia)
- Fixed bug #28512 (Allocate enough space to store MSSQL data). (Frank)
- Fixed bug #28466 (mbstring_convert_variables() array separation problem).
(Moriyoshi)
- Fixed bug #28175 (Allow bundled GD to compile against freetype 2.1.2).
(Elf, Ilia)
- Fixed leap year checking with idate(). (Christian Schneider, Derick)
- Fixed strip_tags() to correctly handle '\0' characters. (Stefan)
- Fixed funny forking effect in FastCGI when PHP_FCGI_CHILDREN was not set.
14 Jul 2004, Version 4.3.8
- Fixed strip_tags() to correctly handle '\0' characters. (Stefan)
- Fixed memory_limit during request startup. (Stefan)
- Replace alloca() with emalloc() for better stack protection. (Ilia)
- Added missing safe_mode checks inside ftok and itpc. (Ilia)
- Fixed bug #28963 (Missing space for \0 in address allocation in IMAP). (Ilia)
- Fixed bug #28632 (Prevent open_basedir bypass via MySQL's LOAD DATA LOCAL).
(Ilia)
03 Jun 2004, Version 4.3.7
- Upgraded bundled GD library to 2.0.23. (Ilia)
- Changed user error handler mechanism to relay to built-in error handler if it
returns false. (Andrei)
- Fixed command line escaping routines for win32. (Ilia)
- Fixed problems with *printf() functions and '%f' formatting. (Marcus)
- Fixed possible crash inside pg_copy_(to|from) function if delimiter is more
then 1 character long. (Ilia)
- Fixed crash inside cpdf_place_inline_image() when working with truecolor
images. (Ilia)
- Fixed handling of return values from storred procedures in mssql_execute()
with multiple result sets returned. (Frank)
- Fixed logic bug in session_register() which allowed registering _SESSION
and/or HTTP_SESSION_VARS. (Sara)
- Fixed bug #28597 (xmlrpc_encode_request() incorrectly encodes chars in
200-210 range). (fernando dot nemec at folha dot com dot br, Ilia)
- Fixed bug #28569 (informix connection id is not thread safe).
(novicky at aarongroup dot cz, Ard)
- Fixed bug #28564 (Problem building informix as a shared extension).
(roques at mti dot ag, Ilia)
- Fixed bug #28508 (Do not make hypot() available if not supported by libc).
(Ilia)
- Fixed bug #28506 (Allow negative start angle in imagearc and imagefilledarc.
(Pierre)
- Fixed bug #28456 (Problem with enclosed / in uploaded files). (Antony)
- Fixed bug #28386 (wordwrap() wraps lines 1 character too soon). (Ilia)
- Fixed bug #28374 (Possible unterminated loop inside
_php_pgsql_trim_message()). (Ilia)
- Fixed bug #28355 (glob() does not return error on Linux when it does not
have permission to open the directory). (Ilia)
- Fixed bug #28289 (incorrect resolving of relative paths by glob() in
windows). (Ilia)
- Fixed bug #28229 (run-tests tripped up by spaces in names). (Marcus)
- Fixed bug #28228 (number_format() does not allow empty decimal separator).
(Ilia)
- Fixed bug #28196 (missing error constants in cURL extension). (Ilia)
- Fixed bug #28187 (parse_url() not handling embedded IPv6 in URLs). (Sara)
- Fixed bug #28175 (build problem for people using FreeType 2.1.0-2.1.2).
(Ilia)
- Fixed bug #28147 (Crash with drawing anti-aliased lines). (Derick)
- Fixed bug #28122 (dba_open db3: Permission denied). (Marcus)
- Fixed bug #28112 (sqlite_query() crashing apache on malformed query). (Ilia,
Marcus)
- Fixed bug #28055 (timeout duration too long in feof()/pfsockopen() liveness
checks). (Wez)
- Fixed bug #28087 (Do not force mysql.trace_mode to 0 on every request).
(Ilia)
- Fixed bug #28042 (greek letters in html to entitity mapping not correct).
(Derick)
- Fixed bug #28007 (compile mssql extension with old versions of FreeTDS
fails). (Frank)
- Fixed bug #27995 (imagefilltoborder() stops the fill process prematurely).
(Ilia)
- Fixed bug #27810 (don't use php's pemalloc in ext/pcre). (Joe Orton)
- Fixed bug #23220 (SSL: fatal protocol error when talking to IIS). (Wez)
15 Apr 2004, Version 4.3.6
- Updated bundled PDFLib library to version 5.0.3p1 in Windows distribution.
(Edin)
- Fixed a crash in multi-threaded environments when a thread is shutdown by
the web server. (Stas)
- Fixed a bug that prevented building of the GD extension against external GD
lib 1.X. (Ilia, Edin, Nick Talbott).
- Synchronized bundled GD library with GD 2.0.22. (Ilia)
- Fixed bug #27963 (Session lifetime setting may leak between requests). (Ilia)
- Fixed bug #27849 (configure craps out on trivial syntax error). (Derick)
- Fixed bug #27822 (is_resource() returns TRUE for closed resources). (Derick)
- Fixed bug #27819 (problems returning reference to a reference parameter).
(Ilia)
@@ -14,6 +162,7 @@ PHP 4 NEWS
- Fixed bug #27802 (default number of children to 8 when PHP_FCGI_CHILDREN is
not defined). (Ilia)
- Fixed bug #27780 (strtotime(+1 xxx) returns a wrong date/time). (Derick)
- Fixed bug #27769 (domxml_xmltree crashes). (Rob)
- Fixed bug #27764 (Get return value from a stored procedure not returning any
result sets). (Frank)
- Fixed bug #27762 (SCO Openserver doesn't have S_ISSOCK). (Wez)
@@ -26,20 +175,21 @@ PHP 4 NEWS
- Fixed bug #27717 (Test Failures when compiled on 64-bit mode). (Ard, Derick)
- Fixed bug #27687 (Bug Adding Default Charset to 'text/*' Content-Type
Header). (Marcus)
- Fixed bug #27664 (--disable-cli doesn't force --without-pear). (Ilia)
- Fixed bug #27663 (compile failure with cURL 7.11.1). (Ilia)
- Fixed bug #27646 (Cannot serialize/unserialize non-finite numeric values).
(Marcus)
- Fixed bug #26757 (session.save_path default is bogus for win32). (Wez)
- Fixed bug #26589 (Crash inside mssql extension when selecting many columns
of type money). (Frank)
- Fixed bug #25547 (error_handler and array index with function call).
(cschneid at cschneid dot com)
26 Mar 2004, Version 4.3.5
- Fixed possible crash using an invalid color index with a palette image in
imagecolortransparent (Pierre)
imagecolortransparent. (Pierre)
- Fixed php-cgi to not ignore command-line switches when run in a web context.
This fixes our test cases allowing INI with GET sections to work (Rasmus)
- Fixed getopt() so it works without $_SERVER (Rasmus, bfrance)
This fixes our test cases allowing INI with GET sections to work. (Rasmus)
- Fixed getopt() so it works without $_SERVER. (Rasmus, bfrance)
- Fixed crash in php_ini_scanned_files() when no additional INI files were
actually parsed. (Jon)
- Fixed possible crashes inside socket extension, due to missing check inside
@@ -53,7 +203,7 @@ PHP 4 NEWS
. Added "sybct.packet_size" php.ini option.
. Changed "sybct.login_timeout" php.ini option changeable at runtime.
. Fixed memory leak in sybase_set_message_handler().
- Synchronized bundled GD library with GD 2.0.17
- Synchronized bundled GD library with GD 2.0.17. (Ilia)
- Upgraded PCRE library to version 4.5. (Andrei)
- Updated bundled PostgreSQL library to version 7.4 in Windows distribution.
(Edin)
+10 -18
View File
@@ -37,8 +37,11 @@ The next few rules are more of a technical nature.
messages every day. Woe be to those who attempt to mess with it.
2. All news updates intended for public viewing, such as new features,
bug fixes, improvements, etc., should go into the NEWS file. Also see
the note below about automatically updating NEWS in your commit message.
bug fixes, improvements, etc., should go into the NEWS file.
NB! Lines, starting with @ will go automagically into NEWS file, but
this is NOT recommended, though. Please, add news entries directly to
NEWS file and don't forget to keep them adjusted and sorted.
3. Do not commit multiple file and dump all messages in one commit. If you
modified several unrelated files, commit each group separately and
@@ -59,14 +62,10 @@ The next few rules are more of a technical nature.
The format of the commit messages is pretty simple.
If a line begins with #, it is taken to be a comment and will not appear
in the ChangeLog. If the line begins with @, it will be redirected to the
NEWS file. Everything else goes into the ChangeLog.
in the ChangeLog. Everything else goes into the ChangeLog.
It is important to note that if your comment or news logline spans multiple
lines, you have to put # or @ at the beginning of _every_ such line. Every
entry in NEWS has to have a name after it, so if you did it with someone's
help, put both your names there. Your name WILL NOT be automatically put
at the end of the NEWS entry - so, please provide it yourself.
lines, you have to put # at the beginning of _every_ such line.
Example. Say you modified two files, datetime.c and string.c. In datetime.c
you added a new format option for date() function, and in string.c you fixed
@@ -78,17 +77,12 @@ For datetime.c:
(PHP date) Added new 'K' format modifier for printing out number of
days until New Year's Eve.
@- Added new 'K' format modifier that will output the number of days
@ until New Year's Eve. (Bob)
For string.c:
(php_trim) Fixed a memory leak resulting from improper use of zval_dtor().
# Man, that thing was leaking all over the place!
@- Fixed memory leak in trim(). (Bob)
The lines above marked with @ will go into NEWS file automagically, and the
# lines will be omitted from the ChangeLog. Alternatively, you might want
to modify NEWS file directly and not use the @ lines.
The # lines will be omitted from the ChangeLog automagically.
If you fix some bugs, you should note the bug ID numbers in your
commit message. Bug ID should be prefixed by "#" for easier access to
@@ -97,12 +91,10 @@ bug report when developers are browsing CVS via. LXR or Bonsai.
Example:
Fixed pgsql notice handler double free crash bug. Bug #14016
@ Fixed pgsql notice handler double free crash bug. Bug #14016
If you don't see your messages in ChangeLog and NEWS right away, don't worry!
If you don't see your messages in ChangeLog right away, don't worry!
These files are updated once a day, so your stuff will not show up until
somewhat later. Don't go adding stuff to NEWS by hand if you already put @
lines in the commit message.
somewhat later.
You can use LXR (http://lxr.php.net/) and Bonsai (http://bonsai.php.net/)
to look at PHP CVS repository in various ways.
+7 -9
View File
@@ -40,8 +40,8 @@ AC_CONFIG_HEADER(main/php_config.h)
MAJOR_VERSION=4
MINOR_VERSION=3
RELEASE_VERSION=6
EXTRA_VERSION="RC2"
RELEASE_VERSION=9
EXTRA_VERSION="RC3"
VERSION="$MAJOR_VERSION.$MINOR_VERSION.$RELEASE_VERSION$EXTRA_VERSION"
dnl Define where extension directories are located in the configure context
@@ -857,15 +857,15 @@ if test "$PHP_PEAR" != "no"; then
dnl
if test "$PHP_SAPI_CLI" = "no"; then
pear_error_msg="$pear_error_msg
PEAR requires CLI to be enabled. Add --enable-cli to the configure line."
PEAR requires CLI to be enabled. Add --enable-cli to the configure line. (or --disable-pear)"
fi
if test "$PHP_PCRE_REGEX" = "no"; then
pear_error_msg="$pear_error_msg
PEAR requires PCRE to be enabled. Add --with-pcre-regex to the configure line."
PEAR requires PCRE to be enabled. Add --with-pcre-regex to the configure line. (or --disable-pear)"
fi
if test "$PHP_XML" = "no"; then
pear_error_msg="$pear_error_msg
PEAR requires XML to be enabled. Add --enable-xml to the configure line."
PEAR requires XML to be enabled. Add --enable-xml to the configure line. (or --disable-pear)"
fi
dnl
@@ -873,7 +873,7 @@ dnl ext/xmlrpc is not really there yet to be a requirement..
dnl
dnl if test "$PHP_XMLRPC" = "no"; then
dnl pear_error_msg="$pear_error_msg
dnl PEAR requires XML-RPC to be enabled. Add --with-xmlrpc to the configure line."
dnl PEAR requires XML-RPC to be enabled. Add --with-xmlrpc to the configure line. (or --disable-pear)"
dnl fi
dnl
@@ -1044,8 +1044,6 @@ if test "$disable_cli" != "1"; then
PHP_CLI_TARGET="\$(SAPI_CLI_PATH)"
PHP_INSTALL_CLI_TARGET="install-cli"
PHP_ADD_SOURCES(sapi/cli, php_cli.c getopt.c,, cli)
else
with_pear=no
fi
PHP_SUBST(PHP_CLI_TARGET)
@@ -1409,7 +1407,7 @@ cat <<X
| If your application relies on register_globals being ON, you |
| should explicitly set it to on in your php.ini file. |
| Note that you are strongly encouraged to read |
| http://www.php.net/manual/en/security.registerglobals.php |
| http://www.php.net/manual/en/security.globals.php |
| about the implications of having register_globals set to on, and |
| avoid using it if possible. |
+--------------------------------------------------------------------+
+1 -1
View File
@@ -185,7 +185,7 @@ PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper,
if (bz_file == NULL) {
/* that didn't work, so try and get something from the network/wrapper */
stream = php_stream_open_wrapper(path, mode, options, opened_path);
stream = php_stream_open_wrapper(path, mode, options | STREAM_WILL_CAST, opened_path);
if (stream) {
int fd;
+2 -2
View File
@@ -1849,7 +1849,7 @@ PHPAPI pval php_COM_get_property_handler(zend_property_reference *property_refer
obj = obj_prop;
php_COM_set(obj, &V_DISPATCH(var_result), TRUE TSRMLS_CC);
VariantInit(var_result); // to protect C_DISPATCH(obj) from being freed when var_result is destructed
VariantInit(var_result); /* to protect C_DISPATCH(obj) from being freed when var_result is destructed */
} else {
php_variant_to_pval(var_result, &retval, codepage TSRMLS_CC);
@@ -1934,7 +1934,7 @@ PHPAPI int php_COM_set_property_handler(zend_property_reference *property_refere
return FAILURE;
}
VariantInit(var_result); // to protect C_DISPATCH(obj) from being freed when var_result is destructed
VariantInit(var_result); /* to protect C_DISPATCH(obj) from being freed when var_result is destructed */
zval_dtor(&overloaded_property->element);
}
FREE_VARIANT(var_result);
+1 -1
View File
@@ -181,7 +181,7 @@ static pval php_VARIANT_get_property_handler(zend_property_reference *property_r
case OE_IS_OBJECT:
if (!strcmp(Z_STRVAL(overloaded_property->element), "value")) {
// var_arg can't be an idispatch, so we don't care for the implicit AddRef() call here
/* var_arg can't be an idispatch, so we don't care for the implicit AddRef() call here */
php_variant_to_pval(var_arg, &result, codepage TSRMLS_CC);
} else if (!strcmp(Z_STRVAL(overloaded_property->element), "type")) {
ZVAL_LONG(&result, V_VT(var_arg))
+1 -1
View File
@@ -119,7 +119,7 @@ PHPAPI void php_pval_to_variant_ex2(pval *pval_arg, VARIANT *var_arg, VARTYPE ty
var_arg = V_VARIANTREF(var_arg); /* put the array in that VARIANT */
}
if (!type) {
// if no type is given we take the variant type
/* if no type is given we take the variant type */
type = VT_VARIANT;
}
+1 -1
View File
@@ -280,7 +280,7 @@ static HRESULT STDMETHODCALLTYPE disp_invokeex(
ZVAL_NULL(zarg);
}
} else {
// arg can't be an idispatch, so we don't care for the implicit AddRef() call here
/* arg can't be an idispatch, so we don't care for the implicit AddRef() call here */
if (FAILURE == php_variant_to_pval(arg, zarg, codepage TSRMLS_CC)) {
trace("failed to convert arg %d to zval\n", i);
ZVAL_NULL(zarg);
+20 -6
View File
@@ -2522,16 +2522,30 @@ PHP_FUNCTION(cpdf_place_inline_image)
}
count = 3 * im->sx * im->sy;
if(NULL == (buffer = (unsigned char *) emalloc(count)))
RETURN_FALSE;
buffer = (unsigned char *) safe_emalloc(3 * im->sx, im->sy, 0);
ptr = buffer;
for(i=0; i<im->sy; i++) {
for(j=0; j<im->sx; j++) {
color = im->pixels[i][j];
*ptr++ = im->red[color];
*ptr++ = im->green[color];
*ptr++ = im->blue[color];
#if HAVE_LIBGD20
if(gdImageTrueColor(im)) {
if (im->tpixels && gdImageBoundsSafe(im, j, i)) {
color = gdImageTrueColorPixel(im, j, i);
*ptr++ = (color >> 16) & 0xFF;
*ptr++ = (color >> 8) & 0xFF;
*ptr++ = color & 0xFF;
}
} else {
#endif
if (im->pixels && gdImageBoundsSafe(im, j, i)) {
color = im->pixels[i][j];
*ptr++ = im->red[color];
*ptr++ = im->green[color];
*ptr++ = im->blue[color];
}
#if HAVE_LIBGD20
}
#endif
}
}
+7 -1
View File
@@ -97,7 +97,13 @@ PHP_MINFO_FUNCTION(ctype)
return; \
switch (Z_TYPE_P(c)) { \
case IS_LONG: \
RETURN_BOOL(iswhat(Z_LVAL_P(c))); \
if (Z_LVAL_P(c) <= 255 && Z_LVAL_P(c) >= 0) { \
RETURN_BOOL(iswhat(Z_LVAL_P(c))); \
} else if (Z_LVAL_P(c) >= -128) { \
RETURN_BOOL(iswhat(Z_LVAL_P(c) + 256)); \
} \
SEPARATE_ZVAL(&c); \
convert_to_string(c); \
case IS_STRING: \
{ \
char *p; \
+58 -2
View File
@@ -22,6 +22,10 @@
#include "config.h"
#endif
#ifdef PHP_WIN32
#include <winsock2.h>
#endif
#include "php.h"
#if HAVE_CURL
@@ -30,7 +34,6 @@
#include <string.h>
#ifdef PHP_WIN32
#include <winsock.h>
#include <sys/types.h>
#endif
@@ -198,10 +201,28 @@ PHP_MINIT_FUNCTION(curl)
REGISTER_CURL_CONSTANT(CURLOPT_SSLENGINE);
REGISTER_CURL_CONSTANT(CURLOPT_SSLENGINE_DEFAULT);
REGISTER_CURL_CONSTANT(CURLOPT_CRLF);
REGISTER_CURL_CONSTANT(CURL_TIMECOND_IFMODSINCE);
REGISTER_CURL_CONSTANT(CURL_TIMECOND_IFUNMODSINCE);
REGISTER_CURL_CONSTANT(CURL_TIMECOND_LASTMOD);
#if LIBCURL_VERSION_NUM >= 0x070a00
REGISTER_CURL_CONSTANT(CURLOPT_ENCODING);
#endif
#if LIBCURL_VERSION_NUM > 0x070a05 /* CURLOPT_HTTPAUTH is available since curl 7.10.6 */
REGISTER_CURL_CONSTANT(CURLOPT_HTTPAUTH);
/* http authentication options */
REGISTER_CURL_CONSTANT(CURLAUTH_BASIC);
REGISTER_CURL_CONSTANT(CURLAUTH_DIGEST);
REGISTER_CURL_CONSTANT(CURLAUTH_GSSNEGOTIATE);
REGISTER_CURL_CONSTANT(CURLAUTH_NTLM);
REGISTER_CURL_CONSTANT(CURLAUTH_ANY);
REGISTER_CURL_CONSTANT(CURLAUTH_ANYSAFE);
#endif
#if LIBCURL_VERSION_NUM > 0x070a06 /* CURLOPT_PROXYAUTH is available since curl 7.10.7 */
REGISTER_CURL_CONSTANT(CURLOPT_PROXYAUTH);
#endif
/* Constants effecting the way CURLOPT_CLOSEPOLICY works */
REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_LEAST_RECENTLY_USED);
REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_LEAST_TRAFFIC);
@@ -284,6 +305,35 @@ PHP_MINIT_FUNCTION(curl)
REGISTER_CURL_CONSTANT(CURLE_TELNET_OPTION_SYNTAX);
REGISTER_CURL_CONSTANT(CURLE_OBSOLETE);
REGISTER_CURL_CONSTANT(CURLE_SSL_PEER_CERTIFICATE);
REGISTER_CURL_CONSTANT(CURLE_GOT_NOTHING);
REGISTER_CURL_CONSTANT(CURLE_SSL_ENGINE_NOTFOUND);
REGISTER_CURL_CONSTANT(CURLE_SSL_ENGINE_SETFAILED);
REGISTER_CURL_CONSTANT(CURLE_SEND_ERROR);
REGISTER_CURL_CONSTANT(CURLE_RECV_ERROR);
#ifdef CURLE_SHARE_IN_USE
REGISTER_CURL_CONSTANT(CURLE_SHARE_IN_USE);
#endif
#ifdef CURLE_SSL_CERTPROBLEM
REGISTER_CURL_CONSTANT(CURLE_SSL_CERTPROBLEM);
#endif
#ifdef CURLE_SSL_CIPHER
REGISTER_CURL_CONSTANT(CURLE_SSL_CIPHER);
#endif
#ifdef CURLE_SSL_CACERT
REGISTER_CURL_CONSTANT(CURLE_SSL_CACERT);
#endif
#ifdef CURLE_BAD_CONTENT_ENCODING
REGISTER_CURL_CONSTANT(CURLE_BAD_CONTENT_ENCODING);
#endif
#ifdef CURLE_LDAP_INVALID_URL
REGISTER_CURL_CONSTANT(CURLE_LDAP_INVALID_URL);
#endif
#ifdef CURLE_FILESIZE_EXCEEDED
REGISTER_CURL_CONSTANT(CURLE_FILESIZE_EXCEEDED);
#endif
#ifdef CURLE_FTP_SSL_FAILED
REGISTER_CURL_CONSTANT(CURLE_FTP_SSL_FAILED);
#endif
REGISTER_CURL_CONSTANT(CURL_NETRC_OPTIONAL);
REGISTER_CURL_CONSTANT(CURL_NETRC_IGNORED);
@@ -732,6 +782,12 @@ PHP_FUNCTION(curl_setopt)
case CURLOPT_HTTPGET:
case CURLOPT_HTTP_VERSION:
case CURLOPT_CRLF:
#if LIBCURL_VERSION_NUM > 0x070a05 /* CURLOPT_HTTPAUTH is available since curl 7.10.6 */
case CURLOPT_HTTPAUTH:
#endif
#if LIBCURL_VERSION_NUM > 0x070a06 /* CURLOPT_PROXYAUTH is available since curl 7.10.7 */
case CURLOPT_PROXYAUTH:
#endif
convert_to_long_ex(zvalue);
error = curl_easy_setopt(ch->cp, option, Z_LVAL_PP(zvalue));
break;
@@ -906,7 +962,7 @@ PHP_FUNCTION(curl_setopt)
error = curl_formadd(&first, &last,
CURLFORM_COPYNAME, string_key,
CURLFORM_NAMELENGTH, string_key_len - 1,
(ZVAL_REFCOUNT(*zvalue) > 1 ? CURLFORM_PTRCONTENTS : CURLFORM_COPYCONTENTS), postval,
CURLFORM_COPYCONTENTS, postval,
CURLFORM_CONTENTSLENGTH, Z_STRLEN_PP(current),
CURLFORM_END);
}
+1 -1
View File
@@ -307,7 +307,7 @@ PHPAPI php_stream *php_curl_stream_opener(php_stream_wrapper *wrapper, char *fil
curl_easy_setopt(curlstream->curl, CURLOPT_PROGRESSDATA, stream);
curl_easy_setopt(curlstream->curl, CURLOPT_NOPROGRESS, 0);
curl_easy_setopt(curlstream->curl, CURLOPT_USERAGENT, "PHP/" PHP_VERSION);
curl_easy_setopt(curlstream->curl, CURLOPT_USERAGENT, FG(user_agent) ? FG(user_agent) : "PHP/" PHP_VERSION);
/* TODO: read cookies and options from context */
+4
View File
@@ -53,6 +53,10 @@ DBA_OPEN_FUNC(db2)
struct stat check_stat;
int s = VCWD_STAT(info->path, &check_stat);
if (!s && !check_stat.st_size) {
info->mode = DBA_TRUNC; /* force truncate */
}
type = info->mode == DBA_READER ? DB_UNKNOWN :
info->mode == DBA_TRUNC ? DB_BTREE :
s ? DB_BTREE : DB_UNKNOWN;
+6 -2
View File
@@ -62,9 +62,13 @@ DBA_OPEN_FUNC(db3)
struct stat check_stat;
int s = VCWD_STAT(info->path, &check_stat);
type = info->mode == DBA_READER ? DB_UNKNOWN :
if (!s && !check_stat.st_size) {
info->mode = DBA_TRUNC; /* force truncate */
}
type = info->mode == DBA_READER ? DB_UNKNOWN :
info->mode == DBA_TRUNC ? DB_BTREE :
s? DB_BTREE : DB_UNKNOWN;
s ? DB_BTREE : DB_UNKNOWN;
gmode = info->mode == DBA_READER ? DB_RDONLY :
(info->mode == DBA_CREAT && s) ? DB_CREATE :
+6 -2
View File
@@ -62,9 +62,13 @@ DBA_OPEN_FUNC(db4)
struct stat check_stat;
int s = VCWD_STAT(info->path, &check_stat);
type = info->mode == DBA_READER ? DB_UNKNOWN :
if (!s && !check_stat.st_size) {
info->mode = DBA_TRUNC; /* force truncate */
}
type = info->mode == DBA_READER ? DB_UNKNOWN :
info->mode == DBA_TRUNC ? DB_BTREE :
s? DB_BTREE : DB_UNKNOWN;
s ? DB_BTREE : DB_UNKNOWN;
gmode = info->mode == DBA_READER ? DB_RDONLY :
(info->mode == DBA_CREAT && s) ? DB_CREATE :
+4 -4
View File
@@ -14,7 +14,7 @@ magic_quotes_runtime=1
require_once('test.inc');
echo "database handler: $handler\n";
// print md5 checksum of test.cdb which is generated by cdb_make program
var_dump(md5(implode('',file(dirname(__FILE__).'/test.cdb'))));
var_dump(md5_file(dirname(__FILE__).'/test.cdb'));
if (($db_make=dba_open($db_file, "n", $handler))!==FALSE) {
dba_insert("1", "1", $db_make);
dba_insert("2", "2", $db_make);
@@ -26,7 +26,7 @@ magic_quotes_runtime=1
// dba_replace cdb_make doesn't know replace
dba_close($db_make);
// write md5 checksum of generated database file
var_dump(md5(implode('',file($db_file))));
var_dump(md5_file($db_file));
// no need to test created database: this is done by dba_cdb_read.phpt
} else {
echo "Error creating database\n";
@@ -34,5 +34,5 @@ magic_quotes_runtime=1
?>
--EXPECT--
database handler: cdb_make
string(32) "723d19f39c1b15b3b455dd64323148d1"
string(32) "723d19f39c1b15b3b455dd64323148d1"
string(32) "12fc5ba2b9dcfef2480e5324eeb5f3e5"
string(32) "12fc5ba2b9dcfef2480e5324eeb5f3e5"
+11
View File
@@ -199,6 +199,11 @@ PHP_FUNCTION(dio_read)
}
ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
if (bytes <= 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0.");
RETURN_FALSE;
}
data = emalloc(bytes + 1);
res = read(f->fd, data, bytes);
if (res <= 0) {
@@ -227,6 +232,12 @@ PHP_FUNCTION(dio_write)
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &r_fd, &data, &data_len, &trunc_len) == FAILURE) {
return;
}
if (trunc_len < 0 || trunc_len > data_len) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "length must be greater or equal to zero and less then the length of the specified string.");
RETURN_FALSE;
}
ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
res = write(f->fd, data, trunc_len ? trunc_len : data_len);
+28 -13
View File
@@ -540,8 +540,8 @@ zend_module_entry domxml_module_entry = {
domxml_functions,
PHP_MINIT(domxml),
PHP_MSHUTDOWN(domxml),
NULL,
NULL,
PHP_RINIT(domxml),
PHP_RSHUTDOWN(domxml),
PHP_MINFO(domxml),
DOMXML_API_VERSION, /* Extension versionnumber */
STANDARD_MODULE_PROPERTIES
@@ -1510,6 +1510,24 @@ static void domxml_error_validate(void *ctx, const char *msg, ...)
}
PHP_RINIT_FUNCTION(domxml)
{
xmlSetGenericErrorFunc(xmlGenericErrorContext, (xmlGenericErrorFunc)domxml_error);
#if HAVE_DOMXSLT
xsltSetGenericErrorFunc(xsltGenericErrorContext, (xmlGenericErrorFunc)domxml_error);
#endif
return SUCCESS;
}
PHP_RSHUTDOWN_FUNCTION(domxml)
{
xmlSetGenericErrorFunc(xmlGenericErrorContext, NULL);
#if HAVE_DOMXSLT
xsltSetGenericErrorFunc(xsltGenericErrorContext, NULL);
#endif
return SUCCESS;
}
PHP_MSHUTDOWN_FUNCTION(domxml)
{
#if HAVE_DOMXSLT
@@ -1668,15 +1686,9 @@ PHP_MINIT_FUNCTION(domxml)
REGISTER_LONG_CONSTANT("DOMXML_LOAD_SUBSTITUTE_ENTITIES", DOMXML_LOAD_SUBSTITUTE_ENTITIES, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("DOMXML_LOAD_COMPLETE_ATTRS",DOMXML_LOAD_COMPLETE_ATTRS, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("DOMXML_LOAD_DONT_KEEP_BLANKS",DOMXML_LOAD_DONT_KEEP_BLANKS, CONST_CS | CONST_PERSISTENT);
xmlSetGenericErrorFunc(xmlGenericErrorContext, (xmlGenericErrorFunc)domxml_error);
#if (defined(LIBXML_THREAD_ENABLED) && LIBXML_VERSION >= 20511)
xmlThrDefSetGenericErrorFunc(xmlGenericErrorContext, (xmlGenericErrorFunc)domxml_error);
#endif
#if HAVE_DOMXSLT
xsltSetGenericErrorFunc(xsltGenericErrorContext, (xmlGenericErrorFunc)domxml_error);
#if HAVE_DOMEXSLT
#if HAVE_DOMXSLT && HAVE_DOMEXSLT
exsltRegisterAll();
#endif
#endif
xmlInitParser();
return SUCCESS;
@@ -4803,15 +4815,17 @@ PHP_FUNCTION(domxml_xmltree)
RETURN_FALSE;
}
DOMXML_RET_OBJ(rv, (xmlNodePtr) docp, &ret);
DOMXML_DOMOBJ_NEW(rv, (xmlNodePtr) docp, &ret);
/* The root itself maybe an array. Though you may not have two Elements
as root, you may have a comment, pi and and element as root.
Thanks to Paul DuBois for pointing me at this.
*/
if (node_children(&children, root TSRMLS_CC) >= 0) {
zend_hash_update(Z_OBJPROP_P(return_value), "children",sizeof("children"), (void *) &children, sizeof(zval *), NULL);
zend_hash_update(Z_OBJPROP_P(rv), "children",sizeof("children"), (void *) &children, sizeof(zval *), NULL);
}
DOMXML_RET_ZVAL(rv);
/* xmlFreeDoc(docp); */
}
/* }}} */
@@ -5358,7 +5372,8 @@ PHP_FUNCTION(domxml_xslt_process)
xmlDocPtr xmldocp;
xmlDocPtr docp;
char **params = NULL;
int ret, clone = -1;
int ret;
long clone = -1;
char *filename;
int filename_len = 0;
FILE *f;
+2
View File
@@ -75,6 +75,8 @@ PHPAPI zval *php_domobject_new(xmlNodePtr obj, int *found, zval* in TSRMLS_DC);
/* directory functions */
PHP_MINIT_FUNCTION(domxml);
PHP_MSHUTDOWN_FUNCTION(domxml);
PHP_RINIT_FUNCTION(domxml);
PHP_RSHUTDOWN_FUNCTION(domxml);
PHP_MINFO_FUNCTION(domxml);
PHP_FUNCTION(domxml_version);
PHP_FUNCTION(xmldoc);
+6 -1
View File
@@ -1213,7 +1213,12 @@ PHP_FUNCTION(fbsql_database)
if (phpLink->databaseName) free(phpLink->databaseName);
phpLink->databaseName = strdup(Z_STRVAL_PP(dbname));
}
RETURN_STRING(phpLink->databaseName, 1);
if (phpLink->databaseName) {
RETURN_STRING(phpLink->databaseName, 1);
}
else {
RETURN_FALSE;
}
}
/* }}} */
+8
View File
@@ -721,6 +721,10 @@ PHP_FUNCTION(fdf_set_file)
return;
}
if (php_check_open_basedir(filename TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(filename, "wb+", CHECKUID_CHECK_MODE_PARAM))) {
RETURN_FALSE;
}
ZEND_FETCH_RESOURCE(fdf, FDFDoc *, &r_fdf, -1, "fdf", le_fdf);
err = FDFSetFile(fdf, filename);
@@ -1481,6 +1485,10 @@ PHP_FUNCTION(fdf_get_attachment) {
ZEND_FETCH_RESOURCE(fdf, FDFDoc *, &r_fdf, -1, "fdf", le_fdf);
if (php_check_open_basedir(savepath TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(savepath, "wb+", CHECKUID_CHECK_MODE_PARAM))) {
RETURN_FALSE;
}
strncpy(pathbuf , savepath, MAXPATHLEN-1);
pathbuf[MAXPATHLEN-1] = '\0';
+5 -1
View File
@@ -32,7 +32,7 @@
#include <fribidi/fribidi.h>
/* The fribidi guys dont believe in BC */
#ifdef FRIBIDI_CHAR_SET_UTF8
#ifndef FRIBIDI_MICRO_VERSION_STR
#define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
#define FRIBIDI_CHARSET_ISO8859_6 FRIBIDI_CHAR_SET_ISO8859_6
#define FRIBIDI_CHARSET_ISO8859_8 FRIBIDI_CHAR_SET_ISO8859_8
@@ -212,7 +212,11 @@ PHP_FUNCTION(fribidi_log2vis)
out_string = (char *) emalloc(sizeof(char)*alloc_len);
#if FRIBIDI_MAJOR_VERSION == 0 && FRIBIDI_MINOR_VERSION <= 10
fribidi_log2vis(u_logical_str, len, &base_dir, u_visual_str, position_L_to_V_list, position_V_to_L_list, embedding_level_list);
#else
fribidi_log2vis(NULL, u_logical_str, len, &base_dir, u_visual_str, position_L_to_V_list, position_V_to_L_list, embedding_level_list);
#endif
/* convert back to original char set */
switch(Z_LVAL_PP(charset)) {
+4 -1
View File
@@ -258,6 +258,7 @@ AC_DEFUN(PHP_GD_CHECK_VERSION,[
PHP_CHECK_LIBRARY(gd, gdImageGifCtx, [AC_DEFINE(HAVE_GD_GIF_CTX, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
PHP_CHECK_LIBRARY(gd, gdCacheCreate, [AC_DEFINE(HAVE_GD_CACHE_CREATE, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
PHP_CHECK_LIBRARY(gd, gdFontCacheShutdown, [AC_DEFINE(HAVE_GD_THREAD_SAFE, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
PHP_CHECK_LIBRARY(gd, gdNewDynamicCtxEx, [AC_DEFINE(HAVE_GD_DYNAMIC_CTX_EX, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
])
dnl
@@ -271,7 +272,7 @@ if test "$PHP_GD" = "yes"; then
libgd/gdxpm.c libgd/gdfontt.c libgd/gdfonts.c libgd/gdfontmb.c libgd/gdfontl.c \
libgd/gdfontg.c libgd/gdtables.c libgd/gdft.c libgd/gdcache.c libgd/gdkanji.c \
libgd/wbmp.c libgd/gd_wbmp.c libgd/gdhelpers.c libgd/gd_topal.c libgd/gd_gif_in.c \
libgd/xbm.c"
libgd/xbm.c libgd/gd_gif_out.c "
dnl check for fabsf and floorf which are available since C99
AC_CHECK_FUNCS(fabsf floorf)
@@ -305,7 +306,9 @@ dnl These are always available with bundled library
AC_DEFINE(HAVE_GD_XBM, 1, [ ])
AC_DEFINE(HAVE_GD_BUNDLED, 1, [ ])
AC_DEFINE(HAVE_GD_GIF_READ, 1, [ ])
AC_DEFINE(HAVE_GD_GIF_CREATE, 1, [ ])
AC_DEFINE(HAVE_GD_IMAGEELLIPSE, 1, [ ])
AC_DEFINE(HAVE_GD_DYNAMIC_CTX_EX, 1, [ ])
dnl Make sure the libgd/ is first in the include path
GDLIB_CFLAGS="-DHAVE_LIBPNG"
+13 -5
View File
@@ -35,6 +35,7 @@
#include "SAPI.h"
#include "php_gd.h"
#include "ext/standard/info.h"
#include "php_open_temporary_file.h"
#if HAVE_SYS_WAIT_H
# include <sys/wait.h>
@@ -107,6 +108,10 @@ extern int gdImageColorResolve(gdImagePtr, int, int, int);
int gdImageColorClosestHWB(gdImagePtr im, int r, int g, int b);
#endif
#ifndef HAVE_GD_DYNAMIC_CTX_EX
#define gdNewDynamicCtxEx(len, data, val) gdNewDynamicCtx(len, data)
#endif
static gdImagePtr _php_image_create_from_string (zval **Data, char *tn, gdImagePtr (*ioctx_func_p)() TSRMLS_DC);
static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, gdImagePtr (*func_p)(), gdImagePtr (*ioctx_func_p)());
static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, void (*func_p)());
@@ -390,7 +395,7 @@ PHP_RSHUTDOWN_FUNCTION(gd)
/* }}} */
#if HAVE_GD_BUNDLED
#define PHP_GD_VERSION_STRING "bundled (2.0.22 compatible)"
#define PHP_GD_VERSION_STRING "bundled (2.0.28 compatible)"
#elif HAVE_LIBGD20
#define PHP_GD_VERSION_STRING "2.0 or higher"
#elif HAVE_GDIMAGECOLORRESOLVE
@@ -648,6 +653,7 @@ PHP_FUNCTION(imageloadfont)
if (body_size != body_size_check) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error reading font");
efree(font);
php_stream_close(stream);
RETURN_FALSE;
}
@@ -1241,7 +1247,7 @@ static int _php_image_type (char data[8])
#ifdef HAVE_GD_WBMP
else {
gdIOCtx *io_ctx;
io_ctx = gdNewDynamicCtx (8, data);
io_ctx = gdNewDynamicCtxEx (8, data, 0);
if (io_ctx) {
if (getmbi((int(*)(void*))gdGetC, io_ctx) == 0 && skipheader((int(*)(void*))gdGetC, io_ctx) == 0 ) {
#if HAVE_LIBGD204
@@ -1273,7 +1279,7 @@ gdImagePtr _php_image_create_from_string(zval **data, char *tn, gdImagePtr (*ioc
gdImagePtr im;
gdIOCtx *io_ctx;
io_ctx = gdNewDynamicCtx (Z_STRLEN_PP(data), Z_STRVAL_PP(data));
io_ctx = gdNewDynamicCtxEx(Z_STRLEN_PP(data), Z_STRVAL_PP(data), 0);
if (!io_ctx) {
return NULL;
@@ -1427,7 +1433,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
goto out_err;
}
io_ctx = gdNewDynamicCtx(buff_size, buff);
io_ctx = gdNewDynamicCtxEx(buff_size, buff, 0);
if(!io_ctx) {
php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot allocate GD IO context");
goto out_err;
@@ -1658,7 +1664,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
FILE *tmp;
char buf[4096];
tmp = tmpfile();
tmp = php_open_temporary_file("", "", NULL TSRMLS_CC);
if (tmp == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open temporary file");
RETURN_FALSE;
@@ -3639,9 +3645,11 @@ static void _php_image_bw_convert( gdImagePtr im_org, gdIOCtx *out, int threshol
return;
}
#if HAVE_LIBGD20
if (im_org->trueColor) {
gdImageTrueColorToPalette(im_org, 1, 256);
}
#endif
for (y = 0; y < dest_height; y++) {
for (x = 0; x < dest_width; x++) {
+8 -4
View File
@@ -43,8 +43,8 @@ RSC=rc.exe
# PROP Intermediate_Dir "Release_TS"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D "HAVE_GD_XBM" /D HAVE_LIBGD13=1 /D HAVE_LIBGD=1 /D HAVE_LIBGD15=1 /D HAVE_LIBGD204=1 /FR /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /I "libgd" /D ZEND_DEBUG=0 /D HAVE_LIBGD15=1 /D HAVE_LIBGD204=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D "HAVE_GD_XBM" /D HAVE_LIBGD=1 /D HAVE_LIBGD13=1 /D HAVE_LIBGD20=1 /D "USE_GD_IOCTX" /D HAVE_LIBFREETYPE=1 /D "USE_GD_IMGSTRTTF" /D HAVE_GD_STRINGTTF=1 /D HAVE_GD_BUNDLED=1 /D "MSWIN32" /D "HAVE_LIBPNG" /D "HAVE_LIBJPEG" /D "HAVE_GD_GD2" /D HAVE_GD_STRINGFTEX=1 /D HAVE_GD_IMAGESETBRUSH=1 /D HAVE_GD_IMAGESETTILE=1 /FR /FD /c
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GD_GIF_CREATE=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D "HAVE_GD_XBM" /D HAVE_LIBGD13=1 /D HAVE_LIBGD=1 /D HAVE_LIBGD15=1 /D HAVE_LIBGD204=1 /FR /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /I "libgd" /D ZEND_DEBUG=0 /D HAVE_LIBGD15=1 /D HAVE_LIBGD204=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GD_GIF_CREATE=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D "HAVE_GD_XBM" /D HAVE_LIBGD=1 /D HAVE_LIBGD13=1 /D HAVE_LIBGD20=1 /D "USE_GD_IOCTX" /D HAVE_LIBFREETYPE=1 /D "USE_GD_IMGSTRTTF" /D HAVE_GD_STRINGTTF=1 /D HAVE_GD_BUNDLED=1 /D "MSWIN32" /D "HAVE_LIBPNG" /D "HAVE_LIBJPEG" /D "HAVE_GD_GD2" /D HAVE_GD_STRINGFTEX=1 /D HAVE_GD_IMAGESETBRUSH=1 /D HAVE_GD_IMAGESETTILE=1 /FR /FD /c
# SUBTRACT CPP /YX
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
@@ -73,8 +73,8 @@ LINK32=link.exe
# PROP Intermediate_Dir "Debug_TS"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D HAVE_LIBGD13=1 /D HAVE_LIBGD=1 /D HAVE_LIBGD15=1 /D HAVE_LIBGD204=1 /FR /YX /FD /c
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /I "libgd" /D ZEND_DEBUG=1 /D "HAVE_LIBGD15" /D HAVE_LIBGD204=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D HAVE_LIBGD=1 /D HAVE_LIBGD13=1 /D HAVE_LIBGD20=1 /D "USE_GD_IOCTX" /D HAVE_LIBFREETYPE=1 /D "USE_GD_IMGSTRTTF" /D HAVE_GD_STRINGTTF=1 /D HAVE_GD_BUNDLED=1 /D "MSWIN32" /D "HAVE_LIBPNG" /D "HAVE_LIBJPEG" /D "HAVE_GD_GD2" /D HAVE_GD_STRINGFTEX=1 /D HAVE_GD_IMAGESETBRUSH=1 /D HAVE_GD_IMAGESETTILE=1 /FR /FD /c
# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GD_GIF_CREATE=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D HAVE_LIBGD13=1 /D HAVE_LIBGD=1 /D HAVE_LIBGD15=1 /D HAVE_LIBGD204=1 /FR /YX /FD /c
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /I "libgd" /D ZEND_DEBUG=1 /D "HAVE_LIBGD15" /D HAVE_LIBGD204=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GD_GIF_CREATE=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D HAVE_LIBGD=1 /D HAVE_LIBGD13=1 /D HAVE_LIBGD20=1 /D "USE_GD_IOCTX" /D HAVE_LIBFREETYPE=1 /D "USE_GD_IMGSTRTTF" /D HAVE_GD_STRINGTTF=1 /D HAVE_GD_BUNDLED=1 /D "MSWIN32" /D "HAVE_LIBPNG" /D "HAVE_LIBJPEG" /D "HAVE_GD_GD2" /D HAVE_GD_STRINGFTEX=1 /D HAVE_GD_IMAGESETBRUSH=1 /D HAVE_GD_IMAGESETTILE=1 /FR /FD /c
# SUBTRACT CPP /YX
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
@@ -231,6 +231,10 @@ SOURCE=.\libgd\gd_gif_in.c
# End Source File
# Begin Source File
SOURCE=.\libgd\gd_gif_out.c
# End Source File
# Begin Source File
SOURCE=.\libgd\gd_io.c
!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
+19 -4
View File
@@ -1290,7 +1290,9 @@ void gdImageAALine (gdImagePtr im, int x1, int y1, int x2, int y2, int col)
inc = (dy * 65536) / dx;
while ((x >> 16) < x2) {
gdImageSetAAPixelColor(im, x >> 16, y >> 16, col, (y >> 8) & 0xFF);
gdImageSetAAPixelColor(im, x >> 16, (y >> 16) + 1,col, (~y >> 8) & 0xFF);
if ((y >> 16) + 1 < im->sy) {
gdImageSetAAPixelColor(im, x >> 16, (y >> 16) + 1,col, (~y >> 8) & 0xFF);
}
x += (1 << 16);
y += inc;
}
@@ -1310,7 +1312,9 @@ void gdImageAALine (gdImagePtr im, int x1, int y1, int x2, int y2, int col)
inc = (dx * 65536) / dy;
while ((y>>16) < y2) {
gdImageSetAAPixelColor(im, x >> 16, y >> 16, col, (x >> 8) & 0xFF);
gdImageSetAAPixelColor(im, (x >> 16) + 1, (y >> 16),col, (~x >> 8) & 0xFF);
if ((x >> 16) + 1 < im->sx) {
gdImageSetAAPixelColor(im, (x >> 16) + 1, (y >> 16),col, (~x >> 8) & 0xFF);
}
x += inc;
y += (1<<16);
}
@@ -1603,9 +1607,14 @@ void gdImageFilledArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e
int lx = 0, ly = 0;
int fx = 0, fy = 0;
while (s<0) {
s += 360;
}
while (e < s) {
e += 360;
}
for (i = s; i <= e; i++) {
int x, y;
x = ((long) gdCosT[i % 360] * (long) w / (2 * 1024)) + cx;
@@ -1823,7 +1832,7 @@ void gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color)
if (y < ((im->sy) - 1)) {
lastBorder = 1;
for (i = leftLimit; i <= rightLimit; i++) {
int c = gdImageGetTrueColorPixel(im, i, y + 1);
int c = gdImageGetPixel(im, i, y + 1);
if (lastBorder) {
if ((c != border) && (c != color)) {
@@ -1870,13 +1879,18 @@ void gdImageFill(gdImagePtr im, int x, int y, int nc)
int l, x1, x2, dy;
int oc; /* old pixel value */
int wx2,wy2;
int alphablending_bak;
/* stack of filled segments */
//struct seg stack[FILL_MAX],*sp = stack;;
/* struct seg stack[FILL_MAX],*sp = stack;; */
struct seg *stack;
struct seg *sp;
alphablending_bak = im->alphaBlendingFlag;
im->alphaBlendingFlag = 0;
if (nc==gdTiled){
_gdImageFillTiled(im,x,y,nc);
im->alphaBlendingFlag = alphablending_bak;
return;
}
@@ -1922,6 +1936,7 @@ skip: for (x++; x<=x2 && (gdImageGetPixel(im, x, y)!=oc); x++);
} while (x<=x2);
}
efree(stack);
im->alphaBlendingFlag = alphablending_bak;
}
void _gdImageFillTiled(gdImagePtr im, int x, int y, int nc)
+75 -30
View File
@@ -11,7 +11,7 @@ extern "C" {
#define PATHSEPARATOR ":"
#else
/* default fontpath for windows systems */
#define DEFAULT_FONTPATH "c:\\winnt\\fonts;."
#define DEFAULT_FONTPATH "c:\\winnt\\fonts;c:\\windows\\fonts;."
#define PATHSEPARATOR ";"
#endif
@@ -21,8 +21,8 @@ extern "C" {
* that the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation. This software is provided "AS IS." Thomas Boutell and
* Boutell.Com, Inc. disclaim all warranties, either express or implied,
* including but not limited to implied warranties of merchantability and
* Boutell.Com, Inc. disclaim all warranties, either express or implied,
* including but not limited to implied warranties of merchantability and
* fitness for a particular purpose, with respect to this code and accompanying
* documentation. */
@@ -43,19 +43,19 @@ void php_gd_error(const char *format, ...);
/* Image type. See functions below; you will not need to change
the elements directly. Use the provided macros to
access sx, sy, the color table, and colorsTotal for
access sx, sy, the color table, and colorsTotal for
read-only purposes. */
/* If 'truecolor' is set true, the image is truecolor;
/* If 'truecolor' is set true, the image is truecolor;
pixels are represented by integers, which
must be 32 bits wide or more.
must be 32 bits wide or more.
True colors are repsented as follows:
ARGB
Where 'A' (alpha channel) occupies only the
LOWER 7 BITS of the MSB. This very small
LOWER 7 BITS of the MSB. This very small
loss of alpha channel resolution allows gd 2.x
to keep backwards compatibility by allowing
signed integers to be used to represent colors,
@@ -78,7 +78,7 @@ void php_gd_error(const char *format, ...);
#define gdEffectOverlay 3
/* This function accepts truecolor pixel values only. The
/* This function accepts truecolor pixel values only. The
source color is composited with the destination color
based on the alpha channel value of the source color.
The resulting color is opaque. */
@@ -96,11 +96,11 @@ typedef struct gdImageStruct {
int colorsTotal;
int red[gdMaxColors];
int green[gdMaxColors];
int blue[gdMaxColors];
int blue[gdMaxColors];
int open[gdMaxColors];
/* For backwards compatibility, this is set to the
first palette entry with 100% transparency,
and is also set and reset by the
and is also set and reset by the
gdImageColorTransparent function. Newer
applications can allocate palette entries
with any desired level of transparency; however,
@@ -112,7 +112,7 @@ typedef struct gdImageStruct {
int *polyInts;
int polyAllocated;
struct gdImageStruct *brush;
struct gdImageStruct *tile;
struct gdImageStruct *tile;
int brushColorMap[gdMaxColors];
int tileColorMap[gdMaxColors];
int styleLength;
@@ -126,10 +126,10 @@ typedef struct gdImageStruct {
really support multiple levels of transparency in
palettes, to my knowledge, as of 2/15/01. Most
common browsers will display 100% opaque and
100% transparent correctly, and do something
100% transparent correctly, and do something
unpredictable and/or undesirable for levels
in between. TBB */
int alpha[gdMaxColors];
int alpha[gdMaxColors];
/* Truecolor flag and pixels. New 2.0 fields appear here at the
end to minimize breakage of existing object code. */
int trueColor;
@@ -137,7 +137,7 @@ typedef struct gdImageStruct {
/* Should alpha channel be copied, or applied, each time a
pixel is drawn? This applies to truecolor images only.
No attempt is made to alpha-blend in palette images,
even if semitransparent palette entries exist.
even if semitransparent palette entries exist.
To do that, build your image as a truecolor image,
then quantize down to 8 bits. */
int alphaBlendingFlag;
@@ -147,7 +147,7 @@ typedef struct gdImageStruct {
PNG at the moment; other future formats may also
have that capability. JPEG doesn't. */
int saveAlphaFlag;
/* 2.0.12: anti-aliased globals */
int AA;
@@ -156,7 +156,7 @@ typedef struct gdImageStruct {
unsigned char **AA_opacity;
int AA_polygon;
/* Stored and pre-computed variables for determining the perpendicular
* distance from a point to the anti-aliased line being drawn:
* distance from a point to the anti-aliased line being drawn:
*/
int AAL_x1;
int AAL_y1;
@@ -230,7 +230,7 @@ gdImagePtr gdImageCreateTrueColor(int sx, int sy);
gdImagePtr gdImageCreateFromPng(FILE *fd);
gdImagePtr gdImageCreateFromPngCtx(gdIOCtxPtr in);
gdImagePtr gdImageCreateFromWBMP(FILE *inFile);
gdImagePtr gdImageCreateFromWBMPCtx(gdIOCtx *infile);
gdImagePtr gdImageCreateFromWBMPCtx(gdIOCtx *infile);
gdImagePtr gdImageCreateFromJpeg(FILE *infile);
gdImagePtr gdImageCreateFromJpegCtx(gdIOCtx *infile);
@@ -256,6 +256,7 @@ gdImagePtr gdImageCreateFromGd2Part(FILE *in, int srcx, int srcy, int w, int h);
gdImagePtr gdImageCreateFromGd2PartCtx(gdIOCtxPtr in, int srcx, int srcy, int w, int h);
gdImagePtr gdImageCreateFromXbm(FILE *fd);
void gdImageXbmCtx(gdImagePtr image, char* file_name, int fg, gdIOCtx * out);
gdImagePtr gdImageCreateFromXpm (char *filename);
@@ -263,11 +264,11 @@ void gdImageDestroy(gdImagePtr im);
/* Replaces or blends with the background depending on the
most recent call to gdImageAlphaBlending and the
alpha channel value of 'color'; default is to overwrite.
alpha channel value of 'color'; default is to overwrite.
Tiling and line styling are also implemented
here. All other gd drawing functions pass through this call,
here. All other gd drawing functions pass through this call,
allowing for many useful effects. */
void gdImageSetPixel(gdImagePtr im, int x, int y, int color);
int gdImageGetPixel(gdImagePtr im, int x, int y);
@@ -295,9 +296,9 @@ void gdImageString16(gdImagePtr im, gdFontPtr f, int x, int y, unsigned short *s
void gdImageStringUp16(gdImagePtr im, gdFontPtr f, int x, int y, unsigned short *s, int color);
/* 2.0.16: for thread-safe use of gdImageStringFT and friends,
* call this before allowing any thread to call gdImageStringFT.
* call this before allowing any thread to call gdImageStringFT.
* Otherwise it is invoked by the first thread to invoke
* gdImageStringFT, with a very small but real risk of a race condition.
* gdImageStringFT, with a very small but real risk of a race condition.
* Return 0 on success, nonzero on failure to initialize freetype.
*/
int gdFontCacheSetup(void);
@@ -320,11 +321,14 @@ typedef struct {
gdFTEX_Shift_JIS, or gdFTEX_Big5;
when not specified, maps are searched
for in the above order. */
int hdpi;
int vdpi;
}
gdFTStringExtra, *gdFTStringExtraPtr;
#define gdFTEX_LINESPACE 1
#define gdFTEX_CHARMAP 2
#define gdFTEX_RESOLUTION 4
/* These are NOT flags; set one in 'charmap' if you set the gdFTEX_CHARMAP bit in 'flags'. */
#define gdFTEX_Unicode 0
@@ -346,7 +350,7 @@ typedef struct {
void gdImagePolygon(gdImagePtr im, gdPointPtr p, int n, int c);
void gdImageFilledPolygon(gdImagePtr im, gdPointPtr p, int n, int c);
/* These functions still work with truecolor images,
/* These functions still work with truecolor images,
for which they never return error. */
int gdImageColorAllocate(gdImagePtr im, int r, int g, int b);
/* gd 2.0: palette entries with non-opaque transparency are permitted. */
@@ -403,8 +407,11 @@ void gdImageColorDeallocate(gdImagePtr im, int color);
conversion to palette is not great (for small images
it can be negative) and the quality loss is ugly. */
gdImagePtr gdImageCreatePaletteFromTrueColor (gdImagePtr im, int ditherFlag, int colorsWanted);
void gdImageTrueColorToPalette(gdImagePtr im, int ditherFlag, int colorsWanted);
/* An attempt at getting the results of gdImageTrueColorToPalette
to look a bit more like the original (im1 is the original
and im2 is the palette version */
@@ -424,10 +431,12 @@ void gdImageColorTransparent(gdImagePtr im, int color);
void gdImagePaletteCopy(gdImagePtr dst, gdImagePtr src);
void gdImagePng(gdImagePtr im, FILE *out);
void gdImagePngCtx(gdImagePtr im, gdIOCtx *out);
void gdImageGif(gdImagePtr im, FILE *out);
void gdImageGifCtx(gdImagePtr im, gdIOCtx *out);
/* 2.0.12: Compression level: 0-9 or -1, where 0 is NO COMPRESSION at all,
* 1 is FASTEST but produces larger files, 9 provides the best
* compression (smallest files) but takes a long time to compress, and
* -1 selects the default compiled into the zlib library.
* -1 selects the default compiled into the zlib library.
*/
void gdImagePngEx(gdImagePtr im, FILE * out, int level);
void gdImagePngCtxEx(gdImagePtr im, gdIOCtx * out, int level);
@@ -485,7 +494,7 @@ void gdImageEllipse(gdImagePtr im, int cx, int cy, int w, int h, int c);
gdArc and gdChord are mutually exclusive;
gdChord just connects the starting and ending
angles with a straight line, while gdArc produces
a rounded edge. gdPie is a synonym for gdArc.
a rounded edge. gdPie is a synonym for gdArc.
gdNoFill indicates that the arc or chord should be
outlined, not filled. gdEdged, used together with
gdNoFill, indicates that the beginning and ending
@@ -504,7 +513,7 @@ void gdImageFilledEllipse(gdImagePtr im, int cx, int cy, int w, int h, int color
void gdImageFillToBorder(gdImagePtr im, int x, int y, int border, int color);
void gdImageFill(gdImagePtr im, int x, int y, int color);
void gdImageCopy(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h);
void gdImageCopyMerge(gdImagePtr dst, gdImagePtr src, int dstX, int dstY,
void gdImageCopyMerge(gdImagePtr dst, gdImagePtr src, int dstX, int dstY,
int srcX, int srcY, int w, int h, int pct);
void gdImageCopyMergeGray(gdImagePtr dst, gdImagePtr src, int dstX, int dstY,
int srcX, int srcY, int w, int h, int pct);
@@ -520,8 +529,8 @@ void gdImageCopyResized(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int
destination pixel, taking into account what portion of the
destination pixel each source pixel represents. This is a
floating point operation, but this is not a performance issue
on modern hardware, except for some embedded devices. If the
destination is a palette image, gdImageCopyResized is
on modern hardware, except for some embedded devices. If the
destination is a palette image, gdImageCopyResized is
substituted automatically. */
void gdImageCopyResampled(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH);
@@ -536,7 +545,7 @@ void gdImageSetTile(gdImagePtr im, gdImagePtr tile);
void gdImageSetAntiAliased(gdImagePtr im, int c);
void gdImageSetAntiAliasedDontBlend(gdImagePtr im, int c, int dont_blend);
void gdImageSetStyle(gdImagePtr im, int *style, int noOfPixels);
/* Line thickness (defaults to 1). Affects lines, ellipses,
/* Line thickness (defaults to 1). Affects lines, ellipses,
rectangles, polygons and so forth. */
void gdImageSetThickness(gdImagePtr im, int thickness);
/* On or off (1 or 0) for all three of these. */
@@ -582,7 +591,7 @@ gdIOCtx *gdNewDynamicCtxEx(int size, void *data, int freeFlag);
gdIOCtx* gdNewSSCtx(gdSourcePtr in, gdSinkPtr out);
void* gdDPExtractData(struct gdIOCtx* ctx, int *size);
#define GD2_CHUNKSIZE 128
#define GD2_CHUNKSIZE 128
#define GD2_CHUNKSIZE_MIN 64
#define GD2_CHUNKSIZE_MAX 4096
@@ -591,6 +600,42 @@ void* gdDPExtractData(struct gdIOCtx* ctx, int *size);
#define GD2_FMT_RAW 1
#define GD2_FMT_COMPRESSED 2
/* filters section
*
* Negate the imag src, white becomes black,
* The red, green, and blue intensities of an image are negated.
* White becomes black, yellow becomes blue, etc.
*/
int gdImageNegate(gdImagePtr src);
/* Convert the image src to a grayscale image */
int gdImageGrayScale(gdImagePtr src);
/* Set the brightness level <brightness> for the image src */
int gdImageBrightness(gdImagePtr src, int brightness);
/* Set the contrast level <contrast> for the image <src> */
int gdImageContrast(gdImagePtr src, double contrast);
/* Simply adds or substracts respectively red, green or blue to a pixel */
int gdImageColor(gdImagePtr src, int red, int green, int blue);
/* Image convolution by a 3x3 custom matrix */
int gdImageConvolution(gdImagePtr src, float ft[3][3], float filter_div, float offset);
int gdImageEdgeDetectQuick(gdImagePtr src);
int gdImageGaussianBlur(gdImagePtr im);
int gdImageSelectiveBlur( gdImagePtr src);
int gdImageEmboss(gdImagePtr im);
int gdImageMeanRemoval(gdImagePtr im);
int gdImageSmooth(gdImagePtr im, float weight);
/* Image comparison definitions */
int gdImageCompare(gdImagePtr im1, gdImagePtr im2);
+759
View File
@@ -0,0 +1,759 @@
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include "gd.h"
/* Code drawn from ppmtogif.c, from the pbmplus package
**
** Based on GIFENCOD by David Rowley <mgardi@watdscu.waterloo.edu>. A
** Lempel-Zim compression based on "compress".
**
** Modified by Marcel Wijkstra <wijkstra@fwi.uva.nl>
**
** Copyright (C) 1989 by Jef Poskanzer.
**
** Permission to use, copy, modify, and distribute this software and its
** documentation for any purpose and without fee is hereby granted, provided
** that the above copyright notice appear in all copies and that both that
** copyright notice and this permission notice appear in supporting
** documentation. This software is provided "as is" without express or
** implied warranty.
**
** The Graphics Interchange Format(c) is the Copyright property of
** CompuServe Incorporated. GIF(sm) is a Service Mark property of
** CompuServe Incorporated.
*/
/*
* a code_int must be able to hold 2**GIFBITS values of type int, and also -1
*/
typedef int code_int;
#ifdef SIGNED_COMPARE_SLOW
typedef unsigned long int count_int;
typedef unsigned short int count_short;
#else /*SIGNED_COMPARE_SLOW*/
typedef long int count_int;
#endif /*SIGNED_COMPARE_SLOW*/
/* 2.0.28: threadsafe */
#define maxbits GIFBITS
/* should NEVER generate this code */
#define maxmaxcode ((code_int)1 << GIFBITS)
#define HSIZE 5003 /* 80% occupancy */
#define hsize HSIZE /* Apparently invariant, left over from
compress */
typedef struct {
int Width, Height;
int curx, cury;
long CountDown;
int Pass;
int Interlace;
int n_bits; /* number of bits/code */
code_int maxcode; /* maximum code, given n_bits */
count_int htab [HSIZE];
unsigned short codetab [HSIZE];
code_int free_ent; /* first unused entry */
/*
* block compression parameters -- after all codes are used up,
* and compression rate changes, start over.
*/
int clear_flg;
int offset;
long int in_count; /* length of input */
long int out_count; /* # of codes output (for debugging) */
int g_init_bits;
gdIOCtx * g_outfile;
int ClearCode;
int EOFCode;
unsigned long cur_accum;
int cur_bits;
/*
* Number of characters so far in this 'packet'
*/
int a_count;
/*
* Define the storage for the packet accumulator
*/
char accum[ 256 ];
} GifCtx;
static int gifPutWord(int w, gdIOCtx *out);
static int colorstobpp(int colors);
static void BumpPixel (GifCtx *ctx);
static int GIFNextPixel (gdImagePtr im, GifCtx *ctx);
static void GIFEncode (gdIOCtxPtr fp, int GWidth, int GHeight, int GInterlace, int Background, int Transparent, int BitsPerPixel, int *Red, int *Green, int *Blue, gdImagePtr im);
static void compress (int init_bits, gdIOCtx *outfile, gdImagePtr im, GifCtx *ctx);
static void output (code_int code, GifCtx *ctx);
static void cl_block (GifCtx *ctx);
static void cl_hash (register count_int chsize, GifCtx *ctx);
static void char_init (GifCtx *ctx);
static void char_out (int c, GifCtx *ctx);
static void flush_char (GifCtx *ctx);
void * gdImageGifPtr (gdImagePtr im, int *size)
{
void *rv;
gdIOCtx *out = gdNewDynamicCtx (2048, NULL);
gdImageGifCtx (im, out);
rv = gdDPExtractData (out, size);
out->gd_free (out);
return rv;
}
void gdImageGif (gdImagePtr im, FILE * outFile)
{
gdIOCtx *out = gdNewFileCtx (outFile);
gdImageGifCtx (im, out);
out->gd_free (out);
}
void gdImageGifCtx(gdImagePtr im, gdIOCtxPtr out)
{
gdImagePtr pim = 0, tim = im;
int interlace, transparent, BitsPerPixel;
interlace = im->interlace;
transparent = im->transparent;
if (im->trueColor) {
/* Expensive, but the only way that produces an
acceptable result: mix down to a palette
based temporary image. */
pim = gdImageCreatePaletteFromTrueColor(im, 1, 256);
if (!pim) {
return;
}
tim = pim;
}
BitsPerPixel = colorstobpp(tim->colorsTotal);
/* All set, let's do it. */
GIFEncode(
out, tim->sx, tim->sy, interlace, 0, transparent, BitsPerPixel,
tim->red, tim->green, tim->blue, tim);
if (pim) {
/* Destroy palette based temporary image. */
gdImageDestroy( pim);
}
}
static int
colorstobpp(int colors)
{
int bpp = 0;
if ( colors <= 2 )
bpp = 1;
else if ( colors <= 4 )
bpp = 2;
else if ( colors <= 8 )
bpp = 3;
else if ( colors <= 16 )
bpp = 4;
else if ( colors <= 32 )
bpp = 5;
else if ( colors <= 64 )
bpp = 6;
else if ( colors <= 128 )
bpp = 7;
else if ( colors <= 256 )
bpp = 8;
return bpp;
}
/*****************************************************************************
*
* GIFENCODE.C - GIF Image compression interface
*
* GIFEncode( FName, GHeight, GWidth, GInterlace, Background, Transparent,
* BitsPerPixel, Red, Green, Blue, gdImagePtr )
*
*****************************************************************************/
#define TRUE 1
#define FALSE 0
/*
* Bump the 'curx' and 'cury' to point to the next pixel
*/
static void
BumpPixel(GifCtx *ctx)
{
/*
* Bump the current X position
*/
++(ctx->curx);
/*
* If we are at the end of a scan line, set curx back to the beginning
* If we are interlaced, bump the cury to the appropriate spot,
* otherwise, just increment it.
*/
if( ctx->curx == ctx->Width ) {
ctx->curx = 0;
if( !ctx->Interlace )
++(ctx->cury);
else {
switch( ctx->Pass ) {
case 0:
ctx->cury += 8;
if( ctx->cury >= ctx->Height ) {
++(ctx->Pass);
ctx->cury = 4;
}
break;
case 1:
ctx->cury += 8;
if( ctx->cury >= ctx->Height ) {
++(ctx->Pass);
ctx->cury = 2;
}
break;
case 2:
ctx->cury += 4;
if( ctx->cury >= ctx->Height ) {
++(ctx->Pass);
ctx->cury = 1;
}
break;
case 3:
ctx->cury += 2;
break;
}
}
}
}
/*
* Return the next pixel from the image
*/
static int
GIFNextPixel(gdImagePtr im, GifCtx *ctx)
{
int r;
if( ctx->CountDown == 0 )
return EOF;
--(ctx->CountDown);
r = gdImageGetPixel(im, ctx->curx, ctx->cury);
BumpPixel(ctx);
return r;
}
/* public */
static void
GIFEncode(gdIOCtxPtr fp, int GWidth, int GHeight, int GInterlace, int Background, int Transparent, int BitsPerPixel, int *Red, int *Green, int *Blue, gdImagePtr im)
{
int B;
int RWidth, RHeight;
int LeftOfs, TopOfs;
int Resolution;
int ColorMapSize;
int InitCodeSize;
int i;
GifCtx ctx;
ctx.Interlace = GInterlace;
ctx.in_count = 1;
memset(&ctx, 0, sizeof(ctx));
ColorMapSize = 1 << BitsPerPixel;
RWidth = ctx.Width = GWidth;
RHeight = ctx.Height = GHeight;
LeftOfs = TopOfs = 0;
Resolution = BitsPerPixel;
/*
* Calculate number of bits we are expecting
*/
ctx.CountDown = (long)ctx.Width * (long)ctx.Height;
/*
* Indicate which pass we are on (if interlace)
*/
ctx.Pass = 0;
/*
* The initial code size
*/
if( BitsPerPixel <= 1 )
InitCodeSize = 2;
else
InitCodeSize = BitsPerPixel;
/*
* Set up the current x and y position
*/
ctx.curx = ctx.cury = 0;
/*
* Write the Magic header
*/
gdPutBuf(Transparent < 0 ? "GIF87a" : "GIF89a", 6, fp );
/*
* Write out the screen width and height
*/
gifPutWord( RWidth, fp );
gifPutWord( RHeight, fp );
/*
* Indicate that there is a global colour map
*/
B = 0x80; /* Yes, there is a color map */
/*
* OR in the resolution
*/
B |= (Resolution - 1) << 5;
/*
* OR in the Bits per Pixel
*/
B |= (BitsPerPixel - 1);
/*
* Write it out
*/
gdPutC( B, fp );
/*
* Write out the Background colour
*/
gdPutC( Background, fp );
/*
* Byte of 0's (future expansion)
*/
gdPutC( 0, fp );
/*
* Write out the Global Colour Map
*/
for( i=0; i<ColorMapSize; ++i ) {
gdPutC( Red[i], fp );
gdPutC( Green[i], fp );
gdPutC( Blue[i], fp );
}
/*
* Write out extension for transparent colour index, if necessary.
*/
if ( Transparent >= 0 ) {
gdPutC( '!', fp );
gdPutC( 0xf9, fp );
gdPutC( 4, fp );
gdPutC( 1, fp );
gdPutC( 0, fp );
gdPutC( 0, fp );
gdPutC( (unsigned char) Transparent, fp );
gdPutC( 0, fp );
}
/*
* Write an Image separator
*/
gdPutC( ',', fp );
/*
* Write the Image header
*/
gifPutWord( LeftOfs, fp );
gifPutWord( TopOfs, fp );
gifPutWord( ctx.Width, fp );
gifPutWord( ctx.Height, fp );
/*
* Write out whether or not the image is interlaced
*/
if( ctx.Interlace )
gdPutC( 0x40, fp );
else
gdPutC( 0x00, fp );
/*
* Write out the initial code size
*/
gdPutC( InitCodeSize, fp );
/*
* Go and actually compress the data
*/
compress( InitCodeSize+1, fp, im, &ctx );
/*
* Write out a Zero-length packet (to end the series)
*/
gdPutC( 0, fp );
/*
* Write the GIF file terminator
*/
gdPutC( ';', fp );
}
/***************************************************************************
*
* GIFCOMPR.C - GIF Image compression routines
*
* Lempel-Ziv compression based on 'compress'. GIF modifications by
* David Rowley (mgardi@watdcsu.waterloo.edu)
*
***************************************************************************/
/*
* General DEFINEs
*/
#define GIFBITS 12
#ifdef NO_UCHAR
typedef char char_type;
#else /*NO_UCHAR*/
typedef unsigned char char_type;
#endif /*NO_UCHAR*/
/*
*
* GIF Image compression - modified 'compress'
*
* Based on: compress.c - File compression ala IEEE Computer, June 1984.
*
* By Authors: Spencer W. Thomas (decvax!harpo!utah-cs!utah-gr!thomas)
* Jim McKie (decvax!mcvax!jim)
* Steve Davies (decvax!vax135!petsd!peora!srd)
* Ken Turkowski (decvax!decwrl!turtlevax!ken)
* James A. Woods (decvax!ihnp4!ames!jaw)
* Joe Orost (decvax!vax135!petsd!joe)
*
*/
#include <ctype.h>
#define ARGVAL() (*++(*argv) || (--argc && *++argv))
#ifdef COMPATIBLE /* But wrong! */
# define MAXCODE(n_bits) ((code_int) 1 << (n_bits) - 1)
#else /*COMPATIBLE*/
# define MAXCODE(n_bits) (((code_int) 1 << (n_bits)) - 1)
#endif /*COMPATIBLE*/
#define HashTabOf(i) ctx->htab[i]
#define CodeTabOf(i) ctx->codetab[i]
/*
* To save much memory, we overlay the table used by compress() with those
* used by decompress(). The tab_prefix table is the same size and type
* as the codetab. The tab_suffix table needs 2**GIFBITS characters. We
* get this from the beginning of htab. The output stack uses the rest
* of htab, and contains characters. There is plenty of room for any
* possible stack (stack used to be 8000 characters).
*/
#define tab_prefixof(i) CodeTabOf(i)
#define tab_suffixof(i) ((char_type*)(htab))[i]
#define de_stack ((char_type*)&tab_suffixof((code_int)1<<GIFBITS))
/*
* compress stdin to stdout
*
* Algorithm: use open addressing double hashing (no chaining) on the
* prefix code / next character combination. We do a variant of Knuth's
* algorithm D (vol. 3, sec. 6.4) along with G. Knott's relatively-prime
* secondary probe. Here, the modular division first probe is gives way
* to a faster exclusive-or manipulation. Also do block compression with
* an adaptive reset, whereby the code table is cleared when the compression
* ratio decreases, but after the table fills. The variable-length output
* codes are re-sized at this point, and a special CLEAR code is generated
* for the decompressor. Late addition: construct the table according to
* file size for noticeable speed improvement on small files. Please direct
* questions about this implementation to ames!jaw.
*/
static void
output(code_int code, GifCtx *ctx);
static void
compress(int init_bits, gdIOCtxPtr outfile, gdImagePtr im, GifCtx *ctx)
{
register long fcode;
register code_int i /* = 0 */;
register int c;
register code_int ent;
register code_int disp;
register code_int hsize_reg;
register int hshift;
/*
* Set up the globals: g_init_bits - initial number of bits
* g_outfile - pointer to output file
*/
ctx->g_init_bits = init_bits;
ctx->g_outfile = outfile;
/*
* Set up the necessary values
*/
ctx->offset = 0;
ctx->out_count = 0;
ctx->clear_flg = 0;
ctx->in_count = 1;
ctx->maxcode = MAXCODE(ctx->n_bits = ctx->g_init_bits);
ctx->ClearCode = (1 << (init_bits - 1));
ctx->EOFCode = ctx->ClearCode + 1;
ctx->free_ent = ctx->ClearCode + 2;
char_init(ctx);
ent = GIFNextPixel( im, ctx );
hshift = 0;
for ( fcode = (long) hsize; fcode < 65536L; fcode *= 2L )
++hshift;
hshift = 8 - hshift; /* set hash code range bound */
hsize_reg = hsize;
cl_hash( (count_int) hsize_reg, ctx ); /* clear hash table */
output( (code_int)ctx->ClearCode, ctx );
#ifdef SIGNED_COMPARE_SLOW
while ( (c = GIFNextPixel( im )) != (unsigned) EOF ) {
#else /*SIGNED_COMPARE_SLOW*/
while ( (c = GIFNextPixel( im, ctx )) != EOF ) { /* } */
#endif /*SIGNED_COMPARE_SLOW*/
++(ctx->in_count);
fcode = (long) (((long) c << maxbits) + ent);
i = (((code_int)c << hshift) ^ ent); /* xor hashing */
if ( HashTabOf (i) == fcode ) {
ent = CodeTabOf (i);
continue;
} else if ( (long)HashTabOf (i) < 0 ) /* empty slot */
goto nomatch;
disp = hsize_reg - i; /* secondary hash (after G. Knott) */
if ( i == 0 )
disp = 1;
probe:
if ( (i -= disp) < 0 )
i += hsize_reg;
if ( HashTabOf (i) == fcode ) {
ent = CodeTabOf (i);
continue;
}
if ( (long)HashTabOf (i) > 0 )
goto probe;
nomatch:
output ( (code_int) ent, ctx );
++(ctx->out_count);
ent = c;
#ifdef SIGNED_COMPARE_SLOW
if ( (unsigned) ctx->free_ent < (unsigned) maxmaxcode) {
#else /*SIGNED_COMPARE_SLOW*/
if ( ctx->free_ent < maxmaxcode ) { /* } */
#endif /*SIGNED_COMPARE_SLOW*/
CodeTabOf (i) = ctx->free_ent++; /* code -> hashtable */
HashTabOf (i) = fcode;
} else
cl_block(ctx);
}
/*
* Put out the final code.
*/
output( (code_int)ent, ctx );
++(ctx->out_count);
output( (code_int) ctx->EOFCode, ctx );
}
/*****************************************************************
* TAG( output )
*
* Output the given code.
* Inputs:
* code: A n_bits-bit integer. If == -1, then EOF. This assumes
* that n_bits =< (long)wordsize - 1.
* Outputs:
* Outputs code to the file.
* Assumptions:
* Chars are 8 bits long.
* Algorithm:
* Maintain a GIFBITS character long buffer (so that 8 codes will
* fit in it exactly). Use the VAX insv instruction to insert each
* code in turn. When the buffer fills up empty it and start over.
*/
static unsigned long masks[] = { 0x0000, 0x0001, 0x0003, 0x0007, 0x000F,
0x001F, 0x003F, 0x007F, 0x00FF,
0x01FF, 0x03FF, 0x07FF, 0x0FFF,
0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF };
static void
output(code_int code, GifCtx *ctx)
{
ctx->cur_accum &= masks[ ctx->cur_bits ];
if( ctx->cur_bits > 0 )
ctx->cur_accum |= ((long)code << ctx->cur_bits);
else
ctx->cur_accum = code;
ctx->cur_bits += ctx->n_bits;
while( ctx->cur_bits >= 8 ) {
char_out( (unsigned int)(ctx->cur_accum & 0xff), ctx );
ctx->cur_accum >>= 8;
ctx->cur_bits -= 8;
}
/*
* If the next entry is going to be too big for the code size,
* then increase it, if possible.
*/
if ( ctx->free_ent > ctx->maxcode || ctx->clear_flg ) {
if( ctx->clear_flg ) {
ctx->maxcode = MAXCODE (ctx->n_bits = ctx->g_init_bits);
ctx->clear_flg = 0;
} else {
++(ctx->n_bits);
if ( ctx->n_bits == maxbits )
ctx->maxcode = maxmaxcode;
else
ctx->maxcode = MAXCODE(ctx->n_bits);
}
}
if( code == ctx->EOFCode ) {
/*
* At EOF, write the rest of the buffer.
*/
while( ctx->cur_bits > 0 ) {
char_out( (unsigned int)(ctx->cur_accum & 0xff), ctx);
ctx->cur_accum >>= 8;
ctx->cur_bits -= 8;
}
flush_char(ctx);
}
}
/*
* Clear out the hash table
*/
static void
cl_block (GifCtx *ctx) /* table clear for block compress */
{
cl_hash ( (count_int) hsize, ctx );
ctx->free_ent = ctx->ClearCode + 2;
ctx->clear_flg = 1;
output( (code_int)ctx->ClearCode, ctx);
}
static void
cl_hash(register count_int chsize, GifCtx *ctx) /* reset code table */
{
register count_int *htab_p = ctx->htab+chsize;
register long i;
register long m1 = -1;
i = chsize - 16;
do { /* might use Sys V memset(3) here */
*(htab_p-16) = m1;
*(htab_p-15) = m1;
*(htab_p-14) = m1;
*(htab_p-13) = m1;
*(htab_p-12) = m1;
*(htab_p-11) = m1;
*(htab_p-10) = m1;
*(htab_p-9) = m1;
*(htab_p-8) = m1;
*(htab_p-7) = m1;
*(htab_p-6) = m1;
*(htab_p-5) = m1;
*(htab_p-4) = m1;
*(htab_p-3) = m1;
*(htab_p-2) = m1;
*(htab_p-1) = m1;
htab_p -= 16;
} while ((i -= 16) >= 0);
for ( i += 16; i > 0; --i )
*--htab_p = m1;
}
/******************************************************************************
*
* GIF Specific routines
*
******************************************************************************/
/*
* Set up the 'byte output' routine
*/
static void
char_init(GifCtx *ctx)
{
ctx->a_count = 0;
}
/*
* Add a character to the end of the current packet, and if it is 254
* characters, flush the packet to disk.
*/
static void
char_out(int c, GifCtx *ctx)
{
ctx->accum[ ctx->a_count++ ] = c;
if( ctx->a_count >= 254 )
flush_char(ctx);
}
/*
* Flush the packet to disk, and reset the accumulator
*/
static void
flush_char(GifCtx *ctx)
{
if( ctx->a_count > 0 ) {
gdPutC( ctx->a_count, ctx->g_outfile );
gdPutBuf( ctx->accum, ctx->a_count, ctx->g_outfile );
ctx->a_count = 0;
}
}
static int gifPutWord(int w, gdIOCtx *out)
{
/* Byte order is little-endian */
gdPutC(w & 0xFF, out);
gdPutC((w >> 8) & 0xFF, out);
return 0;
}
+1333 -1137
View File
File diff suppressed because it is too large. Load diff
+18 -4
View File
@@ -473,7 +473,7 @@ static void *fontFetch (char **error, void *key)
encoding = charmap->encoding_id;
/* EAM DEBUG - Newer versions of libfree2 make it easier by defining encodings */
#if (defined(FREETYPE_MAJOR) && (FREETYPE_MAJOR >=2 ) && (FREETYPE_MINOR >= 1))
#if (defined(FREETYPE_MAJOR) && ((FREETYPE_MAJOR == 2 && ((FREETYPE_MINOR == 1 && FREETYPE_PATCH >= 3) || FREETYPE_MINOR > 1) || FREETYPE_MAJOR > 2)))
if (charmap->encoding == FT_ENCODING_MS_SYMBOL
|| charmap->encoding == FT_ENCODING_ADOBE_CUSTOM
|| charmap->encoding == FT_ENCODING_ADOBE_STANDARD) {
@@ -482,7 +482,7 @@ static void *fontFetch (char **error, void *key)
a->face->charmap = charmap;
return (void *)a;
}
#endif /* Freetype 2.1 or better */
#endif /* Freetype 2.1.3 or better */
/* EAM DEBUG */
if ((platform == 3 && encoding == 1) /* Windows Unicode */
@@ -843,6 +843,8 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
* colorindexes. -- 27.06.2001 <krisku@arrak.fi>
*/
gdCache_head_t *tc_cache;
/* Tuneable horizontal and vertical resolution in dots per inch */
int hdpi, vdpi;
if (strex && ((strex->flags & gdFTEX_LINESPACE) == gdFTEX_LINESPACE)) {
linespace = strex->linespacing;
@@ -872,7 +874,19 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
face = font->face; /* shortcut */
slot = face->glyph; /* shortcut */
if (FT_Set_Char_Size (face, 0, (FT_F26Dot6) (ptsize * 64), GD_RESOLUTION, GD_RESOLUTION)) {
/*
* Added hdpi and vdpi to support images at non-screen resolutions, i.e. 300 dpi TIFF,
* or 100h x 50v dpi FAX format. 2.0.23.
* 2004/02/27 Mark Shackelford, mark.shackelford@acs-inc.com
*/
hdpi = GD_RESOLUTION;
vdpi = GD_RESOLUTION;
if (strex && (strex->flags & gdFTEX_RESOLUTION)) {
hdpi = strex->hdpi;
vdpi = strex->vdpi;
}
if (FT_Set_Char_Size(face, 0, (FT_F26Dot6) (ptsize * 64), hdpi, vdpi)) {
gdCacheDelete(tc_cache);
gdMutexUnlock(gdFontCacheMutex);
return "Could not set character size";
@@ -970,7 +984,7 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
}
/* EAM DEBUG */
#if (defined(FREETYPE_MAJOR) && (FREETYPE_MAJOR >=2 ) && (FREETYPE_MINOR >= 1))
#if (defined(FREETYPE_MAJOR) && ((FREETYPE_MAJOR == 2 && ((FREETYPE_MINOR == 1 && FREETYPE_PATCH >= 3) || FREETYPE_MINOR > 1) || FREETYPE_MAJOR > 2)))
if (font->face->charmap->encoding == FT_ENCODING_MS_SYMBOL) {
/* I do not know the significance of the constant 0xf000.
* It was determined by inspection of the character codes
-92
View File
@@ -1,92 +0,0 @@
--TEST--
Bug #24594 (Filling an area using tiles).
--SKIPIF--
<?php
if (!extension_loaded('gd')) {
die("skip gd extension not available\n");
}
if (!GD_BUNDLED) {
die('skip external GD libraries may fail');
}
?>
--FILE--
<?php
/* $id */
/*
* This test segfaults with the current imagefilltoborder
* implementation. A rewrite of this function is required
* to fix it. The algorithm used in gdImageFill (and the
* privat function for tiled fill) may help here. pierre.
*/
$tile = imagecreate(36,36);
$base = imagecreate(150,150);
$white = imagecolorallocate($tile,255,255,255);
$black = imagecolorallocate($tile,0,0,0);
$white = imagecolorallocate($base,255,255,255);
$black = imagecolorallocate($base,0,0,0);
/* create the dots pattern */
for ($x=0;$x<36;$x+=2) {
for ($y=0;$y<36;$y+=2) {
imagesetpixel($tile,$x,$y,$black);
}
}
imagesettile($base,$tile);
imagerectangle($base, 9,9,139,139,$black);
imageline($base, 9,9,139,139,$black);
imagefill($base,11,12,IMG_COLOR_TILED);
$res = imagecolorat($base,0,10)==$black?'1':'0';
$res .= imagecolorat($base,0,20)==$black?'1':'0';
$res .= imagecolorat($base,0,30)==$black?'1':'0';
$res .= imagecolorat($base,0,40)==$black?'1':'0';
$res .= imagecolorat($base,0,50)==$black?'1':'0';
$res .= imagecolorat($base,0,60)==$black?'1':'0';
$res .= imagecolorat($base,11,12)==$white?'1':'0';
$res .= imagecolorat($base,12,13)==$white?'1':'0';
$res .= imagecolorat($base,13,14)==$white?'1':'0';
$res .= imagecolorat($base,14,15)==$white?'1':'0';
$res .= imagecolorat($base,15,16)==$white?'1':'0';
$res .= imagecolorat($base,16,17)==$white?'1':'0';
$res .= imagecolorat($base,10,12)==$black?'1':'0';
$res .= imagecolorat($base,11,13)==$black?'1':'0';
$res .= imagecolorat($base,12,14)==$black?'1':'0';
$res .= imagecolorat($base,13,15)==$black?'1':'0';
$res .= imagecolorat($base,14,16)==$black?'1':'0';
$res .= imagecolorat($base,15,17)==$black?'1':'0';
echo "$res\n";
imagefilledrectangle($base,0,0,149,149,$white);
imagerectangle($base, 9,9,139,139,$black);
imageline($base, 9,9,139,139,$black);
imagefilltoborder($base,0,0,$black,IMG_COLOR_TILED);
$res = imagecolorat($base,0,10)==$black?'1':'0';
$res .= imagecolorat($base,0,20)==$black?'1':'0';
$res .= imagecolorat($base,0,30)==$black?'1':'0';
$res .= imagecolorat($base,0,40)==$black?'1':'0';
$res .= imagecolorat($base,0,50)==$black?'1':'0';
$res .= imagecolorat($base,0,60)==$black?'1':'0';
$res .= imagecolorat($base,11,12)==$white?'1':'0';
$res .= imagecolorat($base,12,13)==$white?'1':'0';
$res .= imagecolorat($base,13,14)==$white?'1':'0';
$res .= imagecolorat($base,14,15)==$white?'1':'0';
$res .= imagecolorat($base,15,16)==$white?'1':'0';
$res .= imagecolorat($base,16,17)==$white?'1':'0';
$res .= imagecolorat($base,0,16)==$black?'1':'0';
$res .= imagecolorat($base,2,42)==$black?'1':'0';
$res .= imagecolorat($base,4,44)==$black?'1':'0';
$res .= imagecolorat($base,146,146)==$black?'1':'0';
$res .= imagecolorat($base,148,146)==$black?'1':'0';
$res .= imagecolorat($base,0,0)==$black?'1':'0';
echo "$res\n";
?>
--EXPECT--
000000111111101010
111111111111111111
+27
View File
@@ -0,0 +1,27 @@
--TEST--
Bug #28147 (Crash with anti-aliased line)
--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
//
// This script will generate a Seg Fault on Linux
//
$im = imagecreatetruecolor(300, 300);
$w = imagecolorallocate($im, 255, 255, 255);
$red = imagecolorallocate($im, 255, 0, 0);
imagefilledrectangle($im,0,0,299,299,$w);
imageantialias($im,true);
imageline($im, 299, 299, 0, 299, $red);
imagedestroy($im);
echo "Alive\n";
?>
--EXPECT--
Alive
+25
View File
@@ -0,0 +1,25 @@
--TEST--
Bug #28984 (imagefill segfault using a transparent color).
--SKIPIF--
<?php
if (!extension_loaded('gd')) {
die("skip gd extension not available\n");
}
if (!GD_BUNDLED) {
die('skip external GD libraries may fail');
}
?>
--FILE--
<?php
$im = imagecreatetruecolor(100,100);
imagealphablending($im, false);
#$alpha = imagecolorallocatealpha($im, 255, 0, 255,0);
$alpha = imagecolorallocate($im, 255, 0, 0);
imagefill($im, 2, 2, $alpha);
#imagesavealpha($im, true);
imagepng($im, '1.png');
imagedestroy($im);
echo "Done\n";
?>
--EXPECT--
Done
+2 -2
View File
@@ -54,7 +54,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_gettext.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
# ADD LINK32 php4ts.lib libintl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_gettext.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
# ADD LINK32 php4ts.lib libintl.lib iconv.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_gettext.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
!ELSEIF "$(CFG)" == "gettext - Win32 Debug_TS"
@@ -81,7 +81,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib /nologo /dll /machine:I386 /out:"../../Debug_TS/php_gettext.dll" /libpath:"..\..\Debug_TS"
# ADD LINK32 php4ts_debug.lib libintl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /out:"../../Debug_TS/php_gettext.dll" /libpath:"..\..\Debug_TS"
# ADD LINK32 php4ts_debug.lib libintl.lib iconv.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /out:"../../Debug_TS/php_gettext.dll" /libpath:"..\..\Debug_TS"
!ENDIF
+8 -1
View File
@@ -1,7 +1,14 @@
--TEST--
Gettext basic test
--SKIPIF--
<?php if (!extension_loaded("gettext")) print "skip"; ?>
<?php
if (!extension_loaded("gettext")) {
die("skip\n");
}
if (!setlocale(LC_ALL, 'fi_FI')) {
die("skip fi_FI locale not supported.");
}
?>
--FILE--
<?php // $Id$
+1 -2
View File
@@ -830,8 +830,7 @@ ZEND_FUNCTION(gmp_powm)
}
FETCH_GMP_ZVAL(gmpnum_mod, mod_arg);
convert_to_long_ex(mod_arg);
if (!Z_LVAL_PP(mod_arg)) {
if (!mpz_cmp_ui(*gmpnum_mod, 0)) {
RETURN_FALSE;
}
+2 -2
View File
@@ -53,7 +53,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 php4ts.lib iconv-1.3.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_iconv.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\iconv\lib"
# ADD LINK32 php4ts.lib iconv.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_iconv.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\iconv\lib"
!ELSEIF "$(CFG)" == "iconv - Win32 Debug_TS"
@@ -79,7 +79,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 php4ts_debug.lib iconv-1.3.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_iconv.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\iconv\lib"
# ADD LINK32 php4ts_debug.lib iconv.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_iconv.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\iconv\lib"
!ENDIF
+41 -44
View File
@@ -112,7 +112,7 @@ function_entry imap_functions[] = {
PHP_FE(imap_qprint, NULL)
PHP_FE(imap_8bit, NULL)
PHP_FE(imap_binary, NULL)
PHP_FE(imap_utf8, NULL)
PHP_FE(imap_utf8, NULL)
PHP_FE(imap_status, NULL)
PHP_FE(imap_mailboxmsginfo, NULL)
PHP_FE(imap_setflag_full, NULL)
@@ -131,7 +131,7 @@ function_entry imap_functions[] = {
PHP_FE(imap_utf7_encode, NULL)
PHP_FE(imap_mime_header_decode, NULL)
PHP_FE(imap_thread, NULL)
PHP_FE(imap_timeout, NULL)
PHP_FE(imap_timeout, NULL)
#if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001)
PHP_FE(imap_get_quota, NULL)
@@ -142,12 +142,12 @@ function_entry imap_functions[] = {
PHP_FE(imap_mail, NULL)
PHP_FALIAS(imap_header, imap_headerinfo, NULL)
PHP_FALIAS(imap_listmailbox, imap_list, NULL)
PHP_FALIAS(imap_getmailboxes, imap_list_full, NULL)
PHP_FALIAS(imap_scanmailbox, imap_listscan, NULL)
PHP_FALIAS(imap_listsubscribed, imap_lsub, NULL)
PHP_FALIAS(imap_getsubscribed, imap_lsub_full, NULL)
PHP_FALIAS(imap_header, imap_headerinfo, NULL)
PHP_FALIAS(imap_listmailbox, imap_list, NULL)
PHP_FALIAS(imap_getmailboxes, imap_list_full, NULL)
PHP_FALIAS(imap_scanmailbox, imap_listscan, NULL)
PHP_FALIAS(imap_listsubscribed, imap_lsub, NULL)
PHP_FALIAS(imap_getsubscribed, imap_lsub_full, NULL)
PHP_FALIAS(imap_fetchtext, imap_body, NULL)
PHP_FALIAS(imap_scan, imap_listscan, NULL)
PHP_FALIAS(imap_create, imap_createmailbox, NULL)
@@ -181,6 +181,12 @@ ZEND_GET_MODULE(imap)
/* True globals, no need for thread safety */
static int le_imap;
#define PHP_IMAP_CHECK_MSGNO(msgindex) \
if ((msgindex < 1) || ((unsigned) msgindex > imap_le_struct->imap_stream->nmsgs)) { \
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad message number"); \
RETURN_FALSE; \
} \
/* {{{ mail_close_it
*/
static void mail_close_it(zend_rsrc_list_entry *rsrc TSRMLS_DC)
@@ -1314,7 +1320,7 @@ PHP_FUNCTION(imap_list_full)
}
array_init(return_value);
delim = emalloc(2 * sizeof(char));
delim = safe_emalloc(2, sizeof(char), 0);
cur=IMAPG(imap_folder_objects);
while (cur != NIL) {
MAKE_STD_ZVAL(mboxob);
@@ -1485,10 +1491,7 @@ PHP_FUNCTION(imap_headerinfo)
convert_to_string_ex(defaulthost);
}
if (!Z_LVAL_PP(msgno) || Z_LVAL_PP(msgno) < 1 || (unsigned) Z_LVAL_PP(msgno) > imap_le_struct->imap_stream->nmsgs) {
php_error(E_WARNING, "%s(): Bad message number", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
PHP_IMAP_CHECK_MSGNO(Z_LVAL_PP(msgno));
if (mail_fetchstructure(imap_le_struct->imap_stream, Z_LVAL_PP(msgno), NIL)) {
cache = mail_elt(imap_le_struct->imap_stream, Z_LVAL_PP(msgno));
@@ -1635,6 +1638,7 @@ PHP_FUNCTION(imap_lsub_full)
}
array_init(return_value);
delim = safe_emalloc(2, sizeof(char), 0);
cur=IMAPG(imap_sfolder_objects);
while (cur != NIL) {
MAKE_STD_ZVAL(mboxob);
@@ -1736,10 +1740,8 @@ PHP_FUNCTION(imap_fetchstructure)
} else {
msgindex = Z_LVAL_PP(msgno);
}
if ((msgindex < 1) || ((unsigned) msgindex > imap_le_struct->imap_stream->nmsgs)) {
php_error(E_WARNING, "%s(): Bad message number", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
PHP_IMAP_CHECK_MSGNO(msgindex);
mail_fetchstructure_full(imap_le_struct->imap_stream, Z_LVAL_PP(msgno), &body , myargc == 3 ? Z_LVAL_PP(flags) : NIL);
@@ -1773,7 +1775,12 @@ PHP_FUNCTION(imap_fetchbody)
if (myargc == 4) {
convert_to_long_ex(flags);
}
if (myargc < 4 || !(Z_LVAL_PP(flags) & FT_UID)) {
/* only perform the check if the msgno is a message number and not a UID */
PHP_IMAP_CHECK_MSGNO(Z_LVAL_PP(msgno));
}
body = mail_fetchbody_full(imap_le_struct->imap_stream, Z_LVAL_PP(msgno), Z_STRVAL_PP(sec), &len, myargc==4 ? Z_LVAL_PP(flags) : NIL);
if (!body) {
@@ -2477,10 +2484,7 @@ PHP_FUNCTION(imap_fetchheader)
msgindex = Z_LVAL_PP(msgno);
}
if ((msgindex < 1) || ((unsigned) msgindex > imap_le_struct->imap_stream->nmsgs)) {
php_error(E_WARNING, "%s(): Bad message number", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
PHP_IMAP_CHECK_MSGNO(msgindex);
RETVAL_STRING(mail_fetchheader_full(imap_le_struct->imap_stream, Z_LVAL_PP(msgno), NIL, NIL, (myargc == 3 ? Z_LVAL_PP(flags) : NIL)), 1);
}
@@ -3190,6 +3194,9 @@ int _php_imap_mail(char *to, char *subject, char *message, char *headers, char *
bufferLen += strlen(cc) + 6;
}
#define PHP_IMAP_CLEAN if (bufferTo) efree(bufferTo); if (bufferCc) efree(bufferCc); if (bufferBcc) efree(bufferBcc); if (bufferHeader) efree(bufferHeader);
#define PHP_IMAP_BAD_DEST PHP_IMAP_CLEAN; efree(tempMailTo); return (BAD_MSG_DESTINATION);
bufferHeader = (char *)emalloc(bufferLen);
memset(bufferHeader, 0, bufferLen);
if (to && *to) {
@@ -3202,9 +3209,9 @@ int _php_imap_mail(char *to, char *subject, char *message, char *headers, char *
addr = NULL;
rfc822_parse_adrlist(&addr, tempMailTo, NULL);
while (addr) {
if (strcmp(addr->host, ERRHOST) == 0)
return (BAD_MSG_DESTINATION);
else {
if (strcmp(addr->host, ERRHOST) == 0) {
PHP_IMAP_BAD_DEST;
} else {
offset += sprintf(bufferTo + offset, "%s@%s,", addr->mailbox, addr->host);
}
addr = addr->next;
@@ -3225,9 +3232,9 @@ int _php_imap_mail(char *to, char *subject, char *message, char *headers, char *
addr = NULL;
rfc822_parse_adrlist(&addr, tempMailTo, NULL);
while (addr) {
if (strcmp(addr->host, ERRHOST) == 0)
return (BAD_MSG_DESTINATION);
else {
if (strcmp(addr->host, ERRHOST) == 0) {
PHP_IMAP_BAD_DEST;
} else {
offset += sprintf(bufferCc + offset, "%s@%s,", addr->mailbox, addr->host);
}
addr = addr->next;
@@ -3245,9 +3252,9 @@ int _php_imap_mail(char *to, char *subject, char *message, char *headers, char *
addr = NULL;
rfc822_parse_adrlist(&addr, tempMailTo, NULL);
while (addr) {
if (strcmp(addr->host, ERRHOST) == 0)
return (BAD_MSG_DESTINATION);
else {
if (strcmp(addr->host, ERRHOST) == 0) {
PHP_IMAP_BAD_DEST;
} else {
offset += sprintf(bufferBcc + offset, "%s@%s,", addr->mailbox, addr->host);
}
addr = addr->next;
@@ -3269,20 +3276,10 @@ int _php_imap_mail(char *to, char *subject, char *message, char *headers, char *
} else {
php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), GetSMErrorText(tsm_err));
}
PHP_IMAP_CLEAN;
return 0;
}
if (bufferTo) {
efree(bufferTo);
}
if (bufferCc) {
efree(bufferCc);
}
if (bufferBcc) {
efree(bufferBcc);
}
if (bufferHeader) {
efree(bufferHeader);
}
PHP_IMAP_CLEAN;
#else
if (!INI_STR("sendmail_path")) {
return 0;
@@ -3689,7 +3686,7 @@ static void _php_imap_parse_address (ADDRESS *addresslist, char **fulladdress, z
addresstmp = addresslist;
if ((len = _php_imap_address_size(addresstmp))) {
tmpstr = (char *) malloc (len);
tmpstr = (char *) malloc(len + 1);
tmpstr[0] = '\0';
rfc822_write_address(tmpstr, addresstmp);
*fulladdress = tmpstr;
+3
View File
@@ -1,7 +1,10 @@
OVERALL_TARGET += $(srcdir)/ifx.c
$(srcdir)/ifx.c: $(srcdir)/ifx.ec $(builddir)/libphpifx.a
(if test -d $(INFORMIXDIR); then \
THREADLIB=POSIX $(INFORMIXDIR)/bin/esql -e $(IFX_ESQL_FLAGS) $(srcdir)/ifx.ec; mv ifx.c $@; \
THREADLIB=POSIX $(INFORMIXDIR)/bin/esql -e $(IFX_ESQL_FLAGS) $(srcdir)/ifx.ec; \
mv ifx.c $@ || true; \
else \
touch $@; \
fi)
+125 -45
View File
@@ -37,6 +37,10 @@
/* prevent mod_ssl.h's header file from being included. */
#define AP_HOOK_H
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "php.h"
#include "php_globals.h"
#include "ext/standard/php_standard.h"
@@ -50,6 +54,12 @@
#include <winsock.h>
#endif
#ifdef ZTS
#define IFX_THRD_ID tsrm_thread_id()
#else
#define IFX_THRD_ID 0
#endif
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
@@ -122,8 +132,10 @@ typedef char IFX[128];
#define PHP_IFX_CHECK_CONNECTION(ifx) \
{ \
if (ifx_check() < 0) { \
char *ifx_err = ifx_error(ifx); \
IFXG(sv_sqlcode) = SQLCODE; \
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Set connection %s fails (%s)", ifx, ifx_error(ifx)); \
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Set connection %s fails (%s)", ifx, ifx_err); \
efree(ifx_err); \
RETURN_FALSE; \
} \
}
@@ -283,6 +295,7 @@ EXEC SQL BEGIN DECLARE SECTION;
PARAMETER char *link;
EXEC SQL END DECLARE SECTION;
{
char *ifx_err = NULL;
TSRMLS_FETCH();
EXEC SQL SET CONNECTION :link;
@@ -299,7 +312,7 @@ EXEC SQL END DECLARE SECTION;
EXEC SQL DISCONNECT :link;
if (ifx_check() < 0) {
IFXG(sv_sqlcode) = SQLCODE;
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Disconnect link %s after Automatic Rollback fails (%s)", link, ifx_error(link));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Disconnect link %s after Automatic Rollback fails (%s)", link, (ifx_err = ifx_error(link)));
}
}
if (ifx_check() < 0) {
@@ -307,20 +320,23 @@ EXEC SQL END DECLARE SECTION;
EXEC SQL CLOSE DATABASE;
if (ifx_check() < 0) {
IFXG(sv_sqlcode) = SQLCODE;
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Close database fails %s (%s)", link, ifx_error(link));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Close database fails %s (%s)", link, (ifx_err = ifx_error(link)));
}
}
}
else if (SQLCODE < 0) {
IFXG(sv_sqlcode) = SQLCODE;
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Disconnect link %s fails (%s)", link, ifx_error(link));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Disconnect link %s fails (%s)", link, (ifx_err = ifx_error(link)));
}
}
else {
IFXG(sv_sqlcode) = SQLCODE;
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Set connection %s fails (%s)", link, ifx_error(link));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Set connection %s fails (%s)", link, (ifx_err = ifx_error(link)));
}
if (ifx_err) {
efree(ifx_err);
}
}
static void _close_ifx_link(zend_rsrc_list_entry *rsrc TSRMLS_DC)
@@ -532,13 +548,15 @@ EXEC SQL END DECLARE SECTION;
/* create the link */
ifx = (char *) malloc(sizeof(IFX));
IFXG(connectionid)++;
sprintf(ifx, "%s%x", SAFE_STRING(user), IFXG(connectionid));
sprintf(ifx, "%s%x_%x", SAFE_STRING(user), IFX_THRD_ID,IFXG(connectionid));
EXEC SQL CONNECT TO :host AS :ifx USER :user USING :passwd WITH CONCURRENT TRANSACTION;
if (ifx_check() == IFX_ERROR) {
char *ifx_err = ifx_error(ifx);
IFXG(sv_sqlcode) = SQLCODE;
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ifx_error(ifx));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ifx_err);
efree(ifx_err);
free(ifx);
efree(hashed_details);
RETURN_FALSE;
@@ -566,9 +584,11 @@ EXEC SQL END DECLARE SECTION;
EXEC SQL CONNECT TO :host AS :ifx USER :user USING :passwd WITH CONCURRENT TRANSACTION;
if (ifx_check() == IFX_ERROR) {
char *ifx_err = ifx_error(ifx);
IFXG(sv_sqlcode) = SQLCODE;
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Link to server lost, unable to reconnect (%s)", ifx_error(ifx));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Link to server lost, unable to reconnect (%s)", ifx_err);
zend_hash_del(&EG(persistent_list), hashed_details, hashed_details_length + 1);
efree(ifx_err);
efree(hashed_details);
RETURN_FALSE;
}
@@ -604,10 +624,12 @@ EXEC SQL END DECLARE SECTION;
EXEC SQL CONNECT TO :host AS :ifx USER :user USING :passwd WITH CONCURRENT TRANSACTION;
if (ifx_check() == IFX_ERROR) {
char *ifx_err = ifx_error(ifx);
IFXG(sv_sqlcode) = SQLCODE;
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to connect (%s)", ifx_error(ifx));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to connect (%s)", ifx_err);
zend_hash_del(&EG(regular_list), hashed_details, hashed_details_length + 1);
efree(hashed_details);
efree(ifx_err);
RETURN_FALSE;
}
}
@@ -629,13 +651,15 @@ EXEC SQL END DECLARE SECTION;
ifx = (char *) emalloc(sizeof(IFX));
IFXG(connectionid)++;
sprintf(ifx, "connec%x", IFXG(connectionid));
sprintf(ifx, "connec%x_%x", IFX_THRD_ID, IFXG(connectionid));
EXEC SQL CONNECT TO :host AS :ifx USER :user USING :passwd WITH CONCURRENT TRANSACTION;
if (ifx_check() == IFX_ERROR) {
char *ifx_err = ifx_error(ifx);
IFXG(sv_sqlcode) = SQLCODE;
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ifx_error(ifx));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ifx_err);
efree(ifx_err);
efree(hashed_details);
efree(ifx);
RETURN_FALSE;
@@ -800,18 +824,20 @@ EXEC SQL END DECLARE SECTION;
statement = Z_STRVAL_PP(query);
IFXG(cursorid)++;
sprintf(statemid, "statem%x", IFXG(cursorid));
sprintf(cursorid, "cursor%x", IFXG(cursorid));
sprintf(descrpid, "descrp%x", IFXG(cursorid));
sprintf(i_descrpid, "i_descrp%x", IFXG(cursorid));
sprintf(statemid, "statem%x_%x", IFX_THRD_ID, IFXG(cursorid));
sprintf(cursorid, "cursor%x_%x", IFX_THRD_ID, IFXG(cursorid));
sprintf(descrpid, "descrp%x_%x", IFX_THRD_ID, IFXG(cursorid));
sprintf(i_descrpid, "i_descrp%x_%x", IFX_THRD_ID,IFXG(cursorid));
EXEC SQL set connection :ifx;
PHP_IFX_CHECK_CONNECTION(ifx);
EXEC SQL PREPARE :statemid FROM :statement;
if (ifx_check() < 0) {
char *ifx_err = ifx_error(ifx);
IFXG(sv_sqlcode) = SQLCODE;
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Prepare fails (%s)", ifx_error(ifx));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Prepare fails (%s)", ifx_err);
efree(ifx_err);
RETURN_FALSE;
}
@@ -842,10 +868,12 @@ EXEC SQL END DECLARE SECTION;
}
if (!php_intifx_alloc_ibind(Ifx_Result, num_params TSRMLS_CC)) {
char *ifx_err = ifx_error(ifx);
IFXG(sv_sqlcode) = SQLCODE;
EXEC SQL free :statemid;
efree(Ifx_Result);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Allocate i_desciptor <%s> fails (%s)", i_descrpid, ifx_error(ifx));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Allocate i_desciptor <%s> fails (%s)", i_descrpid, ifx_err);
efree(ifx_err);
RETURN_FALSE;
}
@@ -856,18 +884,22 @@ EXEC SQL END DECLARE SECTION;
EXEC SQL ALLOCATE DESCRIPTOR :descrpid WITH MAX :desc_count;
if (ifx_check() < 0) {
char *ifx_err = ifx_error(ifx);
IFXG(sv_sqlcode) = SQLCODE;
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Allocate desciptor <%s> fails (%s)", descrpid, ifx_error(ifx));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Allocate desciptor <%s> fails (%s)", descrpid, ifx_err);
EXEC SQL free :statemid;
efree(ifx_err);
RETURN_FALSE;
}
EXEC SQL DESCRIBE :statemid USING SQL DESCRIPTOR :descrpid;
if (ifx_check() < 0) {
char *ifx_err = ifx_error(ifx);
IFXG(sv_sqlcode) = SQLCODE;
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Describe fails (%s)", ifx_error(ifx));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Describe fails (%s)", ifx_err);
EXEC SQL DEALLOCATE DESCRIPTOR :descrpid;
EXEC SQL free :statemid;
efree(ifx_err);
RETURN_FALSE;
}
@@ -967,11 +999,13 @@ EXEC SQL END DECLARE SECTION;
}
if (ifx_check() < 0) {
char *ifx_err = ifx_error(ifx);
IFXG(sv_sqlcode) = SQLCODE;
EXEC SQL DEALLOCATE DESCRIPTOR :i_descrpid;
EXEC SQL free :statemid;
efree(Ifx_Result);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Execute immediate fails : %s", ifx_error(ifx));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Execute immediate fails : %s", ifx_err);
efree(ifx_err);
RETURN_FALSE;
}
@@ -992,13 +1026,15 @@ EXEC SQL END DECLARE SECTION;
}
if (ifx_check() < 0) {
char *ifx_err = ifx_error(ifx);
IFXG(sv_sqlcode) = SQLCODE;
if (Ifx_Result->numicols > 0) {
EXEC SQL DEALLOCATE DESCRIPTOR :i_descrpid;
}
EXEC SQL free :statemid;
efree(Ifx_Result);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Execute immediate fails : %s", ifx_error(ifx));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Execute immediate fails : %s", ifx_err);
efree(ifx_err);
RETURN_FALSE;
}
Ifx_Result->affected_rows = sqlca.sqlerrd[2]; /* really affected */
@@ -1035,11 +1071,13 @@ EXEC SQL END DECLARE SECTION;
EXEC SQL GET DESCRIPTOR :descrpid :fieldcount = COUNT;
if (ifx_check() < 0) {
char *ifx_err = ifx_error(ifx);
IFXG(sv_sqlcode) = SQLCODE;
EXEC SQL DEALLOCATE DESCRIPTOR :descrpid;
EXEC SQL free :statemid;
efree(Ifx_Result);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not get descriptor %s (%s)", descrpid, ifx_error(ifx));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not get descriptor %s (%s)", descrpid, ifx_err);
efree(ifx_err);
RETURN_FALSE;
}
@@ -1072,22 +1110,26 @@ EXEC SQL END DECLARE SECTION;
}
if (ifx_check() < 0) {
char *ifx_err = ifx_error(ifx);
IFXG(sv_sqlcode) = SQLCODE;
EXEC SQL DEALLOCATE DESCRIPTOR :descrpid;
EXEC SQL free :statemid;
efree(Ifx_Result);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Declare cursor fails (%s)", ifx_error(ifx));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Declare cursor fails (%s)", ifx_err);
efree(ifx_err);
RETURN_FALSE;
}
EXEC SQL OPEN :cursorid;
if (ifx_check() < 0) {
char *ifx_err = ifx_error(ifx);
IFXG(sv_sqlcode) = SQLCODE;
EXEC SQL DEALLOCATE DESCRIPTOR :descrpid;
EXEC SQL free :statemid;
EXEC SQL free :cursorid;
efree(Ifx_Result);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Open cursor fails (%s)", ifx_error(ifx));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Open cursor fails (%s)", ifx_err);
efree(ifx_err);
RETURN_FALSE;
}
@@ -1206,10 +1248,10 @@ EXEC SQL END DECLARE SECTION;
statement = Z_STRVAL_PP(query);
IFXG(cursorid)++;
sprintf(statemid, "statem%x", IFXG(cursorid));
sprintf(cursorid, "cursor%x", IFXG(cursorid));
sprintf(descrpid, "descrp%x", IFXG(cursorid));
sprintf(i_descrpid, "i_descrp%x", IFXG(cursorid));
sprintf(statemid, "statem%x_%x", IFX_THRD_ID, IFXG(cursorid));
sprintf(cursorid, "cursor%x_%x", IFX_THRD_ID, IFXG(cursorid));
sprintf(descrpid, "descrp%x_%x", IFX_THRD_ID, IFXG(cursorid));
sprintf(i_descrpid, "i_descrp%x_%x", IFX_THRD_ID,IFXG(cursorid));
EXEC SQL set connection :ifx;
PHP_IFX_CHECK_CONNECTION(ifx);
@@ -1250,10 +1292,12 @@ EXEC SQL END DECLARE SECTION;
}
if (!php_intifx_alloc_ibind(Ifx_Result, num_params TSRMLS_CC)) {
char *ifx_err = ifx_error(ifx);
IFXG(sv_sqlcode) = SQLCODE;
EXEC SQL free :statemid;
efree(Ifx_Result);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Allocate i_desciptor <%s> fails (%s)", i_descrpid, ifx_error(ifx));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Allocate i_desciptor <%s> fails (%s)", i_descrpid, ifx_err);
efree(ifx_err);
RETURN_FALSE;
}
@@ -1264,18 +1308,22 @@ EXEC SQL END DECLARE SECTION;
EXEC SQL ALLOCATE DESCRIPTOR :descrpid WITH MAX :desc_count;
if (ifx_check() < 0) {
char *ifx_err = ifx_error(ifx);
IFXG(sv_sqlcode) = SQLCODE;
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Allocate desciptor <%s> fails (%s)", descrpid, ifx_error(ifx));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Allocate desciptor <%s> fails (%s)", descrpid, ifx_err);
EXEC SQL free :statemid;
efree(ifx_err);
RETURN_FALSE;
}
EXEC SQL DESCRIBE :statemid USING SQL DESCRIPTOR :descrpid;
if (ifx_check() < 0) {
char *ifx_err = ifx_error(ifx);
IFXG(sv_sqlcode) = SQLCODE;
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Describe fails (%s)", ifx_error(ifx));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Describe fails (%s)", ifx_err);
EXEC SQL DEALLOCATE DESCRIPTOR :descrpid;
EXEC SQL free :statemid;
efree(ifx_err);
RETURN_FALSE;
}
@@ -1377,11 +1425,13 @@ EXEC SQL END DECLARE SECTION;
}
if (ifx_check() < 0) {
char *ifx_err = ifx_error(ifx);
IFXG(sv_sqlcode) = SQLCODE;
EXEC SQL DEALLOCATE DESCRIPTOR :i_descrpid;
EXEC SQL free :statemid;
efree(Ifx_Result);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Prepare fails : %s", ifx_error(ifx));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Prepare fails : %s", ifx_err);
efree(ifx_err);
RETURN_FALSE;
}
@@ -1434,11 +1484,13 @@ EXEC SQL END DECLARE SECTION;
EXEC SQL GET DESCRIPTOR :descrpid :fieldcount = COUNT;
if (ifx_check() < 0) {
char *ifx_err;
IFXG(sv_sqlcode) = SQLCODE;
EXEC SQL DEALLOCATE DESCRIPTOR :descrpid;
EXEC SQL free :statemid;
efree(Ifx_Result);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not get descriptor %s (%s)", descrpid, ifx_error(ifx));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not get descriptor %s (%s)", descrpid, (ifx_err = ifx_error(ifx)));
efree(ifx_err);
RETURN_FALSE;
}
Ifx_Result->numcols = fieldcount;
@@ -1524,8 +1576,10 @@ EXEC SQL END DECLARE SECTION;
EXEC SQL EXECUTE :statemid;
}
if (ifx_check() < 0) {
char *ifx_err = ifx_error(ifx);
IFXG(sv_sqlcode) = SQLCODE;
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Execute immediate fails: %s", ifx_error(ifx));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Execute immediate fails: %s", ifx_err);
efree(ifx_err);
RETURN_FALSE;
}
Ifx_Result->affected_rows = sqlca.sqlerrd[2]; /* really affected */
@@ -1548,15 +1602,19 @@ EXEC SQL END DECLARE SECTION;
}
if (ifx_check() < 0) {
char *ifx_err = ifx_error(ifx);
IFXG(sv_sqlcode) = SQLCODE;
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Declare cursor fails (%s)", ifx_error(ifx));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Declare cursor fails (%s)", ifx_err);
efree(ifx_err);
RETURN_FALSE;
}
EXEC SQL OPEN :cursorid;
if (ifx_check() < 0) {
char *ifx_err = ifx_error(ifx);
IFXG(sv_sqlcode) = SQLCODE;
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Open cursor fails (%s)", ifx_error(ifx));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Open cursor fails (%s)", ifx_err);
efree(ifx_err);
RETURN_FALSE;
}
@@ -1893,8 +1951,12 @@ EXEC SQL END DECLARE SECTION;
switch (ifx_check()) {
case IFX_ERROR:
IFXG(sv_sqlcode) = SQLCODE;
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not fetch row on cursor %s (%s)", ifx_error(ifx), cursorid);
RETURN_FALSE;
{
char *ifx_err = ifx_error(ifx);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not fetch row on cursor %s (%s)", ifx_err, cursorid);
efree(ifx_err);
RETURN_FALSE;
}
break;
case IFX_NODATA:
RETURN_FALSE;
@@ -1917,8 +1979,10 @@ EXEC SQL END DECLARE SECTION;
:indicator = INDICATOR;
if (ifx_check() < 0) {
char *ifx_err = ifx_error(ifx);
IFXG(sv_sqlcode) = SQLCODE;
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Get descriptor (field # %d) fails (%s)", i, ifx_error(ifx));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Get descriptor (field # %d) fails (%s)", i, ifx_err);
efree(ifx_err);
RETURN_FALSE;
}
@@ -2243,7 +2307,11 @@ EXEC SQL END DECLARE SECTION;
switch (ifx_check()) {
case IFX_ERROR:
IFXG(sv_sqlcode) = SQLCODE;
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not fetch next row on cursor %s (%s)", ifx_error(ifx), cursorid);
{
char *ifx_err = ifx_error(ifx);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not fetch next row on cursor %s (%s)", ifx_err, cursorid);
efree(ifx_err);
}
RETURN_FALSE;
break;
case IFX_NODATA:
@@ -2272,8 +2340,10 @@ EXEC SQL END DECLARE SECTION;
for (i = 1; i <= num_fields; i++) {
EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :fieldname = NAME;
if (ifx_check() < 0) {
char *ifx_err = ifx_error(ifx);
IFXG(sv_sqlcode) = SQLCODE;
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Get descriptor (field # %d) fails (%s)", i, ifx_error(ifx));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Get descriptor (field # %d) fails (%s)", i, ifx_err);
efree(ifx_err);
RETURN_FALSE;
}
@@ -2299,8 +2369,10 @@ EXEC SQL END DECLARE SECTION;
:indicator = INDICATOR;
if (ifx_check() < 0) {
char *ifx_err = ifx_error(ifx);
IFXG(sv_sqlcode) = SQLCODE;
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Get descriptor (field # %d) fails (%s)", i, ifx_error(ifx));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Get descriptor (field # %d) fails (%s)", i, ifx_err);
efree(ifx_err);
RETURN_FALSE;
}
@@ -2471,7 +2543,11 @@ $endif;
switch (ifx_check()) {
case IFX_ERROR:
IFXG(sv_sqlcode) = SQLCODE;
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not fetch next row on cursor %s (%s)", ifx_error(ifx), cursorid);
{
char *ifx_err = ifx_error(ifx);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not fetch next row on cursor %s (%s)", ifx_err, cursorid);
efree(ifx_err);
}
RETURN_FALSE;
break;
case IFX_NODATA:
@@ -2545,8 +2621,10 @@ EXEC SQL END DECLARE SECTION;
for (i = 1; i <= num_fields; i++) {
EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :fieldname = NAME, :fieldtype = TYPE;
if (ifx_check() < 0) {
char *ifx_err = ifx_error(ifx);
IFXG(sv_sqlcode) = SQLCODE;
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Get descriptor (field # %d) fails (%s)", i, ifx_error(ifx));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Get descriptor (field # %d) fails (%s)", i, ifx_err);
efree(ifx_err);
RETURN_FALSE;
}
@@ -2708,8 +2786,10 @@ EXEC SQL END DECLARE SECTION;
:isnullable = NULLABLE;
if (ifx_check() < 0) {
char *ifx_err = ifx_error(ifx);
IFXG(sv_sqlcode) = SQLCODE;
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Get descriptor (field # %d) fails (%s)", i, ifx_error(ifx));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Get descriptor (field # %d) fails (%s)", i, ifx_err);
efree(ifx_err);
RETURN_FALSE;
}
+1
View File
@@ -541,6 +541,7 @@ static void php_ii_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
} else { /* already open persistent connection */
if (Z_TYPE_P(le) != le_ii_plink) {
efree(hashed_details);
RETURN_FALSE;
}
/* here we should ensure that the link did not die */
+11 -11
View File
@@ -1201,7 +1201,7 @@ static int _php_ibase_blob_add(zval **string_arg, ibase_blob_handle *ib_blob TSR
/* {{{ _php_ibase_bind()
Bind parameter placeholders in a previously prepared query */
static int _php_ibase_bind(XSQLDA *sqlda, zval **b_vars, BIND_BUF *buf, ibase_query *ib_query TSRMLS_DC)
static int _php_ibase_bind(XSQLDA *sqlda, zval ***b_vars, BIND_BUF *buf, ibase_query *ib_query TSRMLS_DC)
{
int i , rv = SUCCESS;
@@ -1209,7 +1209,7 @@ static int _php_ibase_bind(XSQLDA *sqlda, zval **b_vars, BIND_BUF *buf, ibase_qu
for (i = 0; i < sqlda->sqld; ++var, ++i) { /* bound vars */
zval *b_var = b_vars[i];
zval *b_var = *b_vars[i];
var->sqlind = &buf[i].sqlind;
@@ -1425,17 +1425,17 @@ static void _php_ibase_alloc_xsqlda(XSQLDA *sqlda)
/* }}} */
/* {{{ _php_ibase_exec() */
static int _php_ibase_exec(ibase_result **ib_resultp, ibase_query *ib_query, int argc, zval **args TSRMLS_DC)
static int _php_ibase_exec(ibase_result **ib_resultp, ibase_query *ib_query, int argc, zval ***args TSRMLS_DC)
{
#define IB_RESULT (*ib_resultp)
XSQLDA *in_sqlda = NULL, *out_sqlda = NULL;
BIND_BUF *bind_buf = NULL;
int rv = FAILURE;
int i, rv = FAILURE;
IB_RESULT = NULL;
if (argc > 0 && args != NULL) {
SEPARATE_ZVAL(args);
for (i = 0; i < argc; ++i) {
SEPARATE_ZVAL(args[i]);
}
/* allocate sqlda and output buffers */
@@ -1699,7 +1699,7 @@ PHP_FUNCTION(ibase_rollback)
Execute a query */
PHP_FUNCTION(ibase_query)
{
zval ***args, **bind_args = NULL, **dummy = NULL;
zval ***args, ***bind_args = NULL, **dummy = NULL;
int i, link_id = 0, trans_n = 0, bind_n = 0, trans_id = 0;
char *query;
ibase_db_link *ib_link;
@@ -1742,7 +1742,7 @@ PHP_FUNCTION(ibase_query)
absolutely no sense if not using a prepared SQL statement.
*/
bind_n = ZEND_NUM_ARGS() - i;
bind_args = args[i];
bind_args = &args[i];
}
/* open default transaction */
@@ -1856,7 +1856,7 @@ static int _php_ibase_var_zval(zval *val, void *data, int type, int len, int sca
if (n >= 0) {
Z_STRLEN_P(val) = sprintf (string_data,
"%" ISC_INT64_FORMAT "d.%0*" ISC_INT64_FORMAT "d", n / f, -scale, n % f);
} else if (n < -f) {
} else if (n <= -f) {
Z_STRLEN_P(val) = sprintf (string_data,
"%" ISC_INT64_FORMAT "d.%0*" ISC_INT64_FORMAT "d", n / f, -scale, -n % f);
} else {
@@ -2323,7 +2323,7 @@ PHP_FUNCTION(ibase_prepare)
Execute a previously prepared query */
PHP_FUNCTION(ibase_execute)
{
zval ***args, **bind_args = NULL;
zval ***args, ***bind_args = NULL;
ibase_query *ib_query;
ibase_result *ib_result;
@@ -2342,7 +2342,7 @@ PHP_FUNCTION(ibase_execute)
ZEND_FETCH_RESOURCE(ib_query, ibase_query *, args[0], -1, "InterBase query", le_query);
if (ZEND_NUM_ARGS() > 1) { /* have variables to bind */
bind_args = args[1];
bind_args = &args[1];
}
/* Have we used this cursor before and it's still open? */
-7
View File
@@ -293,12 +293,10 @@ PHP_MINFO_FUNCTION(ldap)
} else {
snprintf(tmp, 31, "%ld/%ld", LDAPG(num_links), LDAPG(max_links));
}
tmp[31] = '\0';
php_info_print_table_row(2, "Total Links", tmp);
#ifdef LDAP_API_VERSION
snprintf(tmp, 31, "%d", LDAP_API_VERSION);
tmp[31] = '\0';
php_info_print_table_row(2, "API Version", tmp);
#endif
@@ -308,27 +306,22 @@ PHP_MINFO_FUNCTION(ldap)
#ifdef LDAP_VENDOR_VERSION
snprintf(tmp, 31, "%d", LDAP_VENDOR_VERSION);
tmp[31] = '\0';
php_info_print_table_row(2, "Vendor Version", tmp);
#endif
#if HAVE_NSLDAP
SDKVersion = ldap_version( &ver );
snprintf(tmp, 31, "%f", SDKVersion/100.0 );
tmp[31] = '\0';
php_info_print_table_row(2, "SDK Version", tmp );
snprintf(tmp, 31, "%f", ver.protocol_version/100.0 );
tmp[31] = '\0';
php_info_print_table_row(2, "Highest LDAP Protocol Supported", tmp );
snprintf(tmp, 31, "%f", ver.SSL_version/100.0 );
tmp[31] = '\0';
php_info_print_table_row(2, "SSL Level Supported", tmp );
if ( ver.security_level != LDAP_SECURITY_NONE ) {
snprintf(tmp, 31, "%d", ver.security_level );
tmp[31] = '\0';
} else {
strcpy(tmp, "SSL not enabled" );
}
+1 -1
View File
@@ -37,7 +37,7 @@ AC_DEFUN([PHP_MBSTRING_EXTENSION], [
if test "$ext_shared" = "no"; then
out="php_config.h"
else
if test -e "$ext_builddir/config.h.in"; then
if test -f "$ext_builddir/config.h.in"; then
out="$abs_builddir/config.h"
else
out="php_config.h"
+1
View File
@@ -3273,6 +3273,7 @@ detect_end:
stack[stack_level] = var;
stack_level++;
var = hash_entry;
SEPARATE_ZVAL(hash_entry);
target_hash = HASH_OF(*var);
if (target_hash != NULL) {
zend_hash_internal_pointer_reset(target_hash);
+27 -4
View File
@@ -33,7 +33,7 @@ unset($c);
$a = "あいうえお";
$b = array(&$a);
$c = $b;
mb_convert_variables("euc-jp", "shift_jis", $c);
mb_convert_variables("EUC-JP", "Shift_JIS", $c);
debug_zval_dump($b);
debug_zval_dump($c);
unset($a);
@@ -43,7 +43,7 @@ unset($c);
$a = "あいうえお";
$b = array($a);
$c = &$b;
mb_convert_variables("euc-jp", "shift_jis", $c);
mb_convert_variables("EUC-JP", "Shift_JIS", $c);
debug_zval_dump($b);
debug_zval_dump($c);
unset($a);
@@ -53,7 +53,17 @@ unset($c);
$a = "あいうえお";
$b = array(&$a);
$c = &$b;
mb_convert_variables("euc-jp", "shift_jis", $c);
mb_convert_variables("EUC-JP", "Shift_JIS", $c);
debug_zval_dump($b);
debug_zval_dump($c);
unset($a);
unset($b);
unset($c);
$a = array(array("�����"));
$b = $a;
$c = $b;
mb_convert_variables("EUC-JP", "Shift_JIS", $c);
debug_zval_dump($b);
debug_zval_dump($c);
unset($a);
@@ -97,4 +107,17 @@ array(1) refcount(1){
[0]=>
string(10) "、「、、、ヲ、ィ、ェ" refcount(2)
}
array(1) refcount(3){
[0]=>
array(1) refcount(1){
[0]=>
string(10) "�����" refcount(1)
}
}
array(1) refcount(2){
[0]=>
array(1) refcount(1){
[0]=>
string(10) "丐中丹尹云" refcount(1)
}
}
+1 -1
View File
@@ -459,7 +459,7 @@ PHP_FUNCTION(mcal_fetch_event)
CALEVENT *myevent;
int myargcount=ZEND_NUM_ARGS();
if (myargcount < 1 || myargcount > 3 || zend_get_parameters_ex(myargcount, &streamind, &eventid, &options) == FAILURE) {
if (myargcount < 2 || myargcount > 3 || zend_get_parameters_ex(myargcount, &streamind, &eventid, &options) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_long_ex(streamind);
+33 -5
View File
@@ -1,16 +1,19 @@
dnl config.m4 for PHP4 MCVE Extension
PHP_ARG_WITH(mcve, for MCVE support,
[ --with-mcve[=DIR] Include MCVE support. libmcve >= 3.2.2 required])
[ --with-mcve[=DIR] Include MCVE support. libmcve >= 3.2.2 or libmonetra >= 4.0 required])
PHP_ARG_WITH(openssl-dir,OpenSSL dir for MCVE,
[ --with-openssl-dir[=DIR] MCVE: openssl install prefix.], no, no)
if test "$PHP_MCVE" != "no"; then
dnl properly set EGREP for AC_EGREP_CPP later on
AC_CHECK_PROG(EGREP, egrep, grep -E)
AC_SUBST(EGREP)
if test "$PHP_OPENSSL_DIR" != "no"; then
PHP_OPENSSL=$PHP_OPENSSL_DIR
PHP_SETUP_OPENSSL(SNMP_SHARED_LIBADD, [], [
PHP_SETUP_OPENSSL(MCVE_SHARED_LIBADD, [], [
AC_MSG_ERROR([MCVE: OpenSSL check failed. Please check config.log for more information.])
])
else
@@ -53,16 +56,41 @@ yes
PHP_ADD_INCLUDE($MCVE_DIR/include)
PHP_ADD_LIBRARY_WITH_PATH(mcve, $MCVE_DIR/lib, MCVE_SHARED_LIBADD)
dnl Build test
dnl Build test. Check for libmcve or libmonetra
dnl libmonetra_compat.h handle's MCVE_ -> M_ conversion
dnl so it is API compatible
has_mcve=0
dnl check for libmcve
PHP_CHECK_LIBRARY(mcve, MCVE_DestroyEngine,
[
AC_DEFINE(HAVE_MCVE, 1, [ ])
has_mcve=1
], [
AC_MSG_ERROR([MCVE: Sanity check failed. Please check config.log for more information.])
has_mcve=0
], [
$MCVE_SHARED_LIBADD
])
dnl check for libmonetra if no proper libmcve
dnl symlink named libmcve is created to libmonetra
dnl during libmonetra install, so this is valid
if test "$has_mcve" = "0" ; then
PHP_CHECK_LIBRARY(mcve, M_DestroyEngine,
[
has_mcve=1
], [
has_mcve=0
], [
$MCVE_SHARED_LIBADD
])
fi
if test "$has_mcve" = "1" ; then
AC_DEFINE(HAVE_MCVE, 1, [ ])
else
AC_MSG_ERROR([MCVE: Sanity check failed. Please check config.log for more information.])
fi
PHP_NEW_EXTENSION(mcve, mcve.c, $ext_shared)
PHP_SUBST(MCVE_SHARED_LIBADD)
fi
+379 -181
View File
File diff suppressed because it is too large. Load diff
+86 -1
View File
@@ -26,13 +26,96 @@ extern zend_module_entry mcve_module_entry;
#define mcve_module_ptr &mcve_module_entry
#define phpext_mcve_ptr mcve_module_ptr
#define PHP_MCVE_VERSION "3.2"
#define PHP_MCVE_VERSION "4.0"
#define MCVE_CONST (CONST_CS | CONST_PERSISTENT)
#define M_map_function(newname, oldname) \
PHP_FUNCTION(oldname) { \
PHP_FN(newname)(INTERNAL_FUNCTION_PARAM_PASSTHRU); \
}
PHP_MINIT_FUNCTION(mcve);
PHP_MINFO_FUNCTION(mcve);
PHP_FUNCTION(m_initengine);
PHP_FUNCTION(m_initconn);
PHP_FUNCTION(m_deleteresponse);
PHP_FUNCTION(m_destroyconn);
PHP_FUNCTION(m_setdropfile);
PHP_FUNCTION(m_setip);
PHP_FUNCTION(m_setssl);
PHP_FUNCTION(m_setssl_files);
PHP_FUNCTION(m_setblocking);
PHP_FUNCTION(m_settimeout);
PHP_FUNCTION(m_verifyconnection);
PHP_FUNCTION(m_verifysslcert);
PHP_FUNCTION(m_maxconntimeout);
PHP_FUNCTION(m_connectionerror);
PHP_FUNCTION(m_deletetrans);
PHP_FUNCTION(m_connect);
PHP_FUNCTION(m_transnew);
PHP_FUNCTION(m_transparam);
PHP_FUNCTION(m_transsend);
PHP_FUNCTION(m_ping);
PHP_FUNCTION(m_responseparam);
PHP_FUNCTION(m_returnstatus);
PHP_FUNCTION(m_returncode);
PHP_FUNCTION(m_transactionssent);
PHP_FUNCTION(m_transactionitem);
PHP_FUNCTION(m_transactionbatch);
PHP_FUNCTION(m_transactionid);
PHP_FUNCTION(m_transactionauth);
PHP_FUNCTION(m_transactionavs);
PHP_FUNCTION(m_transactioncv);
PHP_FUNCTION(m_transactiontext);
PHP_FUNCTION(m_getuserparam);
PHP_FUNCTION(m_monitor);
PHP_FUNCTION(m_transinqueue);
PHP_FUNCTION(m_checkstatus);
PHP_FUNCTION(m_completeauthorizations);
PHP_FUNCTION(m_sale);
PHP_FUNCTION(m_preauth);
PHP_FUNCTION(m_override);
PHP_FUNCTION(m_void);
PHP_FUNCTION(m_preauthcompletion);
PHP_FUNCTION(m_force);
PHP_FUNCTION(m_return);
PHP_FUNCTION(m_iscommadelimited);
PHP_FUNCTION(m_parsecommadelimited);
PHP_FUNCTION(m_getcommadelimited);
PHP_FUNCTION(m_getcell);
PHP_FUNCTION(m_getcellbynum);
PHP_FUNCTION(m_numcolumns);
PHP_FUNCTION(m_numrows);
PHP_FUNCTION(m_getheader);
PHP_FUNCTION(m_destroyengine);
PHP_FUNCTION(m_settle);
PHP_FUNCTION(m_qc);
PHP_FUNCTION(m_gut);
PHP_FUNCTION(m_gft);
PHP_FUNCTION(m_ub);
PHP_FUNCTION(m_gl);
PHP_FUNCTION(m_chkpwd);
PHP_FUNCTION(m_bt);
PHP_FUNCTION(m_uwait);
PHP_FUNCTION(m_text_code);
PHP_FUNCTION(m_text_avs);
PHP_FUNCTION(m_text_cv);
PHP_FUNCTION(m_chngpwd);
PHP_FUNCTION(m_listusers);
PHP_FUNCTION(m_adduser);
PHP_FUNCTION(m_enableuser);
PHP_FUNCTION(m_disableuser);
PHP_FUNCTION(m_getuserarg);
PHP_FUNCTION(m_adduserarg);
PHP_FUNCTION(m_deleteusersetup);
PHP_FUNCTION(m_initusersetup);
PHP_FUNCTION(m_deluser);
PHP_FUNCTION(m_edituser);
PHP_FUNCTION(m_liststats);
/* prototypes for compatability functions */
PHP_FUNCTION(mcve_initengine);
PHP_FUNCTION(mcve_initconn);
PHP_FUNCTION(mcve_deleteresponse);
@@ -109,6 +192,8 @@ PHP_FUNCTION(mcve_initusersetup);
PHP_FUNCTION(mcve_deluser);
PHP_FUNCTION(mcve_edituser);
PHP_FUNCTION(mcve_liststats);
#endif /* _PHP_MCVE_H */
/*
+1 -1
View File
@@ -47,7 +47,7 @@ PHP_ARG_WITH(mnogosearch,for mnoGoSearch support,
AC_DEFINE(HAVE_MNOGOSEARCH,1,[ ])
PHP_SUBST(MNOGOSEARCH_SHARED_LIBADD)
PHP_NEW_EXTENSION(mnogosearch, php_mnogo.c, $ext_shared)
PHP_SUBST(MNOGOSEARCH_SHARED_LIBADD)
fi
+8 -2
View File
@@ -1266,7 +1266,7 @@ PS_OPEN_FUNC(msession)
{
int port;
int len = strlen(save_path)+1;
char * path = alloca(len);
char * path = emalloc(len);
char * szport;
strcpy(path, save_path);
@@ -1285,7 +1285,13 @@ PS_OPEN_FUNC(msession)
ELOG( "ps_open_msession");
PS_SET_MOD_DATA((void *)1); /* session.c needs a non-zero here! */
return PHPMsessionConnect(path, port) ? SUCCESS : FAILURE;
if (PHPMsessionConnect(path, port)) {
efree(path);
return SUCCESS;
} else {
efree(path);
return FAILURE;
}
}
PS_CLOSE_FUNC(msession)
+23 -4
View File
@@ -336,7 +336,7 @@ PHP_RINIT_FUNCTION(mssql)
dbsetlogintime(MS_SQL_G(connect_timeout));
if (MS_SQL_G(timeout) < 0) MS_SQL_G(timeout) = 60;
dbsettime(MS_SQL_G(timeout));
dbsetmaxprocs((SHORT)MS_SQL_G(max_procs));
dbsetmaxprocs((TDS_SHORT)MS_SQL_G(max_procs));
return SUCCESS;
}
@@ -344,6 +344,7 @@ PHP_RINIT_FUNCTION(mssql)
PHP_RSHUTDOWN_FUNCTION(mssql)
{
STR_FREE(MS_SQL_G(appname));
MS_SQL_G(appname) = NULL;
if (MS_SQL_G(server_message)) {
STR_FREE(MS_SQL_G(server_message));
MS_SQL_G(server_message) = NULL;
@@ -847,8 +848,21 @@ static void php_mssql_get_column_content_with_type(mssql_link *mssql_ptr,int off
if ((column_type != SQLDATETIME && column_type != SQLDATETIM4) || MS_SQL_G(datetimeconvert)) {
if (column_type == SQLDATETIM4) res_length += 14;
if (column_type == SQLDATETIME) res_length += 10;
switch (column_type) {
case SQLDATETIM4 :
res_length += 14;
break;
case SQLDATETIME :
res_length += 10;
break;
case SQLMONEY :
case SQLMONEY4 :
case SQLMONEYN :
case SQLDECIMAL :
case SQLNUMERIC :
res_length += 5;
break;
}
res_buf = (unsigned char *) emalloc(res_length+1);
res_length = dbconvert(NULL,coltype(offset),dbdata(mssql_ptr->link,offset), res_length, SQLCHAR,res_buf,-1);
@@ -917,6 +931,8 @@ static void php_mssql_get_column_content_without_type(mssql_link *mssql_ptr,int
case SQLMONEY :
case SQLMONEY4 :
case SQLMONEYN :
case SQLDECIMAL :
case SQLNUMERIC :
res_length += 5;
break;
}
@@ -1090,7 +1106,7 @@ static int _mssql_fetch_batch(mssql_link *mssql_ptr, mssql_result *result, int r
result->lastresult = retvalue;
}
efree(column_types);
if (result->statement) {
if (result->statement && (retvalue == NO_MORE_RESULTS || retvalue == NO_MORE_RPC_RESULTS)) {
_mssql_get_sp_result(mssql_ptr, result->statement TSRMLS_CC);
}
return i;
@@ -1820,6 +1836,9 @@ PHP_FUNCTION(mssql_next_result)
RETURN_FALSE;
}
else if (retvalue == NO_MORE_RESULTS || retvalue == NO_MORE_RPC_RESULTS) {
if (result->statement) {
_mssql_get_sp_result(mssql_ptr, result->statement TSRMLS_CC);
}
RETURN_FALSE;
}
else {
+1
View File
@@ -36,6 +36,7 @@
#include "sqlfront.h"
#include "sqldb.h"
typedef short TDS_SHORT;
#if HAVE_FREETDS
#define SQLTEXT SYBTEXT
#define SQLCHAR SYBCHAR
+4 -2
View File
@@ -259,6 +259,9 @@ static void _free_mysql_result(zend_rsrc_list_entry *rsrc TSRMLS_DC)
*/
static void php_mysql_set_default_link(int id TSRMLS_DC)
{
if (MySG(default_link) != -1) {
zend_list_delete(MySG(default_link));
}
MySG(default_link) = id;
zend_list_addref(id);
}
@@ -425,7 +428,6 @@ PHP_RINIT_FUNCTION(mysql)
/* Reset connect error/errno on every request */
MySG(connect_error) = NULL;
MySG(connect_errno) =0;
MySG(trace_mode) = 0;
MySG(result_allocated) = 0;
return SUCCESS;
}
@@ -591,7 +593,7 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
break;
}
/* disable local infile option for open_basedir */
if (PG(open_basedir) && strlen(PG(open_basedir))) {
if (PG(open_basedir) && strlen(PG(open_basedir)) && (client_flags & CLIENT_LOCAL_FILES)) {
client_flags ^= CLIENT_LOCAL_FILES;
}
+3 -3
View File
@@ -1421,7 +1421,7 @@ PHP_FUNCTION(ncurses_mvdelch)
{
long y,x;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lls",&y,&x)==FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll",&y,&x)==FAILURE) {
return;
}
IS_NCURSES_INITIALIZED();
@@ -1436,7 +1436,7 @@ PHP_FUNCTION(ncurses_mvgetch)
{
long y,x;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lls",&y,&x)==FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll",&y,&x)==FAILURE) {
return;
}
IS_NCURSES_INITIALIZED();
@@ -1450,7 +1450,7 @@ PHP_FUNCTION(ncurses_mvinch)
{
long y,x;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lls",&y,&x)==FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll",&y,&x)==FAILURE) {
return;
}
IS_NCURSES_INITIALIZED();
+2 -2
View File
@@ -1912,14 +1912,14 @@ PHP_FUNCTION(notes_search)
pNoteID = (NOTEID *) (((char *) pSearchResults)
+ sizeof(FT_SEARCH_RESULTS));
//pSearchResults->NumHits
/* pSearchResults->NumHits */
array_init(return_value);
pScores = (BYTE *) (pNoteID + pSearchResults->NumHits);
for (i = 0; i < pSearchResults->NumHits; i++, pNoteID++, pScores++){
add_next_index_long(return_value, (long) *pNoteID );
//RETVAL_LONG( (long) *pNoteID );
/* RETVAL_LONG( (long) *pNoteID ); */
}
OSUnlockObject (SearchResults_handle);
+1 -1
View File
@@ -2982,7 +2982,7 @@ break;
}
memset((void*)&bind,0,sizeof(oci_bind));
zend_hash_next_index_insert(statement->binds,&bind,sizeof(oci_bind),(void **)&bindp);
zend_hash_update(statement->binds, Z_STRVAL_PP(name), Z_STRLEN_PP(name) + 1, &bind, sizeof(oci_bind), (void **)&bindp);
bindp->descr = mydescr;
bindp->pStmt = mystmt;
-29
View File
@@ -1,29 +0,0 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "oci8"=.\oci8.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################
+6 -2
View File
@@ -1008,11 +1008,15 @@ PHP_FUNCTION(odbc_execute)
/* Check for safe mode. */
if (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
RETURN_FALSE;
}
efree(filename);
efree(params);
RETURN_FALSE;
}
/* Check the basedir */
if (php_check_open_basedir(filename TSRMLS_CC)) {
efree(filename);
efree(params);
RETURN_FALSE;
}
+7 -7
View File
@@ -386,7 +386,7 @@ PHP_FUNCTION(pcntl_exec)
args_hash = HASH_OF(args);
argc = zend_hash_num_elements(args_hash);
argv = alloca((argc+2) * sizeof(char *));
argv = safe_emalloc((argc + 2), sizeof(char *), 0);
*argv = path;
for ( zend_hash_internal_pointer_reset(args_hash), current_arg = argv+1;
(argi < argc && (zend_hash_get_current_data(args_hash, (void **) &element) == SUCCESS));
@@ -397,7 +397,7 @@ PHP_FUNCTION(pcntl_exec)
}
*(current_arg) = NULL;
} else {
argv = alloca(2 * sizeof(char *));
argv = emalloc(2 * sizeof(char *));
*argv = path;
*(argv+1) = NULL;
}
@@ -407,13 +407,13 @@ PHP_FUNCTION(pcntl_exec)
envs_hash = HASH_OF(envs);
envc = zend_hash_num_elements(envs_hash);
envp = alloca((envc+1) * sizeof(char *));
envp = safe_emalloc((envc + 1), sizeof(char *), 0);
for ( zend_hash_internal_pointer_reset(envs_hash), pair = envp;
(envi < envc && (zend_hash_get_current_data(envs_hash, (void **) &element) == SUCCESS));
(envi++, pair++, zend_hash_move_forward(envs_hash)) ) {
switch (return_val = zend_hash_get_current_key_ex(envs_hash, &key, &key_length, &key_num, 0, NULL)) {
case HASH_KEY_IS_LONG:
key = alloca(101);
key = emalloc(101);
snprintf(key, 100, "%ld", key_num);
key_length = strlen(key);
break;
@@ -432,7 +432,7 @@ PHP_FUNCTION(pcntl_exec)
strlcat(*pair, Z_STRVAL_PP(element), pair_length);
/* Cleanup */
if (return_val == HASH_KEY_IS_LONG) free_alloca(key);
if (return_val == HASH_KEY_IS_LONG) efree(key);
}
*(pair) = NULL;
}
@@ -445,10 +445,10 @@ PHP_FUNCTION(pcntl_exec)
/* Cleanup */
if (envp != NULL) {
for (pair = envp; *pair != NULL; pair++) efree(*pair);
free_alloca(envp);
efree(envp);
}
free_alloca(argv);
efree(argv);
RETURN_FALSE;
}
+73 -31
View File
@@ -47,20 +47,6 @@
ZEND_DECLARE_MODULE_GLOBALS(pcre)
static void *php_pcre_malloc(size_t size)
{
return pemalloc(size, 1);
}
static void php_pcre_free(void *ptr)
{
if (ptr)
pefree(ptr, 1);
}
static void php_free_pcre_cache(void *data)
{
pcre_cache_entry *pce = (pcre_cache_entry *) data;
@@ -107,14 +93,6 @@ static PHP_MINIT_FUNCTION(pcre)
REGISTER_LONG_CONSTANT("PREG_SPLIT_OFFSET_CAPTURE", PREG_SPLIT_OFFSET_CAPTURE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PREG_GREP_INVERT", PREG_GREP_INVERT, CONST_CS | CONST_PERSISTENT);
pcre_malloc = php_pcre_malloc;
pcre_free = php_pcre_free;
#ifdef NO_RECURSE
pcre_stack_malloc = php_pcre_malloc;
pcre_stack_free = php_pcre_free;
#endif
return SUCCESS;
}
/* }}} */
@@ -130,6 +108,22 @@ static PHP_MSHUTDOWN_FUNCTION(pcre)
}
/* }}} */
#define PCRE_CACHE_SIZE 4096
/* {{{ static pcre_clean_cache */
static int pcre_clean_cache(void *data, void *arg TSRMLS_DC)
{
int *num_clean = (int *)arg;
if (*num_clean > 0) {
(*num_clean)--;
return 1;
} else {
return 0;
}
}
/* }}} */
/* {{{ pcre_get_compiled_regex
*/
PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *preg_options) {
@@ -301,6 +295,16 @@ PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *preg_
efree(pattern);
/*
* If we reached cache limit, clean out the items from the head of the list;
* these are supposedly the oldest ones (but not necessarily the least used
* ones).
*/
if (zend_hash_num_elements(&PCRE_G(pcre_cache)) == PCRE_CACHE_SIZE) {
int num_clean = PCRE_CACHE_SIZE / 8;
zend_hash_apply_with_argument(&PCRE_G(pcre_cache), pcre_clean_cache, &num_clean TSRMLS_CC);
}
/* Store the compiled pattern and extra info in the cache. */
new_entry.re = re;
new_entry.extra = *extra;
@@ -369,7 +373,7 @@ static void php_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global)
const char **stringlist; /* Holds list of subpatterns */
char *match; /* The current match */
char **subpat_names = NULL;/* Array for named subpatterns */
int i;
int i, rc;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ((global) ? "ssz|ll" : "ss|zll"), &regex, &regex_len,
&subject, &subject_len, &subpats, &flags, &start_offset) == FAILURE) {
@@ -415,7 +419,12 @@ static void php_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global)
}
/* Calculate the size of the offsets array, and allocate memory for it. */
pcre_fullinfo(re, extra, PCRE_INFO_CAPTURECOUNT, &num_subpats);
rc = pcre_fullinfo(re, extra, PCRE_INFO_CAPTURECOUNT, &num_subpats);
if (rc < 0) {
php_error(E_WARNING, "%s: internal pcre_fullinfo() error %d",
get_active_function_name(TSRMLS_C), rc);
RETURN_FALSE;
}
num_subpats++;
size_offsets = num_subpats * 3;
offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0);
@@ -432,10 +441,22 @@ static void php_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global)
char *name_table;
unsigned short name_idx;
pcre_fullinfo(re, extra, PCRE_INFO_NAMECOUNT, &name_cnt);
rc = pcre_fullinfo(re, extra, PCRE_INFO_NAMECOUNT, &name_cnt);
if (rc < 0) {
php_error(E_WARNING, "%s: internal pcre_fullinfo() error %d",
get_active_function_name(TSRMLS_C), rc);
RETURN_FALSE;
}
if (name_cnt > 0) {
pcre_fullinfo(re, extra, PCRE_INFO_NAMETABLE, &name_table);
pcre_fullinfo(re, extra, PCRE_INFO_NAMEENTRYSIZE, &name_size);
int rc1, rc2;
rc1 = pcre_fullinfo(re, extra, PCRE_INFO_NAMETABLE, &name_table);
rc2 = pcre_fullinfo(re, extra, PCRE_INFO_NAMEENTRYSIZE, &name_size);
rc = rc2 ? rc2 : rc1;
if (rc < 0) {
php_error(E_WARNING, "%s: internal pcre_fullinfo() error %d",
get_active_function_name(TSRMLS_C), rc);
RETURN_FALSE;
}
while (ni++ < name_cnt) {
name_idx = 0xff * name_table[0] + name_table[1];
@@ -548,7 +569,7 @@ static void php_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global)
}
}
php_pcre_free((void *) stringlist);
pcre_free((void *) stringlist);
}
}
else { /* Failed to match */
@@ -804,6 +825,7 @@ PHPAPI char *php_pcre_replace(char *regex, int regex_len,
*replace_end=NULL, /* End of replacement string */
*eval_result, /* Result of eval or custom function */
walk_last; /* Last walked character */
int rc;
/* Compile regex or get it from cache. */
if ((re = pcre_get_compiled_regex(regex, &extra, &preg_options)) == NULL) {
@@ -823,7 +845,13 @@ PHPAPI char *php_pcre_replace(char *regex, int regex_len,
}
/* Calculate the size of the offsets array, and allocate memory for it. */
size_offsets = (pcre_info(re, NULL, NULL) + 1) * 3;
rc = pcre_fullinfo(re, extra, PCRE_INFO_CAPTURECOUNT, &size_offsets);
if (rc < 0) {
php_error(E_WARNING, "%s: internal pcre_fullinfo() error %d",
get_active_function_name(TSRMLS_C), rc);
return NULL;
}
size_offsets = (size_offsets + 1) * 3;
offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0);
alloc_len = 2 * subject_len + 1;
@@ -1187,6 +1215,7 @@ PHP_FUNCTION(preg_split)
int g_notempty = 0; /* If the match should not be empty */
char *match, /* The current match */
*last_match; /* Location of last match */
int rc;
/* Get function parameters and do error checking */
argc = ZEND_NUM_ARGS();
@@ -1221,7 +1250,13 @@ PHP_FUNCTION(preg_split)
array_init(return_value);
/* Calculate the size of the offsets array, and allocate memory for it. */
size_offsets = (pcre_info(re, NULL, NULL) + 1) * 3;
rc = pcre_fullinfo(re, extra, PCRE_INFO_CAPTURECOUNT, &size_offsets);
if (rc < 0) {
php_error(E_WARNING, "%s: internal pcre_fullinfo() error %d",
get_active_function_name(TSRMLS_C), rc);
RETURN_FALSE;
}
size_offsets = (size_offsets + 1) * 3;
offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0);
/* Start at the beginning of the string */
@@ -1428,6 +1463,7 @@ PHP_FUNCTION(preg_grep)
ulong num_key;
zend_bool invert = 0; /* Whether to return non-matching
entries */
int rc;
/* Get arguments and do error checking */
@@ -1457,7 +1493,13 @@ PHP_FUNCTION(preg_grep)
}
/* Calculate the size of the offsets array, and allocate memory for it. */
size_offsets = (pcre_info(re, NULL, NULL) + 1) * 3;
rc = pcre_fullinfo(re, extra, PCRE_INFO_CAPTURECOUNT, &size_offsets);
if (rc < 0) {
php_error(E_WARNING, "%s: internal pcre_fullinfo() error %d",
get_active_function_name(TSRMLS_C), rc);
RETURN_FALSE;
}
size_offsets = (size_offsets + 1) * 3;
offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0);
/* Initialize return array */
+4 -4
View File
@@ -328,14 +328,14 @@ PHP_FUNCTION(pfpro_process)
args = (zval ***) emalloc(sizeof(zval **) * ZEND_NUM_ARGS());
if (zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE) {
efree(args);
php_error(E_ERROR, "Unable to read parameters in pfpro_process()");
efree(args);
RETURN_FALSE;
}
if (Z_TYPE_PP(args[0]) != IS_ARRAY) {
efree(args);
php_error(E_ERROR, "First parameter to pfpro_process() must be an array");
efree(args);
RETURN_FALSE;
}
@@ -418,11 +418,11 @@ PHP_FUNCTION(pfpro_process)
break;
default:
php_error(E_ERROR, "pfpro_process() array keys must be strings or integers");
if (parmlist) {
efree(parmlist);
}
efree(args);
php_error(E_ERROR, "pfpro_process() array keys must be strings or integers");
RETURN_FALSE;
}
@@ -464,11 +464,11 @@ PHP_FUNCTION(pfpro_process)
break;
default:
php_error(E_ERROR, "pfpro_process() array values must be strings, ints or floats");
if (parmlist) {
efree(parmlist);
}
efree(args);
php_error(E_ERROR, "pfpro_process() array values must be strings, ints or floats");
RETURN_FALSE;
}
zend_hash_move_forward(target_hash);
+5 -5
View File
@@ -222,7 +222,7 @@ static char * _php_pgsql_trim_message(const char *message, int *len)
if (i>1 && (message[i-1] == '\r' || message[i-1] == '\n') && message[i] == '.') {
--i;
}
while (i && (message[i] == '\r' || message[i] == '\n')) {
while (i>0 && (message[i] == '\r' || message[i] == '\n')) {
--i;
}
++i;
@@ -2515,8 +2515,8 @@ PHP_FUNCTION(pg_copy_to)
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink);
query = (char *)emalloc(strlen(query_template) + strlen(table_name) + strlen(pg_null_as) + 1);
sprintf(query, "COPY \"%s\" TO STDOUT DELIMITERS '%s' WITH NULL AS '%s'",
table_name, pg_delim, pg_null_as);
sprintf(query, "COPY \"%s\" TO STDOUT DELIMITERS '%c' WITH NULL AS '%s'",
table_name, *pg_delim, pg_null_as);
while ((pgsql_result = PQgetResult(pgsql))) {
PQclear(pgsql_result);
@@ -2625,8 +2625,8 @@ PHP_FUNCTION(pg_copy_from)
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink);
query = (char *)emalloc(strlen(query_template) + strlen(table_name) + strlen(pg_null_as) + 1);
sprintf(query, "COPY \"%s\" FROM STDIN DELIMITERS '%s' WITH NULL AS '%s'",
table_name, pg_delim, pg_null_as);
sprintf(query, "COPY \"%s\" FROM STDIN DELIMITERS '%c' WITH NULL AS '%s'",
table_name, *pg_delim, pg_null_as);
while ((pgsql_result = PQgetResult(pgsql))) {
PQclear(pgsql_result);
}
+2 -2
View File
@@ -264,7 +264,7 @@ PHP_MINIT_FUNCTION(ps_mm)
return FAILURE;
/* Directory + '/' + File + Module Name + Effective UID + \0 */
ps_mm_path = do_alloca(save_path_len+1+sizeof(PS_MM_FILE)+mod_name_len+strlen(euid)+1);
ps_mm_path = emalloc(save_path_len+1+sizeof(PS_MM_FILE)+mod_name_len+strlen(euid)+1);
memcpy(ps_mm_path, PS(save_path), save_path_len + 1);
if (save_path_len > 0 && ps_mm_path[save_path_len - 1] != DEFAULT_SLASH) {
@@ -277,7 +277,7 @@ PHP_MINIT_FUNCTION(ps_mm)
ret = ps_mm_initialize(ps_mm_instance, ps_mm_path);
free_alloca(ps_mm_path);
efree(ps_mm_path);
if (ret != SUCCESS) {
free(ps_mm_instance);
+27 -21
View File
@@ -436,6 +436,11 @@ PS_SERIALIZER_ENCODE_FUNC(php)
PS_ENCODE_LOOP(
smart_str_appendl(&buf, key, (unsigned char) key_length);
if (memchr(key, PS_DELIMITER, key_length)) {
PHP_VAR_SERIALIZE_DESTROY(var_hash);
smart_str_free(&buf);
return FAILURE;
}
smart_str_appendc(&buf, PS_DELIMITER);
php_var_serialize(&buf, struc, &var_hash TSRMLS_CC);
@@ -503,13 +508,16 @@ break_outer_loop:
static void php_session_track_init(TSRMLS_D)
{
zval *session_vars = NULL;
/* Unconditionally destroy existing arrays -- possible dirty data */
zend_hash_del(&EG(symbol_table), "HTTP_SESSION_VARS",
sizeof("HTTP_SESSION_VARS"));
zend_hash_del(&EG(symbol_table), "_SESSION", sizeof("_SESSION"));
MAKE_STD_ZVAL(PS(http_session_vars));
array_init(PS(http_session_vars));
MAKE_STD_ZVAL(session_vars);
array_init(session_vars);
PS(http_session_vars) = session_vars;
ZEND_SET_GLOBAL_VAR_WITH_LENGTH("HTTP_SESSION_VARS", sizeof("HTTP_SESSION_VARS"), PS(http_session_vars), 2, 1);
ZEND_SET_GLOBAL_VAR_WITH_LENGTH("_SESSION", sizeof("_SESSION"), PS(http_session_vars), 2, 1);
@@ -930,8 +938,9 @@ static void php_session_reset_id(TSRMLS_D)
{
int module_number = PS(module_number);
if (PS(use_cookies)) {
if (PS(use_cookies) && PS(send_cookie)) {
php_session_send_cookie(TSRMLS_C);
PS(send_cookie) = 0;
}
/* if the SID constant exists, destroy it. */
@@ -1110,8 +1119,8 @@ PHP_FUNCTION(session_set_cookie_params)
zend_get_parameters_ex(ZEND_NUM_ARGS(), &lifetime, &path, &domain, &secure) == FAILURE)
WRONG_PARAM_COUNT;
convert_to_long_ex(lifetime);
PS(cookie_lifetime) = Z_LVAL_PP(lifetime);
convert_to_string_ex(lifetime);
zend_alter_ini_entry("session.cookie_lifetime", sizeof("session.cookie_lifetime"), Z_STRVAL_PP(lifetime), Z_STRLEN_PP(lifetime), PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
if (ZEND_NUM_ARGS() > 1) {
convert_to_string_ex(path);
@@ -1174,32 +1183,28 @@ PHP_FUNCTION(session_module_name)
{
zval **p_name;
int ac = ZEND_NUM_ARGS();
char *old;
if (ac < 0 || ac > 1 || zend_get_parameters_ex(ac, &p_name) == FAILURE)
WRONG_PARAM_COUNT;
old = safe_estrdup(PS(mod)->s_name);
if (ac == 1) {
ps_module *tempmod;
convert_to_string_ex(p_name);
tempmod = _php_find_ps_module(Z_STRVAL_PP(p_name) TSRMLS_CC);
if (tempmod) {
if (PS(mod_data))
PS(mod)->s_close(&PS(mod_data) TSRMLS_CC);
PS(mod) = tempmod;
PS(mod_data) = NULL;
} else {
efree(old);
if (!_php_find_ps_module(Z_STRVAL_PP(p_name) TSRMLS_CC)) {
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot find named PHP session module (%s)",
Z_STRVAL_PP(p_name));
RETURN_FALSE;
}
}
if (PS(mod_data)) {
PS(mod)->s_close(&PS(mod_data) TSRMLS_CC);
}
PS(mod_data) = NULL;
RETVAL_STRING(old, 0);
RETVAL_STRING(safe_estrdup(PS(mod)->s_name), 0);
zend_alter_ini_entry("session.save_handler", sizeof("session.save_handler"), Z_STRVAL_PP(p_name), Z_STRLEN_PP(p_name), PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
} else {
RETURN_STRING(safe_estrdup(PS(mod)->s_name), 0);
}
}
/* }}} */
@@ -1287,6 +1292,7 @@ PHP_FUNCTION(session_regenerate_id)
PS(id) = PS(mod)->s_create_sid(&PS(mod_data), NULL TSRMLS_CC);
PS(send_cookie) = 1;
php_session_reset_id(TSRMLS_C);
RETURN_TRUE;
@@ -1354,7 +1360,7 @@ static void php_register_var(zval** entry TSRMLS_DC)
} else {
convert_to_string_ex(entry);
if ((strcmp(Z_STRVAL_PP(entry), "HTTP_SESSION_VARS") != 0) ||
if ((strcmp(Z_STRVAL_PP(entry), "HTTP_SESSION_VARS") != 0) &&
(strcmp(Z_STRVAL_PP(entry), "_SESSION") != 0)) {
PS_ADD_VARL(Z_STRVAL_PP(entry), Z_STRLEN_PP(entry));
}
+1
View File
@@ -5,6 +5,7 @@ Bug #26862 (ob_flush() before output_reset_rewrite_vars() results in data loss)
--INI--
register_globals=0
html_errors=0
session.use_trans_sid=0
--FILE--
<?php
session_start();
+9
View File
@@ -7,4 +7,13 @@ if (!extension_loaded("session") && ini_get("enable_dl")) {
if (!extension_loaded("session")) {
die("skip\n");
}
$save_path = ini_get("session.save_path");
if (!@is_writable($save_path)) {
if (($p = strpos($save_path, ';')) !== false) {
$save_path = substr($save_path, ++$p);
}
if (!@is_writable($save_path)) {
die("skip\n");
}
}
?>
+8 -8
View File
@@ -350,7 +350,7 @@ static char *php_strerror(int error TSRMLS_DC)
buf = hstrerror(error);
#else
{
sprintf(SOCKETS_G(strerror_buf), "Host lookup error %d", error);
spprintf(&(SOCKETS_G(strerror_buf)), 0, "Host lookup error %d", error);
buf = SOCKETS_G(strerror_buf);
}
#endif
@@ -364,7 +364,7 @@ static char *php_strerror(int error TSRMLS_DC)
if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &tmp, 0, NULL)) {
strlcpy(SOCKETS_G(strerror_buf), (char *) tmp, 10000);
SOCKETS_G(strerror_buf) = estrdup(tmp);
LocalFree(tmp);
buf = SOCKETS_G(strerror_buf);
@@ -483,18 +483,18 @@ PHP_MINFO_FUNCTION(sockets)
/* {{{ PHP_RINIT_FUNCTION */
PHP_RINIT_FUNCTION(sockets)
{
if ((SOCKETS_G(strerror_buf) = emalloc(16384)))
return SUCCESS;
return FAILURE;
return SUCCESS;
}
/* }}} */
/* {{{ PHP_RSHUTDOWN_FUNCTION */
PHP_RSHUTDOWN_FUNCTION(sockets)
{
efree(SOCKETS_G(strerror_buf));
if (SOCKETS_G(strerror_buf)) {
efree(SOCKETS_G(strerror_buf));
SOCKETS_G(strerror_buf) = NULL;
}
return SUCCESS;
}
/* }}} */
+26 -6
View File
@@ -543,6 +543,14 @@ static int array_user_compare(const void *a, const void *b TSRMLS_DC)
}
}
/* check is comparison function is valid */
#define PHP_ARRAY_CMP_FUNC_CHECK(func_name) \
if (!zend_is_callable(*func_name, 0, NULL)) { \
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid comparison function."); \
BG(user_compare_func_name) = old_compare_func; \
RETURN_FALSE; \
} \
/* {{{ proto bool usort(array array_arg, string cmp_function)
Sort an array by values using a user-defined comparison function */
PHP_FUNCTION(usort)
@@ -562,6 +570,9 @@ PHP_FUNCTION(usort)
BG(user_compare_func_name) = old_compare_func;
RETURN_FALSE;
}
PHP_ARRAY_CMP_FUNC_CHECK(BG(user_compare_func_name))
if (zend_hash_sort(target_hash, zend_qsort, array_user_compare, 1 TSRMLS_CC) == FAILURE) {
BG(user_compare_func_name) = old_compare_func;
RETURN_FALSE;
@@ -590,6 +601,9 @@ PHP_FUNCTION(uasort)
BG(user_compare_func_name) = old_compare_func;
RETURN_FALSE;
}
PHP_ARRAY_CMP_FUNC_CHECK(BG(user_compare_func_name))
if (zend_hash_sort(target_hash, zend_qsort, array_user_compare, 0 TSRMLS_CC) == FAILURE) {
BG(user_compare_func_name) = old_compare_func;
RETURN_FALSE;
@@ -665,6 +679,9 @@ PHP_FUNCTION(uksort)
BG(user_compare_func_name) = old_compare_func;
RETURN_FALSE;
}
PHP_ARRAY_CMP_FUNC_CHECK(BG(user_compare_func_name))
if (zend_hash_sort(target_hash, zend_qsort, array_user_key_compare, 0 TSRMLS_CC) == FAILURE) {
BG(user_compare_func_name) = old_compare_func;
RETURN_FALSE;
@@ -1243,7 +1260,7 @@ PHP_FUNCTION(extract)
/* break omitted intentionally */
case EXTR_PREFIX_ALL:
if (final_name.len == 0) {
if (final_name.len == 0 && var_name_len != 0) {
smart_str_appendl(&final_name, Z_STRVAL_PP(prefix), Z_STRLEN_PP(prefix));
smart_str_appendc(&final_name, '_');
smart_str_appendl(&final_name, var_name, var_name_len);
@@ -1273,13 +1290,16 @@ PHP_FUNCTION(extract)
if (extract_refs) {
zval **orig_var;
SEPARATE_ZVAL_TO_MAKE_IS_REF(entry);
zval_add_ref(entry);
if (zend_hash_find(EG(active_symbol_table), final_name.c, final_name.len+1, (void **) &orig_var) == SUCCESS) {
zval_ptr_dtor(orig_var);
SEPARATE_ZVAL_TO_MAKE_IS_REF(entry);
zval_add_ref(entry);
*orig_var = *entry;
} else {
(*entry)->is_ref = 1;
zval_add_ref(entry);
zend_hash_update(EG(active_symbol_table), final_name.c, final_name.len+1, (void **) entry, sizeof(zval *), NULL);
}
} else {
@@ -1566,7 +1586,7 @@ HashTable* php_splice(HashTable *in_hash, int offset, int length,
/* ..and the length */
if (length < 0) {
length = num_in-offset+length;
} else if (offset+length > num_in) {
} else if (((unsigned) offset + (unsigned) length) > num_in) {
length = num_in-offset;
}
@@ -1943,7 +1963,7 @@ PHP_FUNCTION(array_slice)
/* ..and the length */
if (length_val < 0) {
length_val = num_in-offset_val+length_val;
} else if (offset_val+length_val > num_in) {
} else if (((unsigned) offset_val + (unsigned)length_val) > num_in) {
length_val = num_in-offset_val;
}
+27 -3
View File
@@ -32,6 +32,10 @@
#include "ext/session/php_session.h"
#include "zend_operators.h"
#ifdef PHP_WIN32
#include "win32/php_win32_globals.h"
#endif
#include <stdarg.h>
#include <stdlib.h>
#include <math.h>
@@ -494,7 +498,9 @@ function_entry basic_functions[] = {
PHP_FE(log, NULL)
PHP_FE(log10, NULL)
PHP_FE(sqrt, NULL)
#ifdef HAVE_HYPOT
PHP_FE(hypot, NULL)
#endif
PHP_FE(deg2rad, NULL)
PHP_FE(rad2deg, NULL)
PHP_FE(bindec, NULL)
@@ -1004,7 +1010,7 @@ PHPAPI double php_get_nan(void)
#if HAVE_HUGE_VAL_NAN
return HUGE_VAL + -HUGE_VAL;
#elif defined(__i386__) || defined(_X86_) || defined(ALPHA) || defined(_ALPHA) || defined(__alpha)
double val = 0;
double val = 0.0;
((php_uint32*)&val)[1] = PHP_DOUBLE_QUIET_NAN_HIGH;
((php_uint32*)&val)[0] = 0;
return val;
@@ -1017,10 +1023,10 @@ PHPAPI double php_get_nan(void)
PHPAPI double php_get_inf(void)
{
#if HAVE_HUGE_VAL_NAN
#if HAVE_HUGE_VAL_INF
return HUGE_VAL;
#elif defined(__i386__) || defined(_X86_) || defined(ALPHA) || defined(_ALPHA) || defined(__alpha)
double val = 0;
double val = 0.0;
((php_uint32*)&val)[1] = PHP_DOUBLE_INFINITY_HIGH;
((php_uint32*)&val)[0] = 0;
return val;
@@ -1035,8 +1041,14 @@ PHP_MINIT_FUNCTION(basic)
{
#ifdef ZTS
ts_allocate_id(&basic_globals_id, sizeof(php_basic_globals), (ts_allocate_ctor) basic_globals_ctor, (ts_allocate_dtor) basic_globals_dtor);
#ifdef PHP_WIN32
ts_allocate_id(&php_win32_core_globals_id, sizeof(php_win32_core_globals), (ts_allocate_ctor)php_win32_core_globals_ctor, NULL);
#endif
#else
basic_globals_ctor(&basic_globals TSRMLS_CC);
#ifdef PHP_WIN32
php_win32_core_globals_ctor(&php_win32_core_globals TSRMLS_CC);
#endif
#endif
REGISTER_LONG_CONSTANT("CONNECTION_ABORTED", PHP_CONNECTION_ABORTED, CONST_CS | CONST_PERSISTENT);
@@ -1123,6 +1135,9 @@ PHP_MSHUTDOWN_FUNCTION(basic)
{
#ifdef ZTS
ts_free_id(basic_globals_id);
#ifdef PHP_WIN32
ts_free_id(php_win32_core_globals_id);
#endif
#else
basic_globals_dtor(&basic_globals TSRMLS_CC);
#endif
@@ -1186,6 +1201,9 @@ PHP_RINIT_FUNCTION(basic)
/* Reset magic_quotes_runtime */
PG(magic_quotes_runtime) = INI_BOOL("magic_quotes_runtime");
/* Default to global wrappers only */
FG(stream_wrappers) = NULL;
return SUCCESS;
}
@@ -1209,6 +1227,12 @@ PHP_RSHUTDOWN_FUNCTION(basic)
}
STR_FREE(BG(locale_string));
if (FG(stream_wrappers)) {
zend_hash_destroy(FG(stream_wrappers));
efree(FG(stream_wrappers));
FG(stream_wrappers) = NULL;
}
PHP_RSHUTDOWN(fsock) (SHUTDOWN_FUNC_ARGS_PASSTHRU);
PHP_RSHUTDOWN(filestat) (SHUTDOWN_FUNC_ARGS_PASSTHRU);
PHP_RSHUTDOWN(syslog) (SHUTDOWN_FUNC_ARGS_PASSTHRU);
+24 -2
View File
@@ -326,7 +326,7 @@ if test "$ac_cv_atof_accept_inf" = "yes"; then
AC_DEFINE([HAVE_ATOF_ACCEPTS_INF], 1, [whether atof() accepts INF])
fi
AC_CACHE_CHECK(whether HUGE_VAL + -HUGEVAL == NAN, ac_cv_huge_val_nan,[
AC_CACHE_CHECK(whether HUGE_VAL == INF, ac_cv_huge_val_inf,[
AC_TRY_RUN([
#include <math.h>
#include <stdlib.h>
@@ -342,6 +342,28 @@ AC_CACHE_CHECK(whether HUGE_VAL + -HUGEVAL == NAN, ac_cv_huge_val_nan,[
#define zend_isinf(a) 0
#endif
int main(int argc, char** argv)
{
return zend_isinf(HUGE_VAL) ? 0 : 1;
}
],[
ac_cv_huge_val_inf=yes
],[
ac_cv_huge_val_inf=no
],[
ac_cv_huge_val_inf=yes
])
])
dnl This is the most probable fallback so we assume yes in case of cross compile.
if test "$ac_cv_huge_val_inf" = "yes"; then
AC_DEFINE([HAVE_HUGE_VAL_INF], 1, [whether HUGE_VAL == INF])
fi
AC_CACHE_CHECK(whether HUGE_VAL + -HUGEVAL == NAN, ac_cv_huge_val_nan,[
AC_TRY_RUN([
#include <math.h>
#include <stdlib.h>
#ifdef HAVE_ISNAN
#define zend_isnan(a) isnan(a)
#elif defined(HAVE_FPCLASS)
@@ -356,7 +378,7 @@ int main(int argc, char** argv)
/* prevent bug #27830 */
return 1;
#else
return zend_isinf(HUGE_VAL) && zend_isnan(HUGE_VAL + -HUGE_VAL) ? 0 : 1;
return zend_isnan(HUGE_VAL + -HUGE_VAL) ? 0 : 1;
#endif
}
],[
+5 -3
View File
@@ -87,9 +87,11 @@ PHPAPI void php_print_credits(int flag)
if (flag & PHP_CREDITS_DOCS) {
php_info_print_table_start();
php_info_print_table_header(1, "PHP Documentation Team");
php_info_print_table_row(1, "Jouni Ahto, Alexander Aulbach, Stig Bakken, Rasmus Lerdorf, Egon Schmid, Lars Torben Wilson, Jim Winstead");
php_info_print_table_row(1, "Edited by: Stig Bakken and Egon Schmid");
php_info_print_table_colspan_header(2, "PHP Documentation");
CREDIT_LINE("Authors", "Mehdi Achour, Friedhelm Betz, Antony Dovgal, Nuno Lopes, Philip Olson, Georg Richter, Damien Seguy, Jakub Vrana");
CREDIT_LINE("Editor", "Gabor Hojtsy");
CREDIT_LINE("User Note Maintainers", "Mehdi Achour, Friedhelm Betz, Vincent Gevers, Aidan Lister, Nuno Lopes, Tom Sommer");
CREDIT_LINE("Other Contributors", "Previously active authors, editors and other contributors are listed in the manual.");
php_info_print_table_end();
}
+1 -1
View File
@@ -39,7 +39,7 @@ CREDIT_LINE("HyperWave", "Uwe Steinmann");
CREDIT_LINE("IMAP", "Rex Logan, Mark Musone, Brian Wang, Kaj-Michael Lang, Antoni Pamies Olive, Rasmus Lerdorf, Andrew Skalski, Chuck Hagenbuch, Daniel R Kalowsky");
CREDIT_LINE("Informix", "Danny Heijl, Christian Cartus, Corne' Cornelius");
CREDIT_LINE("Ingres II", "David Hénot");
CREDIT_LINE("InterBase", "Jouni Ahto, Andrew Avdeev");
CREDIT_LINE("InterBase", "Jouni Ahto, Andrew Avdeev, Ard Biesheuvel");
CREDIT_LINE("IRCG", "Sascha Schumann");
CREDIT_LINE("Java", "Sam Ruby");
CREDIT_LINE("LDAP", "Amitay Isaacs, Eric Warnke, Rasmus Lerdorf, Gerrit Thomson, Stig Venaas");
+1 -1
View File
@@ -64,7 +64,7 @@ static int phpday_tab[2][12] = {
{31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
};
#define isleap(year) (((year % 4) == 0 && (year % 100) != 0) || (year % 400)==0)
#define isleap(year) ((((year) % 4) == 0 && ((year) % 100) != 0) || ((year) % 400)==0)
#define YEAR_BASE 1900
/* {{{ proto int time(void)
+7 -2
View File
@@ -370,12 +370,13 @@ PHP_FUNCTION(glob)
if (!result) {
cwd[0] = '\0';
}
cwd_skip = strlen(cwd)+1;
#ifdef PHP_WIN32
if (IS_SLASH(cwd[0]) && !IS_UNC_PATH(pattern, pattern_len)) {
if (IS_SLASH(*pattern)) {
cwd[2] = '\0';
}
#endif
cwd_skip = strlen(cwd)+1;
snprintf(work_pattern, MAXPATHLEN, "%s%c%s", cwd, DEFAULT_SLASH, pattern);
pattern = work_pattern;
}
@@ -389,8 +390,12 @@ PHP_FUNCTION(glob)
* doesn't. This ensure that if no match is found, an empty array
* is always returned so it can be used without worrying in e.g.
* foreach() */
#ifndef __linux__
RETURN_FALSE;
#else
array_init(return_value);
return;
#endif
}
#endif
RETURN_FALSE;
+11 -1
View File
@@ -410,6 +410,7 @@ char *php_escape_shell_cmd(char *str) {
switch (str[x]) {
case '"':
case '\'':
#ifndef PHP_WIN32
if (!p && (p = memchr(str + x + 1, str[x], l - x - 1))) {
/* noop */
} else if (p && *p == str[x]) {
@@ -419,6 +420,7 @@ char *php_escape_shell_cmd(char *str) {
}
cmd[y++] = str[x];
break;
#endif
case '#': /* This is character-set independent */
case '&':
case ';':
@@ -440,6 +442,12 @@ char *php_escape_shell_cmd(char *str) {
case '\\':
case '\x0A': /* excluding these two */
case '\xFF':
#ifdef PHP_WIN32
/* since Windows does not allow us to escape these chars, just remove them */
case '%':
cmd[y++] = ' ';
break;
#endif
cmd[y++] = '\\';
/* fall-through */
default:
@@ -472,7 +480,9 @@ char *php_escape_shell_arg(char *str) {
switch (str[x]) {
#ifdef PHP_WIN32
case '"':
cmd[y++] = '\\';
case '%':
cmd[y++] = ' ';
break;
#else
case '\'':
cmd[y++] = '\'';
+1 -4
View File
@@ -1224,6 +1224,7 @@ PHP_FUNCTION(popen)
if (!fp) {
php_error_docref2(NULL TSRMLS_CC, buf, p, E_WARNING, "%s", strerror(errno));
efree(p);
RETURN_FALSE;
}
} else {
@@ -2409,10 +2410,6 @@ enclosure:
goto enclosure;
}
} else {
while (e < re && e > s && *(e - 1) == enclosure) {
e--;
}
buf2 = erealloc(buf2, buf2_len + (e - s) + 1);
memcpy(buf2 + buf2_len, s, (e - s));
buf2_len += e - s;
+1
View File
@@ -118,6 +118,7 @@ typedef struct {
long default_socket_timeout;
char *user_agent;
char *user_stream_current_filename; /* for simple recursion protection */
HashTable *stream_wrappers; /* per-request copy of url_stream_wrappers_hash */
} php_file_globals;
#ifdef ZTS
+6 -2
View File
@@ -128,6 +128,7 @@ PHP_RSHUTDOWN_FUNCTION(filestat)
{
if (BG(CurrentStatFile)) {
efree (BG(CurrentStatFile));
BG(CurrentStatFile) = NULL;
}
return SUCCESS;
}
@@ -613,8 +614,11 @@ static void php_stat(const char *filename, php_stat_len filename_length, int typ
if (!IS_LINK_OPERATION(type) && (!IS_EXISTS_CHECK(type) || (errno != ENOENT && errno != ENOTDIR))) { /* fileexists() test must print no error */
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Stat failed for %s (errno=%d - %s)", BG(CurrentStatFile), errno, strerror(errno));
}
efree(BG(CurrentStatFile));
BG(CurrentStatFile) = NULL;
/* This could be null if a failed stat leads to a user error handler which calls a failed stat */
if (BG(CurrentStatFile)) {
efree(BG(CurrentStatFile));
BG(CurrentStatFile) = NULL;
}
#if HAVE_SYMLINK
if (!IS_LINK_OPERATION(type)) /* Don't require success for link operation */
#endif
+32 -10
View File
@@ -65,6 +65,7 @@ static char HEXCHARS[] = "0123456789ABCDEF";
static char *php_convert_to_decimal(double arg, int ndigits, int *decpt, int *sign, int eflag)
{
register int r2;
int mvl;
double fi, fj;
register char *p, *p1;
/*THREADX*/
@@ -90,13 +91,21 @@ static char *php_convert_to_decimal(double arg, int ndigits, int *decpt, int *si
p1 = &cvt_buf[NDIG];
while (fi != 0) {
fj = modf(fi / 10, &fi);
if (p1 <= &cvt_buf[0]) {
mvl = NDIG - ndigits;
memmove(&cvt_buf[mvl], &cvt_buf[0], NDIG-mvl-1);
p1 += mvl;
}
*--p1 = (int) ((fj + .03) * 10) + '0';
r2++;
}
while (p1 < &cvt_buf[NDIG])
*p++ = *p1++;
} else if (arg > 0) {
while ((fj = arg * 10.0) < 0.9999999) {
while ((fj = arg * 10) < 1) {
if (!eflag && (r2 * -1) < ndigits) {
break;
}
arg = fj;
r2--;
}
@@ -109,10 +118,17 @@ static char *php_convert_to_decimal(double arg, int ndigits, int *decpt, int *si
cvt_buf[0] = '\0';
return (cvt_buf);
}
if (p <= p1 && p < &cvt_buf[NDIG]) {
arg = modf(arg * 10, &fj);
if ((int)fj==10) {
*p++ = '1';
fj = 0;
*decpt = ++r2;
}
while (p <= p1 && p < &cvt_buf[NDIG]) {
arg *= 10;
arg = modf(arg, &fj);
*p++ = (int) fj + '0';
arg = modf(arg * 10, &fj);
}
}
if (p1 >= &cvt_buf[NDIG]) {
cvt_buf[NDIG - 1] = '\0';
@@ -286,7 +302,7 @@ php_sprintf_appenddouble(char **buffer, int *pos,
char numbuf[NUM_BUF_SIZE];
char *cvt;
register int i = 0, j = 0;
int sign, decpt;
int sign, decpt, cvt_len;
char decimal_point = EG(float_separator)[0];
PRINTF_DEBUG(("sprintf: appenddouble(%x, %x, %x, %f, %d, '%c', %d, %c)\n",
@@ -312,6 +328,7 @@ php_sprintf_appenddouble(char **buffer, int *pos,
}
cvt = php_convert_to_decimal(number, precision, &decpt, &sign, (fmt == 'e'));
cvt_len = strlen(cvt);
if (sign) {
numbuf[i++] = '-';
@@ -330,10 +347,15 @@ php_sprintf_appenddouble(char **buffer, int *pos,
}
}
} else {
while (decpt-- > 0)
numbuf[i++] = cvt[j++];
if (precision > 0)
while (decpt-- > 0) {
numbuf[i++] = j < cvt_len ? cvt[j++] : '0';
}
if (precision > 0) {
numbuf[i++] = decimal_point;
while (precision-- > 0) {
numbuf[i++] = j < cvt_len ? cvt[j++] : '0';
}
}
}
} else if (fmt == 'e' || fmt == 'E') {
char *exp_p;
@@ -376,9 +398,6 @@ php_sprintf_appenddouble(char **buffer, int *pos,
numbuf[i] = '\0';
if (precision > 0) {
width += (precision + 1);
}
php_sprintf_appendstring(buffer, pos, size, numbuf, width, 0, padding,
alignment, i, sign, 0, always_sign);
}
@@ -611,6 +630,7 @@ php_formatted_print(int ht, int *len, int use_array TSRMLS_DC)
if (multiuse) {
MAKE_STD_ZVAL(tmp);
*tmp = **(args[argnum]);
INIT_PZVAL(tmp);
zval_copy_ctor(tmp);
} else {
SEPARATE_ZVAL(args[argnum]);
@@ -758,6 +778,7 @@ PHP_FUNCTION(user_printf)
}
PHPWRITE(result, len);
efree(result);
RETURN_LONG(len);
}
/* }}} */
@@ -773,6 +794,7 @@ PHP_FUNCTION(vprintf)
}
PHPWRITE(result, len);
efree(result);
RETURN_LONG(len);
}
/* }}} */
+4
View File
@@ -52,6 +52,10 @@ PHP_FUNCTION(ftok)
RETURN_LONG(-1);
}
if ((PG(safe_mode) && (!php_checkuid(Z_STRVAL_PP(pathname), NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(Z_STRVAL_PP(pathname) TSRMLS_CC)) {
RETURN_LONG(-1);
}
k = ftok(Z_STRVAL_PP(pathname),Z_STRVAL_PP(proj)[0]);
RETURN_LONG(k);
+5 -4
View File
@@ -136,13 +136,13 @@ static entity_table_t ent_uni_spacing[] = {
static entity_table_t ent_uni_greek[] = {
/* 913 */
"Alpha", "Beta", "Gamma", "Delta", "Epsilon", "Zeta", "Eta", "Theta",
"Iota", "Kappa", "Lambda", "Mu", "Nu", "X1", "Omicron", "P1", "Rho",
NULL, "Sigma", "Tau", "Upsilon", "Ph1", "Ch1", "Ps1", "Omega",
"Iota", "Kappa", "Lambda", "Mu", "Nu", "Xi", "Omicron", "Pi", "Rho",
NULL, "Sigma", "Tau", "Upsilon", "Phi", "Chi", "Psi", "Omega",
/* 938 - 944 are not mapped */
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
"alpha", "beta", "gamma", "delta", "epsilon", "zeta", "eta", "theta",
"iota", "kappa", "lambda", "mu", "nu", "x1", "omicron", "p1", "rho",
"sigmaf", "sigma", "tau", "upsilon", "ph1", "ch1", "ps1", "omega",
"iota", "kappa", "lambda", "mu", "nu", "xi", "omicron", "pi", "rho",
"sigmaf", "sigma", "tau", "upsilon", "phi", "chi", "psi", "omega",
/* 970 - 976 are not mapped */
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
"thetasym", "ups1h",
@@ -505,6 +505,7 @@ inline static unsigned short get_next_char(enum entity_charset charset,
case 0x50: /* 6, 2nd */
utf |= ((this_char & 0x3f) << 24);
stat++;
break;
default:
/* invalid */
more = 0;
+6 -1
View File
@@ -467,7 +467,12 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
char *s = strrchr(resource->path, '/');
if (!s) {
s = resource->path;
*s = '/';
if (!s[0]) {
efree(s);
s = resource->path = estrdup("/");
} else {
*s = '/';
}
}
s[1] = '\0';
if (resource->path && *(resource->path) == '/' && *(resource->path + 1) == '\0') {
+5
View File
@@ -940,6 +940,11 @@ static int php_get_wbmp(php_stream *stream, struct gfxinfo **result, int check T
}
height = (height << 7) | (i & 0x7f);
} while (i & 0x80);
/* maximum valid sizes for wbmp (although 127x127 may be a more accurate one) */
if (height > 2048 || width > 2048) {
return 0;
}
if (!check) {
(*result)->width = width;
+1 -1
View File
@@ -411,7 +411,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
PUTS(SG(request_info).request_uri);
}
if ((ta->tm_mon==3) && (ta->tm_mday==1)) {
PUTS("?="PHP_EGG_LOGO_GUID"\" alt=\"Thies!\" /></a>");
PUTS("?="PHP_EGG_LOGO_GUID"\" alt=\"Nadia!\" /></a>");
} else {
PUTS("?="PHP_LOGO_GUID"\" alt=\"PHP Logo\" /></a>");
}
+5 -1
View File
@@ -208,6 +208,10 @@ PHP_FUNCTION(iptcembed)
break;
}
if (PG(safe_mode) && (!php_checkuid(Z_STRVAL_PP(jpeg_file), NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
RETURN_FALSE;
}
if (php_check_open_basedir(Z_STRVAL_PP(jpeg_file) TSRMLS_CC)) {
RETURN_FALSE;
}
@@ -347,7 +351,7 @@ PHP_FUNCTION(iptcparse)
inx += 2;
}
sprintf(key, "%d#%03d", (unsigned int) dataset, (unsigned int) recnum);
snprintf(key, sizeof(key), "%d#%03d", (unsigned int) dataset, (unsigned int) recnum);
if ((len > length) || (inx + len) > length)
break;
+10 -8
View File
@@ -617,14 +617,9 @@ PHP_FUNCTION(sqrt)
/* {{{ proto float hypot(float num1, float num2)
Returns sqrt(num1*num1 + num2*num2) */
/*
WARNING: this function is expermental: it could change its name or
disappear in the next version of PHP!
*/
#ifdef HAVE_HYPOT
PHP_FUNCTION(hypot)
{
#ifdef HAVE_HYPOT
zval **num1, **num2;
if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &num1, &num2) == FAILURE) {
@@ -634,8 +629,8 @@ PHP_FUNCTION(hypot)
convert_to_double_ex(num2);
Z_DVAL_P(return_value) = hypot(Z_DVAL_PP(num1), Z_DVAL_PP(num2));
Z_TYPE_P(return_value) = IS_DOUBLE;
#endif
}
#endif
/* }}} */
@@ -1020,7 +1015,12 @@ PHPAPI char *_php_math_number_format(double d, int dec, char dec_point, char tho
is_negative = 1;
d = -d;
}
dec = MAX(0, dec);
if (!dec_point && dec > 0) {
d *= pow(10, dec);
dec = 0;
} else {
dec = MAX(0, dec);
}
PHP_ROUND_WITH_FUZZ(d, dec);
@@ -1140,6 +1140,8 @@ PHP_FUNCTION(number_format)
convert_to_string_ex(t_s);
if (Z_STRLEN_PP(d_p)==1) {
dec_point=Z_STRVAL_PP(d_p)[0];
} else if (Z_STRLEN_PP(d_p)==0) {
dec_point=0;
}
if (Z_STRLEN_PP(t_s)==1) {
thousand_sep=Z_STRVAL_PP(t_s)[0];
+1
View File
@@ -604,6 +604,7 @@ static TABLE const TimezoneTable[] = {
{ "nt", tZONE, HOUR (11) }, /* Nome */
{ "idlw", tZONE, HOUR (12) }, /* International Date Line West */
{ "cet", tZONE, -HOUR (1) }, /* Central European */
{ "cest", tDAYZONE, -HOUR (1) }, /* Central European Summer */
{ "met", tZONE, -HOUR (1) }, /* Middle European */
{ "mewt", tZONE, -HOUR (1) }, /* Middle European Winter */
{ "mest", tDAYZONE, -HOUR (1) }, /* Middle European Summer */
+2
View File
@@ -66,7 +66,9 @@ PHP_FUNCTION(rad2deg);
WARNING: these functions are expermental: they could change their names or
disappear in the next version of PHP!
*/
#ifdef HAVE_HYPOT
PHP_FUNCTION(hypot);
#endif
PHP_FUNCTION(expm1);
PHP_FUNCTION(log1p);
+1 -1
View File
@@ -74,7 +74,7 @@ PHP_FUNCTION(soundex)
/* BUG: should also map here accented letters used in non */
/* English words or names (also found in English text!): */
/* esstsett, thorn, n-tilde, c-cedilla, s-caron, ... */
code = toupper(str[i]);
code = toupper((int)(unsigned char)str[i]);
if (code >= 'A' && code <= 'Z') {
if (_small == 0) {
/* remember first valid char */
+83 -111
View File
@@ -203,10 +203,10 @@ static void php_spn_common_handler(INTERNAL_FUNCTION_PARAMETERS, int behavior)
{
char *s11, *s22;
int len1, len2;
long start, len;
start = 0;
len = 0;
long start = 0, len = 0;
unsigned char match[256] = {0};
char *rs, *s, *e;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ll", &s11, &len1,
&s22, &len2, &start, &len) == FAILURE) {
return;
@@ -234,22 +234,21 @@ static void php_spn_common_handler(INTERNAL_FUNCTION_PARAMETERS, int behavior)
}
}
if ((start + len) > len1) {
if (((unsigned) start + (unsigned) len) > len1) {
len = len1 - start;
}
if (behavior == STR_STRSPN) {
RETURN_LONG(php_strspn(s11 + start /*str1_start*/,
s22 /*str2_start*/,
s11 + start + len /*str1_end*/,
s22 + len2 /*str2_end*/));
} else if (behavior == STR_STRCSPN) {
RETURN_LONG(php_strcspn(s11 + start /*str1_start*/,
s22 /*str2_start*/,
s11 + start + len /*str1_end*/,
s22 + len2 /*str2_end*/));
s = s22;
e = s22 + len2;
while (s < e) {
match[(int)(unsigned char)*s++] = 1;
}
rs = s = s11 + start;
e = s11 + start + len;
while (s <= e && match[(int)(unsigned char)*s++] != behavior);
RETURN_LONG((s - rs) < 1 ? 0 : s - rs - 1);
}
/* {{{ proto int strspn(string str, string mask [, start [, len]])
@@ -638,8 +637,9 @@ PHP_FUNCTION(wordwrap)
return;
}
if (textlen == 0)
RETURN_FALSE;
if (textlen == 0) {
RETURN_EMPTY_STRING();
}
if (linelength == 0 && docut) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't force cut when width is zero.");
@@ -658,7 +658,7 @@ PHP_FUNCTION(wordwrap)
} else if (text[current] == ' ') {
if (current - laststart >= linelength) {
newtext[current] = breakchar[0];
laststart = current;
laststart = current + 1;
}
lastspace = current;
} else if (current - laststart >= linelength && laststart != lastspace) {
@@ -1292,42 +1292,6 @@ PHPAPI char *php_stristr(unsigned char *s, unsigned char *t, size_t s_len, size_
}
/* }}} */
/* {{{ php_strspn
*/
PHPAPI size_t php_strspn(char *s1, char *s2, char *s1_end, char *s2_end)
{
register const char *p = s1, *spanp;
register char c = *p;
cont:
for (spanp = s2; p != s1_end && spanp != s2_end;)
if (*spanp++ == c) {
c = *(++p);
goto cont;
}
return (p - s1);
}
/* }}} */
/* {{{ php_strcspn
*/
PHPAPI size_t php_strcspn(char *s1, char *s2, char *s1_end, char *s2_end)
{
register const char *p, *spanp;
register char c = *s1;
for (p = s1;;) {
spanp = s2;
do {
if (*spanp == c || p == s1_end)
return p - s1;
} while (spanp++ < s2_end);
c = *++p;
}
/* NOTREACHED */
}
/* }}} */
/* {{{ proto string stristr(string haystack, string needle)
Finds first occurrence of a string within another, case insensitive */
PHP_FUNCTION(stristr)
@@ -1672,7 +1636,7 @@ PHP_FUNCTION(substr)
RETURN_FALSE;
}
if ((f + l) > Z_STRLEN_PP(str)) {
if (((unsigned) f + (unsigned) l) > Z_STRLEN_PP(str)) {
l = Z_STRLEN_PP(str) - f;
}
@@ -1734,7 +1698,7 @@ PHP_FUNCTION(substr_replace)
}
}
if ((f + l) > Z_STRLEN_PP(str)) {
if (((unsigned) f + (unsigned) l) > Z_STRLEN_PP(str)) {
l = Z_STRLEN_PP(str) - f;
}
@@ -2269,10 +2233,8 @@ PHP_FUNCTION(addslashes)
RETURN_EMPTY_STRING();
}
RETURN_STRING(php_addslashes(Z_STRVAL_PP(str),
Z_STRLEN_PP(str),
&Z_STRLEN_P(return_value), 0
TSRMLS_CC), 0);
Z_TYPE_P(return_value) = IS_STRING;
Z_STRVAL_P(return_value) = php_addslashes(Z_STRVAL_PP(str), Z_STRLEN_PP(str), &Z_STRLEN_P(return_value), 0 TSRMLS_CC);
}
/* }}} */
@@ -2441,72 +2403,80 @@ PHPAPI char *php_addcslashes(char *str, int length, int *new_length, int should_
}
/* }}} */
/* true static */
const unsigned char php_esc_list[256] = {2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
/* {{{ php_addslashes
*/
PHPAPI char *php_addslashes(char *str, int length, int *new_length, int should_free TSRMLS_DC)
{
/* maximum string length, worst case situation */
char *new_str;
char *source, *target;
char *end;
int local_new_length;
char *e = str + (length ? length : (length = strlen(str)));
char *p = str;
char *new_str, *ps;
int local_new_length = length;
int type = PG(magic_quotes_sybase) ? 1 : 0;
if (!new_length) {
new_length = &local_new_length;
}
if (!str) {
*new_length = 0;
return str;
}
new_str = (char *) emalloc((length?length:(length=strlen(str)))*2+1);
source = str;
end = source + length;
target = new_str;
if (PG(magic_quotes_sybase)) {
while (source < end) {
switch (*source) {
case '\0':
*target++ = '\\';
*target++ = '0';
break;
case '\'':
*target++ = '\'';
*target++ = '\'';
break;
default:
*target++ = *source;
break;
}
source++;
}
} else {
while (source < end) {
switch (*source) {
case '\0':
*target++ = '\\';
*target++ = '0';
break;
case '\'':
case '\"':
case '\\':
*target++ = '\\';
/* break is missing *intentionally* */
default:
*target++ = *source;
break;
}
source++;
/* determine the number of the characters that need to be escaped */
while (p < e) {
if (php_esc_list[(int)(unsigned char)*p++] > type) {
local_new_length++;
}
}
*target = 0;
*new_length = target - new_str;
/* string does not have any escapable characters */
if (local_new_length == length) {
new_str = estrndup(str, length);
goto done;
}
/* create escaped string */
ps = new_str = emalloc(local_new_length + 1);
p = str;
if (!type) {
while (p < e) {
if (php_esc_list[(int)(unsigned char)*p]) {
*ps++ = '\\';
}
*ps++ = *p++;
}
} else {
while (p < e) {
switch (php_esc_list[(int)(unsigned char)*p]) {
case 2:
*ps++ = '\\';
*ps++ = '0';
p++;
break;
case 3:
*ps++ = '\'';
*ps++ = '\'';
p++;
break;
default:
*ps++ = *p++;
break;
}
}
}
*ps = '\0';
done:
if (should_free) {
STR_FREE(str);
}
new_str = (char *) erealloc(new_str, *new_length+1);
*new_length = local_new_length;
return new_str;
}
/* }}} */
@@ -3339,6 +3309,8 @@ PHPAPI size_t php_strip_tags(char *rbuf, int len, int *stateptr, char *allow, in
while (i < len) {
switch (c) {
case '\0':
break;
case '<':
if (isspace(*(p + 1))) {
goto reg_char;
+3 -3
View File
@@ -153,13 +153,13 @@ PHPAPI int strnatcmp_ex(char const *a, size_t a_len, char const *b, size_t b_len
return +1;
++ap; ++bp;
if (ap == aend && bp == bend)
if (ap >= aend && bp >= bend)
/* The strings compare the same. Perhaps the caller
will want to call strcmp to break the tie. */
return 0;
else if (ap == aend)
else if (ap >= aend)
return -1;
else if (bp == bend)
else if (bp >= bend)
return 1;
}
}
+3
View File
@@ -119,6 +119,9 @@ PHP_RSHUTDOWN_FUNCTION(syslog)
if (BG(syslog_device)) {
efree(BG(syslog_device));
}
#ifdef PHP_WIN32
closelog();
#endif
return SUCCESS;
}
+89
View File
@@ -0,0 +1,89 @@
--TEST--
Bug #28974 array_(p)slice() treats large lengths incorrectly - overflow
--FILE--
<?php
$a = $b = $c = array(0,1,2,3,4,5);
print_r($a);
// this is ok:
print_r(array_slice($a,2,2147483645));
// this is wrong:
print_r(array_slice($a,2,2147483646));
echo 'print_r(array_splice($a,2,1));'."\n";
print_r(array_splice($a,2,1));
echo "\$a is :";
print_r($a);
echo 'print_r(array_splice($b,2,2147483645));'."\n";
print_r(array_splice($b,2,2147483645));
echo "\$b is :";
print_r($b);
// this is wrong:
echo 'print_r(array_splice($c,2,2147483646));'."\n";
print_r(array_splice($c,2,2147483646));
echo "\$c is :";
print_r($c);
?>
--EXPECT--
Array
(
[0] => 0
[1] => 1
[2] => 2
[3] => 3
[4] => 4
[5] => 5
)
Array
(
[0] => 2
[1] => 3
[2] => 4
[3] => 5
)
Array
(
[0] => 2
[1] => 3
[2] => 4
[3] => 5
)
print_r(array_splice($a,2,1));
Array
(
[0] => 2
)
$a is :Array
(
[0] => 0
[1] => 1
[2] => 3
[3] => 4
[4] => 5
)
print_r(array_splice($b,2,2147483645));
Array
(
[0] => 2
[1] => 3
[2] => 4
[3] => 5
)
$b is :Array
(
[0] => 0
[1] => 1
)
print_r(array_splice($c,2,2147483646));
Array
(
[0] => 2
[1] => 3
[2] => 4
[3] => 5
)
$c is :Array
(
[0] => 0
[1] => 1
)
@@ -0,0 +1,74 @@
--TEST--
bug #29038 (extract(), EXTR_PREFIX_SAME option prefixes empty strings)
--FILE--
<?php
function f1() {
$c = extract(array("" => 1),EXTR_PREFIX_SAME,"prefix");
echo "Extracted:";
var_dump($c);
print_r(get_defined_vars());
}
function f2() {
$a = 1;
$c = extract(array("a" => 1),EXTR_PREFIX_SAME,"prefix");
echo "Extracted:";
var_dump($c);
print_r(get_defined_vars());
}
function f3() {
$a = 1;
$c = extract(array("a" => 1),EXTR_PREFIX_ALL,"prefix");
echo "Extracted:";
var_dump($c);
print_r(get_defined_vars());
}
function f4() {
$c = extract(array("" => 1),EXTR_PREFIX_ALL,"prefix");
echo "Extracted:";
var_dump($c);
print_r(get_defined_vars());
}
function f5() {
$c = extract(array("111" => 1),EXTR_PREFIX_ALL,"prefix");
echo "Extracted:";
var_dump($c);
print_r(get_defined_vars());
}
f1();
f2();
f3();
f4();
f5();
?>
--EXPECT--
Extracted:int(0)
Array
(
[c] => 0
)
Extracted:int(1)
Array
(
[a] => 1
[prefix_a] => 1
[c] => 1
)
Extracted:int(1)
Array
(
[a] => 1
[prefix_a] => 1
[c] => 1
)
Extracted:int(0)
Array
(
[c] => 0
)
Extracted:int(1)
Array
(
[prefix_111] => 1
[c] => 1
)
+14
View File
@@ -0,0 +1,14 @@
--TEST--
Bug #28228 (number_format() does not allow empty decimal separator)
--FILE--
<?php
echo number_format(1234.5678, 4, '', '') . "\n";
echo number_format(1234.5678, 4, NULL, ',') . "\n";
echo number_format(1234.5678, 4, 0, ',') . "\n";
echo number_format(1234.5678, 4);
?>
--EXPECT--
12345678
12,345,678
1,23405678
1,234.5678
+1 -1
View File
@@ -7,5 +7,5 @@ Bug #22207 (missing 0 when using the e notation in *printf functions)
?>
--EXPECT--
1.1000e+0
string(17) " 1.1000e+0
string(11) " 1.1000e+0
"
+4 -4
View File
@@ -21,14 +21,14 @@ printf("%05u\n", -200);
--EXPECT--
+0200
-0200
+0200.000000
-0200.000000
+200.000000
-200.000000
00200
4294967096
---
00200
-0200
00200.000000
-0200.000000
200.000000
-200.000000
00200
4294967096
Loaded 100 of 176 files, more files were not shown because too many files have changed in this diff. Show more