Compare commits

...
511 Commits
Author SHA1 Message Date
SVN Migration 79e7914724 This commit was manufactured by cvs2svn to create tag 'php_4_3_10'. 2004-12-14 17:42:29 +00:00
Ilia Alshanetsky 84a696da20 Fixed test. 2004-12-14 17:42:28 +00:00
Ilia Alshanetsky 19d0000632 Fixed build. 2004-12-14 17:22:10 +00:00
Ilia Alshanetsky 5a4b7f9c30 4.3.10 2004-12-14 16:07:50 +00:00
Derick Rethans bb2e9ef00c - Fixed compile error related to bug #28605.
#- But it does not *fix* bug #28605.
2004-12-14 08:35:26 +00:00
Ilia Alshanetsky 6cd0a77372 MFH: Fixed bug #28228 (NULL decimal separator is not being handled correctly). 2004-12-14 00:40:01 +00:00
Derick Rethans f137de1506 - MFH: Generate all iconv headers by default 2004-12-11 11:17:21 +00:00
Antony Dovgal aea9676eb0 CS changes 2004-12-09 17:16:57 +00:00
Pierre Joye 67524ef7c9 - update, MFH #28598 2004-12-09 14:26:39 +00:00
Antony Dovgal a5d9c87d49 MFH: fix segfault in session_module_name() when session.save_handler is empty 2004-12-09 14:21:13 +00:00
Pierre Joye 87cae0e01b - MFH: #28598, attempt to restore MS Symbol ttf support 2004-12-09 14:20:20 +00:00
Derick Rethans b4b338a8d1 - Fixed bug #31034 (Problem with non-existing iconv header file). (Derick) 2004-12-09 09:04:46 +00:00
Ilia Alshanetsky fe29c8def5 MFH: Fixed bug #31024 (Crash in fgetcsv() with negative length). 2004-12-08 21:15:02 +00:00
Frank M. Kromann 251851dbb3 MFH: Fix possible leaks 2004-12-08 19:02:29 +00:00
Frank M. Kromann 6416003e95 MFH: Fix logic for file checking. Bug #31019 2004-12-08 18:59:11 +00:00
Joe Orton db633a0760 MFH: Fix VPATH build again. 2004-12-08 12:52:12 +00:00
foobar aff3259a25 MFH: Fix build. This was not supposed to halt configure if test fails. 2004-12-08 06:48:13 +00:00
Brad House 9b72bcfd99 backport from 5.0/head. Newer versions of libmonetra broke compatability with one function. Make workaround that detects version, and works with both. 2004-12-08 03:11:32 +00:00
Ilia Alshanetsky d2bf5faa4f Back to dev. 2004-12-08 01:11:43 +00:00
Ilia Alshanetsky eea7fbdd4f 4.3.10RC2 2004-12-08 01:09:53 +00:00
Antony Dovgal dcfe66f9d7 MFH: fix leak 2004-12-07 17:04:42 +00:00
Antony Dovgal 61442c339f revert it 2004-12-07 14:01:56 +00:00
Derick Rethans 3d2bc043a7 - Tidy up NEWS a bit. 2004-12-07 08:42:50 +00:00
Antony Dovgal 2381aecca9 fix bug #30232 (session_start() sends Set-Cookie header only if the cookie is not set yet)
# looks like somebody fixed it in HEAD and forgot to MFH it..
2004-12-07 08:21:38 +00:00
Ilia Alshanetsky 14c6cd1788 MFh: Fixed bug #30995 (snmp extension does not build with net-snmp 5.2). 2004-12-07 00:34:33 +00:00
Ilia Alshanetsky d059006b67 MFH: Fixed bug #30990 (allow popen() on *NIX to accept 'b' flag). 2004-12-06 23:31:58 +00:00
Derick Rethans 95d9d7069a - Install the iconv extension headers to <installpath>/ext/iconv so that
external extensions can use them.
2004-12-06 20:37:56 +00:00
Ilia Alshanetsky aea33db8bb Revert, this is not needed after all. 2004-12-06 19:44:33 +00:00
Stanislav Malyshev 9ab7598560 fix startup - if startup did not succeed, do not continue with execution 2004-12-06 18:55:16 +00:00
Stanislav Malyshev a21c4e544f do not zero out peak - MM shutdown would do that 2004-12-06 18:51:40 +00:00
Ilia Alshanetsky ccbb17575a As per discussion on internals and pecl, domxml is no longer experimental. 2004-12-05 19:08:56 +00:00
Holger Zimmermann 0cd60dedad Replaced static server variables by function call and configurable list at the Pi3Web server side. 2004-12-05 09:48:48 +00:00
Stefan Esser 1686229772 fix compile 2004-12-03 16:09:19 +00:00
Stefan Esser 0520c88818 MFH 2004-12-03 16:04:26 +00:00
Christian Stocker bc0b61d250 - remove EXPERIMENTAL tag 2004-12-03 15:53:02 +00:00
Ilia Alshanetsky fa3568d490 MFH: Fixed bug #30962 (mssql returns space for NULL columns). 2004-12-03 02:27:11 +00:00
Antony Dovgal 84b568c4be MFH: revert my last patch 2004-12-02 16:36:41 +00:00
Stefan Esser ef56c2d1ee MFH 2004-12-02 01:04:46 +00:00
Stefan Esser aa65def360 MFH 2004-12-02 00:44:33 +00:00
Stefan Esser 26b45cf15f Fixed missing opening bracket 2004-12-01 23:47:54 +00:00
Stefan Esser 8aa0e89801 MFH 2004-12-01 22:56:33 +00:00
Stefan Esser 0c23ef8d85 MFH 2004-12-01 22:42:26 +00:00
Derick Rethans aa3971b119 - Update INSTALL file (to add static instructions) 2004-12-01 09:15:06 +00:00
Derick Rethans 5cc3311229 - MFH: Added testcase for bug #30695 2004-11-29 10:15:22 +00:00
SVN Migration 78388bd7c5 This commit was manufactured by cvs2svn to create branch 'PHP_4_3'. 2004-11-29 10:15:04 +00:00
Derick Rethans 5742bd2c52 - Make it work with PDFLib 5 again (And the check for PDFLib 6 is gone). 2004-11-29 09:13:39 +00:00
Sergey Kartashoff 169205c41a # - MnoGoSearch extension latest patch reverted (part3) 2004-11-28 20:33:12 +00:00
Sergey Kartashoff 7335ef4d30 - MnoGoSearch extension latest patch reverted (part2) 2004-11-28 20:31:37 +00:00
Sergey Kartashoff fb8f2ff8e4 - MnoGoSearch extension latest patch reverted 2004-11-28 20:30:09 +00:00
Sergey Kartashoff 918be06876 - MnoGoSearch extension updated to fix compilation issues with
mnogosearch-3.2.25+
2004-11-28 20:03:30 +00:00
Antony Dovgal 909ad657e1 BFN + change my mail to my name 2004-11-28 17:15:30 +00:00
Antony Dovgal 2abee83ee1 MFH: fix #29954 (array_reduce segfaults when initial value is array) 2004-11-28 17:12:59 +00:00
Stefan Esser a09961a655 MFH 2004-11-28 12:44:56 +00:00
Jon Parise 07392ae5f1 Distribute Net_SMTP 1.2.6 instead of 1.2.3. The former includes a year's
worth of additional bug fixes and improvements, and it has been a stable
release for over six months.

PEAR Bug: 2839
2004-11-27 21:31:10 +00:00
Ilia Alshanetsky 6fcaae369a MFH: Improve offset check inside shmop_write(). 2004-11-27 18:18:19 +00:00
Ilia Alshanetsky c30a032552 Back to dev. 2004-11-23 14:56:29 +00:00
Ilia Alshanetsky a3ee846047 RC1 release date. 2004-11-23 14:08:19 +00:00
Ilia Alshanetsky 6b59cbbdd7 tagging 4.3.10RC1 2004-11-23 14:03:27 +00:00
Edin Kadribasic 2cf6532d17 (Sort of) MFH: export PHP iconv symbols using the old build too 2004-11-23 12:14:20 +00:00
Derick Rethans fc627a4fa1 - MFH: export "php_iconv_string()" 2004-11-23 09:45:23 +00:00
Derick Rethans 0a2b8eb991 - MFH: Added test case for bug #28599 2004-11-23 09:41:53 +00:00
SVN Migration ec7db7ced2 This commit was manufactured by cvs2svn to create branch 'PHP_4_3'. 2004-11-23 09:40:08 +00:00
Frank M. Kromann 41dca25055 Fix #30860 configure fails when tds is compiled as shared 2004-11-22 19:42:31 +00:00
Marcus Boerger 57c2b685d7 - Add missing .cvsignore 2004-11-21 17:47:26 +00:00
Stefan Esser 4eb5de66a4 MFH 2004-11-20 20:16:44 +00:00
Pierre Joye 0823cf28da - Entry for #30229 2004-11-20 13:40:30 +00:00
Pierre Joye 3775b78197 - Fix #30229, imagerectangle draw the corners twice, making it useless
with alpha channel.
  Fix it to work well with thick>1 as well, both filled and wired rectangle
2004-11-20 13:34:52 +00:00
Antony Dovgal be6160f0f9 BFN 2004-11-19 17:03:52 +00:00
Antony Dovgal 6db1b839c8 MFH: fix bug #30587 (array_multisort doesn't separate zvals before changing them) 2004-11-19 16:58:38 +00:00
Ilia Alshanetsky 581e6a7ea8 Fixed bug #30826 (Certain reference relations cannot be unserialized
properly).
2004-11-18 22:14:42 +00:00
Ilia Alshanetsky 4bd84a5e69 MFH: Gracefully handle allocation failure. 2004-11-17 23:43:31 +00:00
Pierre Joye b5d739b88b - Fix #30739, imagefill does not set back the alphablending mode 2004-11-17 17:13:42 +00:00
Edin Kadribasic ef30fa2ee0 Fix windows build 2004-11-17 00:10:26 +00:00
Frank M. Kromann 0e33da898f MFH: Fix win32 build. 2004-11-15 23:27:26 +00:00
Frank M. Kromann e018da1aa3 MFH: Avoid renaming of sprintf to php_sprintf 2004-11-15 23:26:40 +00:00
Derick Rethans 963d068fd5 - Cleaned up some of the locale mess:
* all internal use of sprintf, snprintf and the like will always
    use the . as thousands seperator (if php.h is included only!).
  * echo, printf() and sprintf() always render locale-aware
  * added the %F modifier for non-locale aware rendering for floats
2004-11-15 13:40:31 +00:00
Rainer Schaaf 189654d882 fixed Bug #29297
Configure now only allows to work with PDFlib up to PDFlib 4, as newer
PDFlib versions need the code from the PDFlib PECL module.
2004-11-13 23:42:08 +00:00
Antony Dovgal 4ac1241426 MFH: fix #30751 (phpinfo() shows the same ini path after reconfigure with --with-config-file-path) 2004-11-11 07:01:16 +00:00
Ilia Alshanetsky edd4e6525a MFH: Fixed bug #30750 (Meaningful error message when upload directory is not
accessible).
2004-11-11 00:40:18 +00:00
Wez Furlong 2c14b8fd21 MFH: CloseHandle 2004-11-10 20:28:27 +00:00
Ilia Alshanetsky 4c04d243da MFH: Fixed possible overflow. 2004-11-10 01:44:58 +00:00
Ilia Alshanetsky 9f38730cf9 MFH: Fixed crash inside cpdf_setdash() if called before page init. 2004-11-09 00:45:39 +00:00
Ilia Alshanetsky b9a5843251 MFH: Fixed possible crash on fstat() failure. 2004-11-08 04:55:14 +00:00
Marcus Boerger ac0a29b046 MFH Bug #30627 2004-11-04 20:17:25 +00:00
Derick Rethans 92c8f6ce9b - MFH: Fixed bug #30630: Added a BSD based strtod function that is
locale-independent. (PHP part)
2004-11-03 23:36:03 +00:00
Antony Dovgal cdac193f9f BFN 2004-11-03 13:42:51 +00:00
Antony Dovgal 81c614a1ef fix bug #30654 (persistent connection is deleted from hash if there was exclusive connection with the same credentials)
No need for MFB here - 5.x.x branches work fine.
2004-11-03 13:35:56 +00:00
Ilia Alshanetsky 21c8eb93ba MFH: Fixed bug #30658 (Ensure that temporary files created by GD are removed). 2004-11-02 16:42:13 +00:00
Ilia Alshanetsky e0fc58c29f MFH: Fixed open_basedir & safe_mode bypass inside readlink() function. 2004-11-02 00:38:07 +00:00
Ilia Alshanetsky a451f1c9e4 MFH: Fixed bug #30613 (Prevent infinite recursion in url redirection). 2004-11-01 04:56:10 +00:00
Andi Gutmans 26ed6ea8b2 - [PATCH] Bug fix for #29770, but for PHP 4.3.9 (Vladimir Zidar) 2004-10-29 00:38:44 +00:00
Antony Dovgal a4e90790c4 fix Win32 & Netware build 2004-10-28 05:05:57 +00:00
Antony Dovgal 2b2129c057 BFN 2004-10-27 12:06:13 +00:00
Antony Dovgal e4fadfcd89 MFH: fix bug #30388 (rename across filesystems loses ownership and permission info) 2004-10-27 12:01:20 +00:00
Wez Furlong 02b50acd93 Fix possible crash; patch by Kamesh Jayachandran 2004-10-27 11:11:28 +00:00
Wez Furlong 4ab0cd7dcb BFN 2004-10-26 09:31:20 +00:00
Wez Furlong 8cb520a855 Fix for Bug #29418 (double free when openssl_csr_new fails).
Also hook up MSHUTDOWN function which appears to have never been enabled.

