mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-14 04:30:50 +00:00
Compare commits
99
Commits
php-5.6.0
...
php-5.4.34
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
68e556fc00 | ||
|
|
287c91c1f0 | ||
|
|
ab0939e5e5 | ||
|
|
56754a7f9e | ||
|
|
88412772d2 | ||
|
|
82b07b62c0 | ||
|
|
26ff3a4c1e | ||
|
|
4e7b31a0db | ||
|
|
fcbe20d357 | ||
|
|
2711948d14 | ||
|
|
16e2d954fc | ||
|
|
28ed0119ac | ||
|
|
408b172017 | ||
|
|
e64da8c20d | ||
|
|
00525b824a | ||
|
|
2775dc2b44 | ||
|
|
372844918a | ||
|
|
f86b2193a4 | ||
|
|
99f0760bfb | ||
|
|
d2e1a04b10 | ||
|
|
582f42b8d4 | ||
|
|
592df89027 | ||
|
|
5e95b61639 | ||
|
|
fe551c089a | ||
|
|
53fa6c5b6b | ||
|
|
30aceaf1a7 | ||
|
|
197095c29e | ||
|
|
e665a07ab9 | ||
|
|
b206b0e29d | ||
|
|
ee275e34c8 | ||
|
|
32be79dcfa | ||
|
|
52f35b984c | ||
|
|
bda1cc6946 | ||
|
|
cb41a7bad1 | ||
|
|
437612f656 | ||
|
|
54fbbded37 | ||
|
|
9185cfd539 | ||
|
|
20941b71aa | ||
|
|
276bead9c4 | ||
|
|
359bc0ee2f | ||
|
|
cbe1597b74 | ||
|
|
5a7039035c | ||
|
|
eb2360602e | ||
|
|
88c48a4b95 | ||
|
|
2fefae4771 | ||
|
|
2b10db8e10 | ||
|
|
706aefb781 | ||
|
|
529da0f74c | ||
|
|
1504f7d630 | ||
|
|
3f42f2f5d1 | ||
|
|
0407bdf252 | ||
|
|
7bfe9bf951 | ||
|
|
7ba1409a1a | ||
|
|
35f32637b0 | ||
|
|
eab42649ab | ||
|
|
b7cd099ae0 | ||
|
|
ad492ca932 | ||
|
|
481c4715d4 | ||
|
|
4e2c01617f | ||
|
|
c044164a96 | ||
|
|
aeb633543b | ||
|
|
7311087cf0 | ||
|
|
1355ea60cc | ||
|
|
5e338836ff | ||
|
|
32314f6b67 | ||
|
|
babeca356b | ||
|
|
1847cf10c1 | ||
|
|
fd28010e20 | ||
|
|
990ecc12fc | ||
|
|
0fe07a0e74 | ||
|
|
1ffb7fddc2 | ||
|
|
c74efe1b2e | ||
|
|
b5051ff939 | ||
|
|
e2ba5c7987 | ||
|
|
8e9777a1f1 | ||
|
|
e644aad3f9 | ||
|
|
8ab4e2e90d | ||
|
|
b512adf78d | ||
|
|
2fe5bcbeb5 | ||
|
|
892def5f12 | ||
|
|
8d1d038509 | ||
|
|
6bd5a06894 | ||
|
|
ec002bd837 | ||
|
|
52de149ebc | ||
|
|
2326401fc1 | ||
|
|
7f527897fe | ||
|
|
d4b67896ec | ||
|
|
84605098bc | ||
|
|
ee1ab62763 | ||
|
|
d77ea459bd | ||
|
|
44be7b7f27 | ||
|
|
0335d2ef3e | ||
|
|
a0bb3fd679 | ||
|
|
eca037a51d | ||
|
|
f3230e3522 | ||
|
|
3c328f0984 | ||
|
|
d780c2a673 | ||
|
|
d400b74296 | ||
|
|
08334293f8 |
No files matched your search
@@ -385,6 +385,12 @@ MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 4.0.4
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: hash
|
||||
PRIMARY MAINTAINER: Sara Golemon <pollita@php.net>, Mike Wallner <mike@php.net>, Anatol Belski <ab@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 5.1.2
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: iconv
|
||||
PRIMARY MAINTAINER: Moriyoshi Koizumi <moriyoshi@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
|
||||
@@ -1,28 +1,78 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? 2014, PHP 5.4.33
|
||||
16 Oct 2014, PHP 5.4.34
|
||||
|
||||
- Fileinfo:
|
||||
. Fixed bug #66242 (libmagic: don't assume char is signed). (ArdB)
|
||||
|
||||
- Core:
|
||||
. Fixed bug #67985 (Incorrect last used array index copied to new array after
|
||||
unset). (Tjerk)
|
||||
. Fixed bug #68044 (Integer overflow in unserialize() (32-bits only)).
|
||||
(CVE-2014-3669) (Stas)
|
||||
|
||||
- cURL:
|
||||
. Fixed bug #68089 (NULL byte injection - cURL lib). (Stas)
|
||||
|
||||
- EXIF:
|
||||
. Fixed bug #68113 (Heap corruption in exif_thumbnail()). (CVE-2014-3670)
|
||||
(Stas)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #41631 (socket timeouts not honored in blocking SSL reads)
|
||||
(Daniel Lowrey).
|
||||
. Reverted fixes for bug #41631, due to regressions. (Stas)
|
||||
|
||||
- XMLRPC:
|
||||
. Fixed bug #68027 (Global buffer overflow in mkgmtime() function).
|
||||
(CVE-2014-3668) (Stas)
|
||||
|
||||
18 Sep 2014, PHP 5.4.33
|
||||
|
||||
- Core:
|
||||
. Fixed bug #47358 (glob returns error, should be empty array()). (Pierre)
|
||||
. Fixed bug #65463 (SIGSEGV during zend_shutdown()). (Keyur Govande)
|
||||
. Fixed bug #66036 (Crash on SIGTERM in apache process). (Keyur Govande)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #41631 (socket timeouts not honored in blocking SSL reads).
|
||||
(Daniel Lowrey)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #66091 (memory leaks in DateTime constructor) (Tjerk).
|
||||
. Fixed bug #66091 (memory leaks in DateTime constructor). (Tjerk)
|
||||
|
||||
?? ??? 2014, PHP 5.4.32
|
||||
- FPM:
|
||||
. Fixed #67606 (FPM with mod_fastcgi/apache2.4 is broken). (David Zuelke)
|
||||
|
||||
- GD:
|
||||
. Made fontFetch's path parser thread-safe. (Sara)
|
||||
|
||||
- Wddx:
|
||||
. Fixed bug #67873 (Segfaults in php_wddx_serialize_var). (Anatol, Remi)
|
||||
|
||||
- Zlib:
|
||||
. Fixed bug #67724 (chained zlib filters silently fail with large amounts of
|
||||
data). (Mike)
|
||||
. Fixed bug #67865 (internal corruption phar error). (Mike)
|
||||
|
||||
21 Aug 2014, PHP 5.4.32
|
||||
|
||||
- COM:
|
||||
. Fixed missing type checks in com_event_sink (Yussuf Khalil, Stas).
|
||||
. Fixed bug #41577 (DOTNET is successful once per server run)
|
||||
. Fixed missing type checks in com_event_sink. (Yussuf Khalil, Stas)
|
||||
. Fixed bug #41577 (DOTNET is successful once per server run).
|
||||
(Aidas Kasparas)
|
||||
|
||||
- Fileinfo:
|
||||
. Fixed bug #67705 (extensive backtracking in rule regular expression).
|
||||
(CVE-2014-3538) (Remi)
|
||||
. Fixed bug #67716 (Segfault in cdf.c). (CVE-2014-3587) (Remi)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #66901 (php-gd 'c_color' NULL pointer dereference).
|
||||
(CVE-2014-2497) (Remi)
|
||||
(CVE-2014-2497). (Remi)
|
||||
. Fixed bug #67730 (Null byte injection possible with imagexxx functions).
|
||||
(CVE-2014-5120) (Ryan Mauger)
|
||||
|
||||
- Network:
|
||||
. Fixed bug #67717 (segfault in dns_get_record). (CVE-2014-3597) (Remi)
|
||||
|
||||
- Milter:
|
||||
. Fixed bug #67715 (php-milter does not build and crashes randomly). (Mike)
|
||||
@@ -37,11 +87,11 @@ PHP NEWS
|
||||
with control-c). (Dmitry Saprykin, Johannes)
|
||||
|
||||
- Sessions:
|
||||
. Fixed missing type checks in php_session_create_id (Yussuf Khalil, Stas).
|
||||
. Fixed missing type checks in php_session_create_id. (Yussuf Khalil, Stas).
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #67539 (ArrayIterator use-after-free due to object change during
|
||||
sorting). (research at insighti dot org, Laruence)
|
||||
sorting). (CVE-2014-4698) (research at insighti dot org, Laruence)
|
||||
. Fixed bug #67538 (SPL Iterators use-after-free). (CVE-2014-4670) (Laruence)
|
||||
|
||||
- Core:
|
||||
@@ -51,9 +101,8 @@ PHP NEWS
|
||||
. Fixed bug #60616 (odbc_fetch_into returns junk data at end of multi-byte
|
||||
char fields). (Keyur)
|
||||
|
||||
- Zlib:
|
||||
. Fixed bug #67724 (chained zlib filters silently fail with large amounts of
|
||||
data). (Mike)
|
||||
- MySQLi:
|
||||
. Fixed bug #67839 (mysqli does not handle 4-byte floats correctly). (Keyur)
|
||||
|
||||
24 Jul 2014, PHP 5.4.31
|
||||
|
||||
|
||||
+8
-4
@@ -45,15 +45,16 @@ Currently we have the following branches in use::
|
||||
|
||||
master The active development branch.
|
||||
|
||||
PHP-5.6 Is used to release the PHP 5.6.x series. This is a current
|
||||
stable version and is open for bugfixes only.
|
||||
|
||||
PHP-5.5 Is used to release the PHP 5.5.x series. This is a current
|
||||
stable version and is open for bugfixes only.
|
||||
|
||||
PHP-5.4 Is used to release the PHP 5.4.x series. This is a current
|
||||
stable version and is open for bugfixes only.
|
||||
|
||||
PHP-5.3 Is used to release the PHP 5.3.x series. This is currently
|
||||
in extended support and open forsecurity fixes only. Triaged
|
||||
via security@php.net
|
||||
PHP-5.3 This branch is closed.
|
||||
|
||||
PHP-5.2 This branch is closed.
|
||||
|
||||
@@ -61,9 +62,12 @@ Currently we have the following branches in use::
|
||||
|
||||
PHP-4.4 This branch is closed.
|
||||
|
||||
PHP-X.Y.Z These branches are used for the release managers for tagging
|
||||
the releases, hence they are closed to the general public.
|
||||
|
||||
The next few rules are more of a technical nature::
|
||||
|
||||
1. All changes should first go to the lowest branch (i.e. 5.3) and then
|
||||
1. All changes should first go to the lowest branch (i.e. 5.4) and then
|
||||
get merged up to all other branches. If a change is not needed for
|
||||
later branches (i.e. fixes for features which where dropped from later
|
||||
branches) an empty merge should be done.
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #67985 - Last used array index not copied to new array at assignment
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$a = ['zero', 'one', 'two'];
|
||||
unset($a[2]);
|
||||
$b = $a;
|
||||
$a[] = 'three';
|
||||
$b[] = 'three';
|
||||
|
||||
var_dump($a === $b);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
+14
@@ -813,6 +813,20 @@ void zend_shutdown(TSRMLS_D) /* {{{ */
|
||||
zend_shutdown_timeout_thread();
|
||||
#endif
|
||||
zend_destroy_rsrc_list(&EG(persistent_list) TSRMLS_CC);
|
||||
|
||||
if (EG(active))
|
||||
{
|
||||
/*
|
||||
* The order of destruction is important here.
|
||||
* See bugs #65463 and 66036.
|
||||
*/
|
||||
zend_hash_reverse_apply(GLOBAL_FUNCTION_TABLE, (apply_func_t) zend_cleanup_function_data_full TSRMLS_CC);
|
||||
zend_hash_reverse_apply(GLOBAL_CLASS_TABLE, (apply_func_t) zend_cleanup_user_class_data TSRMLS_CC);
|
||||
zend_cleanup_internal_classes(TSRMLS_C);
|
||||
zend_hash_reverse_apply(GLOBAL_FUNCTION_TABLE, (apply_func_t) clean_non_persistent_function_full TSRMLS_CC);
|
||||
zend_hash_reverse_apply(GLOBAL_CLASS_TABLE, (apply_func_t) clean_non_persistent_class_full TSRMLS_CC);
|
||||
}
|
||||
|
||||
zend_destroy_modules();
|
||||
|
||||
zend_hash_destroy(GLOBAL_FUNCTION_TABLE);
|
||||
|
||||
@@ -639,6 +639,8 @@ ZEND_API void zend_cleanup_internal_class_data(zend_class_entry *ce TSRMLS_DC);
|
||||
ZEND_API void zend_cleanup_internal_classes(TSRMLS_D);
|
||||
ZEND_API int zend_cleanup_function_data(zend_function *function TSRMLS_DC);
|
||||
ZEND_API int zend_cleanup_function_data_full(zend_function *function TSRMLS_DC);
|
||||
ZEND_API int clean_non_persistent_function_full(zend_function *function TSRMLS_DC);
|
||||
ZEND_API int clean_non_persistent_class_full(zend_class_entry **ce TSRMLS_DC);
|
||||
|
||||
ZEND_API void destroy_zend_function(zend_function *function TSRMLS_DC);
|
||||
ZEND_API void zend_function_dtor(zend_function *function);
|
||||
|
||||
@@ -108,7 +108,7 @@ static int clean_non_persistent_function(zend_function *function TSRMLS_DC) /* {
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int clean_non_persistent_function_full(zend_function *function TSRMLS_DC) /* {{{ */
|
||||
ZEND_API int clean_non_persistent_function_full(zend_function *function TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
return (function->type == ZEND_INTERNAL_FUNCTION) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_REMOVE;
|
||||
}
|
||||
@@ -120,7 +120,7 @@ static int clean_non_persistent_class(zend_class_entry **ce TSRMLS_DC) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int clean_non_persistent_class_full(zend_class_entry **ce TSRMLS_DC) /* {{{ */
|
||||
ZEND_API int clean_non_persistent_class_full(zend_class_entry **ce TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
return ((*ce)->type == ZEND_INTERNAL_CLASS) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_REMOVE;
|
||||
}
|
||||
|
||||
@@ -136,6 +136,7 @@ ZEND_API void _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC)
|
||||
ALLOC_HASHTABLE_REL(tmp_ht);
|
||||
zend_hash_init(tmp_ht, zend_hash_num_elements(original_ht), NULL, ZVAL_PTR_DTOR, 0);
|
||||
zend_hash_copy(tmp_ht, original_ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
|
||||
tmp_ht->nNextFreeElement = original_ht->nNextFreeElement;
|
||||
zvalue->value.ht = tmp_ht;
|
||||
}
|
||||
break;
|
||||
|
||||
+1
-1
@@ -2800,7 +2800,7 @@ AC_DEFUN([PHP_DETECT_ICC],
|
||||
|
||||
dnl PHP_DETECT_SUNCC
|
||||
dnl Detect if the systems default compiler is suncc.
|
||||
dnl We also set some usefull CFLAGS if the user didn't set any
|
||||
dnl We also set some useful CFLAGS if the user didn't set any
|
||||
AC_DEFUN([PHP_DETECT_SUNCC],[
|
||||
SUNCC="no"
|
||||
AC_MSG_CHECKING([for suncc])
|
||||
|
||||
+2
-2
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=5
|
||||
PHP_MINOR_VERSION=4
|
||||
PHP_RELEASE_VERSION=33
|
||||
PHP_EXTRA_VERSION="-dev"
|
||||
PHP_RELEASE_VERSION=34
|
||||
PHP_EXTRA_VERSION=""
|
||||
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
|
||||
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
|
||||
|
||||
|
||||
@@ -170,6 +170,12 @@ static int php_curl_option_url(php_curl *ch, const char *url, const int len TSRM
|
||||
#if LIBCURL_VERSION_NUM < 0x071100
|
||||
char *copystr = NULL;
|
||||
#endif
|
||||
|
||||
if (strlen(url) != len) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Curl option contains invalid characters (\\0)");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Disable file:// if open_basedir are used */
|
||||
if (PG(open_basedir) && *PG(open_basedir)) {
|
||||
#if LIBCURL_VERSION_NUM >= 0x071304
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug #68089 (NULL byte injection - cURL lib)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
include 'skipif.inc';
|
||||
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$url = "file:///etc/passwd\0http://google.com";
|
||||
$ch = curl_init();
|
||||
var_dump(curl_setopt($ch, CURLOPT_URL, $url));
|
||||
?>
|
||||
Done
|
||||
--EXPECTF--
|
||||
Warning: curl_setopt(): Curl option contains invalid characters (\0) in %s/bug68089.php on line 4
|
||||
bool(false)
|
||||
Done
|
||||
+717
-730
File diff suppressed because it is too large.
Load diff
+1
-1
@@ -518,7 +518,7 @@ static HashTable* dom_get_debug_info_helper(zval *object, int *is_temp TSRMLS_DC
|
||||
value = null_value;
|
||||
} else if (Z_TYPE_P(value) == IS_OBJECT) {
|
||||
/* these are zvalues create on demand, with refcount and is_ref
|
||||
* status left in an uninitalized stated */
|
||||
* status left in an uninitialized stated */
|
||||
zval_dtor(value);
|
||||
efree(value);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ Test eregi() function : basic functionality - confirm case insensitivity
|
||||
*/
|
||||
|
||||
/*
|
||||
* Test basic funtionality of eregi()
|
||||
* Test basic functionality of eregi()
|
||||
*/
|
||||
|
||||
echo "*** Testing eregi() : basic functionality ***\n";
|
||||
|
||||
+2
-2
@@ -2426,11 +2426,11 @@ static void* exif_ifd_make_value(image_info_data *info_data, int motorola_intel
|
||||
data_ptr += 8;
|
||||
break;
|
||||
case TAG_FMT_SINGLE:
|
||||
memmove(data_ptr, &info_data->value.f, byte_count);
|
||||
memmove(data_ptr, &info_value->f, 4);
|
||||
data_ptr += 4;
|
||||
break;
|
||||
case TAG_FMT_DOUBLE:
|
||||
memmove(data_ptr, &info_data->value.d, byte_count);
|
||||
memmove(data_ptr, &info_value->d, 8);
|
||||
data_ptr += 8;
|
||||
break;
|
||||
}
|
||||
|
||||
Executable
BIN
Binary file not shown.
|
After Width: | Height: | Size: 368 B |
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #68113 (Heap corruption in exif_thumbnail())
|
||||
--SKIPIF--
|
||||
<?php
|
||||
extension_loaded("exif") or die("skip need exif");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(exif_thumbnail(__DIR__."/bug68113.jpg"));
|
||||
?>
|
||||
Done
|
||||
--EXPECTF--
|
||||
Warning: exif_thumbnail(bug68113.jpg): File structure corrupted in %s/bug68113.php on line 2
|
||||
|
||||
Warning: exif_thumbnail(bug68113.jpg): Invalid JPEG file in %s/bug68113.php on line 2
|
||||
bool(false)
|
||||
Done
|
||||
@@ -1269,7 +1269,7 @@ file_signextend(struct magic_set *ms, struct magic *m, uint64_t v)
|
||||
* the sign extension must have happened.
|
||||
*/
|
||||
case FILE_BYTE:
|
||||
v = (char) v;
|
||||
v = (signed char) v;
|
||||
break;
|
||||
case FILE_SHORT:
|
||||
case FILE_BESHORT:
|
||||
|
||||
@@ -820,7 +820,7 @@ cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h,
|
||||
q = (const uint8_t *)(const void *)
|
||||
((const char *)(const void *)p + ofs
|
||||
- 2 * sizeof(uint32_t));
|
||||
if (q > e) {
|
||||
if (q < p || q > e) {
|
||||
DPRINTF(("Ran of the end %p > %p\n", q, e));
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -124,6 +124,11 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
|
||||
RETURN_FALSE;
|
||||
}
|
||||
} else if (Z_TYPE_P(to_zval) == IS_STRING) {
|
||||
if (CHECK_ZVAL_NULL_PATH(to_zval)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid 2nd parameter, filename must not contain null bytes");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
stream = php_stream_open_wrapper(Z_STRVAL_P(to_zval), "wb", REPORT_ERRORS|IGNORE_PATH|IGNORE_URL_WIN, NULL);
|
||||
if (stream == NULL) {
|
||||
RETURN_FALSE;
|
||||
|
||||
+4
-2
@@ -370,9 +370,10 @@ static void *fontFetch (char **error, void *key)
|
||||
fontlist = gdEstrdup(a->fontlist);
|
||||
|
||||
/*
|
||||
* Must use gd_strtok_r else pointer corrupted by strtok in nested loop.
|
||||
* Must use gd_strtok_r becasuse strtok() isn't thread safe
|
||||
*/
|
||||
for (name = gd_strtok_r (fontlist, LISTSEPARATOR, &strtok_ptr); name; name = gd_strtok_r (0, LISTSEPARATOR, &strtok_ptr)) {
|
||||
char *strtok_ptr_path;
|
||||
/* make a fresh copy each time - strtok corrupts it. */
|
||||
path = gdEstrdup (fontsearchpath);
|
||||
|
||||
@@ -388,7 +389,8 @@ static void *fontFetch (char **error, void *key)
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (dir = strtok (path, PATHSEPARATOR); dir; dir = strtok (0, PATHSEPARATOR)) {
|
||||
for (dir = gd_strtok_r (path, PATHSEPARATOR, &strtok_ptr_path); dir;
|
||||
dir = gd_strtok_r (0, PATHSEPARATOR, &strtok_ptr_path)) {
|
||||
if (!strcmp(dir, ".")) {
|
||||
TSRMLS_FETCH();
|
||||
#if HAVE_GETCWD
|
||||
|
||||
@@ -20,6 +20,6 @@ echo '(' . $bbox[6] . ', ' . $bbox[7] . ")\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
(-1, 15)
|
||||
(156, 15)
|
||||
(156, -48)
|
||||
(15%d, 15)
|
||||
(15%d, -48)
|
||||
(-1, -48)
|
||||
@@ -0,0 +1,31 @@
|
||||
--TEST--
|
||||
Testing null byte injection in imagegd2
|
||||
--CLEAN--
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
rmdir($tempdir);
|
||||
--FILE--
|
||||
<?php
|
||||
$image = imagecreate(1,1);// 1px image
|
||||
|
||||
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
if (!file_exists($tempdir) && !is_dir($tempdir)) {
|
||||
mkdir ($tempdir, 0777, true);
|
||||
}
|
||||
|
||||
$userinput = "1\0"; // from post or get data
|
||||
$temp = $tempdir. "/test" . $userinput .".tmp";
|
||||
|
||||
echo "\nimagegd2 TEST\n";
|
||||
imagegd2($image, $temp);
|
||||
var_dump(file_exists($tempdir. "/test1"));
|
||||
var_dump(file_exists($tempdir. "/test1.tmp"));
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
|
||||
--EXPECTF--
|
||||
imagegd2 TEST
|
||||
|
||||
Warning: imagegd2() expects parameter 2 to be a valid path, string given in %s on line %d
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -0,0 +1,31 @@
|
||||
--TEST--
|
||||
Testing null byte injection in imagegd
|
||||
--CLEAN--
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
rmdir($tempdir);
|
||||
--FILE--
|
||||
<?php
|
||||
$image = imagecreate(1,1);// 1px image
|
||||
|
||||
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
if (!file_exists($tempdir) && !is_dir($tempdir)) {
|
||||
mkdir ($tempdir, 0777, true);
|
||||
}
|
||||
|
||||
$userinput = "1\0"; // from post or get data
|
||||
$temp = $tempdir. "/test" . $userinput .".tmp";
|
||||
|
||||
echo "\nimagegd TEST\n";
|
||||
imagegd($image, $temp);
|
||||
var_dump(file_exists($tempdir. "/test1"));
|
||||
var_dump(file_exists($tempdir. "/test1.tmp"));
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
|
||||
--EXPECTF--
|
||||
imagegd TEST
|
||||
|
||||
Warning: imagegd() expects parameter 2 to be a valid path, string given in %s on line %d
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -0,0 +1,38 @@
|
||||
--TEST--
|
||||
Testing null byte injection in imagegif
|
||||
--CLEAN--
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
rmdir($tempdir);
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$support = gd_info();
|
||||
if (!isset($support['GIF Create Support']) || $support['GIF Create Support'] === false) {
|
||||
print 'skip gif support not available';
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$image = imagecreate(1,1);// 1px image
|
||||
|
||||
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
if (!file_exists($tempdir) && !is_dir($tempdir)) {
|
||||
mkdir ($tempdir, 0777, true);
|
||||
}
|
||||
|
||||
$userinput = "1\0"; // from post or get data
|
||||
$temp = $tempdir. "/test" . $userinput .".tmp";
|
||||
|
||||
echo "\nimagegif TEST\n";
|
||||
imagegif($image, $temp);
|
||||
var_dump(file_exists($tempdir. "/test1"));
|
||||
var_dump(file_exists($tempdir. "/test1.tmp"));
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
|
||||
--EXPECTF--
|
||||
imagegif TEST
|
||||
|
||||
Warning: imagegif(): Invalid 2nd parameter, filename must not contain null bytes in %s on line %d
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -0,0 +1,38 @@
|
||||
--TEST--
|
||||
Testing null byte injection in imagejpeg
|
||||
--CLEAN--
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
rmdir($tempdir);
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$support = gd_info();
|
||||
if (!isset($support['JPEG Support']) || $support['JPEG Support'] === false) {
|
||||
print 'skip jpeg support not available';
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$image = imagecreate(1,1);// 1px image
|
||||
|
||||
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
if (!file_exists($tempdir) && !is_dir($tempdir)) {
|
||||
mkdir ($tempdir, 0777, true);
|
||||
}
|
||||
|
||||
$userinput = "1\0"; // from post or get data
|
||||
$temp = $tempdir. "/test" . $userinput .".tmp";
|
||||
|
||||
echo "\nimagejpeg TEST\n";
|
||||
imagejpeg($image, $temp);
|
||||
var_dump(file_exists($tempdir. "/test1"));
|
||||
var_dump(file_exists($tempdir. "/test1.tmp"));
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
|
||||
--EXPECTF--
|
||||
imagejpeg TEST
|
||||
|
||||
Warning: imagejpeg(): Invalid 2nd parameter, filename must not contain null bytes in %s on line %d
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -0,0 +1,38 @@
|
||||
--TEST--
|
||||
Testing null byte injection in imagepng
|
||||
--CLEAN--
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
rmdir($tempdir);
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$support = gd_info();
|
||||
if (!isset($support['PNG Support']) || $support['PNG Support'] === false) {
|
||||
print 'skip png support not available';
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$image = imagecreate(1,1);// 1px image
|
||||
|
||||
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
if (!file_exists($tempdir) && !is_dir($tempdir)) {
|
||||
mkdir ($tempdir, 0777, true);
|
||||
}
|
||||
|
||||
$userinput = "1\0"; // from post or get data
|
||||
$temp = $tempdir. "/test" . $userinput .".tmp";
|
||||
|
||||
echo "\nimagepng TEST\n";
|
||||
imagepng($image, $temp);
|
||||
var_dump(file_exists($tempdir. "/test1"));
|
||||
var_dump(file_exists($tempdir. "/test1.tmp"));
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
|
||||
--EXPECTF--
|
||||
imagepng TEST
|
||||
|
||||
Warning: imagepng(): Invalid 2nd parameter, filename must not contain null bytes in %s on line %d
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -0,0 +1,38 @@
|
||||
--TEST--
|
||||
Testing null byte injection in imagewbmp
|
||||
--CLEAN--
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
rmdir($tempdir);
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$support = gd_info();
|
||||
if (!isset($support['WBMP Support']) || $support['WBMP Support'] === false) {
|
||||
print 'skip wbmp support not available';
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$image = imagecreate(1,1);// 1px image
|
||||
|
||||
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
if (!file_exists($tempdir) && !is_dir($tempdir)) {
|
||||
mkdir ($tempdir, 0777, true);
|
||||
}
|
||||
|
||||
$userinput = "1\0"; // from post or get data
|
||||
$temp = $tempdir. "/test" . $userinput .".tmp";
|
||||
|
||||
echo "\nimagewbmp TEST\n";
|
||||
imagewbmp($image, $temp);
|
||||
var_dump(file_exists($tempdir. "/test1"));
|
||||
var_dump(file_exists($tempdir. "/test1.tmp"));
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
|
||||
--EXPECTF--
|
||||
imagewbmp TEST
|
||||
|
||||
Warning: imagewbmp(): Invalid 2nd parameter, filename must not contain null bytes in %s on line %d
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -0,0 +1,38 @@
|
||||
--TEST--
|
||||
Testing null byte injection in imagewebp
|
||||
--CLEAN--
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
rmdir($tempdir);
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$support = gd_info();
|
||||
if (!isset($support['WEBP Support']) || $support['WEBP Support'] === false) {
|
||||
print 'skip webp support not available';
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$image = imagecreate(1,1);// 1px image
|
||||
|
||||
|
||||
$tempdir = sys_get_temp_dir(). '/php-gdtest';
|
||||
if (!file_exists($tempdir) && !is_dir($tempdir)) {
|
||||
mkdir ($tempdir, 0777, true);
|
||||
}
|
||||
|
||||
$userinput = "1\0"; // from post or get data
|
||||
$temp = $tempdir. "/test" . $userinput .".tmp";
|
||||
|
||||
echo "\nimagewebp TEST\n";
|
||||
imagewebp($image, $temp);
|
||||
var_dump(file_exists($tempdir. "/test1"));
|
||||
var_dump(file_exists($tempdir. "/test1.tmp"));
|
||||
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
|
||||
|
||||
--EXPECTF--
|
||||
imagewbmp TEST
|
||||
|
||||
Warning: imagewebp(): Invalid 2nd parameter, filename must not contain null bytes in %s on line %d
|
||||
bool(false)
|
||||
bool(false)
|
||||
+1
-1
@@ -368,7 +368,7 @@ static int json_utf8_to_utf16(unsigned short *utf16, char utf8[], int len) /* {{
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* Only check if utf8 string is valid, and compute utf16 lenght */
|
||||
/* Only check if utf8 string is valid, and compute utf16 length */
|
||||
for (j=0 ; pos < len ; j++) {
|
||||
us = php_next_utf8_char((const unsigned char *)utf8, len, &pos, &status);
|
||||
if (status != SUCCESS) {
|
||||
|
||||
+21
-2
@@ -385,6 +385,23 @@ static int _get_lderrno(LDAP *ldap)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ _set_lderrno
|
||||
*/
|
||||
static void _set_lderrno(LDAP *ldap, int lderr)
|
||||
{
|
||||
#if !HAVE_NSLDAP
|
||||
#if LDAP_API_VERSION > 2000 || HAVE_ORALDAP
|
||||
/* New versions of OpenLDAP do it this way */
|
||||
ldap_set_option(ldap, LDAP_OPT_ERROR_NUMBER, &lderr);
|
||||
#else
|
||||
ldap->ld_errno = lderr;
|
||||
#endif
|
||||
#else
|
||||
ldap_set_lderrno(ldap, lderr, NULL, NULL);
|
||||
#endif
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto bool ldap_bind(resource link [, string dn [, string password]])
|
||||
Bind to LDAP directory */
|
||||
PHP_FUNCTION(ldap_bind)
|
||||
@@ -399,18 +416,20 @@ PHP_FUNCTION(ldap_bind)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, &link, -1, "ldap link", le_link);
|
||||
|
||||
if (ldap_bind_dn != NULL && memchr(ldap_bind_dn, '\0', ldap_bind_dnlen) != NULL) {
|
||||
_set_lderrno(ld->link, LDAP_INVALID_CREDENTIALS);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "DN contains a null byte");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (ldap_bind_pw != NULL && memchr(ldap_bind_pw, '\0', ldap_bind_pwlen) != NULL) {
|
||||
_set_lderrno(ld->link, LDAP_INVALID_CREDENTIALS);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Password contains a null byte");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, &link, -1, "ldap link", le_link);
|
||||
|
||||
if ((rc = ldap_bind_s(ld->link, ldap_bind_dn, ldap_bind_pw, LDAP_AUTH_SIMPLE)) != LDAP_SUCCESS) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to bind to server: %s", ldap_err2string(rc));
|
||||
RETURN_FALSE;
|
||||
|
||||
@@ -260,7 +260,7 @@ const mbfl_encoding *_php_mb_encoding_handler_ex(const php_mb_encoding_handler_i
|
||||
goto out;
|
||||
}
|
||||
|
||||
num = n; /* make sure to process initilized vars only */
|
||||
num = n; /* make sure to process initialized vars only */
|
||||
|
||||
/* initialize converter */
|
||||
if (info->num_from_encodings <= 0) {
|
||||
|
||||
@@ -62,18 +62,18 @@ mysqli_close($link);
|
||||
--EXPECT--
|
||||
array(7) {
|
||||
[0]=>
|
||||
float(3.14159274101)
|
||||
float(3.141593)
|
||||
[1]=>
|
||||
float(-9.99999997475E-7)
|
||||
float(-1.0E-6)
|
||||
[2]=>
|
||||
float(0)
|
||||
[3]=>
|
||||
float(999999995904)
|
||||
float(1.0E+12)
|
||||
[4]=>
|
||||
float(0.564642488956)
|
||||
float(0.5646425)
|
||||
[5]=>
|
||||
float(1)
|
||||
[6]=>
|
||||
float(8.88888914608E+14)
|
||||
float(8.888889E+14)
|
||||
}
|
||||
done!
|
||||
done!
|
||||
@@ -67,7 +67,7 @@ array(8) {
|
||||
[3]=>
|
||||
int(4999999)
|
||||
[4]=>
|
||||
float(2345.60009766)
|
||||
float(2345.6)
|
||||
[5]=>
|
||||
float(5678.89563)
|
||||
[6]=>
|
||||
@@ -75,4 +75,4 @@ array(8) {
|
||||
[7]=>
|
||||
%unicode|string%(11) "mysql rulez"
|
||||
}
|
||||
done!
|
||||
done!
|
||||
@@ -66,7 +66,7 @@ array(8) {
|
||||
[3]=>
|
||||
int(54)
|
||||
[4]=>
|
||||
float(2.59999990463)
|
||||
float(2.6)
|
||||
[5]=>
|
||||
float(58.89)
|
||||
[6]=>
|
||||
@@ -74,4 +74,4 @@ array(8) {
|
||||
[7]=>
|
||||
%unicode|string%(3) "6.7"
|
||||
}
|
||||
done!
|
||||
done!
|
||||
@@ -0,0 +1,58 @@
|
||||
--TEST--
|
||||
mysqli_float_handling - ensure 4 byte float is handled correctly
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
require_once('skipifemb.inc');
|
||||
require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require('connect.inc');
|
||||
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
|
||||
printf("[001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
die();
|
||||
}
|
||||
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test")) {
|
||||
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
die();
|
||||
}
|
||||
|
||||
if (!mysqli_query($link, "CREATE TABLE test(id INT PRIMARY KEY, fp4 FLOAT, fp8 DOUBLE) ENGINE = InnoDB")) {
|
||||
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
die();
|
||||
}
|
||||
|
||||
// Insert via string to make sure the real floating number gets to the DB
|
||||
if (!mysqli_query($link, "INSERT INTO test(id, fp4, fp8) VALUES (1, 9.9999, 9.9999)")) {
|
||||
printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
die();
|
||||
}
|
||||
|
||||
if (!($stmt = mysqli_prepare($link, "SELECT id, fp4, fp8 FROM test"))) {
|
||||
printf("[005] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
die();
|
||||
}
|
||||
|
||||
if (!mysqli_stmt_execute($stmt)) {
|
||||
printf("[006] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
die();
|
||||
}
|
||||
|
||||
|
||||
if (!($result = mysqli_stmt_get_result($stmt))) {
|
||||
printf("[007] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
die();
|
||||
}
|
||||
|
||||
$data = mysqli_fetch_assoc($result);
|
||||
print $data['id'] . ": " . $data['fp4'] . ": " . $data['fp8'] . "\n";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require_once("clean_table.inc");
|
||||
?>
|
||||
--EXPECTF--
|
||||
1: 9.9999: 9.9999
|
||||
@@ -41,6 +41,11 @@ require_once('skipifconnectfailure.inc');
|
||||
if (false !== ($tmp = mysqli_change_user($link, $user, $passwd, $db . '_unknown_really')))
|
||||
printf("[009] Expecting false, got %s/%s\n", gettype($tmp), $tmp);
|
||||
|
||||
// Reconnect because after 3 failed change_user attempts, the server blocks you off.
|
||||
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[006] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
|
||||
$host, $user, $db, $port, $socket);
|
||||
|
||||
if (!mysqli_query($link, 'SET @mysqli_change_user_test_var=1'))
|
||||
printf("[010] Failed to set test variable: [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
@@ -109,4 +114,4 @@ require_once('skipifconnectfailure.inc');
|
||||
print "done!";
|
||||
?>
|
||||
--EXPECTF--
|
||||
done!
|
||||
done!
|
||||
@@ -43,6 +43,11 @@ if (!$IS_MYSQLND && (mysqli_get_server_version($link) < 50118 && mysqli_get_serv
|
||||
if (false !== ($tmp = $mysqli->change_user($user, $passwd, $db . '_unknown_really')))
|
||||
printf("[008] Expecting false, got %s/%s\n", gettype($tmp), $tmp);
|
||||
|
||||
// Reconnect because after 3 failed change_user attempts, the server blocks you off.
|
||||
if (!$mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[001] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
|
||||
$host, $user, $db, $port, $socket);
|
||||
|
||||
if (!$mysqli->query('SET @mysqli_change_user_test_var=1'))
|
||||
printf("[009] Failed to set test variable: [%d] %s\n", $mysqli->errno, $mysqli->error);
|
||||
|
||||
@@ -81,4 +86,4 @@ if (!$IS_MYSQLND && (mysqli_get_server_version($link) < 50118 && mysqli_get_serv
|
||||
print "done!";
|
||||
?>
|
||||
--EXPECTF--
|
||||
done!
|
||||
done!
|
||||
@@ -36,7 +36,7 @@ $port, $socket, mysqli_connect_errno(), mysqli_connect_error());
|
||||
mysqli_error($link));
|
||||
}
|
||||
|
||||
if (!mysqli_query($link, 'CREATE TABLE test(id INT, label CHAR(1), PRIMARY
|
||||
if (!mysqli_query($link, 'CREATE TABLE test(id INT, label CHAR(3), PRIMARY
|
||||
KEY(id)) ENGINE=' . $engine . " DEFAULT CHARSET=gbk")) {
|
||||
printf("Failed to create test table: [%d] %s\n", mysqli_errno($link),
|
||||
mysqli_error($link));
|
||||
|
||||
@@ -12,6 +12,11 @@ if (!mysqli_query($link, 'DROP TABLE IF EXISTS test')) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (!mysqli_query($link, 'SET SESSION sql_mode=\'\'')) {
|
||||
printf("Failed to drop old test table: [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (!mysqli_query($link, 'CREATE TABLE test(id INT, label CHAR(1), PRIMARY KEY(id)) ENGINE=' . $engine)) {
|
||||
printf("Failed to create test table: [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
exit(1);
|
||||
@@ -20,4 +25,4 @@ if (!mysqli_query($link, 'CREATE TABLE test(id INT, label CHAR(1), PRIMARY KEY(i
|
||||
if (!mysqli_query($link, "INSERT INTO test(id, label) VALUES (1, 'a'), (2, 'b'), (3, 'c'), (4, 'd'), (5, 'e'), (6, 'f')")) {
|
||||
printf("[%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
}
|
||||
?>
|
||||
?>
|
||||
@@ -51,3 +51,29 @@ if test "$PHP_MYSQLND" != "no" || test "$PHP_MYSQLND_ENABLED" = "yes" || test "$
|
||||
#endif
|
||||
])
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl Check if the compiler supports Decimal32/64/128 types from the IEEE-754 2008 version
|
||||
dnl References: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1657.pdf
|
||||
dnl http://speleotrove.com/decimal/
|
||||
dnl
|
||||
AC_CACHE_CHECK([whether whether compiler supports Decimal32/64/128 types], ac_cv_decimal_fp_supported,[
|
||||
AC_TRY_RUN( [
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
typedef float dec32 __attribute__((mode(SD)));
|
||||
dec32 k = 99.49f;
|
||||
double d2 = (double)k;
|
||||
return 0;
|
||||
}
|
||||
],[
|
||||
ac_cv_decimal_fp_supported=yes
|
||||
],[
|
||||
ac_cv_decimal_fp_supported=no
|
||||
],[
|
||||
ac_cv_decimal_fp_supported=no
|
||||
])])
|
||||
if test "$ac_cv_decimal_fp_supported" = "yes"; then
|
||||
AC_DEFINE(HAVE_DECIMAL_FP_SUPPORT, 1, [Define if the compiler supports Decimal32/64/128 types.])
|
||||
fi
|
||||
@@ -195,12 +195,53 @@ void ps_fetch_float(zval *zv, const MYSQLND_FIELD * const field,
|
||||
unsigned int pack_len, zend_uchar **row,
|
||||
zend_bool as_unicode TSRMLS_DC)
|
||||
{
|
||||
float value;
|
||||
float fval;
|
||||
double dval;
|
||||
DBG_ENTER("ps_fetch_float");
|
||||
float4get(value, *row);
|
||||
ZVAL_DOUBLE(zv, value);
|
||||
float4get(fval, *row);
|
||||
(*row)+= 4;
|
||||
DBG_INF_FMT("value=%f", value);
|
||||
DBG_INF_FMT("value=%f", fval);
|
||||
|
||||
/*
|
||||
* The following is needed to correctly support 4-byte floats.
|
||||
* Otherwise, a value of 9.99 in a FLOAT column comes out of mysqli
|
||||
* as 9.9998998641968.
|
||||
*
|
||||
* For GCC, we use the built-in decimal support to "up-convert" a
|
||||
* 4-byte float to a 8-byte double.
|
||||
* When that is not available, we fall back to converting the float
|
||||
* to a string and then converting the string to a double. This mimics
|
||||
* what MySQL does.
|
||||
*/
|
||||
#ifdef HAVE_DECIMAL_FP_SUPPORT
|
||||
{
|
||||
typedef float dec32 __attribute__((mode(SD)));
|
||||
dec32 d32val = fval;
|
||||
|
||||
/* The following cast is guaranteed to do the right thing */
|
||||
dval = (double) d32val;
|
||||
}
|
||||
#else
|
||||
{
|
||||
char num_buf[2048]; /* Over allocated */
|
||||
char *s;
|
||||
|
||||
/* Convert to string. Ignoring localization, etc.
|
||||
* Following MySQL's rules. If precision is undefined (NOT_FIXED_DEC i.e. 31)
|
||||
* or larger than 31, the value is limited to 6 (FLT_DIG).
|
||||
*/
|
||||
s = php_gcvt(fval,
|
||||
field->decimals >= 31 ? 6 : field->decimals,
|
||||
'.',
|
||||
'e',
|
||||
num_buf);
|
||||
|
||||
/* And now convert back to double */
|
||||
dval = zend_strtod(s, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
ZVAL_DOUBLE(zv, dval);
|
||||
DBG_VOID_RETURN;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -1182,7 +1182,7 @@ MYSQLND_METHOD(mysqlnd_res, store_result_fetch_data)(MYSQLND_CONN_DATA * const c
|
||||
No need to FREE_ALLOCA as we can reuse the
|
||||
'lengths' and 'fields' arrays. For lengths its absolutely safe.
|
||||
'fields' is reused because the ownership of the strings has been
|
||||
transfered above.
|
||||
transferred above.
|
||||
*/
|
||||
}
|
||||
/* Overflow ? */
|
||||
|
||||
@@ -204,59 +204,13 @@ static size_t php_openssl_sockop_write(php_stream *stream, const char *buf, size
|
||||
return didwrite;
|
||||
}
|
||||
|
||||
static void php_openssl_stream_wait_for_data(php_netstream_data_t *sock)
|
||||
{
|
||||
int retval;
|
||||
struct timeval *ptimeout;
|
||||
|
||||
if (sock->socket == -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
sock->timeout_event = 0;
|
||||
|
||||
if (sock->timeout.tv_sec == -1)
|
||||
ptimeout = NULL;
|
||||
else
|
||||
ptimeout = &sock->timeout;
|
||||
|
||||
while(1) {
|
||||
retval = php_pollfd_for(sock->socket, PHP_POLLREADABLE, ptimeout);
|
||||
|
||||
if (retval == 0)
|
||||
sock->timeout_event = 1;
|
||||
|
||||
if (retval >= 0)
|
||||
break;
|
||||
|
||||
if (php_socket_errno() != EINTR)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static size_t php_openssl_sockop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
|
||||
{
|
||||
php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract;
|
||||
php_netstream_data_t *sock;
|
||||
int nr_bytes = 0;
|
||||
|
||||
if (sslsock->ssl_active) {
|
||||
int retry = 1;
|
||||
sock = (php_netstream_data_t*)stream->abstract;
|
||||
|
||||
/* The SSL_read() function will block indefinitely waiting for data on a blocking
|
||||
socket. If we don't poll for readability first this operation has the potential
|
||||
to hang forever. To avoid this scenario we poll with a timeout before performing
|
||||
the actual read. If it times out we're finished.
|
||||
*/
|
||||
if (sock->is_blocked) {
|
||||
php_openssl_stream_wait_for_data(sock);
|
||||
if (sock->timeout_event) {
|
||||
stream->eof = 1;
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSL read operation timed out");
|
||||
return nr_bytes;
|
||||
}
|
||||
}
|
||||
|
||||
do {
|
||||
nr_bytes = SSL_read(sslsock->ssl_handle, buf, count);
|
||||
|
||||
@@ -4935,7 +4935,7 @@ by an auxiliary program - but can then be edited by hand if required. There are
|
||||
now no calls to isalnum(), isspace(), isdigit(), isxdigit(), tolower() or
|
||||
toupper() in the code.
|
||||
|
||||
7. Turn the malloc/free funtions variables into pcre_malloc and pcre_free and
|
||||
7. Turn the malloc/free functions variables into pcre_malloc and pcre_free and
|
||||
make them global. Abolish the function for setting them, as the caller can now
|
||||
set them directly.
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
--TEST--
|
||||
Bug #62328 (implementing __toString and a cast to string fails)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once("skipif.inc");
|
||||
?>
|
||||
<?php if (!extension_loaded("simplexml")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
class UberSimpleXML extends SimpleXMLElement {
|
||||
@@ -373,7 +373,7 @@ class Interop_Client
|
||||
}
|
||||
$soap =& $endpoint_info['client'];
|
||||
|
||||
# XXX how do we determine a failure on retreiving/parsing wsdl?
|
||||
# XXX how do we determine a failure on retrieving/parsing wsdl?
|
||||
if ($soap->wsdl->fault) {
|
||||
$fault = $soap->wsdl->fault;
|
||||
$soap_test->setResult(0,'WSDL',
|
||||
|
||||
+1
-1
@@ -326,7 +326,7 @@ PHP_FUNCTION(spl_autoload)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (file_exts == NULL) { /* autoload_extensions is not intialzed, set to defaults */
|
||||
if (file_exts == NULL) { /* autoload_extensions is not initialized, set to defaults */
|
||||
copy = pos1 = estrndup(SPL_DEFAULT_FILE_EXTENSIONS, sizeof(SPL_DEFAULT_FILE_EXTENSIONS)-1);
|
||||
} else {
|
||||
copy = pos1 = estrndup(file_exts, file_exts_len);
|
||||
|
||||
+8
-3
@@ -491,13 +491,18 @@ PHP_FUNCTION(glob)
|
||||
/* now catch the FreeBSD style of "no matches" */
|
||||
if (!globbuf.gl_pathc || !globbuf.gl_pathv) {
|
||||
no_results:
|
||||
#ifndef PHP_WIN32
|
||||
/* Paths containing '*', '?' and some other chars are
|
||||
illegal on Windows but legit on other platforms. For
|
||||
this reason the direct basedir check against the glob
|
||||
query is senseless on windows. For instance while *.txt
|
||||
is a pretty valid filename on EXT3, it's invalid on NTFS. */
|
||||
if (PG(open_basedir) && *PG(open_basedir)) {
|
||||
struct stat s;
|
||||
|
||||
if (0 != VCWD_STAT(pattern, &s) || S_IFDIR != (s.st_mode & S_IFMT)) {
|
||||
if (php_check_open_basedir_ex(pattern, 0 TSRMLS_CC)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
array_init(return_value);
|
||||
return;
|
||||
}
|
||||
|
||||
+60
-24
@@ -412,8 +412,14 @@ PHP_FUNCTION(dns_check_record)
|
||||
|
||||
#if HAVE_FULL_DNS_FUNCS
|
||||
|
||||
#define CHECKCP(n) do { \
|
||||
if (cp + n > end) { \
|
||||
return NULL; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/* {{{ php_parserr */
|
||||
static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int store, int raw, zval **subarray)
|
||||
static u_char *php_parserr(u_char *cp, u_char *end, querybuf *answer, int type_to_fetch, int store, int raw, zval **subarray)
|
||||
{
|
||||
u_short type, class, dlen;
|
||||
u_long ttl;
|
||||
@@ -425,16 +431,18 @@ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int
|
||||
|
||||
*subarray = NULL;
|
||||
|
||||
n = dn_expand(answer->qb2, answer->qb2+65536, cp, name, sizeof(name) - 2);
|
||||
n = dn_expand(answer->qb2, end, cp, name, sizeof(name) - 2);
|
||||
if (n < 0) {
|
||||
return NULL;
|
||||
}
|
||||
cp += n;
|
||||
|
||||
CHECKCP(10);
|
||||
GETSHORT(type, cp);
|
||||
GETSHORT(class, cp);
|
||||
GETLONG(ttl, cp);
|
||||
GETSHORT(dlen, cp);
|
||||
CHECKCP(dlen);
|
||||
if (type_to_fetch != T_ANY && type != type_to_fetch) {
|
||||
cp += dlen;
|
||||
return cp;
|
||||
@@ -461,12 +469,14 @@ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int
|
||||
|
||||
switch (type) {
|
||||
case DNS_T_A:
|
||||
CHECKCP(4);
|
||||
add_assoc_string(*subarray, "type", "A", 1);
|
||||
snprintf(name, sizeof(name), "%d.%d.%d.%d", cp[0], cp[1], cp[2], cp[3]);
|
||||
add_assoc_string(*subarray, "ip", name, 1);
|
||||
cp += dlen;
|
||||
break;
|
||||
case DNS_T_MX:
|
||||
CHECKCP(2);
|
||||
add_assoc_string(*subarray, "type", "MX", 1);
|
||||
GETSHORT(n, cp);
|
||||
add_assoc_long(*subarray, "pri", n);
|
||||
@@ -485,7 +495,7 @@ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int
|
||||
if (type == DNS_T_PTR) {
|
||||
add_assoc_string(*subarray, "type", "PTR", 1);
|
||||
}
|
||||
n = dn_expand(answer->qb2, answer->qb2+65536, cp, name, (sizeof name) - 2);
|
||||
n = dn_expand(answer->qb2, end, cp, name, (sizeof name) - 2);
|
||||
if (n < 0) {
|
||||
return NULL;
|
||||
}
|
||||
@@ -495,18 +505,22 @@ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int
|
||||
case DNS_T_HINFO:
|
||||
/* See RFC 1010 for values */
|
||||
add_assoc_string(*subarray, "type", "HINFO", 1);
|
||||
CHECKCP(1);
|
||||
n = *cp & 0xFF;
|
||||
cp++;
|
||||
CHECKCP(n);
|
||||
add_assoc_stringl(*subarray, "cpu", (char*)cp, n, 1);
|
||||
cp += n;
|
||||
CHECKCP(1);
|
||||
n = *cp & 0xFF;
|
||||
cp++;
|
||||
CHECKCP(n);
|
||||
add_assoc_stringl(*subarray, "os", (char*)cp, n, 1);
|
||||
cp += n;
|
||||
break;
|
||||
case DNS_T_TXT:
|
||||
{
|
||||
int ll = 0;
|
||||
int l1 = 0, l2 = 0;
|
||||
zval *entries = NULL;
|
||||
|
||||
add_assoc_string(*subarray, "type", "TXT", 1);
|
||||
@@ -515,37 +529,41 @@ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int
|
||||
MAKE_STD_ZVAL(entries);
|
||||
array_init(entries);
|
||||
|
||||
while (ll < dlen) {
|
||||
n = cp[ll];
|
||||
if ((ll + n) >= dlen) {
|
||||
while (l1 < dlen) {
|
||||
n = cp[l1];
|
||||
if ((l1 + n) >= dlen) {
|
||||
// Invalid chunk length, truncate
|
||||
n = dlen - (ll + 1);
|
||||
n = dlen - (l1 + 1);
|
||||
}
|
||||
memcpy(tp + ll , cp + ll + 1, n);
|
||||
add_next_index_stringl(entries, cp + ll + 1, n, 1);
|
||||
ll = ll + n + 1;
|
||||
if (n) {
|
||||
memcpy(tp + l2 , cp + l1 + 1, n);
|
||||
add_next_index_stringl(entries, cp + l1 + 1, n, 1);
|
||||
}
|
||||
l1 = l1 + n + 1;
|
||||
l2 = l2 + n;
|
||||
}
|
||||
tp[dlen] = '\0';
|
||||
tp[l2] = '\0';
|
||||
cp += dlen;
|
||||
|
||||
add_assoc_stringl(*subarray, "txt", tp, (dlen>0)?dlen - 1:0, 0);
|
||||
add_assoc_stringl(*subarray, "txt", tp, l2, 0);
|
||||
add_assoc_zval(*subarray, "entries", entries);
|
||||
}
|
||||
break;
|
||||
case DNS_T_SOA:
|
||||
add_assoc_string(*subarray, "type", "SOA", 1);
|
||||
n = dn_expand(answer->qb2, answer->qb2+65536, cp, name, (sizeof name) -2);
|
||||
n = dn_expand(answer->qb2, end, cp, name, (sizeof name) -2);
|
||||
if (n < 0) {
|
||||
return NULL;
|
||||
}
|
||||
cp += n;
|
||||
add_assoc_string(*subarray, "mname", name, 1);
|
||||
n = dn_expand(answer->qb2, answer->qb2+65536, cp, name, (sizeof name) -2);
|
||||
n = dn_expand(answer->qb2, end, cp, name, (sizeof name) -2);
|
||||
if (n < 0) {
|
||||
return NULL;
|
||||
}
|
||||
cp += n;
|
||||
add_assoc_string(*subarray, "rname", name, 1);
|
||||
CHECKCP(5*4);
|
||||
GETLONG(n, cp);
|
||||
add_assoc_long(*subarray, "serial", n);
|
||||
GETLONG(n, cp);
|
||||
@@ -559,6 +577,7 @@ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int
|
||||
break;
|
||||
case DNS_T_AAAA:
|
||||
tp = (u_char*)name;
|
||||
CHECKCP(8*2);
|
||||
for(i=0; i < 8; i++) {
|
||||
GETSHORT(s, cp);
|
||||
if (s != 0) {
|
||||
@@ -593,6 +612,7 @@ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int
|
||||
case DNS_T_A6:
|
||||
p = cp;
|
||||
add_assoc_string(*subarray, "type", "A6", 1);
|
||||
CHECKCP(1);
|
||||
n = ((int)cp[0]) & 0xFF;
|
||||
cp++;
|
||||
add_assoc_long(*subarray, "masklen", n);
|
||||
@@ -628,6 +648,7 @@ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int
|
||||
cp++;
|
||||
}
|
||||
for (i = (n + 8) / 16; i < 8; i++) {
|
||||
CHECKCP(2);
|
||||
GETSHORT(s, cp);
|
||||
if (s != 0) {
|
||||
if (tp > (u_char *)name) {
|
||||
@@ -657,7 +678,7 @@ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int
|
||||
tp[0] = '\0';
|
||||
add_assoc_string(*subarray, "ipv6", name, 1);
|
||||
if (cp < p + dlen) {
|
||||
n = dn_expand(answer->qb2, answer->qb2+65536, cp, name, (sizeof name) - 2);
|
||||
n = dn_expand(answer->qb2, end, cp, name, (sizeof name) - 2);
|
||||
if (n < 0) {
|
||||
return NULL;
|
||||
}
|
||||
@@ -666,6 +687,7 @@ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int
|
||||
}
|
||||
break;
|
||||
case DNS_T_SRV:
|
||||
CHECKCP(3*2);
|
||||
add_assoc_string(*subarray, "type", "SRV", 1);
|
||||
GETSHORT(n, cp);
|
||||
add_assoc_long(*subarray, "pri", n);
|
||||
@@ -673,7 +695,7 @@ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int
|
||||
add_assoc_long(*subarray, "weight", n);
|
||||
GETSHORT(n, cp);
|
||||
add_assoc_long(*subarray, "port", n);
|
||||
n = dn_expand(answer->qb2, answer->qb2+65536, cp, name, (sizeof name) - 2);
|
||||
n = dn_expand(answer->qb2, end, cp, name, (sizeof name) - 2);
|
||||
if (n < 0) {
|
||||
return NULL;
|
||||
}
|
||||
@@ -681,21 +703,35 @@ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int
|
||||
add_assoc_string(*subarray, "target", name, 1);
|
||||
break;
|
||||
case DNS_T_NAPTR:
|
||||
CHECKCP(2*2);
|
||||
add_assoc_string(*subarray, "type", "NAPTR", 1);
|
||||
GETSHORT(n, cp);
|
||||
add_assoc_long(*subarray, "order", n);
|
||||
GETSHORT(n, cp);
|
||||
add_assoc_long(*subarray, "pref", n);
|
||||
|
||||
CHECKCP(1);
|
||||
n = (cp[0] & 0xFF);
|
||||
add_assoc_stringl(*subarray, "flags", (char*)++cp, n, 1);
|
||||
cp++;
|
||||
CHECKCP(n);
|
||||
add_assoc_stringl(*subarray, "flags", (char*)cp, n, 1);
|
||||
cp += n;
|
||||
|
||||
CHECKCP(1);
|
||||
n = (cp[0] & 0xFF);
|
||||
add_assoc_stringl(*subarray, "services", (char*)++cp, n, 1);
|
||||
cp++;
|
||||
CHECKCP(n);
|
||||
add_assoc_stringl(*subarray, "services", (char*)cp, n, 1);
|
||||
cp += n;
|
||||
|
||||
CHECKCP(1);
|
||||
n = (cp[0] & 0xFF);
|
||||
add_assoc_stringl(*subarray, "regex", (char*)++cp, n, 1);
|
||||
cp++;
|
||||
CHECKCP(n);
|
||||
add_assoc_stringl(*subarray, "regex", (char*)cp, n, 1);
|
||||
cp += n;
|
||||
n = dn_expand(answer->qb2, answer->qb2+65536, cp, name, (sizeof name) - 2);
|
||||
|
||||
n = dn_expand(answer->qb2, end, cp, name, (sizeof name) - 2);
|
||||
if (n < 0) {
|
||||
return NULL;
|
||||
}
|
||||
@@ -888,7 +924,7 @@ PHP_FUNCTION(dns_get_record)
|
||||
while (an-- && cp && cp < end) {
|
||||
zval *retval;
|
||||
|
||||
cp = php_parserr(cp, &answer, type_to_fetch, store_results, raw, &retval);
|
||||
cp = php_parserr(cp, end, &answer, type_to_fetch, store_results, raw, &retval);
|
||||
if (retval != NULL && store_results) {
|
||||
add_next_index_zval(return_value, retval);
|
||||
}
|
||||
@@ -901,7 +937,7 @@ PHP_FUNCTION(dns_get_record)
|
||||
while (ns-- > 0 && cp && cp < end) {
|
||||
zval *retval = NULL;
|
||||
|
||||
cp = php_parserr(cp, &answer, DNS_T_ANY, authns != NULL, raw, &retval);
|
||||
cp = php_parserr(cp, end, &answer, DNS_T_ANY, authns != NULL, raw, &retval);
|
||||
if (retval != NULL) {
|
||||
add_next_index_zval(authns, retval);
|
||||
}
|
||||
@@ -913,7 +949,7 @@ PHP_FUNCTION(dns_get_record)
|
||||
while (ar-- > 0 && cp && cp < end) {
|
||||
zval *retval = NULL;
|
||||
|
||||
cp = php_parserr(cp, &answer, DNS_T_ANY, 1, raw, &retval);
|
||||
cp = php_parserr(cp, end, &answer, DNS_T_ANY, 1, raw, &retval);
|
||||
if (retval != NULL) {
|
||||
add_next_index_zval(addtl, retval);
|
||||
}
|
||||
|
||||
@@ -5,15 +5,30 @@ Test glob() function: ensure no platform difference
|
||||
$path = dirname(__FILE__);
|
||||
|
||||
ini_set('open_basedir', NULL);
|
||||
var_dump(glob("$path/*.none"));
|
||||
|
||||
ini_set('open_basedir', $path);
|
||||
var_dump(glob("$path/*.none"));
|
||||
var_dump(glob("$path/?.none"));
|
||||
var_dump(glob("$path/*{hello,world}.none"));
|
||||
var_dump(glob("$path/*/nothere"));
|
||||
var_dump(glob("$path/[aoeu]*.none"));
|
||||
var_dump(glob("$path/directly_not_exists"));
|
||||
|
||||
$b = ini_get('open_basedir');
|
||||
var_dump(empty($b));
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
array(0) {
|
||||
}
|
||||
bool(false)
|
||||
array(0) {
|
||||
}
|
||||
array(0) {
|
||||
}
|
||||
array(0) {
|
||||
}
|
||||
array(0) {
|
||||
}
|
||||
array(0) {
|
||||
}
|
||||
bool(true)
|
||||
==DONE==
|
||||
@@ -0,0 +1,33 @@
|
||||
--TEST--
|
||||
Test glob() function: ensure no platform difference, variation 2
|
||||
--FILE--
|
||||
<?php
|
||||
$path = dirname(__FILE__);
|
||||
|
||||
ini_set('open_basedir', $path);
|
||||
|
||||
var_dump(glob("$path/*.none"));
|
||||
var_dump(glob("$path/?.none"));
|
||||
var_dump(glob("$path/*{hello,world}.none"));
|
||||
var_dump(glob("$path/*/nothere"));
|
||||
var_dump(glob("$path/[aoeu]*.none"));
|
||||
var_dump(glob("$path/directly_not_exists"));
|
||||
|
||||
var_dump($path == ini_get('open_basedir'));
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
array(0) {
|
||||
}
|
||||
array(0) {
|
||||
}
|
||||
array(0) {
|
||||
}
|
||||
array(0) {
|
||||
}
|
||||
array(0) {
|
||||
}
|
||||
array(0) {
|
||||
}
|
||||
bool(true)
|
||||
==DONE==
|
||||
@@ -0,0 +1,29 @@
|
||||
--TEST--
|
||||
Test glob() function: ensure no platform difference, variation 3
|
||||
--SKIPIF--
|
||||
<?php if( substr(PHP_OS, 0, 3) == "WIN" ) {die('skip not valid on Windows');} ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$path = dirname(__FILE__);
|
||||
|
||||
ini_set('open_basedir', '/tmp');
|
||||
|
||||
var_dump(glob("$path/*.none"));
|
||||
var_dump(glob("$path/?.none"));
|
||||
var_dump(glob("$path/*{hello,world}.none"));
|
||||
var_dump(glob("$path/*/nothere"));
|
||||
var_dump(glob("$path/[aoeu]*.none"));
|
||||
var_dump(glob("$path/directly_not_exists"));
|
||||
|
||||
var_dump('/tmp' == ini_get('open_basedir'));
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(true)
|
||||
==DONE==
|
||||
@@ -0,0 +1,35 @@
|
||||
--TEST--
|
||||
Test glob() function: ensure no platform difference, variation 4
|
||||
--SKIPIF--
|
||||
<?php if( substr(PHP_OS, 0, 3) != "WIN" ) {die('skip only valid on Windows');} ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$path = dirname(__FILE__);
|
||||
|
||||
ini_set('open_basedir', 'c:\\windows');
|
||||
|
||||
var_dump(glob("$path/*.none"));
|
||||
var_dump(glob("$path/?.none"));
|
||||
var_dump(glob("$path/*{hello,world}.none"));
|
||||
var_dump(glob("$path/*/nothere"));
|
||||
var_dump(glob("$path/[aoeu]*.none"));
|
||||
var_dump(glob("$path/directly_not_exists"));
|
||||
|
||||
var_dump('c:\\windows' == ini_get('open_basedir'));
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
array(0) {
|
||||
}
|
||||
array(0) {
|
||||
}
|
||||
array(0) {
|
||||
}
|
||||
array(0) {
|
||||
}
|
||||
array(0) {
|
||||
}
|
||||
array(0) {
|
||||
}
|
||||
bool(true)
|
||||
==DONE==
|
||||
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
Bug #68044 Integer overflow in unserialize() (32-bits only)
|
||||
--FILE--
|
||||
<?php
|
||||
echo unserialize('C:3:"XYZ":18446744075857035259:{}');
|
||||
?>
|
||||
===DONE==
|
||||
--EXPECTF--
|
||||
Warning: Insufficient data for unserializing - %d required, 1 present in %s/bug68044.php on line 2
|
||||
|
||||
Notice: unserialize(): Error at offset 32 of 33 bytes in %s/bug68044.php on line 2
|
||||
===DONE==
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Test dirname() function : basic funtionality
|
||||
Test dirname() function : basic functionality
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype: string dirname ( string $path );
|
||||
|
||||
+1
-1
@@ -266,7 +266,7 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length)
|
||||
p = s;
|
||||
} else {
|
||||
/* memrchr is a GNU specific extension
|
||||
Emulate for wide compatability */
|
||||
Emulate for wide compatibility */
|
||||
for(p = e; p >= s && *p != ':'; p--);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.13.5 on Sat Jun 21 21:27:56 2014 */
|
||||
/* Generated by re2c 0.13.5 */
|
||||
#line 1 "ext/standard/var_unserializer.re"
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
@@ -372,7 +372,7 @@ static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
|
||||
|
||||
(*p) += 2;
|
||||
|
||||
if (datalen < 0 || (*p) + datalen >= max) {
|
||||
if (datalen < 0 || (max - (*p)) <= datalen) {
|
||||
zend_error(E_WARNING, "Insufficient data for unserializing - %ld required, %ld present", datalen, (long)(max - (*p)));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -376,7 +376,7 @@ static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
|
||||
|
||||
(*p) += 2;
|
||||
|
||||
if (datalen < 0 || (*p) + datalen >= max) {
|
||||
if (datalen < 0 || (max - (*p)) <= datalen) {
|
||||
zend_error(E_WARNING, "Insufficient data for unserializing - %ld required, %ld present", datalen, (long)(max - (*p)));
|
||||
return 0;
|
||||
}
|
||||
|
||||
+4
-4
@@ -405,7 +405,7 @@ static void php_wddx_serialize_string(wddx_packet *packet, zval *var TSRMLS_DC)
|
||||
|
||||
if (Z_STRLEN_P(var) > 0) {
|
||||
char *buf;
|
||||
int buf_len;
|
||||
size_t buf_len;
|
||||
|
||||
buf = php_escape_html_entities(Z_STRVAL_P(var), Z_STRLEN_P(var), &buf_len, 0, ENT_QUOTES, NULL TSRMLS_CC);
|
||||
|
||||
@@ -626,12 +626,12 @@ static void php_wddx_serialize_array(wddx_packet *packet, zval *arr)
|
||||
*/
|
||||
void php_wddx_serialize_var(wddx_packet *packet, zval *var, char *name, int name_len TSRMLS_DC)
|
||||
{
|
||||
char *tmp_buf;
|
||||
char *name_esc;
|
||||
int name_esc_len;
|
||||
HashTable *ht;
|
||||
|
||||
if (name) {
|
||||
size_t name_esc_len;
|
||||
char *tmp_buf, *name_esc;
|
||||
|
||||
name_esc = php_escape_html_entities(name, name_len, &name_esc_len, 0, ENT_QUOTES, NULL TSRMLS_CC);
|
||||
tmp_buf = emalloc(name_esc_len + sizeof(WDDX_VAR_S));
|
||||
snprintf(tmp_buf, name_esc_len + sizeof(WDDX_VAR_S), WDDX_VAR_S, name_esc);
|
||||
|
||||
@@ -219,16 +219,19 @@ static int date_from_ISO8601 (const char *text, time_t * value) {
|
||||
n = 10;
|
||||
tm.tm_mon = 0;
|
||||
for(i = 0; i < 2; i++) {
|
||||
XMLRPC_IS_NUMBER(text[i])
|
||||
XMLRPC_IS_NUMBER(text[i+4])
|
||||
tm.tm_mon += (text[i+4]-'0')*n;
|
||||
n /= 10;
|
||||
}
|
||||
tm.tm_mon --;
|
||||
if(tm.tm_mon < 0 || tm.tm_mon > 11) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
n = 10;
|
||||
tm.tm_mday = 0;
|
||||
for(i = 0; i < 2; i++) {
|
||||
XMLRPC_IS_NUMBER(text[i])
|
||||
XMLRPC_IS_NUMBER(text[i+6])
|
||||
tm.tm_mday += (text[i+6]-'0')*n;
|
||||
n /= 10;
|
||||
}
|
||||
@@ -236,7 +239,7 @@ static int date_from_ISO8601 (const char *text, time_t * value) {
|
||||
n = 10;
|
||||
tm.tm_hour = 0;
|
||||
for(i = 0; i < 2; i++) {
|
||||
XMLRPC_IS_NUMBER(text[i])
|
||||
XMLRPC_IS_NUMBER(text[i+9])
|
||||
tm.tm_hour += (text[i+9]-'0')*n;
|
||||
n /= 10;
|
||||
}
|
||||
@@ -244,7 +247,7 @@ static int date_from_ISO8601 (const char *text, time_t * value) {
|
||||
n = 10;
|
||||
tm.tm_min = 0;
|
||||
for(i = 0; i < 2; i++) {
|
||||
XMLRPC_IS_NUMBER(text[i])
|
||||
XMLRPC_IS_NUMBER(text[i+12])
|
||||
tm.tm_min += (text[i+12]-'0')*n;
|
||||
n /= 10;
|
||||
}
|
||||
@@ -252,7 +255,7 @@ static int date_from_ISO8601 (const char *text, time_t * value) {
|
||||
n = 10;
|
||||
tm.tm_sec = 0;
|
||||
for(i = 0; i < 2; i++) {
|
||||
XMLRPC_IS_NUMBER(text[i])
|
||||
XMLRPC_IS_NUMBER(text[i+15])
|
||||
tm.tm_sec += (text[i+15]-'0')*n;
|
||||
n /= 10;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
--TEST--
|
||||
Bug #68027 (buffer overflow in mkgmtime() function)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("xmlrpc")) print "skip";
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$d = '6-01-01 20:00:00';
|
||||
xmlrpc_set_type($d, 'datetime');
|
||||
var_dump($d);
|
||||
$datetime = "2001-0-08T21:46:40-0400";
|
||||
$obj = xmlrpc_decode("<?xml version=\"1.0\"?><methodResponse><params><param><value><dateTime.iso8601>$datetime</dateTime.iso8601></value></param></params></methodResponse>");
|
||||
print_r($obj);
|
||||
|
||||
$datetime = "34770-0-08T21:46:40-0400";
|
||||
$obj = xmlrpc_decode("<?xml version=\"1.0\"?><methodResponse><params><param><value><dateTime.iso8601>$datetime</dateTime.iso8601></value></param></params></methodResponse>");
|
||||
print_r($obj);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(stdClass)#1 (3) {
|
||||
["scalar"]=>
|
||||
string(16) "6-01-01 20:00:00"
|
||||
["xmlrpc_type"]=>
|
||||
string(8) "datetime"
|
||||
["timestamp"]=>
|
||||
int(%d)
|
||||
}
|
||||
stdClass Object
|
||||
(
|
||||
[scalar] => 2001-0-08T21:46:40-0400
|
||||
[xmlrpc_type] => datetime
|
||||
[timestamp] => %s
|
||||
)
|
||||
stdClass Object
|
||||
(
|
||||
[scalar] => 34770-0-08T21:46:40-0400
|
||||
[xmlrpc_type] => datetime
|
||||
[timestamp] => %d
|
||||
)
|
||||
Done
|
||||
@@ -310,8 +310,7 @@ static php_stream_filter *php_zlib_filter_create(const char *filtername, zval *f
|
||||
|
||||
data->strm.zalloc = (alloc_func) php_zlib_alloc;
|
||||
data->strm.zfree = (free_func) php_zlib_free;
|
||||
data->strm.avail_out = data->outbuf_len = 0x8000;
|
||||
data->inbuf_len = 2048;
|
||||
data->strm.avail_out = data->outbuf_len = data->inbuf_len = 0x8000;
|
||||
data->strm.next_in = data->inbuf = (Bytef *) pemalloc(data->inbuf_len, persistent);
|
||||
if (!data->inbuf) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zd bytes", data->inbuf_len);
|
||||
|
||||
@@ -989,6 +989,7 @@ PHPAPI char *php_socket_strerror(long err, char *buf, size_t bufsize)
|
||||
buf = estrdup(errstr);
|
||||
} else {
|
||||
strncpy(buf, errstr, bufsize);
|
||||
buf[bufsize?(bufsize-1):0] = 0;
|
||||
}
|
||||
return buf;
|
||||
#else
|
||||
@@ -1013,6 +1014,7 @@ PHPAPI char *php_socket_strerror(long err, char *buf, size_t bufsize)
|
||||
buf = estrdup(sysbuf);
|
||||
} else {
|
||||
strncpy(buf, sysbuf, bufsize);
|
||||
buf[bufsize?(bufsize-1):0] = 0;
|
||||
}
|
||||
|
||||
if (free_it) {
|
||||
|
||||
@@ -301,6 +301,9 @@ PHPAPI size_t _php_stream_write(php_stream *stream, const char *buf, size_t coun
|
||||
#define php_stream_write_string(stream, str) _php_stream_write(stream, str, strlen(str) TSRMLS_CC)
|
||||
#define php_stream_write(stream, buf, count) _php_stream_write(stream, (buf), (count) TSRMLS_CC)
|
||||
|
||||
PHPAPI void _php_stream_fill_read_buffer(php_stream *stream, size_t size TSRMLS_DC);
|
||||
#define php_stream_fill_read_buffer(stream, size) _php_stream_fill_read_buffer((stream), (size) TSRMLS_CC)
|
||||
|
||||
#ifdef ZTS
|
||||
PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4);
|
||||
#else
|
||||
|
||||
+4
-4
@@ -2,8 +2,8 @@
|
||||
/* edit configure.in to change version number */
|
||||
#define PHP_MAJOR_VERSION 5
|
||||
#define PHP_MINOR_VERSION 4
|
||||
#define PHP_RELEASE_VERSION 33
|
||||
#define PHP_RELEASE_VERSION 34
|
||||
|
||||
#define PHP_EXTRA_VERSION "-dev"
|
||||
#define PHP_VERSION "5.4.33-dev"
|
||||
#define PHP_VERSION_ID 50433
|
||||
#define PHP_EXTRA_VERSION ""
|
||||
#define PHP_VERSION "5.4.34"
|
||||
#define PHP_VERSION_ID 50434
|
||||
@@ -573,7 +573,7 @@ fprintf(stderr, "stream_free: %s:%p[%s] preserve_handle=%d release_cast=%d remov
|
||||
|
||||
/* {{{ generic stream operations */
|
||||
|
||||
static void php_stream_fill_read_buffer(php_stream *stream, size_t size TSRMLS_DC)
|
||||
PHPAPI void _php_stream_fill_read_buffer(php_stream *stream, size_t size TSRMLS_DC)
|
||||
{
|
||||
/* allocate/fill the buffer */
|
||||
|
||||
@@ -741,7 +741,7 @@ PHPAPI size_t _php_stream_read(php_stream *stream, char *buf, size_t size TSRMLS
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
php_stream_fill_read_buffer(stream, size TSRMLS_CC);
|
||||
php_stream_fill_read_buffer(stream, size);
|
||||
|
||||
toread = stream->writepos - stream->readpos;
|
||||
if (toread > size) {
|
||||
@@ -977,7 +977,7 @@ PHPAPI char *_php_stream_get_line(php_stream *stream, char *buf, size_t maxlen,
|
||||
}
|
||||
}
|
||||
|
||||
php_stream_fill_read_buffer(stream, toread TSRMLS_CC);
|
||||
php_stream_fill_read_buffer(stream, toread);
|
||||
|
||||
if (stream->writepos - stream->readpos == 0) {
|
||||
break;
|
||||
@@ -1052,7 +1052,7 @@ PHPAPI char *php_stream_get_record(php_stream *stream, size_t maxlen, size_t *re
|
||||
|
||||
to_read_now = MIN(maxlen - buffered_len, stream->chunk_size);
|
||||
|
||||
php_stream_fill_read_buffer(stream, buffered_len + to_read_now TSRMLS_CC);
|
||||
php_stream_fill_read_buffer(stream, buffered_len + to_read_now);
|
||||
|
||||
just_read = STREAM_BUFFERED_AMOUNT(stream) - buffered_len;
|
||||
|
||||
|
||||
@@ -59,8 +59,6 @@ foreach ($codes as $key => $code) {
|
||||
|
||||
echo "\nDone\n";
|
||||
?>
|
||||
--XFAIL--
|
||||
https://bugs.php.net/bug.php?id=55496
|
||||
--EXPECTF--
|
||||
--------------
|
||||
Snippet no. 1:
|
||||
|
||||
@@ -1142,13 +1142,16 @@ static void init_request_info(TSRMLS_D)
|
||||
TRANSLATE_SLASHES(env_document_root);
|
||||
}
|
||||
|
||||
if (env_path_translated != NULL && env_redirect_url != NULL &&
|
||||
if (!apache_was_here && env_path_translated != NULL && env_redirect_url != NULL &&
|
||||
env_path_translated != script_path_translated &&
|
||||
strcmp(env_path_translated, script_path_translated) != 0) {
|
||||
/*
|
||||
* pretty much apache specific. If we have a redirect_url
|
||||
* then our script_filename and script_name point to the
|
||||
* php executable
|
||||
* we don't want to do this for the new mod_proxy_fcgi approach,
|
||||
* where redirect_url may also exist but the below will break
|
||||
* with rewrites to PATH_INFO, hence the !apache_was_here check
|
||||
*/
|
||||
script_path_translated = env_path_translated;
|
||||
/* we correct SCRIPT_NAME now in case we don't have PATH_INFO */
|
||||
@@ -1323,7 +1326,7 @@ static void init_request_info(TSRMLS_D)
|
||||
efree(pt);
|
||||
}
|
||||
} else {
|
||||
/* make sure path_info/translated are empty */
|
||||
/* make sure original values are remembered in ORIG_ copies if we've changed them */
|
||||
if (!orig_script_filename ||
|
||||
(script_path_translated != orig_script_filename &&
|
||||
strcmp(script_path_translated, orig_script_filename) != 0)) {
|
||||
@@ -1332,7 +1335,9 @@ static void init_request_info(TSRMLS_D)
|
||||
}
|
||||
script_path_translated = _sapi_cgibin_putenv("SCRIPT_FILENAME", script_path_translated TSRMLS_CC);
|
||||
}
|
||||
if (env_redirect_url) {
|
||||
if (!apache_was_here && env_redirect_url) {
|
||||
/* if we used PATH_TRANSLATED to work around Apache mod_fastcgi (but not mod_proxy_fcgi,
|
||||
* hence !apache_was_here) weirdness, strip info accordingly */
|
||||
if (orig_path_info) {
|
||||
_sapi_cgibin_putenv("ORIG_PATH_INFO", orig_path_info TSRMLS_CC);
|
||||
_sapi_cgibin_putenv("PATH_INFO", NULL TSRMLS_CC);
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
|
||||
#define SAPI_LSAPI_MAX_HEADER_LENGTH 2048
|
||||
|
||||
static int lsapi_mode = 1;
|
||||
static int lsapi_mode = 0;
|
||||
static char *php_self = "";
|
||||
static char *script_filename = "";
|
||||
static int source_highlight = 0;
|
||||
@@ -195,15 +195,22 @@ static char *sapi_lsapi_getenv( char * name, size_t name_len TSRMLS_DC )
|
||||
/* }}} */
|
||||
|
||||
|
||||
/*
|
||||
|
||||
|
||||
static int add_variable( const char * pKey, int keyLen, const char * pValue, int valLen,
|
||||
void * arg )
|
||||
{
|
||||
php_register_variable_safe((char *)pKey, (char *)pValue, valLen, (zval *)arg TSRMLS_CC);
|
||||
return 1;
|
||||
}
|
||||
*/
|
||||
int filter_arg = (arg == PG(http_globals)[TRACK_VARS_ENV])?PARSE_ENV:PARSE_SERVER;
|
||||
char * new_val = (char *) pValue;
|
||||
unsigned int new_val_len;
|
||||
|
||||
if (sapi_module.input_filter(filter_arg, (char *)pKey, &new_val, valLen, &new_val_len TSRMLS_CC)) {
|
||||
php_register_variable_safe((char *)pKey, new_val, new_val_len, (zval *)arg );
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
static int add_variable( const char * pKey, int keyLen, const char * pValue, int valLen,
|
||||
void * arg )
|
||||
{
|
||||
@@ -222,6 +229,55 @@ static int add_variable( const char * pKey, int keyLen, const char * pValue, int
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
*/
|
||||
|
||||
static void litespeed_php_import_environment_variables(zval *array_ptr TSRMLS_DC)
|
||||
{
|
||||
char buf[128];
|
||||
char **env, *p, *t = buf;
|
||||
size_t alloc_size = sizeof(buf);
|
||||
unsigned long nlen; /* ptrdiff_t is not portable */
|
||||
|
||||
if (PG(http_globals)[TRACK_VARS_ENV] &&
|
||||
array_ptr != PG(http_globals)[TRACK_VARS_ENV] &&
|
||||
Z_TYPE_P(PG(http_globals)[TRACK_VARS_ENV]) == IS_ARRAY &&
|
||||
zend_hash_num_elements(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_ENV])) > 0
|
||||
) {
|
||||
zval_dtor(array_ptr);
|
||||
*array_ptr = *PG(http_globals)[TRACK_VARS_ENV];
|
||||
INIT_PZVAL(array_ptr);
|
||||
zval_copy_ctor(array_ptr);
|
||||
return;
|
||||
} else if (PG(http_globals)[TRACK_VARS_SERVER] &&
|
||||
array_ptr != PG(http_globals)[TRACK_VARS_SERVER] &&
|
||||
Z_TYPE_P(PG(http_globals)[TRACK_VARS_SERVER]) == IS_ARRAY &&
|
||||
zend_hash_num_elements(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER])) > 0
|
||||
) {
|
||||
zval_dtor(array_ptr);
|
||||
*array_ptr = *PG(http_globals)[TRACK_VARS_SERVER];
|
||||
INIT_PZVAL(array_ptr);
|
||||
zval_copy_ctor(array_ptr);
|
||||
return;
|
||||
}
|
||||
|
||||
for (env = environ; env != NULL && *env != NULL; env++) {
|
||||
p = strchr(*env, '=');
|
||||
if (!p) { /* malformed entry? */
|
||||
continue;
|
||||
}
|
||||
nlen = p - *env;
|
||||
if (nlen >= alloc_size) {
|
||||
alloc_size = nlen + 64;
|
||||
t = (t == buf ? emalloc(alloc_size): erealloc(t, alloc_size));
|
||||
}
|
||||
memcpy(t, *env, nlen);
|
||||
t[nlen] = '\0';
|
||||
add_variable(t, nlen, p + 1, strlen( p + 1 ), array_ptr TSRMLS_CC);
|
||||
}
|
||||
if (t != buf && t != NULL) {
|
||||
efree(t);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if ((PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 4) || PHP_MAJOR_VERSION < 5)
|
||||
@@ -255,6 +311,8 @@ static void sapi_lsapi_register_variables(zval *track_vars_array TSRMLS_DC)
|
||||
if ( (SG(request_info).request_uri ) )
|
||||
php_self = (SG(request_info).request_uri );
|
||||
|
||||
litespeed_php_import_environment_variables(track_vars_array TSRMLS_CC);
|
||||
|
||||
#if ((PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 4) || PHP_MAJOR_VERSION < 5)
|
||||
if (!PG(magic_quotes_gpc)) {
|
||||
#endif
|
||||
@@ -268,7 +326,6 @@ static void sapi_lsapi_register_variables(zval *track_vars_array TSRMLS_DC)
|
||||
add_variable_magic_quote("PHP_SELF", 8, php_self, strlen( php_self ), track_vars_array );
|
||||
}
|
||||
#endif
|
||||
php_import_environment_variables(track_vars_array TSRMLS_CC);
|
||||
} else {
|
||||
php_import_environment_variables(track_vars_array TSRMLS_CC);
|
||||
|
||||
@@ -370,7 +427,7 @@ static void sapi_lsapi_log_message(char *message TSRMLS_DC)
|
||||
static sapi_module_struct lsapi_sapi_module =
|
||||
{
|
||||
"litespeed",
|
||||
"LiteSpeed V6.6",
|
||||
"LiteSpeed V6.7",
|
||||
|
||||
php_lsapi_startup, /* startup */
|
||||
php_module_shutdown_wrapper, /* shutdown */
|
||||
@@ -996,6 +1053,7 @@ int main( int argc, char * argv[] )
|
||||
LSAPI_Init();
|
||||
|
||||
LSAPI_Init_Env_Parameters( NULL );
|
||||
lsapi_mode = 1;
|
||||
|
||||
slow_script_msec = LSAPI_Get_Slow_Req_Msecs();
|
||||
|
||||
|
||||
@@ -1912,9 +1912,13 @@ int LSAPI_ForeachOrgHeader_r( LSAPI_Request * pReq,
|
||||
int ret;
|
||||
int count = 0;
|
||||
struct _headerInfo headers[512];
|
||||
|
||||
if ( !pReq || !fn )
|
||||
return -1;
|
||||
|
||||
|
||||
if ( !pReq->m_pHeaderIndex )
|
||||
return 0;
|
||||
|
||||
for( i = 0; i < H_TRANSFER_ENCODING; ++i )
|
||||
{
|
||||
if ( pReq->m_pHeaderIndex->m_headerOff[i] )
|
||||
|
||||
@@ -88,7 +88,7 @@ function mark_methods_as_tested($method_info, $phpt_files) {
|
||||
|
||||
foreach($tested_functions as $tested_function) {
|
||||
|
||||
// go through method info array marking this funtion as tested
|
||||
// go through method info array marking this function as tested
|
||||
foreach($method_info as &$current_method_record) {
|
||||
if (strcasecmp($tested_function, $current_method_record[METHOD_NAME]) == 0) {
|
||||
// matched the method name
|
||||
|
||||
@@ -52,7 +52,7 @@ $conf = array(
|
||||
|
||||
/* file extension of pages requested via http
|
||||
this allows for php to be configured to parse
|
||||
extensions other than php, usefull for multiple
|
||||
extensions other than php, useful for multiple
|
||||
configurations under a single webserver */
|
||||
'TEST_WEB_EXT' => 'php',
|
||||
|
||||
|
||||
@@ -1499,7 +1499,7 @@ function output_as_table(header, ar_out)
|
||||
{
|
||||
var l = header.length;
|
||||
var cols = 80;
|
||||
var fixedlenght = "";
|
||||
var fixedlength = "";
|
||||
var t = 0;
|
||||
var i,j,k,m;
|
||||
var out = "| ";
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
#endif
|
||||
|
||||
#define HOST_NAME_LEN 256
|
||||
#define MAX_APPNAME_LENGHT 100
|
||||
#define MAX_APPNAME_LENGTH 100
|
||||
#define MAIL_BUFFER_SIZE (1024*4) /* 4k buffer */
|
||||
/* Return values */
|
||||
#define MIN_ERROR_INDEX 0 /* Always 0 like SUCCESS */
|
||||
|
||||
Reference in new issue
Block a user