mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-11 11:10:49 +00:00
Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9f5cbd22c8 | ||
|
|
ccfe4bf736 | ||
|
|
aa72ed1ce7 | ||
|
|
a64b0ae39d | ||
|
|
1bd95d5fd3 |
No files matched your search
@@ -1,128 +1,5 @@
|
||||
PHP 4 NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? Nov 2004, Version 4.3.10
|
||||
|
||||
23 Nov 2004, Version 4.3.10RC1
|
||||
- Added the %F modifier to *printf to render a non-locale-aware representation
|
||||
of a float with the . as decimal seperator. (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 #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 #28325 (Circular references not properly serialised). (Moriyoshi)
|
||||
- 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 #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, tony2001 at phpclub dot net)
|
||||
- Fixed bug #29116 (Zend constant warning uses memory after free).
|
||||
(Marcus, jdolecek at NetBSD dot org)
|
||||
- Fixed bug #29114 (Potential double free in php_stat). (Sara)
|
||||
- Fixed bug #29075 (strnatcmp() incorrectly handles whitespace).
|
||||
(Curt, Ilia)
|
||||
- Fixed bug #29049 (array sorting via user function/method does not
|
||||
validate it). (Ilia)
|
||||
- Fixed bug #29038 (extract() with EXTR_PREFIX_SAME prefixes empty strings).
|
||||
(Andrey)
|
||||
- Fixed bug #29034 (wordwrap() returns a boolean when passed empty string).
|
||||
(Ilia)
|
||||
- Fixed bug #28974 (overflow in array_slice(), array_splice(), substr,
|
||||
substr_replace(), strspn(), strcspn()). (Andrey)
|
||||
- Fixed bug #28897 (ibase: -1 returned as -0.000 for 64-bit scaled int). (Ard)
|
||||
- Fixed bug #28879 (Implicit/Explicit array creation inconsistency when using
|
||||
Resources, Arrays, or Objects as indices). (Sara)
|
||||
- Fixed bug #28878 (Setting of inikey's in obj.conf fails). (Uwe Schindler)
|
||||
- Fixed bug #28868 (Internal wrapper registry not thread safe). (Sara)
|
||||
- Fixed bug #28818 (Apache 2 sapis do not export st_dev).
|
||||
(xuefer at 21cn dot com, Ilia).
|
||||
- Fixed bug #28800 (strings beginning with "inf" improperly converted). (Ilia)
|
||||
- Fixed bug #28723 (Fixed mbstring config.m4 to work on OSes where test
|
||||
command does not support -e parameter). (Ilia)
|
||||
- Fixed bug #28692 (\0 in Authenticate header passed via safe_mode). (Ilia)
|
||||
- Fixed bug #28670 (WWW-Authentication header mangling with PCRE in safe_mode
|
||||
adds extra spaces). (Ilia)
|
||||
- Fixed bug #28668 (glob() does not work with relative paths on Windows). (Ilia)
|
||||
- Fixed bug #28649 (Proper glob() return value on Linux when there are no
|
||||
matches). (Ilia)
|
||||
- Fixed bug #28633 (sprintf incorrectly adding padding to floats). (Ilia)
|
||||
- Fixed bug #28627 (When multiple MySQL links are used default link is leaked).
|
||||
(gavin at ipalsoftware dot com, Ilia)
|
||||
- Fixed bug #28525 (gmp_powm() does not work with hexadecimal string modulo
|
||||
represented as a string). (pickett at sumu dot org, Ilia)
|
||||
- Fixed bug #28512 (Allocate enough space to store MSSQL data). (Frank)
|
||||
- Fixed bug #28466 (mbstring_convert_variables() array separation problem).
|
||||
(Moriyoshi)
|
||||
- Fixed bug #28175 (Allow bundled GD to compile against freetype 2.1.2).
|
||||
(Elf, Ilia)
|
||||
|
||||
14 Jul 2004, Version 4.3.8
|
||||
- Fixed strip_tags() to correctly handle '\0' characters. (Stefan)
|
||||
- Fixed memory_limit during request startup. (Stefan)
|
||||
|
||||
+18
-10
@@ -37,11 +37,8 @@ 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.
|
||||
|
||||
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.
|
||||
bug fixes, improvements, etc., should go into the NEWS file. Also see
|
||||
the note below about automatically updating NEWS in your commit message.
|
||||
|
||||
3. Do not commit multiple file and dump all messages in one commit. If you
|
||||
modified several unrelated files, commit each group separately and
|
||||
@@ -62,10 +59,14 @@ 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. Everything else goes into the ChangeLog.
|
||||
in the ChangeLog. If the line begins with @, it will be redirected to the
|
||||
NEWS file. 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 # at the beginning of _every_ such line.
|
||||
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.
|
||||
|
||||
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
|
||||
@@ -77,12 +78,17 @@ 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 will be omitted from the ChangeLog automagically.
|
||||
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.
|
||||
|
||||
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
|
||||
@@ -91,10 +97,12 @@ 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 right away, don't worry!
|
||||
If you don't see your messages in ChangeLog and NEWS right away, don't worry!
|
||||
These files are updated once a day, so your stuff will not show up until
|
||||
somewhat later.
|
||||
somewhat later. Don't go adding stuff to NEWS by hand if you already put @
|
||||
lines in the commit message.
|
||||
|
||||
You can use LXR (http://lxr.php.net/) and Bonsai (http://bonsai.php.net/)
|
||||
to look at PHP CVS repository in various ways.
|
||||
|
||||
+8
-11
@@ -40,8 +40,8 @@ AC_CONFIG_HEADER(main/php_config.h)
|
||||
|
||||
MAJOR_VERSION=4
|
||||
MINOR_VERSION=3
|
||||
RELEASE_VERSION=10
|
||||
EXTRA_VERSION="RC1"
|
||||
RELEASE_VERSION=8
|
||||
EXTRA_VERSION=""
|
||||
VERSION="$MAJOR_VERSION.$MINOR_VERSION.$RELEASE_VERSION$EXTRA_VERSION"
|
||||
|
||||
dnl Define where extension directories are located in the configure context
|
||||
@@ -528,20 +528,17 @@ 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", 0, &hints, &ai) < 0) {
|
||||
if (getaddrinfo("127.0.0.1", NULL, &hints, &ai) < 0) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (ai == 0) {
|
||||
if (ai == NULL) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -570,8 +567,8 @@ fi
|
||||
AC_REPLACE_FUNCS(strlcat strlcpy getopt)
|
||||
AC_FUNC_UTIME_NULL
|
||||
AC_FUNC_ALLOCA
|
||||
dnl PHP_AC_BROKEN_SPRINTF
|
||||
dnl PHP_AC_BROKEN_SNPRINTF
|
||||
PHP_AC_BROKEN_SPRINTF
|
||||
PHP_AC_BROKEN_SNPRINTF
|
||||
PHP_DECLARED_TIMEZONE
|
||||
PHP_TIME_R_TYPE
|
||||
PHP_READDIR_R_TYPE
|
||||
@@ -1213,7 +1210,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_strtod.c)
|
||||
zend_ini.c zend_qsort.c zend_multibyte.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)
|
||||
@@ -1410,7 +1407,7 @@ cat <<X
|
||||
| If your application relies on register_globals being ON, you |
|
||||
| should explicitly set it to on in your php.ini file. |
|
||||
| Note that you are strongly encouraged to read |
|
||||
| http://www.php.net/manual/en/security.globals.php |
|
||||
| http://www.php.net/manual/en/security.registerglobals.php |
|
||||
| about the implications of having register_globals set to on, and |
|
||||
| avoid using it if possible. |
|
||||
+--------------------------------------------------------------------+
|
||||
|
||||
+1
-1
@@ -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 | STREAM_WILL_CAST, opened_path);
|
||||
stream = php_stream_open_wrapper(path, mode, options, opened_path);
|
||||
|
||||
if (stream) {
|
||||
int fd;
|
||||
|
||||
+1
-3
@@ -1563,9 +1563,7 @@ 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);
|
||||
|
||||
|
||||
+1
-7
@@ -97,13 +97,7 @@ PHP_MINFO_FUNCTION(ctype)
|
||||
return; \
|
||||
switch (Z_TYPE_P(c)) { \
|
||||
case IS_LONG: \
|
||||
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); \
|
||||
RETURN_BOOL(iswhat(Z_LVAL_P(c))); \
|
||||
case IS_STRING: \
|
||||
{ \
|
||||
char *p; \
|
||||
|
||||
+10
-44
@@ -201,28 +201,10 @@ 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);
|
||||
@@ -708,7 +690,6 @@ 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;
|
||||
@@ -783,12 +764,6 @@ 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;
|
||||
@@ -963,7 +938,7 @@ PHP_FUNCTION(curl_setopt)
|
||||
error = curl_formadd(&first, &last,
|
||||
CURLFORM_COPYNAME, string_key,
|
||||
CURLFORM_NAMELENGTH, string_key_len - 1,
|
||||
CURLFORM_COPYCONTENTS, postval,
|
||||
(ZVAL_REFCOUNT(*zvalue) > 1 ? CURLFORM_PTRCONTENTS : CURLFORM_COPYCONTENTS), postval,
|
||||
CURLFORM_CONTENTSLENGTH, Z_STRLEN_PP(current),
|
||||
CURLFORM_END);
|
||||
}
|
||||
@@ -1208,13 +1183,10 @@ PHP_FUNCTION(curl_getinfo)
|
||||
switch (option) {
|
||||
case CURLINFO_EFFECTIVE_URL:
|
||||
case CURLINFO_CONTENT_TYPE: {
|
||||
char *s_code = NULL;
|
||||
char *s_code;
|
||||
|
||||
if (curl_easy_getinfo(ch->cp, option, &s_code) == CURLE_OK && s_code) {
|
||||
RETURN_STRING(s_code, 1);
|
||||
} else {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
curl_easy_getinfo(ch->cp, option, &s_code);
|
||||
RETURN_STRING(s_code, 1);
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -1224,13 +1196,10 @@ PHP_FUNCTION(curl_getinfo)
|
||||
case CURLINFO_FILETIME:
|
||||
case CURLINFO_SSL_VERIFYRESULT:
|
||||
case CURLINFO_REDIRECT_COUNT: {
|
||||
long code = 0;
|
||||
long code;
|
||||
|
||||
if (curl_easy_getinfo(ch->cp, option, &code) == CURLE_OK) {
|
||||
RETURN_LONG(code);
|
||||
} else {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
curl_easy_getinfo(ch->cp, option, &code);
|
||||
RETURN_LONG(code);
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -1246,13 +1215,10 @@ PHP_FUNCTION(curl_getinfo)
|
||||
case CURLINFO_CONTENT_LENGTH_UPLOAD:
|
||||
case CURLINFO_STARTTRANSFER_TIME:
|
||||
case CURLINFO_REDIRECT_TIME: {
|
||||
double code = 0.0;
|
||||
double code;
|
||||
|
||||
if (curl_easy_getinfo(ch->cp, option, &code) == CURLE_OK) {
|
||||
RETURN_DOUBLE(code);
|
||||
} else {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
curl_easy_getinfo(ch->cp, option, &code);
|
||||
RETURN_DOUBLE(code);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -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, FG(user_agent) ? FG(user_agent) : "PHP/" PHP_VERSION);
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_USERAGENT, "PHP/" PHP_VERSION);
|
||||
|
||||
/* TODO: read cookies and options from context */
|
||||
|
||||
|
||||
+3
-6
@@ -11,11 +11,8 @@ AC_DEFUN(PHP_DBA_STD_BEGIN,[
|
||||
AC_DEFUN(PHP_TEMP_LDFLAGS,[
|
||||
old_LDFLAGS=$LDFLAGS
|
||||
LDFLAGS="$1 $LDFLAGS"
|
||||
old_LIBS=$LIBS
|
||||
LIBS="$2 $LIBS"
|
||||
$3
|
||||
$2
|
||||
LDFLAGS=$old_LDFLAGS
|
||||
LIBS=$old_LIBS
|
||||
])
|
||||
|
||||
dnl Assign INCLUDE/LFLAGS from PREFIX
|
||||
@@ -137,7 +134,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"
|
||||
],[
|
||||
@@ -174,7 +171,7 @@ AC_DEFUN(PHP_DBA_DB_CHECK,[
|
||||
])
|
||||
fi
|
||||
if test "$ext_shared" = "yes"; then
|
||||
AC_MSG_CHECKING(if dba can be used as shared extension)
|
||||
AC_MSG_CHECKING(if db 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)
|
||||
|
||||
@@ -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_file(dirname(__FILE__).'/test.cdb'));
|
||||
var_dump(md5(implode('',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_file($db_file));
|
||||
var_dump(md5(implode('',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) "12fc5ba2b9dcfef2480e5324eeb5f3e5"
|
||||
string(32) "12fc5ba2b9dcfef2480e5324eeb5f3e5"
|
||||
string(32) "723d19f39c1b15b3b455dd64323148d1"
|
||||
string(32) "723d19f39c1b15b3b455dd64323148d1"
|
||||
+6
-27
@@ -79,10 +79,8 @@ 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;
|
||||
if (f) {
|
||||
close(f->fd);
|
||||
free(f);
|
||||
}
|
||||
close(f->fd);
|
||||
free(f);
|
||||
}
|
||||
|
||||
#define RDIOC(c) REGISTER_LONG_CONSTANT(#c, c, CONST_CS | CONST_PERSISTENT)
|
||||
@@ -144,13 +142,10 @@ PHP_MINFO_FUNCTION(dio)
|
||||
php_info_print_table_end();
|
||||
}
|
||||
|
||||
static int new_php_fd(php_fd_t **f, int fd)
|
||||
static void new_php_fd(php_fd_t **f, int fd)
|
||||
{
|
||||
if (!(*f = malloc(sizeof(php_fd_t)))) {
|
||||
return 0;
|
||||
}
|
||||
*f = malloc(sizeof(php_fd_t));
|
||||
(*f)->fd = fd;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* {{{ proto resource dio_open(string filename, int flags[, int mode])
|
||||
@@ -184,10 +179,7 @@ PHP_FUNCTION(dio_open)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
||||
if (!new_php_fd(&f, fd)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
new_php_fd(&f, fd);
|
||||
ZEND_REGISTER_RESOURCE(return_value, f, le_fd);
|
||||
}
|
||||
/* }}} */
|
||||
@@ -207,11 +199,6 @@ 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) {
|
||||
@@ -240,12 +227,6 @@ 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);
|
||||
@@ -429,9 +410,7 @@ PHP_FUNCTION(dio_fcntl)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (!new_php_fd(&new_f, fcntl(f->fd, cmd, Z_LVAL_P(arg)))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
new_php_fd(&new_f, fcntl(f->fd, cmd, Z_LVAL_P(arg)));
|
||||
ZEND_REGISTER_RESOURCE(return_value, new_f, le_fd);
|
||||
break;
|
||||
}
|
||||
|
||||
+11
-24
@@ -540,8 +540,8 @@ zend_module_entry domxml_module_entry = {
|
||||
domxml_functions,
|
||||
PHP_MINIT(domxml),
|
||||
PHP_MSHUTDOWN(domxml),
|
||||
PHP_RINIT(domxml),
|
||||
PHP_RSHUTDOWN(domxml),
|
||||
NULL,
|
||||
NULL,
|
||||
PHP_MINFO(domxml),
|
||||
DOMXML_API_VERSION, /* Extension versionnumber */
|
||||
STANDARD_MODULE_PROPERTIES
|
||||
@@ -1510,24 +1510,6 @@ 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
|
||||
@@ -1686,9 +1668,15 @@ 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);
|
||||
|
||||
#if HAVE_DOMXSLT && HAVE_DOMEXSLT
|
||||
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
|
||||
exsltRegisterAll();
|
||||
#endif
|
||||
#endif
|
||||
xmlInitParser();
|
||||
return SUCCESS;
|
||||
@@ -5372,8 +5360,7 @@ PHP_FUNCTION(domxml_xslt_process)
|
||||
xmlDocPtr xmldocp;
|
||||
xmlDocPtr docp;
|
||||
char **params = NULL;
|
||||
int ret;
|
||||
long clone = -1;
|
||||
int ret, clone = -1;
|
||||
char *filename;
|
||||
int filename_len = 0;
|
||||
FILE *f;
|
||||
|
||||
@@ -75,8 +75,6 @@ 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
@@ -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 && ImageInfo->FileType!=IMAGE_FILETYPE_JPEG)) {
|
||||
if (offset_val+byte_count>ImageInfo->FileSize || (ImageInfo->FileType!=IMAGE_FILETYPE_TIFF_II && ImageInfo->FileType!=IMAGE_FILETYPE_TIFF_MM)) {
|
||||
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++) {
|
||||
snprintf(tmp, sizeof(tmp), ",%s,", exif_get_sectionname(i));
|
||||
sprintf(tmp, ",%s,", exif_get_sectionname(i));
|
||||
if (strstr(sections_str, tmp)) {
|
||||
sections_needed |= 1<<i;
|
||||
}
|
||||
|
||||
@@ -1213,12 +1213,7 @@ PHP_FUNCTION(fbsql_database)
|
||||
if (phpLink->databaseName) free(phpLink->databaseName);
|
||||
phpLink->databaseName = strdup(Z_STRVAL_PP(dbname));
|
||||
}
|
||||
if (phpLink->databaseName) {
|
||||
RETURN_STRING(phpLink->databaseName, 1);
|
||||
}
|
||||
else {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
RETURN_STRING(phpLink->databaseName, 1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
+2
-5
@@ -867,10 +867,7 @@ PHP_FUNCTION(fdf_save_string)
|
||||
struct stat stat;
|
||||
char *buf;
|
||||
|
||||
if (fstat(fileno(fp), &stat) == -1) {
|
||||
RETVAL_FALSE;
|
||||
goto err;
|
||||
}
|
||||
fstat(fileno(fp), &stat);
|
||||
buf = emalloc(stat.st_size +1);
|
||||
fread(buf, stat.st_size, 1, fp);
|
||||
buf[stat.st_size] = '\0';
|
||||
@@ -888,7 +885,7 @@ PHP_FUNCTION(fdf_save_string)
|
||||
if(err != FDFErcOK) {
|
||||
FDF_FAILURE(err);
|
||||
}
|
||||
err:
|
||||
|
||||
if(temp_filename) {
|
||||
unlink(temp_filename);
|
||||
efree(temp_filename);
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <fribidi/fribidi.h>
|
||||
|
||||
/* The fribidi guys dont believe in BC */
|
||||
#ifndef FRIBIDI_MICRO_VERSION_STR
|
||||
#ifdef FRIBIDI_CHAR_SET_UTF8
|
||||
#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,11 +212,7 @@ 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)) {
|
||||
|
||||
+2
-2
@@ -727,12 +727,12 @@ ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type,
|
||||
ptr = s;
|
||||
}
|
||||
#else
|
||||
while (e > ptr && (s = memchr(ptr, '\r', (e - ptr)))) {
|
||||
while ((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
|
||||
|
||||
+1
-4
@@ -258,7 +258,6 @@ 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
|
||||
@@ -272,7 +271,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/gd_gif_out.c "
|
||||
libgd/xbm.c"
|
||||
|
||||
dnl check for fabsf and floorf which are available since C99
|
||||
AC_CHECK_FUNCS(fabsf floorf)
|
||||
@@ -306,9 +305,7 @@ 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"
|
||||
|
||||
+6
-13
@@ -35,7 +35,6 @@
|
||||
#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>
|
||||
@@ -108,10 +107,6 @@ 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)());
|
||||
@@ -395,7 +390,7 @@ PHP_RSHUTDOWN_FUNCTION(gd)
|
||||
/* }}} */
|
||||
|
||||
#if HAVE_GD_BUNDLED
|
||||
#define PHP_GD_VERSION_STRING "bundled (2.0.28 compatible)"
|
||||
#define PHP_GD_VERSION_STRING "bundled (2.0.23 compatible)"
|
||||
#elif HAVE_LIBGD20
|
||||
#define PHP_GD_VERSION_STRING "2.0 or higher"
|
||||
#elif HAVE_GDIMAGECOLORRESOLVE
|
||||
@@ -1247,7 +1242,7 @@ static int _php_image_type (char data[8])
|
||||
#ifdef HAVE_GD_WBMP
|
||||
else {
|
||||
gdIOCtx *io_ctx;
|
||||
io_ctx = gdNewDynamicCtxEx (8, data, 0);
|
||||
io_ctx = gdNewDynamicCtx (8, data);
|
||||
if (io_ctx) {
|
||||
if (getmbi((int(*)(void*))gdGetC, io_ctx) == 0 && skipheader((int(*)(void*))gdGetC, io_ctx) == 0 ) {
|
||||
#if HAVE_LIBGD204
|
||||
@@ -1279,7 +1274,7 @@ gdImagePtr _php_image_create_from_string(zval **data, char *tn, gdImagePtr (*ioc
|
||||
gdImagePtr im;
|
||||
gdIOCtx *io_ctx;
|
||||
|
||||
io_ctx = gdNewDynamicCtxEx(Z_STRLEN_PP(data), Z_STRVAL_PP(data), 0);
|
||||
io_ctx = gdNewDynamicCtx (Z_STRLEN_PP(data), Z_STRVAL_PP(data));
|
||||
|
||||
if (!io_ctx) {
|
||||
return NULL;
|
||||
@@ -1433,7 +1428,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
io_ctx = gdNewDynamicCtxEx(buff_size, buff, 0);
|
||||
io_ctx = gdNewDynamicCtx(buff_size, buff);
|
||||
if(!io_ctx) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot allocate GD IO context");
|
||||
goto out_err;
|
||||
@@ -1663,9 +1658,8 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
|
||||
int b;
|
||||
FILE *tmp;
|
||||
char buf[4096];
|
||||
char *path;
|
||||
|
||||
tmp = php_open_temporary_file("", "", &path TSRMLS_CC);
|
||||
tmp = tmpfile();
|
||||
if (tmp == NULL) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open temporary file");
|
||||
RETURN_FALSE;
|
||||
@@ -1718,8 +1712,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
|
||||
}
|
||||
|
||||
fclose(tmp);
|
||||
VCWD_UNLINK((const char *)path); /* make sure that the temporary file is removed */
|
||||
efree(path);
|
||||
/* the temporary file is automatically deleted */
|
||||
}
|
||||
RETURN_TRUE;
|
||||
}
|
||||
|
||||
+4
-8
@@ -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_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
|
||||
# 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
|
||||
# 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_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
|
||||
# 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
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
@@ -231,10 +231,6 @@ 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"
|
||||
|
||||
+14
-81
@@ -1879,28 +1879,20 @@ 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;
|
||||
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) {
|
||||
im->alphaBlendingFlag = alphablending_bak;
|
||||
return;
|
||||
}
|
||||
|
||||
if (oc==nc || x<0 || x>wx2 || y<0 || y>wy2) return;
|
||||
|
||||
stack = (struct seg *)emalloc(sizeof(struct seg) * ((int)(im->sy*im->sx)/4)+1);
|
||||
sp = stack;
|
||||
|
||||
@@ -1939,7 +1931,6 @@ 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)
|
||||
@@ -2029,72 +2020,24 @@ 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 (y2 < y1) {
|
||||
t=y1;
|
||||
y1 = y2;
|
||||
y2 = t;
|
||||
|
||||
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;
|
||||
int half = thick / 2;
|
||||
int half1 = thick - half;
|
||||
|
||||
cy = y1ul + thick;
|
||||
while (cy-- > y1ul) {
|
||||
cx = x1ul - 1;
|
||||
while (cx++ < x2lr) {
|
||||
gdImageSetPixel(im, cx, cy, color);
|
||||
}
|
||||
if (y1 < y2) {
|
||||
y1v = y1h - half;
|
||||
y2v = y2h + half1 - 1;
|
||||
} else {
|
||||
y1v = y1h + half1 - 1;
|
||||
y2v = y2h - half;
|
||||
}
|
||||
|
||||
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)
|
||||
@@ -2117,16 +2060,6 @@ 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++) {
|
||||
|
||||
+29
-71
@@ -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,7 +256,6 @@ 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);
|
||||
|
||||
@@ -264,11 +263,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);
|
||||
@@ -296,9 +295,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);
|
||||
@@ -350,7 +349,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. */
|
||||
@@ -407,11 +406,8 @@ 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 */
|
||||
@@ -431,12 +427,10 @@ 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);
|
||||
@@ -494,7 +488,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
|
||||
@@ -513,7 +507,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);
|
||||
@@ -529,8 +523,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);
|
||||
|
||||
@@ -545,7 +539,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. */
|
||||
@@ -591,7 +585,7 @@ gdIOCtx *gdNewDynamicCtxEx(int size, void *data, int freeFlag);
|
||||
gdIOCtx* gdNewSSCtx(gdSourcePtr in, gdSinkPtr out);
|
||||
void* gdDPExtractData(struct gdIOCtx* ctx, int *size);
|
||||
|
||||
#define GD2_CHUNKSIZE 128
|
||||
#define GD2_CHUNKSIZE 128
|
||||
#define GD2_CHUNKSIZE_MIN 64
|
||||
#define GD2_CHUNKSIZE_MAX 4096
|
||||
|
||||
@@ -600,42 +594,6 @@ 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);
|
||||
|
||||
|
||||
@@ -1,759 +0,0 @@
|
||||
#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;
|
||||
}
|
||||
|
||||
|
||||
+1110
-1306
File diff suppressed because it is too large.
Load diff
+1
-1
@@ -984,7 +984,7 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
|
||||
}
|
||||
|
||||
/* EAM DEBUG */
|
||||
#if (defined(FREETYPE_MAJOR) && ((FREETYPE_MAJOR == 2 && ((FREETYPE_MINOR == 1 && FREETYPE_PATCH >= 3) || FREETYPE_MINOR > 1) || FREETYPE_MAJOR > 2)))
|
||||
#if (defined(FREETYPE_MAJOR) && (FREETYPE_MAJOR >=2 ) && (FREETYPE_MINOR >= 1))
|
||||
if (font->face->charmap->encoding == FT_ENCODING_MS_SYMBOL) {
|
||||
/* I do not know the significance of the constant 0xf000.
|
||||
* It was determined by inspection of the character codes
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
--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
|
||||
@@ -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 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"
|
||||
# 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"
|
||||
|
||||
!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 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"
|
||||
# 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"
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
+2
-1
@@ -830,7 +830,8 @@ ZEND_FUNCTION(gmp_powm)
|
||||
}
|
||||
FETCH_GMP_ZVAL(gmpnum_mod, mod_arg);
|
||||
|
||||
if (!mpz_cmp_ui(*gmpnum_mod, 0)) {
|
||||
convert_to_long_ex(mod_arg);
|
||||
if (!Z_LVAL_PP(mod_arg)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
||||
+14
-1
@@ -83,11 +83,24 @@ 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);
|
||||
/* }}} */
|
||||
|
||||
@@ -172,7 +185,7 @@ PHP_MINFO_FUNCTION(miconv)
|
||||
|
||||
/* {{{ php_iconv_string
|
||||
*/
|
||||
PHP_ICONV_API php_iconv_err_t php_iconv_string(const char *in_p, size_t in_len,
|
||||
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
@@ -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 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 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 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.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-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"
|
||||
|
||||
!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" /D "PHP_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 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.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-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"
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
@@ -23,12 +23,8 @@
|
||||
#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
|
||||
|
||||
@@ -72,20 +68,6 @@ 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
|
||||
|
||||
+21
-24
@@ -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,12 +181,6 @@ 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)
|
||||
@@ -1491,7 +1485,10 @@ PHP_FUNCTION(imap_headerinfo)
|
||||
convert_to_string_ex(defaulthost);
|
||||
}
|
||||
|
||||
PHP_IMAP_CHECK_MSGNO(Z_LVAL_PP(msgno));
|
||||
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;
|
||||
}
|
||||
|
||||
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));
|
||||
@@ -1740,8 +1737,10 @@ PHP_FUNCTION(imap_fetchstructure)
|
||||
} else {
|
||||
msgindex = Z_LVAL_PP(msgno);
|
||||
}
|
||||
|
||||
PHP_IMAP_CHECK_MSGNO(msgindex);
|
||||
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;
|
||||
}
|
||||
|
||||
mail_fetchstructure_full(imap_le_struct->imap_stream, Z_LVAL_PP(msgno), &body , myargc == 3 ? Z_LVAL_PP(flags) : NIL);
|
||||
|
||||
@@ -1775,12 +1774,7 @@ 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) {
|
||||
@@ -2484,7 +2478,10 @@ PHP_FUNCTION(imap_fetchheader)
|
||||
msgindex = Z_LVAL_PP(msgno);
|
||||
}
|
||||
|
||||
PHP_IMAP_CHECK_MSGNO(msgindex);
|
||||
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;
|
||||
}
|
||||
|
||||
RETVAL_STRING(mail_fetchheader_full(imap_le_struct->imap_stream, Z_LVAL_PP(msgno), NIL, NIL, (myargc == 3 ? Z_LVAL_PP(flags) : NIL)), 1);
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -37,7 +37,7 @@ AC_DEFUN([PHP_MBSTRING_EXTENSION], [
|
||||
if test "$ext_shared" = "no"; then
|
||||
out="php_config.h"
|
||||
else
|
||||
if test -f "$ext_builddir/config.h.in"; then
|
||||
if test -e "$ext_builddir/config.h.in"; then
|
||||
out="$abs_builddir/config.h"
|
||||
else
|
||||
out="php_config.h"
|
||||
|
||||
@@ -3273,7 +3273,6 @@ 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);
|
||||
|
||||
@@ -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,17 +53,7 @@ unset($c);
|
||||
$a = "あいうえお";
|
||||
$b = array(&$a);
|
||||
$c = &$b;
|
||||
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);
|
||||
mb_convert_variables("euc-jp", "shift_jis", $c);
|
||||
debug_zval_dump($b);
|
||||
debug_zval_dump($c);
|
||||
unset($a);
|
||||
@@ -107,17 +97,4 @@ 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
@@ -459,7 +459,7 @@ PHP_FUNCTION(mcal_fetch_event)
|
||||
CALEVENT *myevent;
|
||||
int myargcount=ZEND_NUM_ARGS();
|
||||
|
||||
if (myargcount < 2 || myargcount > 3 || zend_get_parameters_ex(myargcount, &streamind, &eventid, &options) == FAILURE) {
|
||||
if (myargcount < 1 || myargcount > 3 || zend_get_parameters_ex(myargcount, &streamind, &eventid, &options) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
convert_to_long_ex(streamind);
|
||||
|
||||
+181
-379
File diff suppressed because it is too large.
Load diff
+1
-86
@@ -26,96 +26,13 @@ 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 "4.0"
|
||||
#define PHP_MCVE_VERSION "3.2"
|
||||
|
||||
#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);
|
||||
@@ -192,8 +109,6 @@ PHP_FUNCTION(mcve_initusersetup);
|
||||
PHP_FUNCTION(mcve_deluser);
|
||||
PHP_FUNCTION(mcve_edituser);
|
||||
PHP_FUNCTION(mcve_liststats);
|
||||
|
||||
|
||||
#endif /* _PHP_MCVE_H */
|
||||
|
||||
/*
|
||||
|
||||
+8
-13
@@ -1444,22 +1444,17 @@ PHP_FUNCTION(swfmovie_output)
|
||||
#ifdef HAVE_MING_ZLIB
|
||||
zval **zlimit = NULL;
|
||||
int limit = -1;
|
||||
int argc = ZEND_NUM_ARGS();
|
||||
|
||||
if(argc==0) {
|
||||
limit = 6;
|
||||
} else {
|
||||
if (zend_get_parameters_ex(1, &zlimit) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
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
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ PHP_ARG_WITH(mnogosearch,for mnoGoSearch support,
|
||||
|
||||
AC_DEFINE(HAVE_MNOGOSEARCH,1,[ ])
|
||||
|
||||
PHP_NEW_EXTENSION(mnogosearch, php_mnogo.c, $ext_shared)
|
||||
PHP_SUBST(MNOGOSEARCH_SHARED_LIBADD)
|
||||
PHP_NEW_EXTENSION(mnogosearch, php_mnogo.c, $ext_shared)
|
||||
|
||||
fi
|
||||
+2
-2
@@ -32,8 +32,8 @@ if test "$PHP_MSSQL" != "no"; then
|
||||
fi
|
||||
fi
|
||||
|
||||
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])
|
||||
if test ! -r "$FREETDS_INSTALLATION_DIR/lib/libtds.a"; then
|
||||
AC_MSG_ERROR(Could not find $FREETDS_INSTALLATION_DIR/lib/libtds.a)
|
||||
fi
|
||||
|
||||
MSSQL_INCDIR=$FREETDS_INSTALLATION_DIR/include
|
||||
|
||||
+5
-21
@@ -336,7 +336,7 @@ PHP_RINIT_FUNCTION(mssql)
|
||||
dbsetlogintime(MS_SQL_G(connect_timeout));
|
||||
if (MS_SQL_G(timeout) < 0) MS_SQL_G(timeout) = 60;
|
||||
dbsettime(MS_SQL_G(timeout));
|
||||
dbsetmaxprocs((TDS_SHORT)MS_SQL_G(max_procs));
|
||||
dbsetmaxprocs((SHORT)MS_SQL_G(max_procs));
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -848,25 +848,11 @@ 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)) {
|
||||
|
||||
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;
|
||||
}
|
||||
if (column_type == SQLDATETIM4) res_length += 14;
|
||||
if (column_type == SQLDATETIME) res_length += 10;
|
||||
|
||||
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;
|
||||
@@ -932,15 +918,13 @@ 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;
|
||||
@@ -1812,7 +1796,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);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
@@ -36,8 +36,10 @@
|
||||
#include "sqlfront.h"
|
||||
#include "sqldb.h"
|
||||
|
||||
typedef short TDS_SHORT;
|
||||
#if HAVE_FREETDS
|
||||
#ifndef SHORT
|
||||
typedef short SHORT;
|
||||
#endif
|
||||
#define SQLTEXT SYBTEXT
|
||||
#define SQLCHAR SYBCHAR
|
||||
#define SQLVARCHAR SYBVARCHAR
|
||||
|
||||
@@ -1421,7 +1421,7 @@ PHP_FUNCTION(ncurses_mvdelch)
|
||||
{
|
||||
long y,x;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll",&y,&x)==FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lls",&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, "ll",&y,&x)==FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lls",&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, "ll",&y,&x)==FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lls",&y,&x)==FAILURE) {
|
||||
return;
|
||||
}
|
||||
IS_NCURSES_INITIALIZED();
|
||||
|
||||
+3
-10
@@ -2467,16 +2467,9 @@ _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) && !session->exclusive) {
|
||||
if (! OCI(shutdown)) {
|
||||
zend_hash_del(OCI(user), hashed_details, strlen(hashed_details)+1);
|
||||
}
|
||||
|
||||
@@ -2598,7 +2591,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 && server->is_open == 2)
|
||||
if (server->is_open == 2)
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
@@ -2989,7 +2982,7 @@ break;
|
||||
}
|
||||
|
||||
memset((void*)&bind,0,sizeof(oci_bind));
|
||||
zend_hash_update(statement->binds, Z_STRVAL_PP(name), Z_STRLEN_PP(name) + 1, &bind, sizeof(oci_bind), (void **)&bindp);
|
||||
zend_hash_next_index_insert(statement->binds,&bind,sizeof(oci_bind),(void **)&bindp);
|
||||
|
||||
bindp->descr = mydescr;
|
||||
bindp->pStmt = mystmt;
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
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>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
+2
-6
@@ -1008,15 +1008,11 @@ PHP_FUNCTION(odbc_execute)
|
||||
|
||||
/* Check for safe mode. */
|
||||
if (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
|
||||
efree(filename);
|
||||
efree(params);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
/* Check the basedir */
|
||||
if (php_check_open_basedir(filename TSRMLS_CC)) {
|
||||
efree(filename);
|
||||
efree(params);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ zend_module_entry openssl_module_entry = {
|
||||
"openssl",
|
||||
openssl_functions,
|
||||
PHP_MINIT(openssl),
|
||||
PHP_MSHUTDOWN(openssl),
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
PHP_MINFO(openssl),
|
||||
@@ -1611,18 +1611,11 @@ 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+8
-72
@@ -108,22 +108,6 @@ 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) {
|
||||
@@ -295,16 +279,6 @@ 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;
|
||||
@@ -373,7 +347,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, rc;
|
||||
int i;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ((global) ? "ssz|ll" : "ss|zll"), ®ex, ®ex_len,
|
||||
&subject, &subject_len, &subpats, &flags, &start_offset) == FAILURE) {
|
||||
@@ -419,12 +393,7 @@ static void php_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global)
|
||||
}
|
||||
|
||||
/* Calculate the size of the offsets array, and allocate memory for it. */
|
||||
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;
|
||||
}
|
||||
pcre_fullinfo(re, extra, PCRE_INFO_CAPTURECOUNT, &num_subpats);
|
||||
num_subpats++;
|
||||
size_offsets = num_subpats * 3;
|
||||
offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0);
|
||||
@@ -441,22 +410,10 @@ static void php_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global)
|
||||
char *name_table;
|
||||
unsigned short name_idx;
|
||||
|
||||
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;
|
||||
}
|
||||
pcre_fullinfo(re, extra, PCRE_INFO_NAMECOUNT, &name_cnt);
|
||||
if (name_cnt > 0) {
|
||||
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;
|
||||
}
|
||||
pcre_fullinfo(re, extra, PCRE_INFO_NAMETABLE, &name_table);
|
||||
pcre_fullinfo(re, extra, PCRE_INFO_NAMEENTRYSIZE, &name_size);
|
||||
|
||||
while (ni++ < name_cnt) {
|
||||
name_idx = 0xff * name_table[0] + name_table[1];
|
||||
@@ -825,7 +782,6 @@ 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) {
|
||||
@@ -845,13 +801,7 @@ PHPAPI char *php_pcre_replace(char *regex, int regex_len,
|
||||
}
|
||||
|
||||
/* Calculate the size of the offsets array, and allocate memory for it. */
|
||||
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;
|
||||
size_offsets = (pcre_info(re, NULL, NULL) + 1) * 3;
|
||||
offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0);
|
||||
|
||||
alloc_len = 2 * subject_len + 1;
|
||||
@@ -1215,7 +1165,6 @@ 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();
|
||||
@@ -1250,13 +1199,7 @@ PHP_FUNCTION(preg_split)
|
||||
array_init(return_value);
|
||||
|
||||
/* Calculate the size of the offsets array, and allocate memory for it. */
|
||||
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;
|
||||
size_offsets = (pcre_info(re, NULL, NULL) + 1) * 3;
|
||||
offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0);
|
||||
|
||||
/* Start at the beginning of the string */
|
||||
@@ -1463,7 +1406,6 @@ 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 */
|
||||
|
||||
@@ -1493,13 +1435,7 @@ PHP_FUNCTION(preg_grep)
|
||||
}
|
||||
|
||||
/* Calculate the size of the offsets array, and allocate memory for it. */
|
||||
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;
|
||||
size_offsets = (pcre_info(re, NULL, NULL) + 1) * 3;
|
||||
offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0);
|
||||
|
||||
/* Initialize return array */
|
||||
|
||||
@@ -111,13 +111,6 @@ Use the options --with-tiff-dir=<DIR>, --with-jpeg-dir=<DIR>, --with-png-dir=<DI
|
||||
See config.log for more information.
|
||||
])
|
||||
])
|
||||
AC_CHECK_LIB(pdf, PDF_load_font, [
|
||||
AC_MSG_ERROR([
|
||||
This PDFlib extension only works up to PDFlib 4.0.x.
|
||||
For newer PDFlib version please use the PECL package:
|
||||
pecl.php.net/packages/pdflib
|
||||
])
|
||||
],[])
|
||||
;;
|
||||
*)
|
||||
if test -f "$PHP_PDFLIB/include/pdflib.h" ; then
|
||||
@@ -136,13 +129,6 @@ See config.log for more information.
|
||||
],[
|
||||
-L$PHP_PDFLIB/lib $PDF_SHARED_LIBADD
|
||||
])
|
||||
AC_CHECK_LIB(pdf, PDF_load_font, [
|
||||
AC_MSG_ERROR([
|
||||
This PDFlib extension only works up to PDFlib 4.0.x.
|
||||
For newer PDFlib version please use the PECL package:
|
||||
pecl.php.net/packages/pdflib
|
||||
])
|
||||
],[])
|
||||
else
|
||||
AC_MSG_ERROR([pdflib.h not found! Check the path passed to --with-pdflib=<PATH>. PATH should be the install prefix directory.])
|
||||
fi
|
||||
|
||||
+5
-41
@@ -409,7 +409,7 @@ PS_SERIALIZER_DECODE_FUNC(php_binary)
|
||||
|
||||
if (has_value) {
|
||||
MAKE_STD_ZVAL(current);
|
||||
if (php_var_unserialize(¤t, (const unsigned char **)&p, endptr, &var_hash TSRMLS_CC)) {
|
||||
if (php_var_unserialize(¤t, &p, endptr, &var_hash TSRMLS_CC)) {
|
||||
php_set_session_var(name, namelen, current, &var_hash TSRMLS_CC);
|
||||
}
|
||||
zval_ptr_dtor(¤t);
|
||||
@@ -436,11 +436,6 @@ 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);
|
||||
@@ -489,7 +484,7 @@ PS_SERIALIZER_DECODE_FUNC(php)
|
||||
|
||||
if (has_value) {
|
||||
MAKE_STD_ZVAL(current);
|
||||
if (php_var_unserialize(¤t, (const unsigned char **)&q, endptr, &var_hash TSRMLS_CC)) {
|
||||
if (php_var_unserialize(¤t, &q, endptr, &var_hash TSRMLS_CC)) {
|
||||
php_set_session_var(name, namelen, current, &var_hash TSRMLS_CC);
|
||||
}
|
||||
zval_ptr_dtor(¤t);
|
||||
@@ -528,11 +523,7 @@ static char *php_session_encode(int *newlen TSRMLS_DC)
|
||||
char *ret = NULL;
|
||||
|
||||
IF_SESSION_VARS() {
|
||||
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)
|
||||
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.");
|
||||
@@ -543,10 +534,6 @@ 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.");
|
||||
@@ -946,9 +933,8 @@ static void php_session_reset_id(TSRMLS_D)
|
||||
{
|
||||
int module_number = PS(module_number);
|
||||
|
||||
if (PS(use_cookies) && PS(send_cookie)) {
|
||||
if (PS(use_cookies)) {
|
||||
php_session_send_cookie(TSRMLS_C);
|
||||
PS(send_cookie) = 0;
|
||||
}
|
||||
|
||||
/* if the SID constant exists, destroy it. */
|
||||
@@ -985,21 +971,6 @@ 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;
|
||||
}
|
||||
@@ -1315,7 +1286,6 @@ 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;
|
||||
@@ -1409,15 +1379,9 @@ PHP_FUNCTION(session_register)
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
if (PS(session_status) == php_session_none || PS(session_status) == php_session_disabled) {
|
||||
if (PS(session_status) == php_session_none)
|
||||
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]);
|
||||
|
||||
@@ -350,7 +350,7 @@ static char *php_strerror(int error TSRMLS_DC)
|
||||
buf = hstrerror(error);
|
||||
#else
|
||||
{
|
||||
spprintf(&(SOCKETS_G(strerror_buf)), 0, "Host lookup error %d", error);
|
||||
spprintf(&(SOCKETS_G(strerror_buf)), "Host lookup error %d", error);
|
||||
buf = SOCKETS_G(strerror_buf);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -7,4 +7,4 @@ $(srcdir)/var_unserializer.c: $(srcdir)/var_unserializer.re
|
||||
$(srcdir)/url_scanner_ex.c: $(srcdir)/url_scanner_ex.re
|
||||
$(RE2C) -b $(srcdir)/url_scanner_ex.re > $@
|
||||
|
||||
$(builddir)/info.lo: $(builddir)/../../main/build-defs.h
|
||||
$(srcdir)/info.c: $(builddir)/../../main/build-defs.h
|
||||
+7
-28
@@ -543,14 +543,6 @@ static int array_user_compare(const void *a, const void *b TSRMLS_DC)
|
||||
}
|
||||
}
|
||||
|
||||
/* check is comparison function is valid */
|
||||
#define PHP_ARRAY_CMP_FUNC_CHECK(func_name) \
|
||||
if (!zend_is_callable(*func_name, 0, NULL)) { \
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid comparison function."); \
|
||||
BG(user_compare_func_name) = old_compare_func; \
|
||||
RETURN_FALSE; \
|
||||
} \
|
||||
|
||||
/* {{{ proto bool usort(array array_arg, string cmp_function)
|
||||
Sort an array by values using a user-defined comparison function */
|
||||
PHP_FUNCTION(usort)
|
||||
@@ -570,9 +562,6 @@ PHP_FUNCTION(usort)
|
||||
BG(user_compare_func_name) = old_compare_func;
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
PHP_ARRAY_CMP_FUNC_CHECK(BG(user_compare_func_name))
|
||||
|
||||
if (zend_hash_sort(target_hash, zend_qsort, array_user_compare, 1 TSRMLS_CC) == FAILURE) {
|
||||
BG(user_compare_func_name) = old_compare_func;
|
||||
RETURN_FALSE;
|
||||
@@ -601,9 +590,6 @@ PHP_FUNCTION(uasort)
|
||||
BG(user_compare_func_name) = old_compare_func;
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
PHP_ARRAY_CMP_FUNC_CHECK(BG(user_compare_func_name))
|
||||
|
||||
if (zend_hash_sort(target_hash, zend_qsort, array_user_compare, 0 TSRMLS_CC) == FAILURE) {
|
||||
BG(user_compare_func_name) = old_compare_func;
|
||||
RETURN_FALSE;
|
||||
@@ -679,9 +665,6 @@ PHP_FUNCTION(uksort)
|
||||
BG(user_compare_func_name) = old_compare_func;
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
PHP_ARRAY_CMP_FUNC_CHECK(BG(user_compare_func_name))
|
||||
|
||||
if (zend_hash_sort(target_hash, zend_qsort, array_user_key_compare, 0 TSRMLS_CC) == FAILURE) {
|
||||
BG(user_compare_func_name) = old_compare_func;
|
||||
RETURN_FALSE;
|
||||
@@ -1260,7 +1243,7 @@ PHP_FUNCTION(extract)
|
||||
/* break omitted intentionally */
|
||||
|
||||
case EXTR_PREFIX_ALL:
|
||||
if (final_name.len == 0 && var_name_len != 0) {
|
||||
if (final_name.len == 0) {
|
||||
smart_str_appendl(&final_name, Z_STRVAL_PP(prefix), Z_STRLEN_PP(prefix));
|
||||
smart_str_appendc(&final_name, '_');
|
||||
smart_str_appendl(&final_name, var_name, var_name_len);
|
||||
@@ -1290,16 +1273,13 @@ PHP_FUNCTION(extract)
|
||||
if (extract_refs) {
|
||||
zval **orig_var;
|
||||
|
||||
SEPARATE_ZVAL_TO_MAKE_IS_REF(entry);
|
||||
zval_add_ref(entry);
|
||||
|
||||
if (zend_hash_find(EG(active_symbol_table), final_name.c, final_name.len+1, (void **) &orig_var) == SUCCESS) {
|
||||
zval_ptr_dtor(orig_var);
|
||||
|
||||
SEPARATE_ZVAL_TO_MAKE_IS_REF(entry);
|
||||
zval_add_ref(entry);
|
||||
|
||||
*orig_var = *entry;
|
||||
} else {
|
||||
(*entry)->is_ref = 1;
|
||||
zval_add_ref(entry);
|
||||
zend_hash_update(EG(active_symbol_table), final_name.c, final_name.len+1, (void **) entry, sizeof(zval *), NULL);
|
||||
}
|
||||
} else {
|
||||
@@ -1586,7 +1566,7 @@ HashTable* php_splice(HashTable *in_hash, int offset, int length,
|
||||
/* ..and the length */
|
||||
if (length < 0) {
|
||||
length = num_in-offset+length;
|
||||
} else if (((unsigned) offset + (unsigned) length) > num_in) {
|
||||
} else if (offset+length > num_in) {
|
||||
length = num_in-offset;
|
||||
}
|
||||
|
||||
@@ -1712,7 +1692,7 @@ static void _phpi_pop(INTERNAL_FUNCTION_PARAMETERS, int off_the_end)
|
||||
zval **stack, /* Input stack */
|
||||
**val; /* Value to be popped */
|
||||
char *key = NULL;
|
||||
uint key_len = 0;
|
||||
int key_len = 0;
|
||||
ulong index;
|
||||
|
||||
/* Get the arguments and do error-checking */
|
||||
@@ -1963,7 +1943,7 @@ PHP_FUNCTION(array_slice)
|
||||
/* ..and the length */
|
||||
if (length_val < 0) {
|
||||
length_val = num_in-offset_val+length_val;
|
||||
} else if (((unsigned) offset_val + (unsigned)length_val) > num_in) {
|
||||
} else if (offset_val+length_val > num_in) {
|
||||
length_val = num_in-offset_val;
|
||||
}
|
||||
|
||||
@@ -2934,7 +2914,6 @@ PHP_FUNCTION(array_multisort)
|
||||
array, and the very first argument has to be an array.
|
||||
*/
|
||||
for (i = 0; i < argc; i++) {
|
||||
SEPARATE_ZVAL(args[i]);
|
||||
if (Z_TYPE_PP(args[i]) == IS_ARRAY) {
|
||||
/* We see the next array, so we update the sort flags of
|
||||
the previous array and reset the sort flags. */
|
||||
|
||||
@@ -32,10 +32,6 @@
|
||||
#include "ext/session/php_session.h"
|
||||
#include "zend_operators.h"
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
#include "win32/php_win32_globals.h"
|
||||
#endif
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
@@ -275,7 +271,6 @@ void test_class_startup(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#undef sprintf
|
||||
|
||||
function_entry basic_functions[] = {
|
||||
PHP_FE(constant, NULL)
|
||||
@@ -1042,14 +1037,8 @@ PHP_MINIT_FUNCTION(basic)
|
||||
{
|
||||
#ifdef ZTS
|
||||
ts_allocate_id(&basic_globals_id, sizeof(php_basic_globals), (ts_allocate_ctor) basic_globals_ctor, (ts_allocate_dtor) basic_globals_dtor);
|
||||
#ifdef PHP_WIN32
|
||||
ts_allocate_id(&php_win32_core_globals_id, sizeof(php_win32_core_globals), (ts_allocate_ctor)php_win32_core_globals_ctor, NULL);
|
||||
#endif
|
||||
#else
|
||||
basic_globals_ctor(&basic_globals TSRMLS_CC);
|
||||
#ifdef PHP_WIN32
|
||||
php_win32_core_globals_ctor(&php_win32_core_globals TSRMLS_CC);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
REGISTER_LONG_CONSTANT("CONNECTION_ABORTED", PHP_CONNECTION_ABORTED, CONST_CS | CONST_PERSISTENT);
|
||||
@@ -1136,9 +1125,6 @@ PHP_MSHUTDOWN_FUNCTION(basic)
|
||||
{
|
||||
#ifdef ZTS
|
||||
ts_free_id(basic_globals_id);
|
||||
#ifdef PHP_WIN32
|
||||
ts_free_id(php_win32_core_globals_id);
|
||||
#endif
|
||||
#else
|
||||
basic_globals_dtor(&basic_globals TSRMLS_CC);
|
||||
#endif
|
||||
@@ -1202,9 +1188,6 @@ PHP_RINIT_FUNCTION(basic)
|
||||
/* Reset magic_quotes_runtime */
|
||||
PG(magic_quotes_runtime) = INI_BOOL("magic_quotes_runtime");
|
||||
|
||||
/* Default to global wrappers only */
|
||||
FG(stream_wrappers) = NULL;
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@@ -1228,12 +1211,6 @@ PHP_RSHUTDOWN_FUNCTION(basic)
|
||||
}
|
||||
STR_FREE(BG(locale_string));
|
||||
|
||||
if (FG(stream_wrappers)) {
|
||||
zend_hash_destroy(FG(stream_wrappers));
|
||||
efree(FG(stream_wrappers));
|
||||
FG(stream_wrappers) = NULL;
|
||||
}
|
||||
|
||||
PHP_RSHUTDOWN(fsock) (SHUTDOWN_FUNC_ARGS_PASSTHRU);
|
||||
PHP_RSHUTDOWN(filestat) (SHUTDOWN_FUNC_ARGS_PASSTHRU);
|
||||
PHP_RSHUTDOWN(syslog) (SHUTDOWN_FUNC_ARGS_PASSTHRU);
|
||||
|
||||
@@ -67,10 +67,6 @@ AC_DEFUN(AC_CRYPT_CAP,[
|
||||
|
||||
AC_CACHE_CHECK(for standard DES crypt, ac_cv_crypt_des,[
|
||||
AC_TRY_RUN([
|
||||
#if HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_CRYPT_H
|
||||
#include <crypt.h>
|
||||
#endif
|
||||
@@ -98,10 +94,6 @@ main() {
|
||||
|
||||
AC_CACHE_CHECK(for extended DES crypt, ac_cv_crypt_ext_des,[
|
||||
AC_TRY_RUN([
|
||||
#if HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_CRYPT_H
|
||||
#include <crypt.h>
|
||||
#endif
|
||||
@@ -129,10 +121,6 @@ main() {
|
||||
|
||||
AC_CACHE_CHECK(for MD5 crypt, ac_cv_crypt_md5,[
|
||||
AC_TRY_RUN([
|
||||
#if HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_CRYPT_H
|
||||
#include <crypt.h>
|
||||
#endif
|
||||
@@ -172,10 +160,6 @@ main() {
|
||||
|
||||
AC_CACHE_CHECK(for Blowfish crypt, ac_cv_crypt_blowfish,[
|
||||
AC_TRY_RUN([
|
||||
#if HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_CRYPT_H
|
||||
#include <crypt.h>
|
||||
#endif
|
||||
|
||||
@@ -87,11 +87,9 @@ PHPAPI void php_print_credits(int flag)
|
||||
|
||||
if (flag & PHP_CREDITS_DOCS) {
|
||||
php_info_print_table_start();
|
||||
php_info_print_table_colspan_header(2, "PHP Documentation");
|
||||
CREDIT_LINE("Authors", "Mehdi Achour, Friedhelm Betz, Antony Dovgal, Nuno Lopes, Philip Olson, Georg Richter, Damien Seguy, Jakub Vrana");
|
||||
CREDIT_LINE("Editor", "Gabor Hojtsy");
|
||||
CREDIT_LINE("User Note Maintainers", "Mehdi Achour, Friedhelm Betz, Vincent Gevers, Aidan Lister, Nuno Lopes, Tom Sommer");
|
||||
CREDIT_LINE("Other Contributors", "Previously active authors, editors and other contributors are listed in the manual.");
|
||||
php_info_print_table_header(1, "PHP Documentation Team");
|
||||
php_info_print_table_row(1, "Jouni Ahto, Alexander Aulbach, Stig Bakken, Rasmus Lerdorf, Egon Schmid, Lars Torben Wilson, Jim Winstead");
|
||||
php_info_print_table_row(1, "Edited by: Stig Bakken and Egon Schmid");
|
||||
php_info_print_table_end();
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ static int phpday_tab[2][12] = {
|
||||
{31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
|
||||
};
|
||||
|
||||
#define isleap(year) ((((year) % 4) == 0 && ((year) % 100) != 0) || ((year) % 400)==0)
|
||||
#define isleap(year) (((year % 4) == 0 && (year % 100) != 0) || (year % 400)==0)
|
||||
#define YEAR_BASE 1900
|
||||
|
||||
/* {{{ proto int time(void)
|
||||
|
||||
+5
-4
@@ -371,12 +371,13 @@ PHP_FUNCTION(glob)
|
||||
cwd[0] = '\0';
|
||||
}
|
||||
#ifdef PHP_WIN32
|
||||
if (IS_SLASH(*pattern)) {
|
||||
if (!IS_SLASH(cwd[0])) {
|
||||
cwd[2] = '\0';
|
||||
cwd_skip = 3;
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
cwd_skip = strlen(cwd)+1;
|
||||
|
||||
#endif
|
||||
snprintf(work_pattern, MAXPATHLEN, "%s%c%s", cwd, DEFAULT_SLASH, pattern);
|
||||
pattern = work_pattern;
|
||||
}
|
||||
@@ -390,7 +391,7 @@ PHP_FUNCTION(glob)
|
||||
* doesn't. This ensure that if no match is found, an empty array
|
||||
* is always returned so it can be used without worrying in e.g.
|
||||
* foreach() */
|
||||
#ifndef __linux__
|
||||
#if __linux__
|
||||
RETURN_FALSE;
|
||||
#else
|
||||
array_init(return_value);
|
||||
|
||||
@@ -602,7 +602,6 @@ static void proc_open_rsrc_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC)
|
||||
WaitForSingleObject(child, INFINITE);
|
||||
GetExitCodeProcess(child, &wstatus);
|
||||
FG(pclose_ret) = wstatus;
|
||||
CloseHandle(child);
|
||||
#else
|
||||
# if HAVE_SYS_WAIT_H
|
||||
int wstatus;
|
||||
|
||||
+11
-35
@@ -909,7 +909,7 @@ static int parse_context_options(php_stream_context *context, zval *options)
|
||||
HashPosition pos, opos;
|
||||
zval **wval, **oval;
|
||||
char *wkey, *okey;
|
||||
uint wkey_len, okey_len;
|
||||
int wkey_len, okey_len;
|
||||
int ret = SUCCESS;
|
||||
ulong num_key;
|
||||
|
||||
@@ -1189,7 +1189,7 @@ PHP_FUNCTION(popen)
|
||||
zval **arg1, **arg2;
|
||||
FILE *fp;
|
||||
char *p, *tmp = NULL;
|
||||
char *b, *buf = 0;
|
||||
char *b, buf[1024];
|
||||
php_stream *stream;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
|
||||
@@ -1212,11 +1212,10 @@ PHP_FUNCTION(popen)
|
||||
b = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (b) {
|
||||
spprintf(&buf, 0, "%s%s", PG(safe_mode_exec_dir), b);
|
||||
snprintf(buf, sizeof(buf), "%s%s", PG(safe_mode_exec_dir), b);
|
||||
} else {
|
||||
spprintf(&buf, 0, "%s/%s", PG(safe_mode_exec_dir), Z_STRVAL_PP(arg1));
|
||||
snprintf(buf, sizeof(buf), "%s/%s", PG(safe_mode_exec_dir), Z_STRVAL_PP(arg1));
|
||||
}
|
||||
|
||||
tmp = php_escape_shell_cmd(buf);
|
||||
@@ -1226,12 +1225,8 @@ PHP_FUNCTION(popen)
|
||||
if (!fp) {
|
||||
php_error_docref2(NULL TSRMLS_CC, buf, p, E_WARNING, "%s", strerror(errno));
|
||||
efree(p);
|
||||
efree(buf);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
efree(buf);
|
||||
|
||||
} else {
|
||||
fp = VCWD_POPEN(Z_STRVAL_PP(arg1), p);
|
||||
if (!fp) {
|
||||
@@ -1919,32 +1914,9 @@ PHP_FUNCTION(rename)
|
||||
if (ret == -1) {
|
||||
#ifdef EXDEV
|
||||
if (errno == EXDEV) {
|
||||
struct stat sb;
|
||||
if (php_copy_file(old_name, new_name TSRMLS_CC) == SUCCESS) {
|
||||
if (VCWD_STAT(old_name, &sb) == 0) {
|
||||
#if !defined(TSRM_WIN32) && !defined(NETWARE)
|
||||
if (VCWD_CHMOD(new_name, sb.st_mode)) {
|
||||
if (errno == EPERM) {
|
||||
php_error_docref2(NULL TSRMLS_CC, old_name, new_name, E_WARNING, "%s", strerror(errno));
|
||||
VCWD_UNLINK(old_name);
|
||||
RETURN_TRUE;
|
||||
}
|
||||
php_error_docref2(NULL TSRMLS_CC, old_name, new_name, E_WARNING, "%s", strerror(errno));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if (VCWD_CHOWN(new_name, sb.st_uid, sb.st_gid)) {
|
||||
if (errno == EPERM) {
|
||||
php_error_docref2(NULL TSRMLS_CC, old_name, new_name, E_WARNING, "%s", strerror(errno));
|
||||
VCWD_UNLINK(old_name);
|
||||
RETURN_TRUE;
|
||||
}
|
||||
php_error_docref2(NULL TSRMLS_CC, old_name, new_name, E_WARNING, "%s", strerror(errno));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#endif
|
||||
VCWD_UNLINK(old_name);
|
||||
RETURN_TRUE;
|
||||
}
|
||||
if (php_copy_file(old_name, new_name TSRMLS_CC) == SUCCESS) {
|
||||
VCWD_UNLINK(old_name);
|
||||
RETURN_TRUE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -2438,6 +2410,10 @@ enclosure:
|
||||
goto enclosure;
|
||||
}
|
||||
} else {
|
||||
while (e < re && e > s && *(e - 1) == enclosure) {
|
||||
e--;
|
||||
}
|
||||
|
||||
buf2 = erealloc(buf2, buf2_len + (e - s) + 1);
|
||||
memcpy(buf2 + buf2_len, s, (e - s));
|
||||
buf2_len += e - s;
|
||||
|
||||
@@ -118,7 +118,6 @@ typedef struct {
|
||||
long default_socket_timeout;
|
||||
char *user_agent;
|
||||
char *user_stream_current_filename; /* for simple recursion protection */
|
||||
HashTable *stream_wrappers; /* per-request copy of url_stream_wrappers_hash */
|
||||
} php_file_globals;
|
||||
|
||||
#ifdef ZTS
|
||||
|
||||
@@ -128,7 +128,6 @@ PHP_RSHUTDOWN_FUNCTION(filestat)
|
||||
{
|
||||
if (BG(CurrentStatFile)) {
|
||||
efree (BG(CurrentStatFile));
|
||||
BG(CurrentStatFile) = NULL;
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -614,11 +613,8 @@ static void php_stat(const char *filename, php_stat_len filename_length, int typ
|
||||
if (!IS_LINK_OPERATION(type) && (!IS_EXISTS_CHECK(type) || (errno != ENOENT && errno != ENOTDIR))) { /* fileexists() test must print no error */
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Stat failed for %s (errno=%d - %s)", BG(CurrentStatFile), errno, strerror(errno));
|
||||
}
|
||||
/* This could be null if a failed stat leads to a user error handler which calls a failed stat */
|
||||
if (BG(CurrentStatFile)) {
|
||||
efree(BG(CurrentStatFile));
|
||||
BG(CurrentStatFile) = NULL;
|
||||
}
|
||||
efree(BG(CurrentStatFile));
|
||||
BG(CurrentStatFile) = NULL;
|
||||
#if HAVE_SYMLINK
|
||||
if (!IS_LINK_OPERATION(type)) /* Don't require success for link operation */
|
||||
#endif
|
||||
|
||||
@@ -303,15 +303,7 @@ php_sprintf_appenddouble(char **buffer, int *pos,
|
||||
char *cvt;
|
||||
register int i = 0, j = 0;
|
||||
int sign, decpt, cvt_len;
|
||||
char decimal_point = '.';
|
||||
#ifdef HAVE_LOCALE_H
|
||||
struct lconv lc;
|
||||
char locale_decimal_point;
|
||||
localeconv_r(&lc);
|
||||
locale_decimal_point = (lc.decimal_point)[0];
|
||||
#else
|
||||
char locale_decimal_point = '.';
|
||||
#endif
|
||||
char decimal_point = EG(float_separator)[0];
|
||||
|
||||
PRINTF_DEBUG(("sprintf: appenddouble(%x, %x, %x, %f, %d, '%c', %d, %c)\n",
|
||||
*buffer, pos, size, number, width, padding, alignment, fmt));
|
||||
@@ -344,12 +336,12 @@ php_sprintf_appenddouble(char **buffer, int *pos,
|
||||
numbuf[i++] = '+';
|
||||
}
|
||||
|
||||
if (fmt == 'f' || fmt == 'F') {
|
||||
if (fmt == 'f') {
|
||||
if (decpt <= 0) {
|
||||
numbuf[i++] = '0';
|
||||
if (precision > 0) {
|
||||
int k = precision;
|
||||
numbuf[i++] = fmt == 'F' ? decimal_point : locale_decimal_point;
|
||||
numbuf[i++] = decimal_point;
|
||||
while ((decpt++ < 0) && k--) {
|
||||
numbuf[i++] = '0';
|
||||
}
|
||||
@@ -359,7 +351,7 @@ php_sprintf_appenddouble(char **buffer, int *pos,
|
||||
numbuf[i++] = j < cvt_len ? cvt[j++] : '0';
|
||||
}
|
||||
if (precision > 0) {
|
||||
numbuf[i++] = fmt == 'F' ? decimal_point : locale_decimal_point;
|
||||
numbuf[i++] = decimal_point;
|
||||
while (precision-- > 0) {
|
||||
numbuf[i++] = j < cvt_len ? cvt[j++] : '0';
|
||||
}
|
||||
@@ -406,6 +398,9 @@ php_sprintf_appenddouble(char **buffer, int *pos,
|
||||
|
||||
numbuf[i] = '\0';
|
||||
|
||||
if (precision > 0) {
|
||||
width += (precision + 1);
|
||||
}
|
||||
php_sprintf_appendstring(buffer, pos, size, numbuf, width, 0, padding,
|
||||
alignment, i, sign, 0, always_sign);
|
||||
}
|
||||
@@ -473,8 +468,7 @@ php_sprintf_getnumber(char *buffer, int *pos)
|
||||
* "b" integer argument is printed as binary
|
||||
* "c" integer argument is printed as a single character
|
||||
* "d" argument is an integer
|
||||
* "f" the argument is a float, the decimal separator is locale-aware
|
||||
* "F" the argument is a float, but the decimal separator is always "."
|
||||
* "f" the argument is a float
|
||||
* "o" integer argument is printed as octal
|
||||
* "s" argument is a string
|
||||
* "x" integer argument is printed as lowercase hexadecimal
|
||||
@@ -639,7 +633,6 @@ php_formatted_print(int ht, int *len, int use_array TSRMLS_DC)
|
||||
if (multiuse) {
|
||||
MAKE_STD_ZVAL(tmp);
|
||||
*tmp = **(args[argnum]);
|
||||
INIT_PZVAL(tmp);
|
||||
zval_copy_ctor(tmp);
|
||||
} else {
|
||||
SEPARATE_ZVAL(args[argnum]);
|
||||
@@ -674,7 +667,6 @@ php_formatted_print(int ht, int *len, int use_array TSRMLS_DC)
|
||||
|
||||
case 'e':
|
||||
case 'f':
|
||||
case 'F':
|
||||
/* XXX not done */
|
||||
convert_to_double(tmp);
|
||||
php_sprintf_appenddouble(&result, &outpos, &size,
|
||||
|
||||
@@ -505,7 +505,6 @@ inline static unsigned short get_next_char(enum entity_charset charset,
|
||||
case 0x50: /* 6, 2nd */
|
||||
utf |= ((this_char & 0x3f) << 24);
|
||||
stat++;
|
||||
break;
|
||||
default:
|
||||
/* invalid */
|
||||
more = 0;
|
||||
|
||||
@@ -940,11 +940,6 @@ static int php_get_wbmp(php_stream *stream, struct gfxinfo **result, int check T
|
||||
}
|
||||
height = (height << 7) | (i & 0x7f);
|
||||
} while (i & 0x80);
|
||||
|
||||
/* maximum valid sizes for wbmp (although 127x127 may be a more accurate one) */
|
||||
if (!height || !width || height > 2048 || width > 2048) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!check) {
|
||||
(*result)->width = width;
|
||||
|
||||
@@ -115,6 +115,9 @@ char *php_lookup_class_name(zval *object, size_t *nlen, zend_bool del TSRMLS_DC)
|
||||
|
||||
if (nlen)
|
||||
*nlen = Z_STRLEN_PP(val);
|
||||
|
||||
if (del)
|
||||
zend_hash_del(object_properties, MAGIC_MEMBER, sizeof(MAGIC_MEMBER));
|
||||
}
|
||||
|
||||
return (retval);
|
||||
|
||||
+1
-1
@@ -411,7 +411,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
|
||||
PUTS(SG(request_info).request_uri);
|
||||
}
|
||||
if ((ta->tm_mon==3) && (ta->tm_mday==1)) {
|
||||
PUTS("?="PHP_EGG_LOGO_GUID"\" alt=\"Nadia!\" /></a>");
|
||||
PUTS("?="PHP_EGG_LOGO_GUID"\" alt=\"Thies!\" /></a>");
|
||||
} else {
|
||||
PUTS("?="PHP_LOGO_GUID"\" alt=\"PHP Logo\" /></a>");
|
||||
}
|
||||
|
||||
@@ -65,14 +65,6 @@ PHP_FUNCTION(readlink)
|
||||
}
|
||||
convert_to_string_ex(filename);
|
||||
|
||||
if (PG(safe_mode) && !php_checkuid(Z_STRVAL_PP(filename), NULL, CHECKUID_CHECK_FILE_AND_DIR)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (php_check_open_basedir(Z_STRVAL_PP(filename) TSRMLS_CC)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
ret = readlink(Z_STRVAL_PP(filename), buff, MAXPATHLEN-1);
|
||||
|
||||
if (ret == -1) {
|
||||
|
||||
@@ -617,6 +617,11 @@ PHP_FUNCTION(sqrt)
|
||||
/* {{{ proto float hypot(float num1, float num2)
|
||||
Returns sqrt(num1*num1 + num2*num2) */
|
||||
|
||||
/*
|
||||
WARNING: this function is expermental: it could change its name or
|
||||
disappear in the next version of PHP!
|
||||
*/
|
||||
|
||||
#ifdef HAVE_HYPOT
|
||||
PHP_FUNCTION(hypot)
|
||||
{
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
if (Z_OBJCE_P(struc) == BG(incomplete_class)) { \
|
||||
class_name = php_lookup_class_name(struc, &name_len, 1 TSRMLS_CC); \
|
||||
free_class_name = 1; \
|
||||
incomplete_class = 1; \
|
||||
} else { \
|
||||
class_name = Z_OBJCE_P(struc)->name; \
|
||||
name_len = Z_OBJCE_P(struc)->name_length; \
|
||||
@@ -43,8 +42,7 @@
|
||||
#define PHP_CLASS_ATTRIBUTES \
|
||||
char *class_name; \
|
||||
size_t name_len; \
|
||||
zend_bool free_class_name = 0; \
|
||||
zend_bool incomplete_class = 0
|
||||
zend_bool free_class_name = 0 \
|
||||
|
||||
#define INCOMPLETE_CLASS "__PHP_Incomplete_Class"
|
||||
#define MAGIC_MEMBER "__PHP_Incomplete_Class_Name"
|
||||
|
||||
@@ -109,7 +109,7 @@ PHP_MINIT_FUNCTION(nl_langinfo);
|
||||
PHPAPI int strnatcmp_ex(char const *a, size_t a_len, char const *b, size_t b_len, int fold_case);
|
||||
|
||||
#ifdef HAVE_LOCALECONV
|
||||
PHPAPI struct lconv *localeconv_r(struct lconv *out);
|
||||
struct lconv *localeconv_r(struct lconv *out);
|
||||
#endif
|
||||
|
||||
PHPAPI char *php_strtoupper(char *s, size_t len);
|
||||
|
||||
@@ -46,7 +46,7 @@ struct php_unserialize_data {
|
||||
typedef struct php_unserialize_data php_unserialize_data_t;
|
||||
|
||||
PHPAPI void php_var_serialize(smart_str *buf, zval **struc, php_serialize_data_t *var_hash TSRMLS_DC);
|
||||
PHPAPI int php_var_unserialize(zval **rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC);
|
||||
PHPAPI int php_var_unserialize(zval **rval, const char **p, const char *max, php_unserialize_data_t *var_hash TSRMLS_DC);
|
||||
|
||||
#define PHP_VAR_SERIALIZE_INIT(var_hash) \
|
||||
zend_hash_init(&(var_hash), 10, NULL, NULL, 0)
|
||||
|
||||
@@ -78,7 +78,6 @@
|
||||
#endif
|
||||
#include "zend_execute.h"
|
||||
#include "zend_operators.h"
|
||||
#include "zend_strtod.h"
|
||||
#include "php_globals.h"
|
||||
#include "basic_functions.h"
|
||||
#include "scanf.h"
|
||||
@@ -1195,7 +1194,7 @@ PHPAPI int php_sscanf_internal( char *string, char *format,
|
||||
if (!(flags & SCAN_SUPPRESS)) {
|
||||
double dvalue;
|
||||
*end = '\0';
|
||||
dvalue = zend_strtod(buf, NULL);
|
||||
dvalue = strtod(buf, NULL);
|
||||
if (numVars) {
|
||||
current = args[objIndex++];
|
||||
convert_to_double( *current );
|
||||
|
||||
@@ -74,7 +74,7 @@ PHP_FUNCTION(soundex)
|
||||
/* BUG: should also map here accented letters used in non */
|
||||
/* English words or names (also found in English text!): */
|
||||
/* esstsett, thorn, n-tilde, c-cedilla, s-caron, ... */
|
||||
code = toupper((int)(unsigned char)str[i]);
|
||||
code = toupper(str[i]);
|
||||
if (code >= 'A' && code <= 'Z') {
|
||||
if (_small == 0) {
|
||||
/* remember first valid char */
|
||||
|
||||
+117
-81
@@ -133,7 +133,7 @@ static char *php_bin2hex(const unsigned char *old, const size_t oldlen, size_t *
|
||||
#ifdef HAVE_LOCALECONV
|
||||
/* {{{ localeconv_r
|
||||
* glibc's localeconv is not reentrant, so lets make it so ... sorta */
|
||||
PHPAPI struct lconv *localeconv_r(struct lconv *out)
|
||||
struct lconv *localeconv_r(struct lconv *out)
|
||||
{
|
||||
struct lconv *res;
|
||||
|
||||
@@ -203,10 +203,10 @@ static void php_spn_common_handler(INTERNAL_FUNCTION_PARAMETERS, int behavior)
|
||||
{
|
||||
char *s11, *s22;
|
||||
int len1, len2;
|
||||
long start = 0, len = 0;
|
||||
unsigned char match[256] = {0};
|
||||
char *rs, *s, *e;
|
||||
|
||||
long start, len;
|
||||
|
||||
start = 0;
|
||||
len = 0;
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ll", &s11, &len1,
|
||||
&s22, &len2, &start, &len) == FAILURE) {
|
||||
return;
|
||||
@@ -234,21 +234,22 @@ static void php_spn_common_handler(INTERNAL_FUNCTION_PARAMETERS, int behavior)
|
||||
}
|
||||
}
|
||||
|
||||
if (((unsigned) start + (unsigned) len) > len1) {
|
||||
if ((start + len) > len1) {
|
||||
len = len1 - start;
|
||||
}
|
||||
|
||||
s = s22;
|
||||
e = s22 + len2;
|
||||
while (s < e) {
|
||||
match[(int)(unsigned char)*s++] = 1;
|
||||
if (behavior == STR_STRSPN) {
|
||||
RETURN_LONG(php_strspn(s11 + start /*str1_start*/,
|
||||
s22 /*str2_start*/,
|
||||
s11 + start + len /*str1_end*/,
|
||||
s22 + len2 /*str2_end*/));
|
||||
} else if (behavior == STR_STRCSPN) {
|
||||
RETURN_LONG(php_strcspn(s11 + start /*str1_start*/,
|
||||
s22 /*str2_start*/,
|
||||
s11 + start + len /*str1_end*/,
|
||||
s22 + len2 /*str2_end*/));
|
||||
}
|
||||
|
||||
rs = s = s11 + start;
|
||||
e = s11 + start + len;
|
||||
while (s <= e && match[(int)(unsigned char)*s++] != behavior);
|
||||
|
||||
RETURN_LONG((s - rs) < 1 ? 0 : s - rs - 1);
|
||||
|
||||
}
|
||||
|
||||
/* {{{ proto int strspn(string str, string mask [, start [, len]])
|
||||
@@ -637,9 +638,8 @@ PHP_FUNCTION(wordwrap)
|
||||
return;
|
||||
}
|
||||
|
||||
if (textlen == 0) {
|
||||
RETURN_EMPTY_STRING();
|
||||
}
|
||||
if (textlen == 0)
|
||||
RETURN_FALSE;
|
||||
|
||||
if (linelength == 0 && docut) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't force cut when width is zero.");
|
||||
@@ -1292,6 +1292,42 @@ PHPAPI char *php_stristr(unsigned char *s, unsigned char *t, size_t s_len, size_
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ php_strspn
|
||||
*/
|
||||
PHPAPI size_t php_strspn(char *s1, char *s2, char *s1_end, char *s2_end)
|
||||
{
|
||||
register const char *p = s1, *spanp;
|
||||
register char c = *p;
|
||||
|
||||
cont:
|
||||
for (spanp = s2; p != s1_end && spanp != s2_end;)
|
||||
if (*spanp++ == c) {
|
||||
c = *(++p);
|
||||
goto cont;
|
||||
}
|
||||
return (p - s1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ php_strcspn
|
||||
*/
|
||||
PHPAPI size_t php_strcspn(char *s1, char *s2, char *s1_end, char *s2_end)
|
||||
{
|
||||
register const char *p, *spanp;
|
||||
register char c = *s1;
|
||||
|
||||
for (p = s1;;) {
|
||||
spanp = s2;
|
||||
do {
|
||||
if (*spanp == c || p == s1_end)
|
||||
return p - s1;
|
||||
} while (spanp++ < s2_end);
|
||||
c = *++p;
|
||||
}
|
||||
/* NOTREACHED */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto string stristr(string haystack, string needle)
|
||||
Finds first occurrence of a string within another, case insensitive */
|
||||
PHP_FUNCTION(stristr)
|
||||
@@ -1636,7 +1672,7 @@ PHP_FUNCTION(substr)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (((unsigned) f + (unsigned) l) > Z_STRLEN_PP(str)) {
|
||||
if ((f + l) > Z_STRLEN_PP(str)) {
|
||||
l = Z_STRLEN_PP(str) - f;
|
||||
}
|
||||
|
||||
@@ -1698,7 +1734,7 @@ PHP_FUNCTION(substr_replace)
|
||||
}
|
||||
}
|
||||
|
||||
if (((unsigned) f + (unsigned) l) > Z_STRLEN_PP(str)) {
|
||||
if ((f + l) > Z_STRLEN_PP(str)) {
|
||||
l = Z_STRLEN_PP(str) - f;
|
||||
}
|
||||
|
||||
@@ -2233,8 +2269,10 @@ PHP_FUNCTION(addslashes)
|
||||
RETURN_EMPTY_STRING();
|
||||
}
|
||||
|
||||
Z_TYPE_P(return_value) = IS_STRING;
|
||||
Z_STRVAL_P(return_value) = php_addslashes(Z_STRVAL_PP(str), Z_STRLEN_PP(str), &Z_STRLEN_P(return_value), 0 TSRMLS_CC);
|
||||
RETURN_STRING(php_addslashes(Z_STRVAL_PP(str),
|
||||
Z_STRLEN_PP(str),
|
||||
&Z_STRLEN_P(return_value), 0
|
||||
TSRMLS_CC), 0);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -2403,86 +2441,72 @@ PHPAPI char *php_addcslashes(char *str, int length, int *new_length, int should_
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* true static */
|
||||
const unsigned char php_esc_list[256] = {2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
|
||||
|
||||
/* {{{ php_addslashes
|
||||
*/
|
||||
PHPAPI char *php_addslashes(char *str, int length, int *new_length, int should_free TSRMLS_DC)
|
||||
{
|
||||
char *e = str + (length ? length : (length = strlen(str)));
|
||||
char *p = str;
|
||||
char *new_str, *ps;
|
||||
int local_new_length = length;
|
||||
int type = PG(magic_quotes_sybase) ? 1 : 0;
|
||||
|
||||
/* maximum string length, worst case situation */
|
||||
char *new_str;
|
||||
char *source, *target;
|
||||
char *end;
|
||||
int local_new_length;
|
||||
|
||||
if (!new_length) {
|
||||
new_length = &local_new_length;
|
||||
}
|
||||
|
||||
if (!str) {
|
||||
*new_length = 0;
|
||||
return str;
|
||||
}
|
||||
|
||||
/* determine the number of the characters that need to be escaped */
|
||||
while (p < e) {
|
||||
if (php_esc_list[(int)(unsigned char)*p++] > type) {
|
||||
local_new_length++;
|
||||
}
|
||||
}
|
||||
|
||||
/* string does not have any escapable characters */
|
||||
if (local_new_length == length) {
|
||||
new_str = estrndup(str, length);
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* create escaped string */
|
||||
ps = new_str = emalloc(local_new_length + 1);
|
||||
p = str;
|
||||
if (!type) {
|
||||
while (p < e) {
|
||||
int c = php_esc_list[(int)(unsigned char)*p];
|
||||
if (c == 2) {
|
||||
*ps++ = '\\';
|
||||
*ps++ = '0';
|
||||
p++;
|
||||
continue;
|
||||
} else if (c) {
|
||||
*ps++ = '\\';
|
||||
new_str = (char *) emalloc((length?length:(length=strlen(str)))*2+1);
|
||||
source = str;
|
||||
end = source + length;
|
||||
target = new_str;
|
||||
|
||||
if (PG(magic_quotes_sybase)) {
|
||||
while (source < end) {
|
||||
switch (*source) {
|
||||
case '\0':
|
||||
*target++ = '\\';
|
||||
*target++ = '0';
|
||||
break;
|
||||
case '\'':
|
||||
*target++ = '\'';
|
||||
*target++ = '\'';
|
||||
break;
|
||||
default:
|
||||
*target++ = *source;
|
||||
break;
|
||||
}
|
||||
*ps++ = *p++;
|
||||
source++;
|
||||
}
|
||||
} else {
|
||||
while (p < e) {
|
||||
switch (php_esc_list[(int)(unsigned char)*p]) {
|
||||
case 2:
|
||||
*ps++ = '\\';
|
||||
*ps++ = '0';
|
||||
p++;
|
||||
while (source < end) {
|
||||
switch (*source) {
|
||||
case '\0':
|
||||
*target++ = '\\';
|
||||
*target++ = '0';
|
||||
break;
|
||||
|
||||
case 3:
|
||||
*ps++ = '\'';
|
||||
*ps++ = '\'';
|
||||
p++;
|
||||
break;
|
||||
|
||||
case '\'':
|
||||
case '\"':
|
||||
case '\\':
|
||||
*target++ = '\\';
|
||||
/* break is missing *intentionally* */
|
||||
default:
|
||||
*ps++ = *p++;
|
||||
break;
|
||||
*target++ = *source;
|
||||
break;
|
||||
}
|
||||
|
||||
source++;
|
||||
}
|
||||
}
|
||||
*ps = '\0';
|
||||
|
||||
done:
|
||||
|
||||
*target = 0;
|
||||
*new_length = target - new_str;
|
||||
if (should_free) {
|
||||
STR_FREE(str);
|
||||
}
|
||||
*new_length = local_new_length;
|
||||
|
||||
new_str = (char *) erealloc(new_str, *new_length+1);
|
||||
return new_str;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -3139,6 +3163,18 @@ PHP_FUNCTION(setlocale)
|
||||
efree(args);
|
||||
RETVAL_STRING(retval, 1);
|
||||
|
||||
if (cat == LC_NUMERIC || cat == LC_ALL) {
|
||||
struct lconv lc;
|
||||
localeconv_r(&lc);
|
||||
|
||||
EG(float_separator)[0] = (lc.decimal_point)[0];
|
||||
|
||||
if ((lc.decimal_point)[0] != '.') {
|
||||
/* set locale back to C */
|
||||
setlocale(LC_NUMERIC, "C");
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -153,13 +153,13 @@ PHPAPI int strnatcmp_ex(char const *a, size_t a_len, char const *b, size_t b_len
|
||||
return +1;
|
||||
|
||||
++ap; ++bp;
|
||||
if (ap >= aend && bp >= bend)
|
||||
if (ap == aend && bp == bend)
|
||||
/* The strings compare the same. Perhaps the caller
|
||||
will want to call strcmp to break the tie. */
|
||||
return 0;
|
||||
else if (ap >= aend)
|
||||
else if (ap == aend)
|
||||
return -1;
|
||||
else if (bp >= bend)
|
||||
else if (bp == bend)
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,9 +119,6 @@ PHP_RSHUTDOWN_FUNCTION(syslog)
|
||||
if (BG(syslog_device)) {
|
||||
efree(BG(syslog_device));
|
||||
}
|
||||
#ifdef PHP_WIN32
|
||||
closelog();
|
||||
#endif
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
--TEST--
|
||||
Bug #28974 array_(p)slice() treats large lengths incorrectly - overflow
|
||||
--FILE--
|
||||
<?php
|
||||
$a = $b = $c = array(0,1,2,3,4,5);
|
||||
print_r($a);
|
||||
// this is ok:
|
||||
print_r(array_slice($a,2,2147483645));
|
||||
|
||||
// this is wrong:
|
||||
print_r(array_slice($a,2,2147483646));
|
||||
echo 'print_r(array_splice($a,2,1));'."\n";
|
||||
print_r(array_splice($a,2,1));
|
||||
echo "\$a is :";
|
||||
print_r($a);
|
||||
echo 'print_r(array_splice($b,2,2147483645));'."\n";
|
||||
print_r(array_splice($b,2,2147483645));
|
||||
echo "\$b is :";
|
||||
print_r($b);
|
||||
|
||||
// this is wrong:
|
||||
echo 'print_r(array_splice($c,2,2147483646));'."\n";
|
||||
print_r(array_splice($c,2,2147483646));
|
||||
echo "\$c is :";
|
||||
print_r($c);
|
||||
?>
|
||||
--EXPECT--
|
||||
Array
|
||||
(
|
||||
[0] => 0
|
||||
[1] => 1
|
||||
[2] => 2
|
||||
[3] => 3
|
||||
[4] => 4
|
||||
[5] => 5
|
||||
)
|
||||
Array
|
||||
(
|
||||
[0] => 2
|
||||
[1] => 3
|
||||
[2] => 4
|
||||
[3] => 5
|
||||
)
|
||||
Array
|
||||
(
|
||||
[0] => 2
|
||||
[1] => 3
|
||||
[2] => 4
|
||||
[3] => 5
|
||||
)
|
||||
print_r(array_splice($a,2,1));
|
||||
Array
|
||||
(
|
||||
[0] => 2
|
||||
)
|
||||
$a is :Array
|
||||
(
|
||||
[0] => 0
|
||||
[1] => 1
|
||||
[2] => 3
|
||||
[3] => 4
|
||||
[4] => 5
|
||||
)
|
||||
print_r(array_splice($b,2,2147483645));
|
||||
Array
|
||||
(
|
||||
[0] => 2
|
||||
[1] => 3
|
||||
[2] => 4
|
||||
[3] => 5
|
||||
)
|
||||
$b is :Array
|
||||
(
|
||||
[0] => 0
|
||||
[1] => 1
|
||||
)
|
||||
print_r(array_splice($c,2,2147483646));
|
||||
Array
|
||||
(
|
||||
[0] => 2
|
||||
[1] => 3
|
||||
[2] => 4
|
||||
[3] => 5
|
||||
)
|
||||
$c is :Array
|
||||
(
|
||||
[0] => 0
|
||||
[1] => 1
|
||||
)
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
Bug #22414: passthru() does not read data correctly
|
||||
--SKIPIF--
|
||||
<?php if (strtolower(@getenv('TEST_PHP_EXECUTABLE'))=='auto') die('skip: TEST_PHP_EXECUTABLE = auto'); ?>
|
||||
--INI--
|
||||
safe_mode=
|
||||
output_handler=
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
--TEST--
|
||||
bug #29038 (extract(), EXTR_PREFIX_SAME option prefixes empty strings)
|
||||
--FILE--
|
||||
<?php
|
||||
function f1() {
|
||||
$c = extract(array("" => 1),EXTR_PREFIX_SAME,"prefix");
|
||||
echo "Extracted:";
|
||||
var_dump($c);
|
||||
print_r(get_defined_vars());
|
||||
}
|
||||
function f2() {
|
||||
$a = 1;
|
||||
$c = extract(array("a" => 1),EXTR_PREFIX_SAME,"prefix");
|
||||
echo "Extracted:";
|
||||
var_dump($c);
|
||||
print_r(get_defined_vars());
|
||||
}
|
||||
function f3() {
|
||||
$a = 1;
|
||||
$c = extract(array("a" => 1),EXTR_PREFIX_ALL,"prefix");
|
||||
echo "Extracted:";
|
||||
var_dump($c);
|
||||
print_r(get_defined_vars());
|
||||
}
|
||||
function f4() {
|
||||
$c = extract(array("" => 1),EXTR_PREFIX_ALL,"prefix");
|
||||
echo "Extracted:";
|
||||
var_dump($c);
|
||||
print_r(get_defined_vars());
|
||||
}
|
||||
function f5() {
|
||||
$c = extract(array("111" => 1),EXTR_PREFIX_ALL,"prefix");
|
||||
echo "Extracted:";
|
||||
var_dump($c);
|
||||
print_r(get_defined_vars());
|
||||
}
|
||||
|
||||
f1();
|
||||
f2();
|
||||
f3();
|
||||
f4();
|
||||
f5();
|
||||
?>
|
||||
--EXPECT--
|
||||
Extracted:int(0)
|
||||
Array
|
||||
(
|
||||
[c] => 0
|
||||
)
|
||||
Extracted:int(1)
|
||||
Array
|
||||
(
|
||||
[a] => 1
|
||||
[prefix_a] => 1
|
||||
[c] => 1
|
||||
)
|
||||
Extracted:int(1)
|
||||
Array
|
||||
(
|
||||
[a] => 1
|
||||
[prefix_a] => 1
|
||||
[c] => 1
|
||||
)
|
||||
Extracted:int(0)
|
||||
Array
|
||||
(
|
||||
[c] => 0
|
||||
)
|
||||
Extracted:int(1)
|
||||
Array
|
||||
(
|
||||
[prefix_111] => 1
|
||||
[c] => 1
|
||||
)
|
||||
@@ -1,9 +0,0 @@
|
||||
--TEST--
|
||||
Bug #30069 (floats as strings used in calculations do not work)
|
||||
--FILE--
|
||||
<?php
|
||||
echo ".1" * "2";
|
||||
echo "\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
0.2
|
||||
@@ -1,5 +1,7 @@
|
||||
--TEST--
|
||||
serialize()/unserialize()/var_dump()
|
||||
--POST--
|
||||
--GET--
|
||||
--FILE--
|
||||
<?php
|
||||
class t
|
||||
@@ -12,16 +14,11 @@ class t
|
||||
|
||||
class s
|
||||
{
|
||||
var $a;
|
||||
var $b;
|
||||
var $c;
|
||||
|
||||
function s()
|
||||
{
|
||||
$this->a = "hallo";
|
||||
$this->b = "php";
|
||||
$this->c = "world";
|
||||
$this->d = "!";
|
||||
}
|
||||
|
||||
function __sleep()
|
||||
@@ -97,11 +94,9 @@ object(t)(1) {
|
||||
__sleep called
|
||||
O:1:"s":2:{s:1:"a";s:5:"hallo";s:1:"c";s:5:"world";}
|
||||
__wakeup called
|
||||
object(s)(3) {
|
||||
object(s)(2) {
|
||||
["a"]=>
|
||||
string(5) "hallo"
|
||||
["b"]=>
|
||||
NULL
|
||||
["c"]=>
|
||||
string(5) "world"
|
||||
}
|
||||
|
||||
@@ -1,44 +1,36 @@
|
||||
--TEST--
|
||||
Bug #25378 (unserialize() crashes with invalid data)
|
||||
serialize() (Bug #14293)
|
||||
--POST--
|
||||
--GET--
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(unserialize('b:0;'));
|
||||
var_dump(unserialize('b:1;'));
|
||||
var_dump(unserialize('i:823;'));
|
||||
var_dump(unserialize('s:0:"";'));
|
||||
var_dump(unserialize('s:3:"foo";'));
|
||||
var_dump(unserialize('a:1:{i:0;s:2:"12";}'));
|
||||
var_dump(unserialize('a:2:{i:0;a:0:{}i:1;a:0:{}}'));
|
||||
var_dump(unserialize('a:3:{i:0;s:3:"foo";i:1;s:3:"bar";i:2;s:3:"baz";}'));
|
||||
var_dump(unserialize('O:8:"stdClass":0:{}'));
|
||||
class t
|
||||
{
|
||||
function t()
|
||||
{
|
||||
$this->a = 'hello';
|
||||
}
|
||||
|
||||
function __sleep()
|
||||
{
|
||||
echo "__sleep called\n";
|
||||
return array('a','b');
|
||||
}
|
||||
}
|
||||
|
||||
$t = new t();
|
||||
$data = serialize($t);
|
||||
echo "$data\n";
|
||||
$t = unserialize($data);
|
||||
var_dump($t);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(true)
|
||||
int(823)
|
||||
string(0) ""
|
||||
string(3) "foo"
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(2) "12"
|
||||
__sleep called
|
||||
O:1:"t":2:{s:1:"a";s:5:"hello";s:1:"b";N;}
|
||||
object(t)(2) {
|
||||
["a"]=>
|
||||
string(5) "hello"
|
||||
["b"]=>
|
||||
NULL
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(0) {
|
||||
}
|
||||
[1]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(3) "foo"
|
||||
[1]=>
|
||||
string(3) "bar"
|
||||
[2]=>
|
||||
string(3) "baz"
|
||||
}
|
||||
object(stdClass)(0) {
|
||||
}
|
||||
===DONE===
|
||||
@@ -1,34 +0,0 @@
|
||||
--TEST--
|
||||
Bug #14293 (serialize() and __sleep())
|
||||
--FILE--
|
||||
<?php
|
||||
class t
|
||||
{
|
||||
function t()
|
||||
{
|
||||
$this->a = 'hello';
|
||||
}
|
||||
|
||||
function __sleep()
|
||||
{
|
||||
echo "__sleep called\n";
|
||||
return array('a','b');
|
||||
}
|
||||
}
|
||||
|
||||
$t = new t();
|
||||
$data = serialize($t);
|
||||
echo "$data\n";
|
||||
$t = unserialize($data);
|
||||
var_dump($t);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
__sleep called
|
||||
O:1:"t":2:{s:1:"a";s:5:"hello";s:1:"b";N;}
|
||||
object(t)(2) {
|
||||
["a"]=>
|
||||
string(5) "hello"
|
||||
["b"]=>
|
||||
NULL
|
||||
}
|
||||
@@ -3,57 +3,7 @@ Bug #25378 (unserialize() crashes with invalid data)
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(unserialize("s:-1:\"\";"));
|
||||
var_dump(unserialize("i:823"));
|
||||
var_dump(unserialize("O:8:\"stdClass :0:{}"));
|
||||
var_dump(unserialize("O:8:\"stdClass\"+0:{}"));
|
||||
var_dump(unserialize("O:1000:\"stdClass\":0:{}"));
|
||||
var_dump(unserialize("a:2:{i:0;s:2:\"12\":"));
|
||||
var_dump(unserialize("a:2:{i:0;s:2:\"12\";i:1;s:3000:\"123"));
|
||||
var_dump(unserialize("a:2:{i:0;s:2:\"12\"+i:1;s:3:\"123\";}"));
|
||||
var_dump(unserialize("a:2:{i:0;s:2:\"12\";i:1;s:3:\"123\";"));
|
||||
var_dump(unserialize("s:3000:\"123\";"));
|
||||
var_dump(unserialize("s:3000:\"123"));
|
||||
var_dump(unserialize("s:3:\"123;"));
|
||||
var_dump(unserialize("s:0:\"123\";"));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Notice: unserialize(): Error at offset 0 of 8 bytes in %sbug25378.php on line %d
|
||||
Notice: unserialize(): Error at offset 0 of 8 bytes in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Notice: unserialize(): Error at offset 0 of 5 bytes in %sbug25378.php on line %d
|
||||
bool(false)
|
||||
|
||||
Notice: unserialize(): Error at offset 13 of 19 bytes in %sbug25378.php on line %d
|
||||
bool(false)
|
||||
|
||||
Notice: unserialize(): Error at offset 14 of 19 bytes in %sbug25378.php on line %d
|
||||
bool(false)
|
||||
|
||||
Notice: unserialize(): Error at offset 2 of 22 bytes in %sbug25378.php on line %d
|
||||
bool(false)
|
||||
|
||||
Notice: unserialize(): Error at offset 17 of 18 bytes in %sbug25378.php on line %d
|
||||
bool(false)
|
||||
|
||||
Notice: unserialize(): Error at offset 24 of 33 bytes in %sbug25378.php on line %d
|
||||
bool(false)
|
||||
|
||||
Notice: unserialize(): Error at offset 17 of 33 bytes in %sbug25378.php on line %d
|
||||
bool(false)
|
||||
|
||||
Notice: unserialize(): Error at offset 33 of 32 bytes in %sbug25378.php on line %d
|
||||
bool(false)
|
||||
|
||||
Notice: unserialize(): Error at offset 2 of 13 bytes in %sbug25378.php on line %d
|
||||
bool(false)
|
||||
|
||||
Notice: unserialize(): Error at offset 2 of 11 bytes in %sbug25378.php on line %d
|
||||
bool(false)
|
||||
|
||||
Notice: unserialize(): Error at offset 8 of 9 bytes in %sbug25378.php on line %d
|
||||
bool(false)
|
||||
|
||||
Notice: unserialize(): Error at offset 5 of 10 bytes in %sbug25378.php on line %d
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Bug #27469 (serialize() objects of incomplete class)
|
||||
--FILE--
|
||||
<?php
|
||||
$str = 'O:9:"TestClass":0:{}';
|
||||
$obj = unserialize($str);
|
||||
var_dump($obj);
|
||||
echo serialize($obj)."\n";
|
||||
var_dump($obj);
|
||||
echo serialize($obj)."\n";
|
||||
var_dump($obj);
|
||||
?>
|
||||
--EXPECT--
|
||||
object(__PHP_Incomplete_Class)(1) {
|
||||
["__PHP_Incomplete_Class_Name"]=>
|
||||
string(9) "testclass"
|
||||
}
|
||||
O:9:"testclass":0:{}
|
||||
object(__PHP_Incomplete_Class)(1) {
|
||||
["__PHP_Incomplete_Class_Name"]=>
|
||||
string(9) "testclass"
|
||||
}
|
||||
O:9:"testclass":0:{}
|
||||
object(__PHP_Incomplete_Class)(1) {
|
||||
["__PHP_Incomplete_Class_Name"]=>
|
||||
string(9) "testclass"
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
--TEST--
|
||||
Bug #28325 (Problem in serialisation of circular references)
|
||||
--FILE--
|
||||
<?php
|
||||
class a {
|
||||
var $b;
|
||||
}
|
||||
class b {
|
||||
var $c;
|
||||
}
|
||||
class c {
|
||||
var $d;
|
||||
}
|
||||
$a = new a();
|
||||
$a->b = new b();
|
||||
$a->b->c = new c();
|
||||
$a->b->c->d = $a;
|
||||
var_dump(unserialize(serialize($a)));
|
||||
?>
|
||||
--EXPECT--
|
||||
object(a)(1) {
|
||||
["b"]=>
|
||||
object(b)(1) {
|
||||
["c"]=>
|
||||
object(c)(1) {
|
||||
["d"]=>
|
||||
object(a)(1) {
|
||||
["b"]=>
|
||||
object(b)(1) {
|
||||
["c"]=>
|
||||
object(c)(1) {
|
||||
["d"]=>
|
||||
NULL
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,5 +7,5 @@ Bug #22207 (missing 0 when using the e notation in *printf functions)
|
||||
?>
|
||||
--EXPECT--
|
||||
1.1000e+0
|
||||
string(11) " 1.1000e+0
|
||||
string(17) " 1.1000e+0
|
||||
"
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
Bug #28633 (sprintf incorrectly adding padding to floats)
|
||||
--FILE--
|
||||
<?php
|
||||
echo sprintf("%05.2f", 0.02) . "\n";
|
||||
echo sprintf("%05.2f", 2.02) . "\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
00.02
|
||||
02.02
|
||||
@@ -1,14 +0,0 @@
|
||||
--TEST--
|
||||
Bug #29075 (strnatcmp() incorrectly handles whitespace)
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(
|
||||
strnatcmp('foo ', 'foo '),
|
||||
strnatcmp('foo', 'foo'),
|
||||
strnatcmp(' foo', ' foo')
|
||||
);
|
||||
?>
|
||||
--EXPECT--
|
||||
int(0)
|
||||
int(0)
|
||||
int(0)
|
||||
@@ -18,7 +18,6 @@ strip_tags() function
|
||||
echo "\n";
|
||||
echo strip_tags('TESTS ?!!?!?!!!?!!');
|
||||
echo "\n";
|
||||
echo strip_tags('<i>CAN-2004-<'.chr(0).'b>0595</i>', '<i>');
|
||||
?>
|
||||
--EXPECT--
|
||||
NEAT STUFF
|
||||
@@ -28,4 +27,3 @@ NEAT STUFF
|
||||
NEAT STUFF
|
||||
NEAT STUFF
|
||||
TESTS ?!!?!?!!!?!!
|
||||
<i>CAN-2004-0595</i>
|
||||
@@ -17,7 +17,7 @@ set_time_limit(0);
|
||||
|
||||
for ($i=1;$i<=100000;$i++) {
|
||||
list($micro,$time)=explode(" ",microtime());
|
||||
if ($time > $last_t || ($time == $last_t && $micro >= $last_m)) {
|
||||
if ($time > $last_t || ($time == $last_t && $micro > $last_m)) {
|
||||
$passed++;
|
||||
} else if ($failed++ <=10) {
|
||||
$result .= sprintf('%06d', $i).": $time $micro < $last_t $last_m\n";
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
--TEST--
|
||||
Bug #28599 (strtotime fails with zero base time)
|
||||
--FILE--
|
||||
<?php
|
||||
print gmdate("d-m-Y H:i:s", strtotime("+30 minutes", 1100535573));
|
||||
?>
|
||||
--EXPECT--
|
||||
15-11-2004 16:49:33
|
||||
+24
-33
@@ -60,16 +60,15 @@ PHPAPI void php_url_free(php_url *theurl)
|
||||
|
||||
/* {{{ php_replace_controlchars
|
||||
*/
|
||||
PHPAPI char *php_replace_controlchars_ex(char *str, int len)
|
||||
PHPAPI char *php_replace_controlchars(char *str)
|
||||
{
|
||||
unsigned char *s = (unsigned char *)str;
|
||||
unsigned char *e = (unsigned char *)str + len;
|
||||
|
||||
if (!str) {
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
while (s < e) {
|
||||
while (*s) {
|
||||
|
||||
if (iscntrl(*s)) {
|
||||
*s='_';
|
||||
@@ -80,21 +79,13 @@ PHPAPI char *php_replace_controlchars_ex(char *str, int len)
|
||||
return (str);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
PHPAPI char *php_replace_controlchars(char *str)
|
||||
{
|
||||
return php_replace_controlchars_ex(str, strlen(str));
|
||||
}
|
||||
|
||||
PHPAPI php_url *php_url_parse(char const *str)
|
||||
{
|
||||
return php_url_parse_ex(str, strlen(str));
|
||||
}
|
||||
|
||||
|
||||
/* {{{ php_url_parse
|
||||
*/
|
||||
PHPAPI php_url *php_url_parse_ex(char const *str, int length)
|
||||
PHPAPI php_url *php_url_parse(char *str)
|
||||
{
|
||||
int length = strlen(str);
|
||||
char port_buf[6];
|
||||
php_url *ret = ecalloc(1, sizeof(php_url));
|
||||
char *s, *e, *p, *pp, *ue;
|
||||
@@ -103,7 +94,7 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length)
|
||||
ue = s + length;
|
||||
|
||||
/* parse scheme */
|
||||
if ((e = memchr(s, ':', length)) && (e - s)) {
|
||||
if ((e = strchr(s, ':')) && (e-s)) {
|
||||
/*
|
||||
* certain schemas like mailto: and zlib: may not have any / after them
|
||||
* this check ensures we support those.
|
||||
@@ -122,14 +113,14 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length)
|
||||
}
|
||||
|
||||
ret->scheme = estrndup(s, (e-s));
|
||||
php_replace_controlchars_ex(ret->scheme, (e - s));
|
||||
php_replace_controlchars(ret->scheme);
|
||||
|
||||
length -= ++e - s;
|
||||
s = e;
|
||||
goto just_path;
|
||||
} else {
|
||||
ret->scheme = estrndup(s, (e-s));
|
||||
php_replace_controlchars_ex(ret->scheme, (e - s));
|
||||
php_replace_controlchars(ret->scheme);
|
||||
|
||||
if (*(e+2) == '/') {
|
||||
s = e + 3;
|
||||
@@ -139,8 +130,8 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
s = e + 1;
|
||||
if (!strncasecmp("file", ret->scheme, sizeof("file"))) {
|
||||
s = e + 1;
|
||||
goto nohost;
|
||||
} else {
|
||||
length -= ++e - s;
|
||||
@@ -173,8 +164,8 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length)
|
||||
|
||||
e = ue;
|
||||
|
||||
if (!(p = memchr(s, '/', (ue - s)))) {
|
||||
if ((p = memchr(s, '?', (ue - s)))) {
|
||||
if (!(p = strchr(s, '/'))) {
|
||||
if ((p = strchr(s, '?'))) {
|
||||
e = p;
|
||||
}
|
||||
} else {
|
||||
@@ -186,17 +177,17 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length)
|
||||
if ((pp = memchr(s, ':', (p-s)))) {
|
||||
if ((pp-s) > 0) {
|
||||
ret->user = estrndup(s, (pp-s));
|
||||
php_replace_controlchars_ex(ret->user, (pp - s));
|
||||
php_replace_controlchars(ret->user);
|
||||
}
|
||||
|
||||
pp++;
|
||||
if (p-pp > 0) {
|
||||
ret->pass = estrndup(pp, (p-pp));
|
||||
php_replace_controlchars_ex(ret->pass, (p-pp));
|
||||
php_replace_controlchars(ret->pass);
|
||||
}
|
||||
} else {
|
||||
ret->user = estrndup(s, (p-s));
|
||||
php_replace_controlchars_ex(ret->user, (p-s));
|
||||
php_replace_controlchars(ret->user);
|
||||
}
|
||||
|
||||
s = p + 1;
|
||||
@@ -244,7 +235,7 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length)
|
||||
}
|
||||
|
||||
ret->host = estrndup(s, (p-s));
|
||||
php_replace_controlchars_ex(ret->host, (p - s));
|
||||
php_replace_controlchars(ret->host);
|
||||
|
||||
if (e == ue) {
|
||||
return ret;
|
||||
@@ -254,7 +245,7 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length)
|
||||
|
||||
nohost:
|
||||
|
||||
if ((p = memchr(s, '?', (ue - s)))) {
|
||||
if ((p = strchr(s, '?'))) {
|
||||
pp = strchr(s, '#');
|
||||
|
||||
if (pp && pp < p) {
|
||||
@@ -264,24 +255,24 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length)
|
||||
|
||||
if (p - s) {
|
||||
ret->path = estrndup(s, (p-s));
|
||||
php_replace_controlchars_ex(ret->path, (p - s));
|
||||
php_replace_controlchars(ret->path);
|
||||
}
|
||||
|
||||
if (pp) {
|
||||
if (pp - ++p) {
|
||||
ret->query = estrndup(p, (pp-p));
|
||||
php_replace_controlchars_ex(ret->query, (pp - p));
|
||||
php_replace_controlchars(ret->query);
|
||||
}
|
||||
p = pp;
|
||||
goto label_parse;
|
||||
} else if (++p - ue) {
|
||||
ret->query = estrndup(p, (ue-p));
|
||||
php_replace_controlchars_ex(ret->query, (ue - p));
|
||||
php_replace_controlchars(ret->query);
|
||||
}
|
||||
} else if ((p = memchr(s, '#', (ue - s)))) {
|
||||
} else if ((p = strchr(s, '#'))) {
|
||||
if (p - s) {
|
||||
ret->path = estrndup(s, (p-s));
|
||||
php_replace_controlchars_ex(ret->path, (p - s));
|
||||
php_replace_controlchars(ret->path);
|
||||
}
|
||||
|
||||
label_parse:
|
||||
@@ -289,11 +280,11 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length)
|
||||
|
||||
if (ue - p) {
|
||||
ret->fragment = estrndup(p, (ue-p));
|
||||
php_replace_controlchars_ex(ret->fragment, (ue - p));
|
||||
php_replace_controlchars(ret->fragment);
|
||||
}
|
||||
} else {
|
||||
ret->path = estrndup(s, (ue-s));
|
||||
php_replace_controlchars_ex(ret->path, (ue - s));
|
||||
php_replace_controlchars(ret->path);
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -312,7 +303,7 @@ PHP_FUNCTION(parse_url)
|
||||
return;
|
||||
}
|
||||
|
||||
resource = php_url_parse_ex(str, str_len);
|
||||
resource = php_url_parse(str);
|
||||
if (resource == NULL) {
|
||||
php_error_docref1(NULL TSRMLS_CC, str, E_WARNING, "Unable to parse url");
|
||||
RETURN_FALSE;
|
||||
|
||||
+1
-2
@@ -32,8 +32,7 @@ typedef struct php_url {
|
||||
} php_url;
|
||||
|
||||
PHPAPI void php_url_free(php_url *theurl);
|
||||
PHPAPI php_url *php_url_parse(char const *str);
|
||||
PHPAPI php_url *php_url_parse_ex(char const *str, int length);
|
||||
PHPAPI php_url *php_url_parse(char *str);
|
||||
PHPAPI int php_url_decode(char *str, int len); /* return value: length of decoded string */
|
||||
PHPAPI int php_raw_url_decode(char *str, int len); /* return value: length of decoded string */
|
||||
PHPAPI char *php_url_encode(char *s, int len, int *new_length);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Generated by re2c 0.5 on Thu Jul 22 21:53:53 2004 */
|
||||
#line 1 "/home/rei/php4/ext/standard/url_scanner_ex.re"
|
||||
/* Generated by re2c 0.5 on Wed Feb 11 11:33:22 2004 */
|
||||
#line 1 "/home/php4/ext/standard/url_scanner_ex.re"
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
@@ -917,31 +917,16 @@ static void php_url_scanner_output_handler(char *output, uint output_len, char *
|
||||
{
|
||||
size_t len;
|
||||
|
||||
if (BG(url_adapt_state_ex).url_app.len != 0) {
|
||||
*handled_output = url_adapt_ext(output, output_len, &len, (zend_bool) (mode & PHP_OUTPUT_HANDLER_END ? 1 : 0) TSRMLS_CC);
|
||||
if (BG(url_adapt_state_ex).url_app.len != 0) {
|
||||
*handled_output = url_adapt_ext(output, output_len, &len, (zend_bool) (mode & (PHP_OUTPUT_HANDLER_END|PHP_OUTPUT_HANDLER_CONT) ? 1 : 0) TSRMLS_CC);
|
||||
if (sizeof(uint) < sizeof(size_t)) {
|
||||
if (len > UINT_MAX)
|
||||
len = UINT_MAX;
|
||||
}
|
||||
*handled_output_len = len;
|
||||
} else if (BG(url_adapt_state_ex).url_app.len == 0) {
|
||||
url_adapt_state_ex_t *ctx = &BG(url_adapt_state_ex);
|
||||
if (ctx->buf.len) {
|
||||
smart_str_appendl(&ctx->result, ctx->buf.c, ctx->buf.len);
|
||||
smart_str_appendl(&ctx->result, output, output_len);
|
||||
|
||||
*handled_output = ctx->result.c;
|
||||
*handled_output_len = ctx->buf.len + output_len;
|
||||
|
||||
ctx->result.c = NULL;
|
||||
ctx->result.len = 0;
|
||||
smart_str_free(&ctx->buf);
|
||||
} else {
|
||||
*handled_output = NULL;
|
||||
}
|
||||
} else {
|
||||
*handled_output = NULL;
|
||||
}
|
||||
} else {
|
||||
*handled_output = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
int php_url_scanner_add_var(char *name, int name_len, char *value, int value_len, int urlencode TSRMLS_DC)
|
||||
|
||||
Loaded 100 of 160 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user