Patch by Kamesh Jayachandran
2004-10-26 09:29:22 +00:00
Edin Kadribasic 06a0021a55 Revert Linux LFS patch 2004-10-22 10:46:07 +00:00
Edin Kadribasic 63b0419766 BFN 2004-10-22 00:00:41 +00:00
Edin Kadribasic 1701079235 BFN 2004-10-21 23:59:11 +00:00
Edin Kadribasic 9a27a01007 Enable LFS (large file support) for Linux. Support for other operating
systems can be added later. FreeBSD does not seem to require any
special compile flags to enable LFS.
Fixes #27792.
2004-10-21 23:47:59 +00:00
Edin Kadribasic 045499b31f MFH: bugfix #30133 2004-10-21 23:43:41 +00:00
Joe Orton bcb3eb98a8 MFH: Fix case where php_handle_aborted_connection was called
outside a try/end_try block (#25570).
2004-10-21 19:43:37 +00:00
Joe Orton 3b3ef4c5ee MFH: Fixed apache2* SAPI build against httpd 2.1. 2004-10-21 19:41:55 +00:00
Stanislav Malyshev 62e23967ee fix HEAD problem: if some output is attempted in shutdown,
it bails out from shutdown sequence, which is bad
2004-10-20 15:27:25 +00:00
Ilia Alshanetsky 5b683f14f5 MFH: Fixed bug #30475 (curl_getinfo() may crash in some situations). 2004-10-18 22:43:29 +00:00
Antony Dovgal 75ae21df6d BFN 2004-10-18 15:16:21 +00:00
Antony Dovgal f890a666a8 MFH: fix bug #30442 ( segmentation fault when parsing ?getvariable[][ ) 2004-10-18 15:08:46 +00:00
Ilia Alshanetsky db953cd7ff MFH: Fixed a bug in addslashes() handling of the '\0' character. 2004-10-17 18:41:30 +00:00
Sebastian Bergmann bf3ad32af1 MFH: Add *.gcda and *.gcno (from gcc -fprofile-{use|generate}) to .cvsignore. 2004-10-10 16:24:30 +00:00
SVN Migration 018f7b5094 This commit was manufactured by cvs2svn to create branch 'PHP_4_3'. 2004-10-10 16:10:39 +00:00
Antony Dovgal 2a4fc5e0ee MFH: fix possible segfault 2004-10-10 15:06:20 +00:00
Marcus Boerger 388504729f MFH speling 2004-10-08 19:03:14 +00:00
Ilia Alshanetsky a360086291 MFH: Fixed bug #30027 (Possible crash inside ftp_get()). 2004-10-05 23:55:21 +00:00
Ilia Alshanetsky 6abde062a9 MFH: Fixed bug #30281 (Prevent non-wbmp images from being detected as such) 2004-10-04 20:44:07 +00:00
Rasmus Lerdorf 972ec73cb1 Not sure when this BC breaking change snuck in, but the output method
didn't take an argument before and this compression argument is documented
to be optional but in the code it wasn't.  This patch fixes the BC break
by making the compression argument optional.
2004-10-01 19:18:40 +00:00
Magnus M��tt� 637a9710a1 The length should be passed to the function,
so no need to check it inside the function too.
Will also fix a compile failure with gcc 3.4.
2004-10-01 18:28:44 +00:00
Ilia Alshanetsky d564087e47 MFH: Make PHP_EOL constant available. 2004-10-01 14:27:13 +00:00
Antony Dovgal 9e8ce192df BFN 2004-09-30 15:02:06 +00:00
Antony Dovgal 48a22e8997 MFH: fix segfaults and bug #30282 and suppress compile warnings 2004-09-30 14:18:25 +00:00
Ilia Alshanetsky f3313b21b6 MFH: Fixed bug #30276 (Possible crash in ctype_digit on large numbers). 2004-09-30 01:24:03 +00:00
Ilia Alshanetsky 8f5de28871 MFH: Fix compilation 2004-09-29 12:40:09 +00:00
foobar c6a4f91836 - Fixed bug #30205 (Missing <unistd.h> in crypt() configure test). 2004-09-28 20:42:36 +00:00
Antony Dovgal e2cea361db MFH: fix bug #29652 2004-09-28 17:28:27 +00:00
Ilia Alshanetsky 545e42675d MFH: Fixed bug #30224 (Sybase date strings are sometimes not null
terminated).
2004-09-28 14:09:01 +00:00
Wez Furlong 70e1858a92 MFH: fix for #30057 2004-09-26 01:17:42 +00:00
Marcus Boerger 5a91c43301 MFH lib substituation 2004-09-25 15:32:20 +00:00
Marcus Boerger 98b81c2a4e BFN 2004-09-24 22:00:47 +00:00
Marcus Boerger c3f72d45ec - MFH Several serialize/unserialize fixes 2004-09-24 21:57:19 +00:00
Marcus Boerger 7952ed122a - MFH Several serialize/unserialize fixes
# first commit .re
2004-09-24 21:56:59 +00:00
Derick Rethans 6efc4c4940 - Backported Marcus' foreach() speedup patch from PHP 5.x. 2004-09-24 13:15:12 +00:00
Derick Rethans 31f503c1aa [0.25]
- Fixed some signed issues.
2004-09-24 13:07:18 +00:00
Ilia Alshanetsky 70b35bb580 MFH: Fixed bug #29913 (parse_url() is now binary safe). (Ilia) 2004-09-22 00:51:51 +00:00
Ilia Alshanetsky 13effac5aa Fixed minor version #. 2004-09-21 23:38:55 +00:00
Uwe Schindler 97dbc366c7 Fixed bug #29805 (HTTP Authentication Issues) 2004-09-21 22:00:39 +00:00
Ilia Alshanetsky 21d9578e52 Back to dev. 2004-09-20 23:29:49 +00:00
Ilia Alshanetsky ca25d91f13 4.3.9 2004-09-20 22:28:35 +00:00
Ilia Alshanetsky b663137e04 Prepare news file for release. 2004-09-20 22:27:55 +00:00
Ilia Alshanetsky 6175cec8a7 MFH: Fixed bug #30050 (Possible crash inside php_shutdown_config()). 2004-09-17 02:49:48 +00:00
Uwe Schindler 2b5c855143 Sorry REVERT bevor 4.3.9 is out because of not critical!!!! 2004-09-15 21:51:29 +00:00
Uwe Schindler 4fdd5249fb Fixed bug #29805 (HTTP Authentication Issues) 2004-09-15 21:25:31 +00:00
foobar 35b1b345c4 MFH: Test for bug #30069 2004-09-15 13:55:32 +00:00
SVN Migration 15b4d3dc78 This commit was manufactured by cvs2svn to create branch 'PHP_4_3'. 2004-09-15 13:54:17 +00:00
Rasmus Lerdorf ef6d751b04 Stefano did the real work tracking this one down 2004-09-14 06:10:02 +00:00
Ilia Alshanetsky 0938da3685 Back to dev. 2004-09-14 04:33:09 +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
Ilia Alshanetsky 9a87c59f72 Prepare for 4.3.6RC2 2004-04-05 15:34:37 +00:00
Ilia Alshanetsky 831caad432 Restore wddx tests, without the troublesome date conversions. 2004-04-05 14:10:19 +00:00
Moriyoshi Koizumi 0ef09b9609 - MFH(r-1.49): Let it work safely 2004-04-04 19:23:43 +00:00
Moriyoshi Koizumi df1e5064e7 - Remove test, as it's never worked as expected. 2004-04-04 19:19:45 +00:00
Ilia Alshanetsky ad63c6c086 MFH: Fixed a bug that prevented building of the GD extension against
external GD lib 1.X.
2004-04-04 18:00:23 +00:00
Derick Rethans 8d802f10f0 - MFH: Fixed comment and double 0 2004-04-04 12:45:34 +00:00
Derick Rethans 6c192034a2 - MFH: One more test for DST bugs. 2004-04-04 12:43:17 +00:00
SVN Migration 3bab4824f0 This commit was manufactured by cvs2svn to create branch 'PHP_4_3'. 2004-04-04 12:42:14 +00:00
Marcus Boerger 951f80976b MFH: Add comment 2004-04-04 12:31:38 +00:00
Ard Biesheuvel 0e00c049c7 MFH: gcc-2.95/sparc test 2004-04-04 10:24:09 +00:00
Derick Rethans e85ca0efce - Fixed bug #27849 (configure craps out on trivial syntax error). 2004-04-03 17:23:14 +00:00
Greg Beaver 56c1fec8d8 MFH
fixed #534 for real (remove notice if state=stable doesn't exist, and use "none" for stable version number)
2004-04-03 15:56:11 +00:00
Ard Biesheuvel 4b1deca2e1 2nd try for glibc2.2/sparc64 2004-04-03 12:37:45 +00:00
Ard Biesheuvel c40ac6b268 Changed test to include returning HUGE_VAL as well (intended to resolve #27830) 2004-04-03 09:46:20 +00:00
Greg Beaver 8e07a4fd52 MFH
fix Bug #937 throwError() treats every call as static
fix Bug #964 PEAR_ERROR_EXCEPTION causes fatal error
2004-04-03 06:28:48 +00:00
Greg Beaver 5336ad6dbd MFH fix #534: pear search doesn't list unstable releases 2004-04-03 06:09:27 +00:00
Greg Beaver e1fa70df9a not devel any more 2004-04-03 00:42:14 +00:00
Ilia Alshanetsky 85923625fe Fixed bug #27730. 2004-04-02 16:54:44 +00:00
Derick Rethans de9e6e1f1b - Fixed unintialized variables. 2004-04-02 09:33:49 +00:00
Ilia Alshanetsky b145f87d40 MFH: Fixed reversed condition for error reporting. 2004-04-01 22:05:38 +00:00
Ilia Alshanetsky f579d02059 Back to dev. 2004-04-01 21:48:32 +00:00
Ilia Alshanetsky 2058fec25b Prepare for 4.3.6RC1. 2004-04-01 20:51:34 +00:00
Derick Rethans 6c63a9e153 - Fixed bug #27780 (strtotime(+1 xxx) returns a wrong date/time) 2004-04-01 20:35:41 +00:00
Ilia Alshanetsky 4de55b50dc Revert patch for bug #27782. 2004-04-01 19:07:02 +00:00
Ilia Alshanetsky bbdbfa8563 Bug fixing news & test for bug #27819. 2004-04-01 17:49:21 +00:00
Derick Rethans cc5e0df571 - MFH: Fixed bug #27822 (is_resource() returns TRUE for closed resources) 2004-04-01 08:56:33 +00:00
SVN Migration d528916296 This commit was manufactured by cvs2svn to create branch 'PHP_4_3'. 2004-04-01 08:54:45 +00:00
Ilia Alshanetsky 0cd7e11430 Bug fixing news. 2004-03-31 23:27:40 +00:00
Ilia Alshanetsky 772523e4a8 MFH: Fixed bug #27809 (ftp_systype returns null on some ftp servers). 2004-03-31 20:44:04 +00:00
Hartmut Holzgraefe 5f1a942add MFH 2004-03-31 17:59:28 +00:00
Ilia Alshanetsky ddbc35b39c MFH: Fixed bug #27802 (default number of children to 8 when
PHP_FCGI_CHILDREN is not defined).
2004-03-31 17:01:45 +00:00
Ard Biesheuvel ea3c36078c MFH 2004-03-31 10:31:43 +00:00
Ilia Alshanetsky 24e9c2b3ff MFH: Fixed bug #27782 (Wrong behaviour of next(), prev() and each()). 2004-03-30 19:09:10 +00:00
SVN Migration 6241abce94 This commit was manufactured by cvs2svn to create branch 'PHP_4_3'. 2004-03-30 19:08:44 +00:00
Frank M. Kromann 53b5689016 MFH: Fix for #27764. Get return value from a stored procedure not returning any result sets 2004-03-30 17:54:38 +00:00
Stanislav Malyshev 7eed89deb7 Disabled calling dtors on tsrm_shutdown - calling dtors in tsrm_shutdown makes
modules registering TSRM ids to crash, if they have dtors,
since the module is unloaded before tsrm_shutdown is called.
Can be re-enabled after tsrm_free_id is implemented.
2004-03-30 16:54:20 +00:00
Ilia Alshanetsky 06f91140fe Bug fixing news. 2004-03-30 13:43:53 +00:00
Wez Furlong 0825bb2386 Fix for Bug #27762: SCO Openserver doesn't have S_ISSOCK
Possible side effect from this is that CLI scripts run from inetd won't
realize that stdin/stdout are sockets.  But thats not our problem.
2004-03-30 11:04:32 +00:00
Marcus Boerger 64fe4952b6 MFH: NAN==NAN doest work (Ard) 2004-03-29 23:26:32 +00:00
Ilia Alshanetsky 96b2eaca0d MFH: Removed extra spaces that cause the test to fail. 2004-03-29 21:57:54 +00:00
Wez Furlong ffe1113b3d Fix for Bug #26757: session.save_path default is bogus for win32
Based on a patch found in the bug report.
Concept approved by Ilia.
2004-03-29 21:28:47 +00:00
Ilia Alshanetsky db9a8f2f5e Bug fixing news. 2004-03-29 19:35:19 +00:00
Marcus Boerger 6efb1b369c MFH: Found a NAN/INF solution that should be portable everywhere(?) 2004-03-29 19:03:59 +00:00
Frank M. Kromann 538a818db0 MFH: Fix for #27743. Make sure Money types are converted and returned correct 2004-03-29 18:33:13 +00:00
Ilia Alshanetsky 9934670186 MFH: Synchronized bundled GD library with GD 2.0.22. 2004-03-29 18:21:00 +00:00
Ilia Alshanetsky 89206cfca4 MFH: Fixed bug #27731 (error_reporting() inside @ block fails to set
error_reporting level).
2004-03-29 00:52:20 +00:00
Ilia Alshanetsky cb8e1f16ee Fixed build. 2004-03-29 00:27:17 +00:00
Ilia Alshanetsky 1af4d7724f Fixed bug #27732 (Fixed compilation bug inside php_sab_info.h). 2004-03-29 00:09:34 +00:00
Marcus Boerger 7e941eefe8 MFH: Improve portability (idea by Ard) 2004-03-28 21:50:01 +00:00
Rasmus Lerdorf 885e837b2a - Merge whitespace and trivial changes from HEAD back to the branch so the
diff between HEAD and PHP_4_3 only shows feature changes
- Fix test case for bug #27719 (TZ=EST means no DST so the test was wrong)
2004-03-28 14:57:32 +00:00
Marcus Boerger 6a3fc10b05 MFH: Add new #undef's 2004-03-27 01:53:18 +00:00
Marcus Boerger e96b4d55bd BFN 2004-03-27 01:48:04 +00:00
Marcus Boerger 5188dd875f Fixed bug #27687 (Bug Adding Default Charset to 'text/*' Content-Type Header 2004-03-27 01:45:44 +00:00
Marcus Boerger 6f431d5d6d MFH: Move defines to proper location 2004-03-27 01:41:46 +00:00
Marcus Boerger 4e78551db1 Touch after .c 2004-03-27 01:28:00 +00:00
Marcus Boerger 9de151b2ce BFN 2004-03-27 01:18:40 +00:00
Marcus Boerger 91786ab7a5 MFH: bugfix #27646 2004-03-27 01:17:07 +00:00
SVN Migration 0bf404dbeb This commit was manufactured by cvs2svn to create branch 'PHP_4_3'. 2004-03-27 00:50:42 +00:00
Derick Rethans e566c744d1 - MFH: Fix for bug #27717. 2004-03-26 22:14:35 +00:00
Ard Biesheuvel a96a6a2b7f Alignment fix 2004-03-26 20:53:09 +00:00
Ard Biesheuvel f51237d726 MFH 2004-03-26 20:07:34 +00:00
Ard Biesheuvel b1061c7443 MFH: Calculate pow(long,long) in a way that works on 64-bit platforms 2004-03-26 20:01:53 +00:00
Derick Rethans 5d3a542a08 - COmmit the test, not the diff 2004-03-26 19:50:45 +00:00
Ilia Alshanetsky 20c0fb5e9c MFH: Fixed bug #27664 (--disable-cli doesn't force --without-pear). 2004-03-26 19:48:53 +00:00
Derick Rethans e89ac09125 - Add test for #27719 2004-03-26 19:44:18 +00:00
Rasmus Lerdorf 94728f7301 The 2am offset was a bad choice as this hour doesn't necessarily exist
on a DST switch.  So use 4am instead.  Fixes bug #27719
2004-03-26 19:29:31 +00:00
Ilia Alshanetsky e65f145d46 Bug fixing news. 2004-03-26 19:07:49 +00:00
Ilia Alshanetsky 2986565c79 MFH: Fixes to allow curl extension to compile against libcurl 7.11.1 2004-03-26 19:04:17 +00:00
Ilia Alshanetsky e2088baab4 Back to dev. 2004-03-25 14:14:21 +00:00
268 changed files with 10646 additions and 4495 deletions

No files matched your search

+1 -1
View File
@@ -262,7 +262,7 @@ STATUS: Unknown
EXTENSION: domxml
PRIMARY MAINTAINER: Uwe Steinmann <steinm@php.net>
MAINTENANCE: Maintained
STATUS: Experimental
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: dotnet
PRIMARY MAINTAINER: Sam Ruby <rubys@us.ibm.com>
+1481 -378
View File
File diff suppressed because it is too large. Load diff
+239 -5
View File
@@ -1,11 +1,245 @@
PHP 4 NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? Mar 2004, Version 4.3.5
15 Dec 2004, Version 4.3.10
- Added the %F modifier to *printf to render a non-locale-aware representation
of a float with the . as decimal separator. (Derick)
- Fixed a bug in addslashes() handling of the '\0' character. (Ilia)
- Backported Marcus' foreach() speedup patch from PHP 5.x. (Derick)
- Fixed potential problems with unserializing invalid serialize data. (Marcus)
- Fixed bug #31034 (Problem with non-existing iconv header file). (Derick)
- Fixed bug #31024 (Crash in fgetcsv() with negative length). (Ilia)
- Fixed bug #31019 (Logic error mssql library checking). (Frank)
- Fixed bug #30995 (snmp extension does not build with net-snmp 5.2). (Ilia)
- Fixed bug #30990 (allow popen() on *NIX to accept 'b' flag). (Ilia)
- Fixed bug #30826 (Certain reference relations cannot be unserialized
properly). (Ilia)
- Fixed bug #30750 (Meaningful error message when upload directory is not
accessible). (Ilia)
- Fixed bug #30739 (imagefill does not set back alphablending mode). (Pierre)
- Fixed bug #30672 (Problem handling exif data in jpeg images at unusual
places). (Marcus)
- Fixed bug #30658 (Ensure that temporary files created by GD are removed).
(Ilia)
- Fixed bug #30654 (oci8 persistent connection is deleted from hash
if there was exclusive connection with the same credentials). (Tony)
- Fixed bug #30613 (Prevent infinite recursion in url redirection). (Ilia)
- Fixed bug #30587 (array_multisort doesn't separate zvals before
changing them). (Tony)
- Fixed bug #30475 (curl_getinfo() may crash in some situations). (Ilia)
- Fixed bug #30442 (segfault when parsing ?getvariable[][ ). (Tony)
- Fixed bug #30388 (rename across filesystems loses ownership and
permission info). (Tony)
- Fixed bug #30282 (segfault when using unknown/unsupported
session.save_handler and/or session.serialize_handler). (Tony)
- Fixed bug #30281 (Prevent non-wbmp images from being detected as such).
(Ilia)
- Fixed bug #30276 (Possible crash in ctype_digit on large numbers). (Ilia)
- Fixed bug #30229 (imagerectangle and imagefilledrectangle do work well
with alpha channel, corners are drawn twice). (Pierre)
- Fixed bug #30224 (Sybase date strings are sometimes not null terminated).
(Ilia)
- Fixed bug #30133 (get_current_user() crashes on Windows). (Edin)
- Fixed bug #30057 (did not detect IPV6 on FreeBSD 4.1). (Wez)
- Fixed bug #30027 (Possible crash inside ftp_get()).
(cfield at affinitysolutions dot com)
- Fixed bug #29805 (HTTP Authentication Issues). (Uwe Schindler)
- Fixed bug #29418 (double free when openssl_csr_new fails).
(Kamesh Jayachandran).
- Fixed bug #28598 (Lost support for MS Symbol fonts). (Pierre)
- Fixed bug #28325 (Circular references not properly serialized). (Moriyoshi)
- Fixed bug #28228 (NULL decimal separator is not being handled correctly).
(Ilia)
- Fixed bug #27469 (serialize() objects of incomplete class). (Dmitry)
22 Sep 2004, Version 4.3.9
- GPC input processing fixes (Stefano Di Paola, Rasmus, Stefan)
- 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)
- 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 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.
- Fixed bug #30050 (Possible crash inside php_shutdown_config()).
(Ilia, nw at softwarekombinat dot de)
- Fixed bug #29954 (array_reduce segfaults when initial value is array). (Tony)
- Fixed bug #29882 (isset crashes on arrays). (Marcus)
- 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 #29607 (highlighting code with HEREDOC produces invalid output).
(Ilia)
- Fixed bug #29599 (domxml_error segfaults another apache module). (Rob)
- Fixed bug #29594 (Use PHP's own tmpfile() implementation). (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, Tony)
- 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)
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)
- Fixed bug #27809 (ftp_systype returns null on some ftp servers). (Ilia)
- 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)
- Fixed bug #27743 (Make sure Money types are converted and returned
correctly). (Frank)
- Fixed bug #27732 (Fixed compilation bug inside php_sab_info.h). (Ilia)
- Fixed bug #27731 (error_reporting() inside @ block fails to set
error_reporting level). (Ilia)
- Fixed bug #27719 (mktime issues on and around DST changeover). (Rasmus)
- 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 #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
@@ -19,7 +253,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.
+6
View File
@@ -158,9 +158,15 @@ TSRM_API void tsrm_shutdown(void)
next_p = p->next;
for (j=0; j<p->count; j++) {
/* Disabled - calling dtors in tsrm_shutdown makes
modules registering TSRM ids to crash, if they have
dtors, since the module is unloaded before tsrm_shutdown
is called. Can be re-enabled after tsrm_free_id is
implemented.
if (resource_types_table && resource_types_table[j].dtor) {
resource_types_table[j].dtor(p->storage[j], &p->storage);
}
*/
free(p->storage[j]);
}
free(p->storage);
+51 -10
View File
@@ -301,15 +301,22 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
if (path_length == 0)
return (0);
if (path_length >= MAXPATHLEN)
return (1);
#if !defined(TSRM_WIN32) && !defined(NETWARE)
/* cwd_length can be 0 when getcwd() fails.
* This can happen under solaris when a dir does not have read permissions
* but *does* have execute permissions */
if (IS_ABSOLUTE_PATH(path, path_length) || (state->cwd_length < 1)) {
if (use_realpath && realpath(path, resolved_path)) {
path = resolved_path;
path_length = strlen(path);
if (use_realpath) {
if (realpath(path, resolved_path)) {
path = resolved_path;
path_length = strlen(path);
} else {
/* disable for now
return 1; */
}
}
} else { /* Concat current directory with relative path and then run realpath() on it */
char *tmp;
@@ -325,9 +332,19 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
memcpy(ptr, path, path_length);
ptr += path_length;
*ptr = '\0';
if (use_realpath && realpath(tmp, resolved_path)) {
path = resolved_path;
path_length = strlen(path);
if (strlen(tmp) >= MAXPATHLEN) {
free(tmp);
return 1;
}
if (use_realpath) {
if (realpath(tmp, resolved_path)) {
path = resolved_path;
path_length = strlen(path);
} else {
/* disable for now
free(tmp);
return 1; */
}
}
free(tmp);
}
@@ -818,13 +835,24 @@ CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC)
CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC)
{
int command_length;
int dir_length, extra = 0;
char *command_line;
char *ptr;
char *ptr, *dir;
FILE *retval;
command_length = strlen(command);
ptr = command_line = (char *) malloc(command_length + sizeof("cd ; ") + CWDG(cwd).cwd_length+1);
dir_length = CWDG(cwd).cwd_length;
dir = CWDG(cwd).cwd;
while (dir_length > 0) {
if (*dir == '\'') extra+=3;
dir++;
dir_length--;
}
dir_length = CWDG(cwd).cwd_length;
dir = CWDG(cwd).cwd;
ptr = command_line = (char *) malloc(command_length + sizeof("cd '' ; ") + dir_length +1+1);
if (!command_line) {
return NULL;
}
@@ -834,8 +862,21 @@ CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC)
if (CWDG(cwd).cwd_length == 0) {
*ptr++ = DEFAULT_SLASH;
} else {
memcpy(ptr, CWDG(cwd).cwd, CWDG(cwd).cwd_length);
ptr += CWDG(cwd).cwd_length;
*ptr++ = '\'';
while (dir_length > 0) {
switch (*dir) {
case '\'':
*ptr++ = '\'';
*ptr++ = '\\';
*ptr++ = '\'';
/* fall-through */
default:
*ptr++ = *dir;
}
dir++;
dir_length--;
}
*ptr++ = '\'';
}
*ptr++ = ' ';
+19 -7
View File
@@ -1,4 +1,4 @@
dnl $Id$
dnl $Id$ -*- autoconf -*-
dnl
dnl This file contains local autoconf functions.
@@ -20,12 +20,12 @@ AC_DEFUN(PHP_PROG_RE2C,[
AC_CHECK_PROG(RE2C, re2c, re2c, [exit 0;])
])
dnl PHP_DEFINE(WHAT[, value])
dnl PHP_DEFINE(WHAT[, value[, directory]])
dnl
dnl Creates builddir/include/what.h and in there #define WHAT value
dnl
AC_DEFUN([PHP_DEFINE],[
[echo "#define ]$1[]ifelse([$2],,[ 1],[ $2])[" > include/php_]translit($1,A-Z,a-z)[.h]
[echo "#define ]$1[]ifelse([$2],,[ 1],[ $2])[" > ]ifelse([$3],,[include],[$3])[/php_]translit($1,A-Z,a-z)[.h]
])
dnl PHP_INIT_BUILD_SYSTEM
@@ -1699,16 +1699,28 @@ AC_DEFUN([PHP_SETUP_ICONV], [
found_iconv=no
unset ICONV_DIR
# Create the directories for a VPATH build:
test -d ext || mkdir ext
test -d ext/iconv || mkdir ext/iconv
echo > ext/iconv/php_have_bsd_iconv.h
echo > ext/iconv/php_have_glibc_iconv.h
echo > ext/iconv/php_have_libiconv.h
echo > ext/iconv/php_have_iconv.h
echo > ext/iconv/php_php_iconv_impl.h
echo > ext/iconv/php_php_iconv_h_path.h
echo > ext/iconv/php_iconv_supports_errno.h
dnl
dnl Check libc first if no path is provided in --with-iconv
dnl
if test "$PHP_ICONV" = "yes"; then
AC_CHECK_FUNC(iconv, [
PHP_DEFINE(HAVE_ICONV)
PHP_DEFINE(HAVE_ICONV,1,[ext/iconv])
found_iconv=yes
],[
AC_CHECK_FUNC(libiconv,[
PHP_DEFINE(HAVE_LIBICONV)
PHP_DEFINE(HAVE_LIBICONV,1,[ext/iconv])
found_iconv=yes
])
])
@@ -1741,11 +1753,11 @@ AC_DEFUN([PHP_SETUP_ICONV], [
then
PHP_CHECK_LIBRARY($iconv_lib_name, libiconv, [
found_iconv=yes
PHP_DEFINE(HAVE_LIBICONV)
PHP_DEFINE(HAVE_LIBICONV,1,[ext/iconv])
], [
PHP_CHECK_LIBRARY($iconv_lib_name, iconv, [
found_iconv=yes
PHP_DEFINE(HAVE_ICONV)
PHP_DEFINE(HAVE_ICONV,1,[ext/iconv])
], [], [
-L$ICONV_DIR/lib
])
+16 -12
View File
@@ -40,7 +40,7 @@ AC_CONFIG_HEADER(main/php_config.h)
MAJOR_VERSION=4
MINOR_VERSION=3
RELEASE_VERSION=5
RELEASE_VERSION=10
EXTRA_VERSION=""
VERSION="$MAJOR_VERSION.$MINOR_VERSION.$RELEASE_VERSION$EXTRA_VERSION"
@@ -351,6 +351,7 @@ stdlib.h \
string.h \
syslog.h \
sysexits.h \
sys/bitypes.h \
sys/file.h \
sys/mman.h \
sys/mount.h \
@@ -528,17 +529,20 @@ AC_CACHE_CHECK([for getaddrinfo], ac_cv_func_getaddrinfo,
AC_TRY_RUN([
#include <netdb.h>
#include <sys/types.h>
#ifndef AF_INET
# include <sys/socket.h>
#endif
int main(void) {
struct addrinfo *ai, *pai, hints;
memset(&hints, 0, sizeof(hints));
hints.ai_flags = AI_NUMERICHOST;
if (getaddrinfo("127.0.0.1", NULL, &hints, &ai) < 0) {
if (getaddrinfo("127.0.0.1", 0, &hints, &ai) < 0) {
exit(1);
}
if (ai == NULL) {
if (ai == 0) {
exit(1);
}
@@ -567,8 +571,8 @@ fi
AC_REPLACE_FUNCS(strlcat strlcpy getopt)
AC_FUNC_UTIME_NULL
AC_FUNC_ALLOCA
PHP_AC_BROKEN_SPRINTF
PHP_AC_BROKEN_SNPRINTF
dnl PHP_AC_BROKEN_SPRINTF
dnl PHP_AC_BROKEN_SNPRINTF
PHP_DECLARED_TIMEZONE
PHP_TIME_R_TYPE
PHP_READDIR_R_TYPE
@@ -857,15 +861,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 +877,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
@@ -916,7 +920,7 @@ fi
if test "$abs_srcdir" != "$abs_builddir"; then
INCLUDES="$INCLUDES -I\$(top_srcdir)/main -I\$(top_srcdir)/Zend"
INCLUDES="$INCLUDES -I\$(top_srcdir)/TSRM"
INCLUDES="$INCLUDES -I\$(top_srcdir)/TSRM -I\$(top_builddir)/"
fi
ZEND_EXTRA_LIBS="$LIBS"
@@ -1210,7 +1214,7 @@ PHP_ADD_SOURCES(Zend, \
zend_opcode.c zend_operators.c zend_ptr_stack.c zend_stack.c \
zend_variables.c zend.c zend_API.c zend_extensions.c zend_hash.c \
zend_list.c zend_indent.c zend_builtin_functions.c zend_sprintf.c \
zend_ini.c zend_qsort.c zend_multibyte.c)
zend_ini.c zend_qsort.c zend_multibyte.c zend_strtod.c)
if test -r "$abs_srcdir/Zend/zend_objects.c"; then
PHP_ADD_SOURCES(Zend, zend_objects.c zend_object_handlers.c zend_objects_API.c zend_mm.c)
@@ -1407,7 +1411,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
View File
@@ -92,6 +92,7 @@ bc_raisemod (bc_num base, bc_num expo, bc_num mod, bc_num *result, int scale TSR
bc_free_num (&power);
bc_free_num (&exponent);
bc_free_num (result);
bc_free_num (&parity);
*result = temp;
return 0; /* Everything is OK. */
}
+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);
+23 -7
View File
@@ -1563,7 +1563,9 @@ PHP_FUNCTION(cpdf_setdash)
php_error(E_WARNING, "%s(): Unable to find identifier %d", get_active_function_name(TSRMLS_C), id);
RETURN_FALSE;
}
if (!pdf->currentMemStream) {
RETURN_FALSE;
}
snprintf(buffer, BUFFERLEN, "[%d %d] 0", (int) Z_LVAL_P(arg2), (int) Z_LVAL_P(arg3));
cpdf_setdash(pdf, buffer);
@@ -2522,16 +2524,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 && Z_LVAL_P(c) < 0) { \
RETURN_BOOL(iswhat(Z_LVAL_P(c) + 256)); \
} \
SEPARATE_ZVAL(&c); \
convert_to_string(c); \
case IS_STRING: \
{ \
char *p; \
+91 -12
View File
@@ -22,6 +22,10 @@
#include "config.h"
#endif
#ifdef PHP_WIN32
#include <winsock2.h>
#endif
#include "php.h"
#if HAVE_CURL
@@ -30,13 +34,17 @@
#include <string.h>
#ifdef PHP_WIN32
#include <winsock.h>
#include <sys/types.h>
#endif
#include <curl/curl.h>
#include <curl/easy.h>
/* As of curl 7.11.1 this is no longer defined inside curl.h */
#ifndef HttpPost
#define HttpPost curl_httppost
#endif
#define SMART_STR_PREALLOC 4096
#include "ext/standard/php_smart_str.h"
@@ -133,7 +141,9 @@ PHP_MINIT_FUNCTION(curl)
REGISTER_CURL_CONSTANT(CURLOPT_FOLLOWLOCATION);
REGISTER_CURL_CONSTANT(CURLOPT_FTPASCII);
REGISTER_CURL_CONSTANT(CURLOPT_PUT);
#if CURLOPT_MUTE != 0
REGISTER_CURL_CONSTANT(CURLOPT_MUTE);
#endif
REGISTER_CURL_CONSTANT(CURLOPT_USERPWD);
REGISTER_CURL_CONSTANT(CURLOPT_PROXYUSERPWD);
REGISTER_CURL_CONSTANT(CURLOPT_RANGE);
@@ -191,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);
@@ -277,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);
@@ -506,6 +563,7 @@ static size_t curl_write_header(char *data, size_t size, size_t nmemb, void *ctx
}
/* }}} */
#if CURLOPT_PASSWDFUNCTION != 0
/* {{{ curl_passwd
*/
static size_t curl_passwd(void *ctx, char *prompt, char *buf, int buflen)
@@ -552,6 +610,7 @@ static size_t curl_passwd(void *ctx, char *prompt, char *buf, int buflen)
return ret;
}
/* }}} */
#endif
/* {{{ curl_free_string
*/
@@ -649,6 +708,7 @@ PHP_FUNCTION(curl_init)
curl_easy_setopt(ch->cp, CURLOPT_WRITEHEADER, (void *) ch);
curl_easy_setopt(ch->cp, CURLOPT_DNS_USE_GLOBAL_CACHE, 1);
curl_easy_setopt(ch->cp, CURLOPT_DNS_CACHE_TIMEOUT, 120);
curl_easy_setopt(ch->cp, CURLOPT_MAXREDIRS, 20); /* prevent infinite redirects */
if (argc > 0) {
char *urlcopy;
@@ -697,7 +757,9 @@ PHP_FUNCTION(curl_setopt)
case CURLOPT_NETRC:
case CURLOPT_FOLLOWLOCATION:
case CURLOPT_PUT:
case CURLOPT_MUTE:
#if CURLOPT_MUTE != 0
case CURLOPT_MUTE:
#endif
case CURLOPT_TIMEOUT:
case CURLOPT_FTP_USE_EPSV:
case CURLOPT_LOW_SPEED_LIMIT:
@@ -721,6 +783,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;
@@ -842,6 +910,7 @@ PHP_FUNCTION(curl_setopt)
ch->handlers->write_header->func = *zvalue;
ch->handlers->write_header->method = PHP_CURL_USER;
break;
#if CURLOPT_PASSWDFUNCTION != 0
case CURLOPT_PASSWDFUNCTION:
if (ch->handlers->passwd) {
zval_ptr_dtor(&ch->handlers->passwd);
@@ -851,6 +920,7 @@ PHP_FUNCTION(curl_setopt)
error = curl_easy_setopt(ch->cp, CURLOPT_PASSWDFUNCTION, curl_passwd);
error = curl_easy_setopt(ch->cp, CURLOPT_PASSWDDATA, (void *) ch);
break;
#endif
case CURLOPT_POSTFIELDS:
if (Z_TYPE_PP(zvalue) == IS_ARRAY || Z_TYPE_PP(zvalue) == IS_OBJECT) {
zval **current;
@@ -893,7 +963,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);
}
@@ -1138,10 +1208,13 @@ PHP_FUNCTION(curl_getinfo)
switch (option) {
case CURLINFO_EFFECTIVE_URL:
case CURLINFO_CONTENT_TYPE: {
char *s_code;
char *s_code = NULL;
curl_easy_getinfo(ch->cp, option, &s_code);
RETURN_STRING(s_code, 1);
if (curl_easy_getinfo(ch->cp, option, &s_code) == CURLE_OK && s_code) {
RETURN_STRING(s_code, 1);
} else {
RETURN_FALSE;
}
break;
}
@@ -1151,10 +1224,13 @@ PHP_FUNCTION(curl_getinfo)
case CURLINFO_FILETIME:
case CURLINFO_SSL_VERIFYRESULT:
case CURLINFO_REDIRECT_COUNT: {
long code;
long code = 0;
curl_easy_getinfo(ch->cp, option, &code);
RETURN_LONG(code);
if (curl_easy_getinfo(ch->cp, option, &code) == CURLE_OK) {
RETURN_LONG(code);
} else {
RETURN_FALSE;
}
break;
}
@@ -1170,10 +1246,13 @@ PHP_FUNCTION(curl_getinfo)
case CURLINFO_CONTENT_LENGTH_UPLOAD:
case CURLINFO_STARTTRANSFER_TIME:
case CURLINFO_REDIRECT_TIME: {
double code;
double code = 0.0;
curl_easy_getinfo(ch->cp, option, &code);
RETURN_DOUBLE(code);
if (curl_easy_getinfo(ch->cp, option, &code) == CURLE_OK) {
RETURN_DOUBLE(code);
} else {
RETURN_FALSE;
}
break;
}
+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 */
+6 -3
View File
@@ -11,8 +11,11 @@ AC_DEFUN(PHP_DBA_STD_BEGIN,[
AC_DEFUN(PHP_TEMP_LDFLAGS,[
old_LDFLAGS=$LDFLAGS
LDFLAGS="$1 $LDFLAGS"
$2
old_LIBS=$LIBS
LIBS="$2 $LIBS"
$3
LDFLAGS=$old_LDFLAGS
LIBS=$old_LIBS
])
dnl Assign INCLUDE/LFLAGS from PREFIX
@@ -134,7 +137,7 @@ dnl parameters(version, library list, function)
AC_DEFUN(PHP_DBA_DB_CHECK,[
for LIB in $2; do
if test -f $THIS_PREFIX/lib/lib$LIB.a -o -f $THIS_PREFIX/lib/lib$LIB.$SHLIB_SUFFIX_NAME; then
PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib -l$LIB,[
PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib, -l$LIB,[
AC_TRY_LINK([
#include "$THIS_INCLUDE"
],[
@@ -171,7 +174,7 @@ AC_DEFUN(PHP_DBA_DB_CHECK,[
])
fi
if test "$ext_shared" = "yes"; then
AC_MSG_CHECKING(if db can be used as shared extension)
AC_MSG_CHECKING(if dba can be used as shared extension)
AC_EGREP_CPP(yes,[
#include "$THIS_INCLUDE"
#if DB_VERSION_MAJOR > 3 || (DB_VERSION_MAJOR == 3 && DB_VERSION_MINOR > 2)
+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"
+27 -6
View File
@@ -79,8 +79,10 @@ ZEND_GET_MODULE(dio)
static void _dio_close_fd(zend_rsrc_list_entry *rsrc TSRMLS_DC)
{
php_fd_t *f = (php_fd_t *) rsrc->ptr;
close(f->fd);
free(f);
if (f) {
close(f->fd);
free(f);
}
}
#define RDIOC(c) REGISTER_LONG_CONSTANT(#c, c, CONST_CS | CONST_PERSISTENT)
@@ -142,10 +144,13 @@ PHP_MINFO_FUNCTION(dio)
php_info_print_table_end();
}
static void new_php_fd(php_fd_t **f, int fd)
static int new_php_fd(php_fd_t **f, int fd)
{
*f = malloc(sizeof(php_fd_t));
if (!(*f = malloc(sizeof(php_fd_t)))) {
return 0;
}
(*f)->fd = fd;
return 1;
}
/* {{{ proto resource dio_open(string filename, int flags[, int mode])
@@ -179,7 +184,10 @@ PHP_FUNCTION(dio_open)
RETURN_FALSE;
}
new_php_fd(&f, fd);
if (!new_php_fd(&f, fd)) {
RETURN_FALSE;
}
ZEND_REGISTER_RESOURCE(return_value, f, le_fd);
}
/* }}} */
@@ -199,6 +207,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 +240,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);
@@ -410,7 +429,9 @@ PHP_FUNCTION(dio_fcntl)
RETURN_FALSE;
}
new_php_fd(&new_f, fcntl(f->fd, cmd, Z_LVAL_P(arg)));
if (!new_php_fd(&new_f, fcntl(f->fd, cmd, Z_LVAL_P(arg)))) {
RETURN_FALSE;
}
ZEND_REGISTER_RESOURCE(return_value, new_f, le_fd);
break;
}
-5
View File
@@ -1,5 +0,0 @@
this extension is experimental,
its functions may change their names
or move to extension all together
so do not rely to much on them
you have been warned!
+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);
+2 -2
View File
@@ -2712,7 +2712,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
// JPEG does not use absolute pointers instead its pointers are relative to the start
// of the TIFF header in APP1 section.
*/
if (offset_val+byte_count>ImageInfo->FileSize || (ImageInfo->FileType!=IMAGE_FILETYPE_TIFF_II && ImageInfo->FileType!=IMAGE_FILETYPE_TIFF_MM)) {
if (offset_val+byte_count>ImageInfo->FileSize || (ImageInfo->FileType!=IMAGE_FILETYPE_TIFF_II && ImageInfo->FileType!=IMAGE_FILETYPE_TIFF_MM && ImageInfo->FileType!=IMAGE_FILETYPE_JPEG)) {
if (value_ptr < dir_entry) {
/* we can read this if offset_val > 0 */
/* some files have their values in other parts of the file */
@@ -3750,7 +3750,7 @@ PHP_FUNCTION(exif_read_data)
}
}
for (i=0; i<SECTION_COUNT; i++) {
sprintf(tmp, ",%s,", exif_get_sectionname(i));
snprintf(tmp, sizeof(tmp), ",%s,", exif_get_sectionname(i));
if (strstr(sections_str, tmp)) {
sections_needed |= 1<<i;
}
+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;
}
}
/* }}} */
+13 -2
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);
@@ -863,7 +867,10 @@ PHP_FUNCTION(fdf_save_string)
struct stat stat;
char *buf;
fstat(fileno(fp), &stat);
if (fstat(fileno(fp), &stat) == -1) {
RETVAL_FALSE;
goto err;
}
buf = emalloc(stat.st_size +1);
fread(buf, stat.st_size, 1, fp);
buf[stat.st_size] = '\0';
@@ -881,7 +888,7 @@ PHP_FUNCTION(fdf_save_string)
if(err != FDFErcOK) {
FDF_FAILURE(err);
}
err:
if(temp_filename) {
unlink(temp_filename);
efree(temp_filename);
@@ -1481,6 +1488,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)) {
+5 -2
View File
@@ -362,6 +362,9 @@ ftp_syst(ftpbuf_t *ftp)
return NULL;
syst = ftp->inbuf;
while (*syst == ' ') {
syst++;
}
if ((end = strchr(syst, ' ')))
*end = 0;
ftp->syst = estrdup(syst);
@@ -724,12 +727,12 @@ ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type,
ptr = s;
}
#else
while ((s = memchr(ptr, '\r', (e - ptr)))) {
while (e > ptr && (s = memchr(ptr, '\r', (e - ptr)))) {
php_stream_write(outstream, ptr, (s - ptr));
if (*(s + 1) == '\n') {
s++;
php_stream_putc(outstream, '\n');
}
php_stream_putc(outstream, '\n');
ptr = s + 1;
}
#endif
+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"
+20 -6
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.17 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;
@@ -1616,6 +1622,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
}
switch(image_type) {
#ifdef HAVE_GD_WBMP
case PHP_GDIMG_CONVERT_WBM:
if (q == -1) {
q = 0;
@@ -1625,6 +1632,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
}
gdImageWBMP(im, q, fp);
break;
#endif
case PHP_GDIMG_TYPE_JPG:
(*func_p)(im, fp, q);
break;
@@ -1655,14 +1663,16 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
int b;
FILE *tmp;
char buf[4096];
char *path;
tmp = tmpfile();
tmp = php_open_temporary_file("", "", &path TSRMLS_CC);
if (tmp == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open temporary file");
RETURN_FALSE;
}
switch(image_type) {
#ifdef HAVE_GD_WBMP
case PHP_GDIMG_CONVERT_WBM:
if (q == -1) {
q = 0;
@@ -1672,6 +1682,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
}
gdImageWBMP(im, q, tmp);
break;
#endif
case PHP_GDIMG_TYPE_JPG:
(*func_p)(im, tmp, q);
break;
@@ -1707,7 +1718,8 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
}
fclose(tmp);
/* the temporary file is automatically deleted */
VCWD_UNLINK((const char *)path); /* make sure that the temporary file is removed */
efree(path);
}
RETURN_TRUE;
}
@@ -3635,9 +3647,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"
+110 -32
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;
@@ -1870,20 +1879,28 @@ 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;
}
wx2=im->sx;wy2=im->sy;
oc = gdImageGetPixel(im, x, y);
if (oc==nc || x<0 || x>wx2 || y<0 || y>wy2) return;
if (oc==nc || x<0 || x>wx2 || y<0 || y>wy2) {
im->alphaBlendingFlag = alphablending_bak;
return;
}
stack = (struct seg *)emalloc(sizeof(struct seg) * ((int)(im->sy*im->sx)/4)+1);
sp = stack;
@@ -1922,6 +1939,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)
@@ -2011,24 +2029,72 @@ void gdImageRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color)
{
int x1h = x1, x1v = x1, y1h = y1, y1v = y1, x2h = x2, x2v = x2, y2h = y2, y2v = y2;
int thick = im->thick;
int half1 = 1;
int t;
if (thick > 1) {
int half = thick / 2;
int half1 = thick - half;
if (y2 < y1) {
t=y1;
y1 = y2;
y2 = t;
if (y1 < y2) {
y1v = y1h - half;
y2v = y2h + half1 - 1;
} else {
y1v = y1h + half1 - 1;
y2v = y2h - half;
t = x1;
x1 = x2;
x2 = t;
}
x1h = x1; x1v = x1; y1h = y1; y1v = y1; x2h = x2; x2v = x2; y2h = y2; y2v = y2;
if (thick > 1) {
int cx, cy, x1ul, y1ul, x2lr, y2lr;
int half = thick >> 1;
half1 = thick - half;
x1ul = x1 - half;
y1ul = y1 - half;
x2lr = x2 + half;
y2lr = y2 + half;
cy = y1ul + thick;
while (cy-- > y1ul) {
cx = x1ul - 1;
while (cx++ < x2lr) {
gdImageSetPixel(im, cx, cy, color);
}
}
cy = y2lr - thick;
while (cy++ < y2lr) {
cx = x1ul - 1;
while (cx++ < x2lr) {
gdImageSetPixel(im, cx, cy, color);
}
}
cy = y1ul + thick - 1;
while (cy++ < y2lr -thick) {
cx = x1ul - 1;
while (cx++ < x1ul + thick) {
gdImageSetPixel(im, cx, cy, color);
}
}
cy = y1ul + thick - 1;
while (cy++ < y2lr -thick) {
cx = x2lr - thick - 1;
while (cx++ < x2lr) {
gdImageSetPixel(im, cx, cy, color);
}
}
return;
} else {
y1v = y1h + 1;
y2v = y2h - 1;
gdImageLine(im, x1h, y1h, x2h, y1h, color);
gdImageLine(im, x1h, y2h, x2h, y2h, color);
gdImageLine(im, x1v, y1v, x1v, y2v, color);
gdImageLine(im, x2v, y1v, x2v, y2v, color);
}
gdImageLine(im, x1h, y1h, x2h, y1h, color);
gdImageLine(im, x1h, y2h, x2h, y2h, color);
gdImageLine(im, x1v, y1v, x1v, y2v, color);
gdImageLine(im, x2v, y1v, x2v, y2v, color);
}
void gdImageFilledRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color)
@@ -2051,6 +2117,16 @@ void gdImageFilledRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int
if (y1 > gdImageSY(im)) {
y1 = gdImageSY(im);
}
if (y2 < y1) {
int t;
t=y1;
y1 = y2;
y2 = t;
t = x1;
x1 = x2;
x2 = t;
}
for (y = y1; (y <= y2); y++) {
for (x = x1; (x <= x2); x++) {
@@ -2292,7 +2368,8 @@ void gdImageCopyResized (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int
int tmp = gdImageGetPixel (src, x, y);
mapTo = gdImageGetTrueColorPixel (src, x, y);
if (gdImageGetTransparent (src) == tmp) {
tox++;
/* 2.0.21, TK: not tox++ */
tox += stx[x - srcX];
continue;
}
} else {
@@ -2300,7 +2377,8 @@ void gdImageCopyResized (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int
mapTo = gdImageGetTrueColorPixel (src, x, y);
/* Added 7/24/95: support transparent copies */
if (gdImageGetTransparent (src) == mapTo) {
tox++;
/* 2.0.21, TK: not tox++ */
tox += stx[x - srcX];
continue;
}
}
@@ -2356,22 +2434,24 @@ void gdImageCopyResized (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int
void gdImageCopyResampled (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH)
{
int x, y;
double sy1, sy2, sx1, sx2;
if (!dst->trueColor) {
gdImageCopyResized (dst, src, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH);
return;
}
for (y = dstY; (y < dstY + dstH); y++) {
sy1 = ((double) y - (double) dstY) * (double) srcH / (double) dstH;
sy2 = ((double) (y + 1) - (double) dstY) * (double) srcH / (double) dstH;
for (x = dstX; (x < dstX + dstW); x++) {
float sy1, sy2, sx1, sx2;
float sx, sy;
float spixels = 0.0f;
float red = 0.0f, green = 0.0f, blue = 0.0f, alpha = 0.0f;
float alpha_factor, alpha_sum = 0.0f, contrib_sum = 0.0f;
sy1 = ((float)(y - dstY)) * (float)srcH / (float)dstH;
sy2 = ((float)(y + 1 - dstY)) * (float) srcH / (float) dstH;
double sx, sy;
double spixels = 0;
double red = 0.0, green = 0.0, blue = 0.0, alpha = 0.0;
double alpha_factor, alpha_sum = 0.0, contrib_sum = 0.0;
sx1 = ((double) x - (double) dstX) * (double) srcW / dstW;
sx2 = ((double) (x + 1) - (double) dstX) * (double) srcW / dstW;
sy = sy1;
do {
float yportion;
double yportion;
if (floor_cast(sy) == floor_cast(sy1)) {
yportion = 1.0f - (sy - floor_cast(sy));
if (yportion > sy2 - sy1) {
@@ -2383,12 +2463,10 @@ void gdImageCopyResampled (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, i
} else {
yportion = 1.0f;
}
sx1 = ((float)(x - dstX)) * (float) srcW / dstW;
sx2 = ((float)(x + 1 - dstX)) * (float) srcW / dstW;
sx = sx1;
do {
float xportion;
float pcontribution;
double xportion;
double pcontribution;
int p;
if (floorf(sx) == floor_cast(sx1)) {
xportion = 1.0f - (sx - floor_cast(sx));
+76 -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. */
@@ -578,10 +587,11 @@ void gdImageSaveAlpha(gdImagePtr im, int saveAlphaArg);
gdIOCtx* gdNewFileCtx(FILE*);
gdIOCtx* gdNewDynamicCtx(int, void*);
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
@@ -590,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);
+10
View File
@@ -147,6 +147,16 @@ gdImagePtr gdImageCreateFromGd (FILE * inFile)
return im;
}
gdImagePtr gdImageCreateFromGdPtr (int size, void *data)
{
gdImagePtr im;
gdIOCtx *in = gdNewDynamicCtxEx(size, data, 0);
im = gdImageCreateFromGdCtx(in);
in->gd_free(in);
return im;
}
gdImagePtr gdImageCreateFromGdCtx (gdIOCtxPtr in)
{
int sx, sy;
+20
View File
@@ -237,6 +237,16 @@ gdImagePtr gdImageCreateFromGd2 (FILE * inFile)
return im;
}
gdImagePtr gdImageCreateFromGd2Ptr (int size, void *data)
{
gdImagePtr im;
gdIOCtx *in = gdNewDynamicCtxEx(size, data, 0);
im = gdImageCreateFromGd2Ctx(in);
in->gd_free(in);
return im;
}
gdImagePtr gdImageCreateFromGd2Ctx (gdIOCtxPtr in)
{
int sx, sy;
@@ -378,6 +388,16 @@ fail2:
return 0;
}
gdImagePtr gdImageCreateFromGd2PartPtr (int size, void *data, int srcx, int srcy, int w, int h)
{
gdImagePtr im;
gdIOCtx *in = gdNewDynamicCtxEx(size, data, 0);
im = gdImageCreateFromGd2PartCtx(in, srcx, srcy, w, h);
in->gd_free(in);
return im;
}
gdImagePtr gdImageCreateFromGd2Part (FILE * inFile, int srcx, int srcy, int w, int h)
{
gdImagePtr im;
+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;
}
+24 -6
View File
@@ -33,6 +33,7 @@ typedef struct dpStruct
int realSize;
int dataGood;
int pos;
int freeOK;
}
dynamicPtr;
@@ -52,7 +53,7 @@ static int appendDynamic (dynamicPtr * dp, const void *src, int size);
static int gdReallocDynamic (dynamicPtr * dp, int required);
static int trimDynamic (dynamicPtr * dp);
static void gdFreeDynamicCtx (struct gdIOCtx *ctx);
static dynamicPtr *newDynamic (int initialSize, void *data);
static dynamicPtr *newDynamic (int initialSize, void *data, int freeOKFlag);
static int dynamicPutbuf (struct gdIOCtx *, const void *, int);
static void dynamicPutchar (struct gdIOCtx *, int a);
@@ -66,6 +67,11 @@ static long dynamicTell (struct gdIOCtx *);
/* return data as a dynamic pointer */
gdIOCtx *
gdNewDynamicCtx (int initialSize, void *data)
{
return gdNewDynamicCtxEx(initialSize, data, 1);
}
gdIOCtx * gdNewDynamicCtxEx (int initialSize, void *data, int freeOKFlag)
{
dpIOCtx *ctx;
dynamicPtr *dp;
@@ -76,7 +82,7 @@ gdNewDynamicCtx (int initialSize, void *data)
return NULL;
}
dp = newDynamic (initialSize, data);
dp = newDynamic (initialSize, data, freeOKFlag);
if (!dp)
{
gdFree (ctx);
@@ -120,7 +126,7 @@ gdDPExtractData (struct gdIOCtx *ctx, int *size)
{
*size = 0;
data = NULL;
if (dp->data != NULL)
if (dp->data != NULL && dp->freeOK)
{
gdFree (dp->data);
}
@@ -177,6 +183,10 @@ dynamicSeek (struct gdIOCtx *ctx, const int pos)
bytesNeeded = pos;
if (bytesNeeded > dp->realSize)
{
/* 2.0.21 */
if (!dp->freeOK) {
return FALSE;
}
if (!gdReallocDynamic (dp, dp->realSize * 2))
{
dp->dataGood = FALSE;
@@ -199,8 +209,7 @@ dynamicSeek (struct gdIOCtx *ctx, const int pos)
}
/* return data as a dynamic pointer */
static dynamicPtr *
newDynamic (int initialSize, void *data)
static dynamicPtr * newDynamic (int initialSize, void *data, int freeOKFlag)
{
dynamicPtr *dp;
dp = (dynamicPtr *) gdMalloc (sizeof (dynamicPtr));
@@ -213,6 +222,7 @@ newDynamic (int initialSize, void *data)
return NULL;
dp->pos = 0;
dp->freeOK = freeOKFlag;
return dp;
}
@@ -348,6 +358,10 @@ appendDynamic (dynamicPtr * dp, const void *src, int size)
if (bytesNeeded > dp->realSize)
{
/* 2.0.21 */
if (!dp->freeOK) {
return FALSE;
}
if (!gdReallocDynamic (dp, bytesNeeded * 2))
{
dp->dataGood = FALSE;
@@ -407,5 +421,9 @@ gdReallocDynamic (dynamicPtr * dp, int required)
static int
trimDynamic (dynamicPtr * dp)
{
return gdReallocDynamic (dp, dp->logicalSize);
/* 2.0.21: we don't reallocate memory we don't own */
if (!dp->freeOK) {
return FALSE;
}
return gdReallocDynamic (dp, dp->logicalSize);
}
+87 -17
View File
@@ -221,8 +221,20 @@ gdImagePtr gdImageCreateFromJpeg (FILE * inFile)
return im;
}
gdImagePtr gdImageCreateFromJpegPtr (int size, void *data)
{
gdImagePtr im;
gdIOCtx *in = gdNewDynamicCtxEx(size, data, 0);
im = gdImageCreateFromJpegCtx(in);
in->gd_free(in);
return im;
}
void jpeg_gdIOCtx_src (j_decompress_ptr cinfo, gdIOCtx * infile);
static int CMYKToRGB(int c, int m, int y, int k, int inverted);
/*
* Create a gd-format image from the JPEG-format INFILE. Returns the
* image, or NULL upon error.
@@ -239,6 +251,8 @@ gdImagePtr gdImageCreateFromJpegCtx (gdIOCtx * infile)
unsigned int i, j;
int retval;
JDIMENSION nrows;
int channels = 3;
int inverted = 0;
memset (&cinfo, 0, sizeof (cinfo));
memset (&jerr, 0, sizeof (jerr));
@@ -262,6 +276,9 @@ gdImagePtr gdImageCreateFromJpegCtx (gdIOCtx * infile)
jpeg_gdIOCtx_src (&cinfo, infile);
/* 2.0.22: save the APP14 marker to check for Adobe Photoshop CMYK files with inverted components. */
jpeg_save_markers(&cinfo, JPEG_APP0 + 14, 256);
retval = jpeg_read_header (&cinfo, TRUE);
if (retval != JPEG_HEADER_OK) {
php_gd_error_ex(E_WARNING, "gd-jpeg: warning: jpeg_read_header returned %d, expected %d", retval, JPEG_HEADER_OK);
@@ -281,8 +298,14 @@ gdImagePtr gdImageCreateFromJpegCtx (gdIOCtx * infile)
goto error;
}
/* Force the image into RGB colorspace, but don't reduce the number of colors anymore (GD 2.0) */
cinfo.out_color_space = JCS_RGB;
/* 2.0.22: very basic support for reading CMYK colorspace files. Nice for
* thumbnails but there's no support for fussy adjustment of the
* assumed properties of inks and paper. */
if ((cinfo.jpeg_color_space == JCS_CMYK) || (cinfo.jpeg_color_space == JCS_YCCK)) {
cinfo.out_color_space = JCS_CMYK;
} else {
cinfo.out_color_space = JCS_RGB;
}
if (jpeg_start_decompress (&cinfo) != TRUE) {
php_gd_error("gd-jpeg: warning: jpeg_start_decompress reports suspended data source");
@@ -301,8 +324,29 @@ gdImagePtr gdImageCreateFromJpegCtx (gdIOCtx * infile)
gdImageInterlace (im, cinfo.progressive_mode != 0);
#endif
if (cinfo.output_components != 3) {
php_gd_error_ex(E_WARNING, "gd-jpeg: error: JPEG color quantization request resulted in output_components == %d (expected 3)", cinfo.output_components);
if (cinfo.out_color_space == JCS_RGB) {
if (cinfo.output_components != 3) {
php_gd_error_ex(E_WARNING, "gd-jpeg: error: JPEG color quantization request resulted in output_components == %d (expected 3 for RGB)", cinfo.output_components);
goto error;
}
channels = 3;
} else if (cinfo.out_color_space == JCS_CMYK) {
jpeg_saved_marker_ptr marker;
if (cinfo.output_components != 4) {
php_gd_error_ex(E_WARNING, "gd-jpeg: error: JPEG color quantization request resulted in output_components == %d (expected 4 for CMYK)", cinfo.output_components);
goto error;
}
channels = 4;
marker = cinfo.marker_list;
while (marker) {
if ((marker->marker == (JPEG_APP0 + 14)) && (marker->data_length >= 12) && (!strncmp((const char *) marker->data, "Adobe", 5))) {
inverted = 1;
break;
}
marker = marker->next;
}
} else {
php_gd_error_ex(E_WARNING, "gd-jpeg: error: unexpected colorspace.");
goto error;
}
@@ -311,22 +355,37 @@ gdImagePtr gdImageCreateFromJpegCtx (gdIOCtx * infile)
goto error;
#endif /* BITS_IN_JSAMPLE == 12 */
row = safe_emalloc(cinfo.output_width * 3, sizeof(JSAMPLE), 0);
memset(row, 0, cinfo.output_width * 3 * sizeof(JSAMPLE));
row = safe_emalloc(cinfo.output_width * channels, sizeof(JSAMPLE), 0);
memset(row, 0, cinfo.output_width * channels * sizeof(JSAMPLE));
rowptr[0] = row;
for (i = 0; i < cinfo.output_height; i++) {
register JSAMPROW currow = row;
register int *tpix = im->tpixels[i];
nrows = jpeg_read_scanlines (&cinfo, rowptr, 1);
if (nrows != 1) {
php_gd_error_ex(E_WARNING, "gd-jpeg: error: jpeg_read_scanlines returns %u, expected 1", nrows);
goto error;
if (cinfo.out_color_space == JCS_CMYK) {
for (i = 0; i < cinfo.output_height; i++) {
register JSAMPROW currow = row;
register int *tpix = im->tpixels[i];
nrows = jpeg_read_scanlines (&cinfo, rowptr, 1);
if (nrows != 1) {
php_gd_error_ex(E_WARNING, "gd-jpeg: error: jpeg_read_scanlines returns %u, expected 1", nrows);
goto error;
}
for (j = 0; j < cinfo.output_width; j++, currow += 4, tpix++) {
*tpix = CMYKToRGB (currow[0], currow[1], currow[2], currow[3], inverted);
}
}
for (j = 0; j < cinfo.output_width; j++, currow += 3, tpix++) {
*tpix = gdTrueColor (currow[0], currow[1], currow[2]);
} else {
for (i = 0; i < cinfo.output_height; i++) {
register JSAMPROW currow = row;
register int *tpix = im->tpixels[i];
nrows = jpeg_read_scanlines (&cinfo, rowptr, 1);
if (nrows != 1) {
php_gd_error_ex(E_WARNING, "gd-jpeg: error: jpeg_read_scanlines returns %u, expected 1", nrows);
goto error;
}
for (j = 0; j < cinfo.output_width; j++, currow += 3, tpix++) {
*tpix = gdTrueColor (currow[0], currow[1], currow[2]);
}
}
}
}
if (jpeg_finish_decompress (&cinfo) != TRUE) {
php_gd_error("gd-jpeg: warning: jpeg_finish_decompress reports suspended data source");
@@ -353,8 +412,19 @@ error:
return 0;
}
/*
/* A very basic conversion approach, TBB */
static int CMYKToRGB(int c, int m, int y, int k, int inverted)
{
if (inverted) {
c = 255 - c;
m = 255 - m;
y = 255 - y;
k = 255 - k;
}
return gdTrueColor((255 - c) * (255 - k) / 255, (255 - m) * (255 - k) / 255, (255 - y) * (255 - k) / 255);
}
/*
* gdIOCtx JPEG data sources and sinks, T. Boutell
* almost a simple global replace from T. Lane's stdio versions.
*
+8
View File
@@ -93,6 +93,14 @@ gdImagePtr gdImageCreateFromPng (FILE * inFile)
return im;
}
gdImagePtr gdImageCreateFromPngPtr (int size, void *data)
{
gdImagePtr im;
gdIOCtx *in = gdNewDynamicCtxEx(size, data, 0);
im = gdImageCreateFromPngCtx(in);
in->gd_free(in);
return im;
}
/* This routine is based in part on the Chapter 13 demo code in "PNG: The
* Definitive Guide" (http://www.cdrom.com/pub/png/pngbook.html).
+1333 -1137
View File
File diff suppressed because it is too large. Load diff
+9
View File
@@ -192,6 +192,15 @@ gdImageCreateFromWBMP (FILE * inFile)
return (im);
}
gdImagePtr gdImageCreateFromWBMPPtr (int size, void *data)
{
gdImagePtr im;
gdIOCtx *in = gdNewDynamicCtxEx(size, data, 0);
im = gdImageCreateFromWBMPCtx(in);
in->gd_free(in);
return im;
}
/* gdImageWBMP
** -----------
*/
+5
View File
@@ -4381,4 +4381,9 @@ gdFont gdFontGiantRep =
gdFontPtr gdFontGiant = &gdFontGiantRep;
gdFontPtr gdFontGetGiant(void)
{
return gdFontGiant;
}
/* This file has not been truncated. */
+1
View File
@@ -20,6 +20,7 @@ extern "C" {
#include "gd.h"
extern gdFontPtr gdFontGiant;
extern gdFontPtr gdFontGetGiant(void);
#ifdef __cplusplus
}
+5
View File
@@ -4638,4 +4638,9 @@ gdFont gdFontLargeRep =
gdFontPtr gdFontLarge = &gdFontLargeRep;
gdFontPtr gdFontGetLarge(void)
{
return gdFontLarge;
}
/* This file has not been truncated. */
+1
View File
@@ -21,6 +21,7 @@ extern "C" {
#include "gd.h"
extern gdFontPtr gdFontLarge;
extern gdFontPtr gdFontGetLarge(void);
#ifdef __cplusplus
}
+5
View File
@@ -3868,4 +3868,9 @@ gdFont gdFontMediumBoldRep =
gdFontPtr gdFontMediumBold = &gdFontMediumBoldRep;
gdFontPtr gdFontGetMediumBold(void)
{
return gdFontMediumBold;
}
/* This file has not been truncated. */
+1
View File
@@ -19,6 +19,7 @@ extern "C" {
#include "gd.h"
extern gdFontPtr gdFontMediumBold;
extern gdFontPtr gdFontGetMediumBold(void);
#ifdef __cplusplus
}
+5
View File
@@ -3868,4 +3868,9 @@ gdFont gdFontSmallRep =
gdFontPtr gdFontSmall = &gdFontSmallRep;
gdFontPtr gdFontGetSmall(void)
{
return gdFontSmall;
}
/* This file has not been truncated. */
+1
View File
@@ -19,6 +19,7 @@ extern "C" {
#include "gd.h"
extern gdFontPtr gdFontSmall;
extern gdFontPtr gdFontGetSmall(void);
#ifdef __cplusplus
}
+5
View File
@@ -2589,4 +2589,9 @@ gdFont gdFontTinyRep =
gdFontPtr gdFontTiny = &gdFontTinyRep;
gdFontPtr gdFontGetTiny(void)
{
return gdFontTiny;
}
/* This file has not been truncated. */
+1
View File
@@ -20,6 +20,7 @@ extern "C" {
#include "gd.h"
extern gdFontPtr gdFontTiny;
extern gdFontPtr gdFontGetTiny(void);
#ifdef __cplusplus
}
+29 -10
View File
@@ -79,9 +79,9 @@ gdImageStringFT (gdImage * im, int *brect, int fg, char *fontlist,
/*
* The character (space) used to separate alternate fonts in the
* fontlist parameter to gdImageStringFT.
* fontlist parameter to gdImageStringFT. 2.0.18: space was a oor choice for this.
*/
#define LISTSEPARATOR " "
#define LISTSEPARATOR ";"
/*
* DEFAULT_FONTPATH and PATHSEPARATOR are host type dependent and
@@ -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 */
#ifdef FT_ENCODING_MS_SYMBOL
#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 /* FT_ENCODING_MS_SYMBOL */
#endif /* Freetype 2.1.3 or better */
/* EAM DEBUG */
if ((platform == 3 && encoding == 1) /* Windows Unicode */
@@ -777,6 +777,11 @@ void gdFontCacheShutdown()
FT_Done_FreeType(library);
}
}
void gdFreeFontCache()
{
gdFontCacheShutdown();
}
int gdFontCacheSetup(void)
{
@@ -838,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;
@@ -867,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";
@@ -939,7 +958,6 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
while (*next) {
ch = *next;
/* carriage returns */
if (ch == '\r') {
penf.x = 0;
@@ -965,17 +983,18 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
}
/* EAM DEBUG */
#ifdef FT_ENCODING_MS_SYMBOL
if (font->face->charmap->encoding == FT_ENCODING_MS_SYMBOL) {
#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 && strcmp(font->face->family_name, "Symbol") == 0) {
/* I do not know the significance of the constant 0xf000.
* It was determined by inspection of the character codes
* stored in Microsoft font symbol.
*/
/* Convert to the Symbol glyph range only for a Symbol family member */
len = gdTcl_UtfToUniChar (next, &ch);
ch |= 0xf000;
next += len;
} else
#endif /* FT_ENCODING_MS_SYMBOL */
#endif /* Freetype 2.1 or better */
/* EAM DEBUG */
switch (m) {
@@ -1041,7 +1060,7 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
FT_Set_Transform(face, &matrix, NULL);
/* Convert character code to glyph index */
glyph_index = FT_Get_Char_Index(face, ch);
/* retrieve kerning distance and move pen position */
if (use_kerning && previous && glyph_index) {
FT_Get_Kerning(face, previous, glyph_index, ft_kerning_default, &delta);
-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;
}
+11 -8
View File
@@ -65,23 +65,26 @@ if test "$PHP_ICONV" != "no"; then
esac
fi
echo > ext/iconv/php_have_bsd_iconv.h
echo > ext/iconv/php_have_glibc_iconv.h
case "$iconv_impl_name" in
gnu_libiconv [)]
PHP_DEFINE([PHP_ICONV_IMPL],[\"libiconv\"])
PHP_DEFINE([PHP_ICONV_IMPL],[\"libiconv\"],[ext/iconv])
AC_DEFINE([PHP_ICONV_IMPL],["libiconv"],[Which iconv implementation to use])
;;
bsd [)]
PHP_DEFINE([HAVE_BSD_ICONV],1)
PHP_DEFINE([HAVE_BSD_ICONV],1,[ext/iconv])
AC_DEFINE([HAVE_BSD_ICONV],1,[Konstantin Chugeuv's iconv implementation])
PHP_DEFINE([PHP_ICONV_IMPL],[\"BSD iconv\"])
PHP_DEFINE([PHP_ICONV_IMPL],[\"BSD iconv\"],[ext/iconv])
AC_DEFINE([PHP_ICONV_IMPL],["BSD iconv"],[Which iconv implementation to use])
;;
glibc [)]
PHP_DEFINE([HAVE_GLIBC_ICONV],1)
PHP_DEFINE([HAVE_GLIBC_ICONV],1,[ext/iconv])
AC_DEFINE([HAVE_GLIBC_ICONV],1,[glibc's iconv implementation])
PHP_DEFINE([PHP_ICONV_IMPL],[\"glibc\"])
PHP_DEFINE([PHP_ICONV_IMPL],[\"glibc\"],[ext/iconv])
AC_DEFINE([PHP_ICONV_IMPL],["glibc"],[Which iconv implementation to use])
;;
esac
@@ -106,11 +109,11 @@ int main() {
}
],[
AC_MSG_RESULT(yes)
PHP_DEFINE([ICONV_SUPPORTS_ERRNO],1)
PHP_DEFINE([ICONV_SUPPORTS_ERRNO],1,[ext/iconv])
AC_DEFINE([ICONV_SUPPORTS_ERRNO],1,[Whether iconv supports error no or not])
],[
AC_MSG_RESULT(no)
PHP_DEFINE([ICONV_SUPPORTS_ERRNO],0)
PHP_DEFINE([ICONV_SUPPORTS_ERRNO],0,[ext/iconv])
AC_DEFINE([ICONV_SUPPORTS_ERRNO],0,[Whether iconv supports error no or not])
])
@@ -120,7 +123,7 @@ int main() {
#include FOO
], [], [
AC_MSG_RESULT([yes])
PHP_DEFINE([PHP_ICONV_H_PATH], [<$PHP_ICONV_H_PATH>])
PHP_DEFINE([PHP_ICONV_H_PATH], [<$PHP_ICONV_H_PATH>],[ext/iconv])
AC_DEFINE_UNQUOTED([PHP_ICONV_H_PATH], [<$PHP_ICONV_H_PATH>], [Path to iconv.h])
], [
AC_MSG_RESULT([no])
+1 -14
View File
@@ -83,24 +83,11 @@ ZEND_DECLARE_MODULE_GLOBALS(iconv)
ZEND_GET_MODULE(iconv)
#endif
/* {{{ typedef enum php_iconv_err_t */
typedef enum _php_iconv_err_t {
PHP_ICONV_ERR_SUCCESS = SUCCESS,
PHP_ICONV_ERR_CONVERTER = 1,
PHP_ICONV_ERR_WRONG_CHARSET = 2,
PHP_ICONV_ERR_TOO_BIG = 3,
PHP_ICONV_ERR_ILLEGAL_SEQ = 4,
PHP_ICONV_ERR_ILLEGAL_CHAR = 5,
PHP_ICONV_ERR_UNKNOWN = 6
} php_iconv_err_t;
/* }}} */
#ifdef HAVE_LIBICONV
#define iconv libiconv
#endif
/* {{{ prototypes */
static php_iconv_err_t php_iconv_string(const char * in_p, size_t in_len, char **out, size_t *out_len, const char *in_charset, const char *out_charset);
static void _php_iconv_show_error(php_iconv_err_t err, const char *in_charset, const char *out_charset TSRMLS_DC);
/* }}} */
@@ -185,7 +172,7 @@ PHP_MINFO_FUNCTION(miconv)
/* {{{ php_iconv_string
*/
php_iconv_err_t php_iconv_string(const char *in_p, size_t in_len,
PHP_ICONV_API php_iconv_err_t php_iconv_string(const char *in_p, size_t in_len,
char **out, size_t *out_len,
const char *in_charset, const char *out_charset)
{
+4 -4
View File
@@ -43,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ICONV_EXPORTS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /I "..\..\win32" /I "..\..\..\php_build\iconv\include" /D "WIN32" /D "PHP_EXPORTS" /D "COMPILE_DL_ICONV" /D "HAVE_ICONV" /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "ZEND_WIN32" /D "PHP_WIN32" /D ZTS=1 /D "ICONV_SUPPORTS_ERRNO" /D "HAVE_LIBICONV" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /I "..\..\win32" /I "..\..\..\php_build\iconv\include" /D ZEND_DEBUG=0 /D "ICONV_SUPPORTS_ERRNO" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "PHP_EXPORTS" /D "COMPILE_DL_ICONV" /D "ZEND_WIN32" /D "PHP_WIN32" /D "HAVE_ICONV" /D ZTS=1 /D "HAVE_LIBICONV" /D "PHP_ICONV_EXPORTS" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x407 /d "NDEBUG"
@@ -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"
@@ -69,7 +69,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ICONV_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /I "..\..\win32" /I "..\..\..\php_build\iconv\include" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "PHP_EXPORTS" /D "COMPILE_DL_ICONV" /D "ZEND_WIN32" /D "PHP_WIN32" /D "HAVE_ICONV" /D ZTS=1 /D "HAVE_LIBICONV" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /I "..\..\win32" /I "..\..\..\php_build\iconv\include" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "PHP_EXPORTS" /D "COMPILE_DL_ICONV" /D "ZEND_WIN32" /D "PHP_WIN32" /D "HAVE_ICONV" /D ZTS=1 /D "HAVE_LIBICONV" /D "PHP_ICONV_EXPORTS" /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x407 /d "_DEBUG"
@@ -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
+25 -7
View File
@@ -23,19 +23,23 @@
#define PHP_ICONV_H
#ifdef PHP_WIN32
#ifdef PHP_ICONV_EXPORTS
#define PHP_ICONV_API __declspec(dllexport)
#else
#define PHP_ICONV_API __declspec(dllimport)
#endif
#else
#define PHP_ICONV_API
#endif
#ifdef PHP_ATOM_INC
#include "php_have_iconv.h"
#include "php_have_libiconv.h"
#include "php_have_glibc_iconv.h"
#include "php_have_bsd_iconv.h"
#include "php_iconv_supports_errno.h"
#include "php_php_iconv_impl.h"
#include "php_php_iconv_h_path.h"
#include "ext/iconv/php_have_iconv.h"
#include "ext/iconv/php_have_libiconv.h"
#include "ext/iconv/php_have_glibc_iconv.h"
#include "ext/iconv/php_have_bsd_iconv.h"
#include "ext/iconv/php_iconv_supports_errno.h"
#include "ext/iconv/php_php_iconv_impl.h"
#include "ext/iconv/php_php_iconv_h_path.h"
#endif
@@ -68,6 +72,20 @@ ZEND_END_MODULE_GLOBALS(iconv)
#define ICONV_OUTPUT_ENCODING "ISO-8859-1"
#define ICONV_INTERNAL_ENCODING "ISO-8859-1"
/* {{{ typedef enum php_iconv_err_t */
typedef enum _php_iconv_err_t {
PHP_ICONV_ERR_SUCCESS = SUCCESS,
PHP_ICONV_ERR_CONVERTER = 1,
PHP_ICONV_ERR_WRONG_CHARSET = 2,
PHP_ICONV_ERR_TOO_BIG = 3,
PHP_ICONV_ERR_ILLEGAL_SEQ = 4,
PHP_ICONV_ERR_ILLEGAL_CHAR = 5,
PHP_ICONV_ERR_UNKNOWN = 6
} php_iconv_err_t;
/* }}} */
PHP_ICONV_API php_iconv_err_t php_iconv_string(const char * in_p, size_t in_len, char **out, size_t *out_len, const char *in_charset, const char *out_charset);
#else
#define iconv_module_ptr NULL
+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" );
}
+6 -2
View File
@@ -34,10 +34,14 @@ AC_DEFUN([PHP_MBSTRING_EXTENSION], [
PHP_ADD_BUILD_DIR([$ext_builddir/$dir])
done
if test "$ext_shared" = "no" || ! test -e "$ext_builddir/config.h.in"; then
if test "$ext_shared" = "no"; then
out="php_config.h"
else
out="$abs_builddir/config.h"
if test -f "$ext_builddir/config.h.in"; then
out="$abs_builddir/config.h"
else
out="php_config.h"
fi
fi
for cfg in $PHP_MBSTRING_EXTRA_CONFIG_HEADERS; do
+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);
+47 -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
@@ -48,21 +51,60 @@ yes
],[
AC_MSG_ERROR([libmcve 3.2.2 or greater required.])
])
AC_MSG_CHECKING([for correct libmonetra 4.2 or higher])
AC_EGREP_CPP(yes,[
#include "$MCVE_DIR/include/mcve.h"
#ifdef MCVE_SetSSL_CAfile
yes
#endif
],[
AC_MSG_RESULT([yes])
],[
AC_DEFINE([LIBMONETRA_BELOW_4_2], 1, [Whether or not we're using libmonetra 4.2 or higher ])
AC_MSG_RESULT([no])
])
CPPFLAGS=$saved_CPPFLAGS
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
+401 -184
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 */
/*
+13 -8
View File
@@ -1444,17 +1444,22 @@ PHP_FUNCTION(swfmovie_output)
#ifdef HAVE_MING_ZLIB
zval **zlimit = NULL;
int limit = -1;
int argc = ZEND_NUM_ARGS();
if (zend_get_parameters_ex(1, &zlimit) == FAILURE) {
WRONG_PARAM_COUNT;
}
if(argc==0) {
limit = 6;
} else {
if (zend_get_parameters_ex(1, &zlimit) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_long_ex(zlimit);
limit = Z_LVAL_PP(zlimit);
convert_to_long_ex(zlimit);
limit = Z_LVAL_PP(zlimit);
if ((limit < 0) || (limit > 9)) {
php_error(E_WARNING,"compression level must be within 0..9");
RETURN_FALSE;
if ((limit < 0) || (limit > 9)) {
php_error(E_WARNING,"compression level must be within 0..9");
RETURN_FALSE;
}
}
#endif
+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)
+2 -2
View File
@@ -32,8 +32,8 @@ if test "$PHP_MSSQL" != "no"; then
fi
fi
if test ! -r "$FREETDS_INSTALLATION_DIR/lib/libtds.a"; then
AC_MSG_ERROR(Could not find $FREETDS_INSTALLATION_DIR/lib/libtds.a)
if test ! -r "$FREETDS_INSTALLATION_DIR/lib/libtds.a" && test ! -r "$FREETDS_INSTALLATION_DIR/lib/libtds.so"; then
AC_MSG_ERROR(Could not find $FREETDS_INSTALLATION_DIR/lib/libtds.[a|so])
fi
MSSQL_INCDIR=$FREETDS_INSTALLATION_DIR/include
+59 -23
View File
@@ -270,14 +270,11 @@ static void php_mssql_init_globals(zend_mssql_globals *mssql_globals)
long compatability_mode;
mssql_globals->num_persistent = 0;
mssql_globals->get_column_content = php_mssql_get_column_content_with_type;
if (cfg_get_long("mssql.compatability_mode", &compatability_mode) == SUCCESS) {
if (compatability_mode) {
mssql_globals->get_column_content = php_mssql_get_column_content_without_type;
} else {
mssql_globals->get_column_content = php_mssql_get_column_content_with_type;
}
} else {
mssql_globals->get_column_content = php_mssql_get_column_content_with_type;
}
}
@@ -336,7 +333,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 +341,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;
@@ -516,6 +514,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
if (DBSETOPT(mssql.link, DBTEXTLIMIT, buffer)==FAIL) {
efree(hashed_details);
dbfreelogin(mssql.login);
dbclose(mssql.link);
RETURN_FALSE;
}
}
@@ -535,6 +534,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
free(mssql_ptr);
efree(hashed_details);
dbfreelogin(mssql.login);
dbclose(mssql.link);
RETURN_FALSE;
}
MS_SQL_G(num_persistent)++;
@@ -545,22 +545,25 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
log_error("PHP/MS SQL: Hashed persistent link is not a MS SQL link!",php_rqst->server);
#endif
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Hashed persistent link is not a MS SQL link!");
efree(hashed_details);
RETURN_FALSE;
}
mssql_ptr = (mssql_link *) le->ptr;
/* test that the link hasn't died */
if (DBDEAD(mssql_ptr->link) == TRUE) {
dbclose(mssql_ptr->link);
#if BROKEN_MSSQL_PCONNECTS
log_error("PHP/MS SQL: Persistent link died, trying to reconnect...",php_rqst->server);
#endif
if ((mssql_ptr->link=dbopen(mssql_ptr->login,host))==FAIL) {
if ((mssql_ptr->link=dbopen(mssql_ptr->login,host))==NULL) {
#if BROKEN_MSSQL_PCONNECTS
log_error("PHP/MS SQL: Unable to reconnect!",php_rqst->server);
#endif
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Link to server lost, unable to reconnect");
zend_hash_del(&EG(persistent_list), hashed_details, hashed_details_length+1);
efree(hashed_details);
dbfreelogin(mssql_ptr->login);
RETURN_FALSE;
}
#if BROKEN_MSSQL_PCONNECTS
@@ -572,6 +575,8 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
#endif
zend_hash_del(&EG(persistent_list), hashed_details, hashed_details_length + 1);
efree(hashed_details);
dbfreelogin(mssql_ptr->login);
dbclose(mssql_ptr->link);
RETURN_FALSE;
}
}
@@ -590,6 +595,8 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
void *ptr;
if (Z_TYPE_P(index_ptr) != le_index_ptr) {
efree(hashed_details);
dbfreelogin(mssql.login);
RETURN_FALSE;
}
link = (int) index_ptr->ptr;
@@ -599,6 +606,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
Z_LVAL_P(return_value) = link;
php_mssql_set_default_link(link TSRMLS_CC);
Z_TYPE_P(return_value) = IS_RESOURCE;
dbfreelogin(mssql.login);
efree(hashed_details);
return;
} else {
@@ -608,12 +616,14 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
if (MS_SQL_G(max_links) != -1 && MS_SQL_G(num_links) >= MS_SQL_G(max_links)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%ld)", MS_SQL_G(num_links));
efree(hashed_details);
dbfreelogin(mssql.login);
RETURN_FALSE;
}
if ((mssql.link=dbopen(mssql.login, host))==NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to connect to server: %s", host);
efree(hashed_details);
dbfreelogin(mssql.login);
RETURN_FALSE;
}
@@ -629,6 +639,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
if (DBSETOPT(mssql.link, DBTEXTLIMIT, buffer)==FAIL) {
efree(hashed_details);
dbfreelogin(mssql.login);
dbclose(mssql.link);
RETURN_FALSE;
}
}
@@ -796,13 +807,19 @@ static void php_mssql_get_column_content_with_type(mssql_link *mssql_ptr,int off
Z_TYPE_P(result) = IS_STRING;
break;
}
case SQLMONEY4:
case SQLFLT4:
Z_DVAL_P(result) = (double) floatcol4(offset);
Z_TYPE_P(result) = IS_DOUBLE;
break;
case SQLMONEY:
case SQLMONEYN:
case SQLMONEY4:
case SQLMONEYN: {
DBFLT8 res_buf;
dbconvert(NULL, column_type, dbdata(mssql_ptr->link,offset), 8, SQLFLT8, (LPBYTE)&res_buf, -1);
Z_DVAL_P(result) = res_buf;
Z_TYPE_P(result) = IS_DOUBLE;
}
break;
case SQLFLT8:
Z_DVAL_P(result) = (double) floatcol8(offset);
Z_TYPE_P(result) = IS_DOUBLE;
@@ -841,11 +858,25 @@ 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);
res_buf[res_length] = '\0';
} else {
if (column_type == SQLDATETIM4) {
DBDATETIME temp;
@@ -911,13 +942,15 @@ 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;
}
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);
res_buf[res_length] = '\0';
} else {
if (column_type == SQLDATETIM4) {
DBDATETIME temp;
@@ -964,6 +997,7 @@ static void _mssql_get_sp_result(mssql_link *mssql_ptr, mssql_statement *stateme
case SQLINT2:
case SQLINT4:
convert_to_long_ex(&bind->zval);
/* FIXME this works only on little endian machine !!! */
Z_LVAL_P(bind->zval) = *((int *)(dbretdata(mssql_ptr->link,i)));
break;
@@ -984,6 +1018,7 @@ static void _mssql_get_sp_result(mssql_link *mssql_ptr, mssql_statement *stateme
Z_STRLEN_P(bind->zval) = dbretlen(mssql_ptr->link,i);
Z_STRVAL_P(bind->zval) = estrndup(dbretdata(mssql_ptr->link,i),Z_STRLEN_P(bind->zval));
break;
/* TODO binary */
}
}
else {
@@ -1084,7 +1119,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;
@@ -1171,6 +1206,9 @@ PHP_FUNCTION(mssql_query)
while ((num_fields = dbnumcols(mssql_ptr->link)) <= 0 && retvalue == SUCCEED) {
retvalue = dbresults(mssql_ptr->link);
}
if (retvalue != SUCCEED) {
RETURN_FALSE;
}
if ((num_fields = dbnumcols(mssql_ptr->link)) <= 0) {
RETURN_TRUE;
}
@@ -1191,12 +1229,8 @@ PHP_FUNCTION(mssql_query)
result->mssql_ptr = mssql_ptr;
result->cur_field=result->cur_row=result->num_rows=0;
if (num_fields > 0) {
result->fields = (mssql_field *) emalloc(sizeof(mssql_field)*result->num_fields);
result->num_rows = _mssql_fetch_batch(mssql_ptr, result, retvalue TSRMLS_CC);
}
else
result->fields = NULL;
result->fields = (mssql_field *) emalloc(sizeof(mssql_field)*result->num_fields);
result->num_rows = _mssql_fetch_batch(mssql_ptr, result, retvalue TSRMLS_CC);
ZEND_REGISTER_RESOURCE(return_value, result, le_result);
}
@@ -1789,7 +1823,7 @@ PHP_FUNCTION(mssql_result)
}
*return_value = result->data[Z_LVAL_PP(row)][field_offset];
ZVAL_COPY_CTOR(return_value);
zval_copy_ctor(return_value);
}
/* }}} */
@@ -1814,6 +1848,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 {
@@ -2124,8 +2161,6 @@ PHP_FUNCTION(mssql_execute)
dbcanquery(mssql_ptr->link);
retval_results = dbresults(mssql_ptr->link);
} while (retval_results == SUCCEED);
_mssql_get_sp_result(mssql_ptr, statement TSRMLS_CC);
}
else {
/* Skip results not returning any columns */
@@ -2148,7 +2183,7 @@ PHP_FUNCTION(mssql_execute)
}
}
}
else if (retval_results == NO_MORE_RESULTS || retval_results == NO_MORE_RPC_RESULTS) {
if (retval_results == NO_MORE_RESULTS || retval_results == NO_MORE_RPC_RESULTS) {
_mssql_get_sp_result(mssql_ptr, statement TSRMLS_CC);
}
@@ -2219,7 +2254,7 @@ PHP_FUNCTION(mssql_guid_string)
break;
}
dbconvert(NULL, SQLBINARY, (BYTE*)Z_STRVAL_PP(binary), 16, SQLCHAR, buffer, -1);
dbconvert(NULL, SQLBINARY, (BYTE*)Z_STRVAL_PP(binary), MIN(16, Z_STRLEN_PP(binary)), SQLCHAR, buffer, -1);
if (sf) {
php_strtoupper(buffer, 32);
@@ -2227,6 +2262,7 @@ PHP_FUNCTION(mssql_guid_string)
}
else {
int i;
/* FIXME this works only on little endian machine */
for (i=0; i<4; i++) {
buffer2[2*i] = buffer[6-2*i];
buffer2[2*i+1] = buffer[7-2*i];
+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);
+10 -3
View File
@@ -2467,9 +2467,16 @@ _oci_close_session(oci_session *session)
(ub4) OCI_HTYPE_SESSION));
}
#ifdef HAVE_OCI_9_2
/* free environment handle (and fix bug #29652 with growing .msb FD number under weirdie Solarises) */
CALL_OCI(OCIHandleFree(
(dvoid *) session->pEnv,
OCI_HTYPE_ENV));
#endif
hashed_details = session->hashed_details;
if (! OCI(shutdown)) {
if (! OCI(shutdown) && !session->exclusive) {
zend_hash_del(OCI(user), hashed_details, strlen(hashed_details)+1);
}
@@ -2591,7 +2598,7 @@ static int _oci_session_cleanup(void *data TSRMLS_DC)
list_entry *le = (list_entry *) data;
if (Z_TYPE_P(le) == le_session) {
oci_server *server = ((oci_session*) le->ptr)->server;
if (server->is_open == 2)
if (server && server->is_open == 2)
return 1;
}
return 0;
@@ -2982,7 +2989,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;
}
+8 -1
View File
@@ -118,7 +118,7 @@ zend_module_entry openssl_module_entry = {
"openssl",
openssl_functions,
PHP_MINIT(openssl),
NULL,
PHP_MSHUTDOWN(openssl),
NULL,
NULL,
PHP_MINFO(openssl),
@@ -1611,11 +1611,18 @@ PHP_FUNCTION(openssl_csr_new)
if (we_made_the_key) {
/* and a resource for the private key */
ZVAL_RESOURCE(out_pkey, zend_list_insert(req.priv_key, le_key));
req.priv_key = NULL; /* make sure the cleanup code doesn't zap it! */
}
else if (key_resource != -1)
req.priv_key = NULL; /* make sure the cleanup code doesn't zap it! */
}
}
else {
if (!we_made_the_key) {
/* if we have not made the key we are not supposed to zap it by calling dispose! */
req.priv_key = NULL;
}
}
}
}
}
+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);
}
+5
View File
@@ -46,6 +46,7 @@
#include "php_session.h"
#include "mod_files.h"
#include "ext/standard/flock_compat.h"
#include "php_open_temporary_file.h"
#define FILE_PREFIX "sess_"
@@ -234,6 +235,10 @@ PS_OPEN_FUNC(files)
data = ecalloc(sizeof(*data), 1);
PS_SET_MOD_DATA(data);
if (*save_path == '\0') {
save_path = php_get_temporary_directory();
}
data->fd = -1;
if ((p = strchr(save_path, ';'))) {
errno = 0;
+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);
+73 -26
View File
@@ -120,7 +120,11 @@ static PHP_INI_MH(OnUpdateSerializer)
PHP_INI_BEGIN()
STD_PHP_INI_BOOLEAN("session.bug_compat_42", "1", PHP_INI_ALL, OnUpdateBool, bug_compat, php_ps_globals, ps_globals)
STD_PHP_INI_BOOLEAN("session.bug_compat_warn", "1", PHP_INI_ALL, OnUpdateBool, bug_compat_warn, php_ps_globals, ps_globals)
#ifdef PHP_WIN32
STD_PHP_INI_ENTRY("session.save_path", "", PHP_INI_ALL, OnUpdateString, save_path, php_ps_globals, ps_globals)
#else
STD_PHP_INI_ENTRY("session.save_path", "/tmp", PHP_INI_ALL, OnUpdateString, save_path, php_ps_globals, ps_globals)
#endif
STD_PHP_INI_ENTRY("session.name", "PHPSESSID", PHP_INI_ALL, OnUpdateString, session_name, php_ps_globals, ps_globals)
PHP_INI_ENTRY("session.save_handler", "files", PHP_INI_ALL, OnUpdateSaveHandler)
STD_PHP_INI_BOOLEAN("session.auto_start", "0", PHP_INI_ALL, OnUpdateBool, auto_start, php_ps_globals, ps_globals)
@@ -405,7 +409,7 @@ PS_SERIALIZER_DECODE_FUNC(php_binary)
if (has_value) {
MAKE_STD_ZVAL(current);
if (php_var_unserialize(&current, &p, endptr, &var_hash TSRMLS_CC)) {
if (php_var_unserialize(&current, (const unsigned char **)&p, endptr, &var_hash TSRMLS_CC)) {
php_set_session_var(name, namelen, current, &var_hash TSRMLS_CC);
}
zval_ptr_dtor(&current);
@@ -432,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);
@@ -480,7 +489,7 @@ PS_SERIALIZER_DECODE_FUNC(php)
if (has_value) {
MAKE_STD_ZVAL(current);
if (php_var_unserialize(&current, &q, endptr, &var_hash TSRMLS_CC)) {
if (php_var_unserialize(&current, (const unsigned char **)&q, endptr, &var_hash TSRMLS_CC)) {
php_set_session_var(name, namelen, current, &var_hash TSRMLS_CC);
}
zval_ptr_dtor(&current);
@@ -499,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);
@@ -516,7 +528,11 @@ static char *php_session_encode(int *newlen TSRMLS_DC)
char *ret = NULL;
IF_SESSION_VARS() {
if (PS(serializer)->encode(&ret, newlen TSRMLS_CC) == FAILURE)
if (!PS(serializer)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown session.serialize_handler. Failed to encode session object.");
ret = NULL;
}
else if (PS(serializer)->encode(&ret, newlen TSRMLS_CC) == FAILURE)
ret = NULL;
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot encode non-existent session.");
@@ -527,6 +543,10 @@ static char *php_session_encode(int *newlen TSRMLS_DC)
static void php_session_decode(const char *val, int vallen TSRMLS_DC)
{
if (!PS(serializer)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown session.serialize_handler. Failed to decode session object.");
return;
}
if (PS(serializer)->decode(val, vallen TSRMLS_CC) == FAILURE) {
php_session_destroy(TSRMLS_C);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to decode session object. Session has been destroyed.");
@@ -863,7 +883,7 @@ static void php_session_send_cookie(TSRMLS_D)
t = tv.tv_sec + PS(cookie_lifetime);
if (t > 0) {
date_fmt = php_std_date(t);
date_fmt = php_std_date(t TSRMLS_CC);
smart_str_appends(&ncookie, COOKIE_EXPIRES);
smart_str_appends(&ncookie, date_fmt);
efree(date_fmt);
@@ -926,8 +946,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. */
@@ -964,6 +985,21 @@ PHPAPI void php_session_start(TSRMLS_D)
PS(define_sid) = 1;
PS(send_cookie) = 1;
if (PS(session_status) != php_session_none) {
if (PS(session_status) == php_session_disabled) {
char *value;
value = zend_ini_string("session.save_handler", sizeof("session.save_handler"), 0);
if (value) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot find save handler %s", value);
}
else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot find unknown save handler");
}
return;
}
php_error(E_NOTICE, "A session had already been started - ignoring session_start()");
return;
}
@@ -1106,8 +1142,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);
@@ -1170,32 +1206,36 @@ 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);
if (PS(mod) && PS(mod)->s_name) {
RETVAL_STRING(safe_estrdup(PS(mod)->s_name), 0);
} else {
RETVAL_EMPTY_STRING();
}
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 {
if (PS(mod) && PS(mod)->s_name) {
RETURN_STRING(safe_estrdup(PS(mod)->s_name), 0);
} else {
RETURN_EMPTY_STRING();
}
}
}
/* }}} */
@@ -1283,6 +1323,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;
@@ -1350,7 +1391,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));
}
@@ -1376,9 +1417,15 @@ PHP_FUNCTION(session_register)
WRONG_PARAM_COUNT;
}
if (PS(session_status) == php_session_none)
if (PS(session_status) == php_session_none || PS(session_status) == php_session_disabled) {
php_session_start(TSRMLS_C);
}
if (PS(session_status) == php_session_disabled) {
efree(args);
RETURN_FALSE;
}
for (i = 0; i < argc; i++) {
if (Z_TYPE_PP(args[i]) == IS_ARRAY)
SEPARATE_ZVAL(args[i]);
+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();
Loaded 100 of 268 files, more files were not shown because too many files have changed in this diff. Show more