mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-26 10:25:41 +00:00
Compare commits
56
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4631611c44 | ||
|
|
0697a64f7e | ||
|
|
d6fcaf5da4 | ||
|
|
685708160e | ||
|
|
4a10037cb4 | ||
|
|
b5ce6df0da | ||
|
|
8eaaabdd58 | ||
|
|
2cab085bb3 | ||
|
|
00ba784a2c | ||
|
|
9690ded288 | ||
|
|
ee3227af48 | ||
|
|
c21e901ba7 | ||
|
|
7817fc07e1 | ||
|
|
be6d72b3a4 | ||
|
|
6d2bc72530 | ||
|
|
824cbc2781 | ||
|
|
7424bfc7ac | ||
|
|
848e24f24d | ||
|
|
2be27074b6 | ||
|
|
12a09183b3 | ||
|
|
d4bf0799b8 | ||
|
|
d4200ba6cf | ||
|
|
315b95b065 | ||
|
|
de58fb34c9 | ||
|
|
7f3bdda29b | ||
|
|
7b5f232b03 | ||
|
|
4b9db65f68 | ||
|
|
5941b30bb8 | ||
|
|
a29016d70d | ||
|
|
db8bf0a9e0 | ||
|
|
2d01a89ad1 | ||
|
|
8488c34fc6 | ||
|
|
73e43b6e19 | ||
|
|
c1962e900a | ||
|
|
0d022ddf03 | ||
|
|
3c4dd73c02 | ||
|
|
e304468e57 | ||
|
|
1ed5a2a54d | ||
|
|
62a2387a8d | ||
|
|
8bee0fbd37 | ||
|
|
07a4185df1 | ||
|
|
5018581410 | ||
|
|
14d231bd16 | ||
|
|
90a5d7c2ad | ||
|
|
1895bf7b94 | ||
|
|
e68acd031d | ||
|
|
e857dfa7cc | ||
|
|
69ba81d183 | ||
|
|
aa405b7da2 | ||
|
|
bf6873a18e | ||
|
|
1666cfcca0 | ||
|
|
773f980e00 | ||
|
|
5733f11ee9 | ||
|
|
1616363850 | ||
|
|
662083fc4f | ||
|
|
3f5c47af3b |
No files matched your search
@@ -1,11 +1,66 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? ????, PHP 7.3.24
|
||||
17 Dec 2020, PHP 7.3.26RC1
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #80457 (stream_get_contents() fails with maxlength=-1 or default).
|
||||
(bruno dot premont at restena dot lu)
|
||||
|
||||
26 Nov 2020, PHP 7.3.25
|
||||
|
||||
- Core:
|
||||
. Fixed bug #80280 (ADD_EXTENSION_DEP() fails for ext/standard and ext/date).
|
||||
(cmb)
|
||||
. Fixed bug #80258 (Windows Deduplication Enabled, randon permission errors).
|
||||
(cmb)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #62474 (com_event_sink crashes on certain arguments). (cmb)
|
||||
|
||||
- DOM:
|
||||
. Fixed bug #80268 (loadHTML() truncates at NUL bytes). (cmb)
|
||||
|
||||
- IMAP:
|
||||
. Fixed bug #64076 (imap_sort() does not return FALSE on failure). (cmb)
|
||||
. Fixed bug #76618 (segfault on imap_reopen). (girgias)
|
||||
. Fixed bug #80239 (imap_rfc822_write_address() leaks memory). (cmb)
|
||||
. Fixed minor regression caused by fixing bug #80220. (cmb)
|
||||
. Fixed bug #80242 (imap_mail_compose() segfaults for multipart with rfc822).
|
||||
(cmb)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #80310 (ext-intl with icu4c 68.1: use of undeclared identifier
|
||||
'TRUE'). (Alexander M. Turek)
|
||||
|
||||
- ODBC:
|
||||
. Fixed bug #44618 (Fetching may rely on uninitialized data). (cmb)
|
||||
|
||||
- SNMP:
|
||||
. Fixed bug #70461 (disable md5 code when it is not supported in net-snmp).
|
||||
(Alexander Bergmann, cmb)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #80266 (parse_url silently drops port number 0). (cmb, Nikita)
|
||||
|
||||
29 Oct 2020, PHP 7.3.24
|
||||
|
||||
- Core:
|
||||
. Fixed bug #79423 (copy command is limited to size of file it can copy).
|
||||
(cmb)
|
||||
|
||||
- Calendar:
|
||||
. Fixed bug #80185 (jdtounix() fails after 2037). (cmb)
|
||||
|
||||
- IMAP:
|
||||
. Fixed bug #80213 (imap_mail_compose() segfaults on certain $bodies). (cmb)
|
||||
. Fixed bug #80215 (imap_mail_compose() may modify by-val parameters). (cmb)
|
||||
. Fixed bug #80220 (imap_mail_compose() may leak memory). (cmb)
|
||||
. Fixed bug #80223 (imap_mail_compose() leaks envelope on malformed bodies).
|
||||
(cmb)
|
||||
. Fixed bug #80216 (imap_mail_compose() does not validate types/encodings).
|
||||
(cmb)
|
||||
. Fixed bug #80226 (imap_sort() leaks sortpgm memory). (cmb)
|
||||
|
||||
- MySQLnd:
|
||||
. Fixed bug #80115 (mysqlnd.debug doesn't recognize absolute paths with
|
||||
slashes). (cmb)
|
||||
@@ -18,6 +73,7 @@ PHP NEWS
|
||||
(cmb)
|
||||
. Fixed bug #80150 (Failure to fetch error message). (cmb)
|
||||
. Fixed bug #80152 (odbc_execute() moves internal pointer of $params). (cmb)
|
||||
. Fixed bug #46050 (odbc_next_result corrupts prepared resource). (cmb)
|
||||
|
||||
- OPcache:
|
||||
. Fixed bug #80083 (Optimizer pass 6 removes variables used for ibm_db2 data
|
||||
@@ -31,6 +87,9 @@ PHP NEWS
|
||||
. Fixed bug #76943 (Inconsistent stream_wrapper_restore() errors). (cmb)
|
||||
. Fixed bug #76735 (Incorrect message in fopen on invalid mode). (cmb)
|
||||
|
||||
- Tidy:
|
||||
. Fixed bug #77040 (tidyNode::isHtml() is completely broken). (cmb)
|
||||
|
||||
01 Oct 2020, PHP 7.3.23
|
||||
|
||||
- Core:
|
||||
@@ -60,7 +119,11 @@ PHP NEWS
|
||||
|
||||
- PDO:
|
||||
. Fixed bug #80027 (Terrible performance using $query->fetch on queries with
|
||||
many bind parameters (Matteo)
|
||||
many bind parameters). (Matteo)
|
||||
|
||||
- SOAP:
|
||||
. Fixed bug #47021 (SoapClient stumbles over WSDL delivered with
|
||||
"Transfer-Encoding: chunked"). (Matteo)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #79986 (str_ireplace bug with diacritics characters). (cmb)
|
||||
@@ -104,10 +167,6 @@ PHP NEWS
|
||||
. Fixed bug #64705 (errorInfo property of PDOException is null when
|
||||
PDO::__construct() fails). (Ahmed Abdou)
|
||||
|
||||
- SOAP:
|
||||
. Fixed bug #47021 (SoapClient stumbles over WSDL delivered with
|
||||
"Transfer-Encoding: chunked"). (Matteo)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #79930 (array_merge_recursive() crashes when called with array
|
||||
with single reference). (Nikita)
|
||||
|
||||
+5
-4
@@ -116,16 +116,16 @@ int main()
|
||||
double d = (double) LONG_MIN * LONG_MIN + 2e9;
|
||||
|
||||
if ((long) d == 2e9 && (long) -d == -2e9) {
|
||||
exit(0);
|
||||
return 0;
|
||||
}
|
||||
} else if (sizeof(long) == 8) {
|
||||
double correct = 18e18 - ((double) LONG_MIN * -2); /* Subtract ULONG_MAX + 1 */
|
||||
|
||||
if ((long) 18e18 == correct) { /* On 64-bit, only check between LONG_MAX and ULONG_MAX */
|
||||
exit(0);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
]])], [
|
||||
AC_DEFINE([ZEND_DVAL_TO_LVAL_CAST_OK], 1, [Define if double cast to long preserves least significant bits])
|
||||
@@ -249,7 +249,7 @@ int main()
|
||||
fprintf(fp, "%d %d\n", ZEND_MM_ALIGNMENT, zeros);
|
||||
fclose(fp);
|
||||
|
||||
exit(0);
|
||||
return 0;
|
||||
}
|
||||
]])], [
|
||||
LIBZEND_MM_ALIGN=`cat conftest.zend | cut -d ' ' -f 1`
|
||||
@@ -318,6 +318,7 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <sys/mman.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#ifndef MAP_ANON
|
||||
# ifdef MAP_ANONYMOUS
|
||||
# define MAP_ANON MAP_ANONYMOUS
|
||||
|
||||
+4
-1
@@ -63,7 +63,10 @@ dnl Check for broken sprintf()
|
||||
dnl
|
||||
AC_DEFUN([AC_ZEND_BROKEN_SPRINTF],[
|
||||
AC_CACHE_CHECK(whether sprintf is broken, ac_cv_broken_sprintf,[
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }]])],[
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <stdio.h>
|
||||
int main() {char buf[20]; return sprintf(buf,"testing 123")!=11; }
|
||||
]])],[
|
||||
ac_cv_broken_sprintf=no
|
||||
],[
|
||||
ac_cv_broken_sprintf=yes
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Array addition should not add INDIRECT elements
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$x = 1;
|
||||
$ary = ['y' => 1];
|
||||
$ary += $GLOBALS;
|
||||
var_dump($ary['x']);
|
||||
$x = 2;
|
||||
var_dump($ary['x']);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
int(1)
|
||||
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Add $GLOBALS to itself
|
||||
--FILE--
|
||||
<?php
|
||||
$GLOBALS += $GLOBALS;
|
||||
$x = $GLOBALS + $GLOBALS;
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
+1
-1
@@ -20,7 +20,7 @@
|
||||
#ifndef ZEND_H
|
||||
#define ZEND_H
|
||||
|
||||
#define ZEND_VERSION "3.3.24-dev"
|
||||
#define ZEND_VERSION "3.3.26RC1"
|
||||
|
||||
#define ZEND_ENGINE_3
|
||||
|
||||
|
||||
@@ -666,6 +666,7 @@ ZEND_API void zend_create_closure(zval *res, zend_function *func, zend_class_ent
|
||||
if (func->type == ZEND_USER_FUNCTION) {
|
||||
memcpy(&closure->func, func, sizeof(zend_op_array));
|
||||
closure->func.common.fn_flags |= ZEND_ACC_CLOSURE;
|
||||
closure->func.common.fn_flags &= ~ZEND_ACC_IMMUTABLE;
|
||||
if (closure->func.op_array.static_variables) {
|
||||
closure->func.op_array.static_variables =
|
||||
zend_array_dup(closure->func.op_array.static_variables);
|
||||
@@ -676,7 +677,9 @@ ZEND_API void zend_create_closure(zval *res, zend_function *func, zend_class_ent
|
||||
|| func->common.scope != scope
|
||||
|| (func->common.fn_flags & ZEND_ACC_NO_RT_ARENA)
|
||||
) {
|
||||
if (!func->op_array.run_time_cache && (func->common.fn_flags & ZEND_ACC_CLOSURE)) {
|
||||
if (!func->op_array.run_time_cache
|
||||
&& (func->common.fn_flags & ZEND_ACC_CLOSURE)
|
||||
&& !(func->common.fn_flags & ZEND_ACC_IMMUTABLE)) {
|
||||
/* If a real closure is used for the first time, we create a shared runtime cache
|
||||
* and remember which scope it is for. */
|
||||
func->common.scope = scope;
|
||||
|
||||
+17
-13
@@ -1999,7 +1999,7 @@ ZEND_API void ZEND_FASTCALL zend_hash_merge(HashTable *target, HashTable *source
|
||||
{
|
||||
uint32_t idx;
|
||||
Bucket *p;
|
||||
zval *t;
|
||||
zval *t, *s;
|
||||
|
||||
IS_CONSISTENT(source);
|
||||
IS_CONSISTENT(target);
|
||||
@@ -2008,18 +2008,20 @@ ZEND_API void ZEND_FASTCALL zend_hash_merge(HashTable *target, HashTable *source
|
||||
if (overwrite) {
|
||||
for (idx = 0; idx < source->nNumUsed; idx++) {
|
||||
p = source->arData + idx;
|
||||
if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue;
|
||||
if (UNEXPECTED(Z_TYPE(p->val) == IS_INDIRECT) &&
|
||||
UNEXPECTED(Z_TYPE_P(Z_INDIRECT(p->val)) == IS_UNDEF)) {
|
||||
continue;
|
||||
s = &p->val;
|
||||
if (UNEXPECTED(Z_TYPE_P(s) == IS_INDIRECT)) {
|
||||
s = Z_INDIRECT_P(s);
|
||||
}
|
||||
if (UNEXPECTED(Z_TYPE_P(s) == IS_UNDEF)) {
|
||||
continue;
|
||||
}
|
||||
if (p->key) {
|
||||
t = _zend_hash_add_or_update_i(target, p->key, &p->val, HASH_UPDATE | HASH_UPDATE_INDIRECT);
|
||||
t = _zend_hash_add_or_update_i(target, p->key, s, HASH_UPDATE | HASH_UPDATE_INDIRECT);
|
||||
if (pCopyConstructor) {
|
||||
pCopyConstructor(t);
|
||||
}
|
||||
} else {
|
||||
t = zend_hash_index_update(target, p->h, &p->val);
|
||||
t = zend_hash_index_update(target, p->h, s);
|
||||
if (pCopyConstructor) {
|
||||
pCopyConstructor(t);
|
||||
}
|
||||
@@ -2028,18 +2030,20 @@ ZEND_API void ZEND_FASTCALL zend_hash_merge(HashTable *target, HashTable *source
|
||||
} else {
|
||||
for (idx = 0; idx < source->nNumUsed; idx++) {
|
||||
p = source->arData + idx;
|
||||
if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue;
|
||||
if (UNEXPECTED(Z_TYPE(p->val) == IS_INDIRECT) &&
|
||||
UNEXPECTED(Z_TYPE_P(Z_INDIRECT(p->val)) == IS_UNDEF)) {
|
||||
continue;
|
||||
s = &p->val;
|
||||
if (UNEXPECTED(Z_TYPE_P(s) == IS_INDIRECT)) {
|
||||
s = Z_INDIRECT_P(s);
|
||||
}
|
||||
if (UNEXPECTED(Z_TYPE_P(s) == IS_UNDEF)) {
|
||||
continue;
|
||||
}
|
||||
if (p->key) {
|
||||
t = _zend_hash_add_or_update_i(target, p->key, &p->val, HASH_ADD | HASH_UPDATE_INDIRECT);
|
||||
t = _zend_hash_add_or_update_i(target, p->key, s, HASH_ADD | HASH_UPDATE_INDIRECT);
|
||||
if (t && pCopyConstructor) {
|
||||
pCopyConstructor(t);
|
||||
}
|
||||
} else {
|
||||
t = zend_hash_index_add(target, p->h, &p->val);
|
||||
t = zend_hash_index_add(target, p->h, s);
|
||||
if (t && pCopyConstructor) {
|
||||
pCopyConstructor(t);
|
||||
}
|
||||
|
||||
@@ -903,7 +903,7 @@ try_again:
|
||||
|
||||
static zend_never_inline void ZEND_FASTCALL add_function_array(zval *result, zval *op1, zval *op2) /* {{{ */
|
||||
{
|
||||
if ((result == op1) && (result == op2)) {
|
||||
if (result == op1 && Z_ARR_P(op1) == Z_ARR_P(op2)) {
|
||||
/* $a += $a */
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -747,6 +747,7 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim
|
||||
HANDLE hFind = INVALID_HANDLE_VALUE;
|
||||
ALLOCA_FLAG(use_heap_large)
|
||||
wchar_t *pathw = NULL;
|
||||
int may_retry_reparse_point;
|
||||
#define FREE_PATHW() \
|
||||
do { free(pathw); } while(0);
|
||||
|
||||
@@ -846,6 +847,7 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
retry_reparse_point:
|
||||
may_retry_reparse_point = 0;
|
||||
if (save) {
|
||||
pathw = php_win32_ioutil_any_to_w(path);
|
||||
if (!pathw) {
|
||||
@@ -940,6 +942,7 @@ retry_reparse_tag_cloud:
|
||||
CloseHandle(hLink);
|
||||
|
||||
if(pbuffer->ReparseTag == IO_REPARSE_TAG_SYMLINK) {
|
||||
may_retry_reparse_point = 1;
|
||||
reparsetarget = pbuffer->SymbolicLinkReparseBuffer.ReparseTarget;
|
||||
isabsolute = (pbuffer->SymbolicLinkReparseBuffer.Flags == 0) ? 1 : 0;
|
||||
#if VIRTUAL_CWD_DEBUG
|
||||
@@ -1076,7 +1079,7 @@ retry_reparse_tag_cloud:
|
||||
free_alloca(pbuffer, use_heap_large);
|
||||
free(substitutename);
|
||||
|
||||
{
|
||||
if (may_retry_reparse_point) {
|
||||
DWORD attrs;
|
||||
|
||||
FREE_PATHW()
|
||||
|
||||
@@ -7097,15 +7097,6 @@ ZEND_VM_HANDLER(153, ZEND_DECLARE_LAMBDA_FUNCTION, CONST, UNUSED)
|
||||
zfunc = zend_hash_find_ex(EG(function_table), Z_STR_P(RT_CONSTANT(opline, opline->op1)), 1);
|
||||
ZEND_ASSERT(zfunc != NULL && Z_FUNC_P(zfunc)->type == ZEND_USER_FUNCTION);
|
||||
|
||||
fbc = Z_PTR_P(zfunc);
|
||||
if (fbc->common.fn_flags & ZEND_ACC_IMMUTABLE) {
|
||||
zend_function *new_func = zend_arena_alloc(&CG(arena), sizeof(zend_op_array));
|
||||
|
||||
memcpy(new_func, fbc, sizeof(zend_op_array));
|
||||
new_func->common.fn_flags &= ~ZEND_ACC_IMMUTABLE;
|
||||
Z_PTR_P(zfunc) = fbc = new_func;
|
||||
}
|
||||
|
||||
if (Z_TYPE(EX(This)) == IS_OBJECT) {
|
||||
called_scope = Z_OBJCE(EX(This));
|
||||
if (UNEXPECTED((Z_FUNC_P(zfunc)->common.fn_flags & ZEND_ACC_STATIC) ||
|
||||
|
||||
@@ -9209,15 +9209,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DECLARE_LAMBDA_FUNCTION_SPEC_C
|
||||
zfunc = zend_hash_find_ex(EG(function_table), Z_STR_P(RT_CONSTANT(opline, opline->op1)), 1);
|
||||
ZEND_ASSERT(zfunc != NULL && Z_FUNC_P(zfunc)->type == ZEND_USER_FUNCTION);
|
||||
|
||||
fbc = Z_PTR_P(zfunc);
|
||||
if (fbc->common.fn_flags & ZEND_ACC_IMMUTABLE) {
|
||||
zend_function *new_func = zend_arena_alloc(&CG(arena), sizeof(zend_op_array));
|
||||
|
||||
memcpy(new_func, fbc, sizeof(zend_op_array));
|
||||
new_func->common.fn_flags &= ~ZEND_ACC_IMMUTABLE;
|
||||
Z_PTR_P(zfunc) = fbc = new_func;
|
||||
}
|
||||
|
||||
if (Z_TYPE(EX(This)) == IS_OBJECT) {
|
||||
called_scope = Z_OBJCE(EX(This));
|
||||
if (UNEXPECTED((Z_FUNC_P(zfunc)->common.fn_flags & ZEND_ACC_STATIC) ||
|
||||
|
||||
+22
-18
@@ -1209,14 +1209,14 @@ AC_DEFUN([PHP_DOES_PWRITE_WORK],[
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
$1
|
||||
main() {
|
||||
int main() {
|
||||
int fd = open("conftest_in", O_WRONLY|O_CREAT, 0600);
|
||||
|
||||
if (fd < 0) exit(1);
|
||||
if (pwrite(fd, "text", 4, 0) != 4) exit(1);
|
||||
if (fd < 0) return 1;
|
||||
if (pwrite(fd, "text", 4, 0) != 4) return 1;
|
||||
/* Linux glibc breakage until 2.2.5 */
|
||||
if (pwrite(fd, "text", 4, -1) != -1 || errno != EINVAL) exit(1);
|
||||
exit(0);
|
||||
if (pwrite(fd, "text", 4, -1) != -1 || errno != EINVAL) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
]])],[
|
||||
@@ -1239,14 +1239,14 @@ AC_DEFUN([PHP_DOES_PREAD_WORK],[
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
$1
|
||||
main() {
|
||||
int main() {
|
||||
char buf[3];
|
||||
int fd = open("conftest_in", O_RDONLY);
|
||||
if (fd < 0) exit(1);
|
||||
if (pread(fd, buf, 2, 0) != 2) exit(1);
|
||||
if (fd < 0) return 1;
|
||||
if (pread(fd, buf, 2, 0) != 2) return 1;
|
||||
/* Linux glibc breakage until 2.2.5 */
|
||||
if (pread(fd, buf, 2, -1) != -1 || errno != EINVAL) exit(1);
|
||||
exit(0);
|
||||
if (pread(fd, buf, 2, -1) != -1 || errno != EINVAL) return 1;
|
||||
return 0;
|
||||
}
|
||||
]])],[
|
||||
ac_cv_pread=yes
|
||||
@@ -1347,25 +1347,26 @@ AC_DEFUN([PHP_READDIR_R_TYPE],[
|
||||
#define _REENTRANT
|
||||
#include <sys/types.h>
|
||||
#include <dirent.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 1024
|
||||
#endif
|
||||
|
||||
main() {
|
||||
int main() {
|
||||
DIR *dir;
|
||||
char entry[sizeof(struct dirent)+PATH_MAX];
|
||||
struct dirent *pentry = (struct dirent *) &entry;
|
||||
|
||||
dir = opendir("/");
|
||||
if (!dir)
|
||||
exit(1);
|
||||
return 1;
|
||||
if (readdir_r(dir, (struct dirent *) entry, &pentry) == 0) {
|
||||
close(dir);
|
||||
exit(0);
|
||||
return 0;
|
||||
}
|
||||
close(dir);
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
]])],[
|
||||
ac_cv_what_readdir_r=POSIX
|
||||
@@ -1693,6 +1694,7 @@ AC_DEFUN([PHP_BROKEN_GLIBC_FOPEN_APPEND], [
|
||||
AC_CACHE_VAL(_cv_have_broken_glibc_fopen_append,[
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
FILE *fp;
|
||||
@@ -1702,7 +1704,7 @@ int main(int argc, char *argv[])
|
||||
fp = fopen(filename, "w");
|
||||
if (fp == NULL) {
|
||||
perror("fopen");
|
||||
exit(2);
|
||||
return 2;
|
||||
}
|
||||
fputs("foobar", fp);
|
||||
fclose(fp);
|
||||
@@ -1812,13 +1814,13 @@ int seeker(void *cookie, __off64_t *position, int whence)
|
||||
|
||||
cookie_io_functions_t funcs = {reader, writer, seeker, closer};
|
||||
|
||||
main() {
|
||||
int main() {
|
||||
struct cookiedata g = { 0 };
|
||||
FILE *fp = fopencookie(&g, "r", funcs);
|
||||
|
||||
if (fp && fseek(fp, 8192, SEEK_SET) == 0 && g.pos == 8192)
|
||||
exit(0);
|
||||
exit(1);
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
]])], [
|
||||
@@ -2252,6 +2254,8 @@ AC_DEFUN([PHP_SETUP_ICU],[
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
ICU_CFLAGS="$ICU_CFLAGS -DU_DEFINE_FALSE_AND_TRUE=1"
|
||||
])
|
||||
|
||||
dnl
|
||||
|
||||
Vendored
+1
-5
@@ -978,10 +978,6 @@ else
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" void exit (int);
|
||||
#endif
|
||||
|
||||
void fnord() { int i=42;}
|
||||
int main ()
|
||||
{
|
||||
@@ -997,7 +993,7 @@ int main ()
|
||||
else
|
||||
puts (dlerror ());
|
||||
|
||||
exit (status);
|
||||
return (status);
|
||||
}]
|
||||
EOF
|
||||
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
|
||||
|
||||
+8
-7
@@ -107,8 +107,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=7
|
||||
PHP_MINOR_VERSION=3
|
||||
PHP_RELEASE_VERSION=24
|
||||
PHP_EXTRA_VERSION="-dev"
|
||||
PHP_RELEASE_VERSION=26
|
||||
PHP_EXTRA_VERSION="RC1"
|
||||
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
|
||||
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
|
||||
|
||||
@@ -716,6 +716,7 @@ dnl Also check for working getaddrinfo
|
||||
AC_CACHE_CHECK([for getaddrinfo], ac_cv_func_getaddrinfo,
|
||||
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]],
|
||||
[[struct addrinfo *g,h;g=&h;getaddrinfo("","",g,&g);]])],[AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <string.h>
|
||||
#include <netdb.h>
|
||||
#include <sys/types.h>
|
||||
#ifndef AF_INET
|
||||
@@ -728,11 +729,11 @@ int main(void) {
|
||||
hints.ai_flags = AI_NUMERICHOST;
|
||||
|
||||
if (getaddrinfo("127.0.0.1", 0, &hints, &ai) < 0) {
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (ai == 0) {
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
pai = ai;
|
||||
@@ -740,16 +741,16 @@ int main(void) {
|
||||
while (pai) {
|
||||
if (pai->ai_family != AF_INET) {
|
||||
/* 127.0.0.1/NUMERICHOST should only resolve ONE way */
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
if (pai->ai_addr->sa_family != AF_INET) {
|
||||
/* 127.0.0.1/NUMERICHOST should only resolve ONE way */
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
pai = pai->ai_next;
|
||||
}
|
||||
freeaddrinfo(ai);
|
||||
exit(0);
|
||||
return 0;
|
||||
}
|
||||
]])],[ac_cv_func_getaddrinfo=yes], [ac_cv_func_getaddrinfo=no], [ac_cv_func_getaddrinfo=no])],
|
||||
[ac_cv_func_getaddrinfo=no])])
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
#include "sdncal.h"
|
||||
#include <time.h>
|
||||
|
||||
#define SECS_PER_DAY (24 * 3600)
|
||||
|
||||
/* {{{ proto int unixtojd([int timestamp])
|
||||
Convert UNIX timestamp to Julian Day */
|
||||
PHP_FUNCTION(unixtojd)
|
||||
@@ -62,11 +64,11 @@ PHP_FUNCTION(jdtounix)
|
||||
}
|
||||
uday -= 2440588 /* J.D. of 1.1.1970 */;
|
||||
|
||||
if (uday < 0 || uday > 24755) { /* before beginning of unix epoch or behind end of unix epoch */
|
||||
if (uday < 0 || uday > ZEND_LONG_MAX / SECS_PER_DAY) { /* before beginning of unix epoch or greater than representable */
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
RETURN_LONG(uday * 24 * 3600);
|
||||
RETURN_LONG(uday * SECS_PER_DAY);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #80185 (jdtounix() fails after 2037)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('calendar')) die('skip ext/calendar required');
|
||||
if (PHP_INT_SIZE != 8) die("skip for 64bit platforms only");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(jdtounix(2465712));
|
||||
var_dump(jdtounix(PHP_INT_MAX / 86400 + 2440588));
|
||||
var_dump(jdtounix(PHP_INT_MAX / 86400 + 2440589));
|
||||
?>
|
||||
--EXPECT--
|
||||
int(2170713600)
|
||||
int(9223372036854720000)
|
||||
bool(false)
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #80185 (jdtounix() fails after 2037)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('calendar')) die('skip ext/calendar required');
|
||||
if (PHP_INT_SIZE != 4) die("skip for 32bit platforms only");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(jdtounix(2465712));
|
||||
var_dump(jdtounix(PHP_INT_MAX / 86400 + 2440588));
|
||||
var_dump(jdtounix(PHP_INT_MAX / 86400 + 2440589));
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
int(2147472000)
|
||||
bool(false)
|
||||
@@ -267,18 +267,20 @@ ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj
|
||||
|
||||
if (obj) {
|
||||
if (dispname == NULL && sink) {
|
||||
IProvideClassInfo2 *pci2;
|
||||
IProvideClassInfo *pci;
|
||||
if (V_VT(&obj->v) == VT_DISPATCH) {
|
||||
IProvideClassInfo2 *pci2;
|
||||
IProvideClassInfo *pci;
|
||||
|
||||
if (SUCCEEDED(IDispatch_QueryInterface(V_DISPATCH(&obj->v), &IID_IProvideClassInfo2, (void**)&pci2))) {
|
||||
gotguid = SUCCEEDED(IProvideClassInfo2_GetGUID(pci2, GUIDKIND_DEFAULT_SOURCE_DISP_IID, &iid));
|
||||
IProvideClassInfo2_Release(pci2);
|
||||
}
|
||||
if (!gotguid && SUCCEEDED(IDispatch_QueryInterface(V_DISPATCH(&obj->v), &IID_IProvideClassInfo, (void**)&pci))) {
|
||||
/* examine the available interfaces */
|
||||
/* TODO: write some code here */
|
||||
php_error_docref(NULL, E_WARNING, "IProvideClassInfo: this code not yet written!");
|
||||
IProvideClassInfo_Release(pci);
|
||||
if (SUCCEEDED(IDispatch_QueryInterface(V_DISPATCH(&obj->v), &IID_IProvideClassInfo2, (void**)&pci2))) {
|
||||
gotguid = SUCCEEDED(IProvideClassInfo2_GetGUID(pci2, GUIDKIND_DEFAULT_SOURCE_DISP_IID, &iid));
|
||||
IProvideClassInfo2_Release(pci2);
|
||||
}
|
||||
if (!gotguid && SUCCEEDED(IDispatch_QueryInterface(V_DISPATCH(&obj->v), &IID_IProvideClassInfo, (void**)&pci))) {
|
||||
/* examine the available interfaces */
|
||||
/* TODO: write some code here */
|
||||
php_error_docref(NULL, E_WARNING, "IProvideClassInfo: this code not yet written!");
|
||||
IProvideClassInfo_Release(pci);
|
||||
}
|
||||
}
|
||||
} else if (dispname == NULL) {
|
||||
if (obj->typeinfo) {
|
||||
@@ -295,15 +297,17 @@ ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj
|
||||
/* get the library from the object; the rest will be dealt with later */
|
||||
ITypeInfo_GetContainingTypeLib(obj->typeinfo, &typelib, &idx);
|
||||
} else if (typelibname == NULL) {
|
||||
IDispatch_GetTypeInfo(V_DISPATCH(&obj->v), 0, LANG_NEUTRAL, &typeinfo);
|
||||
if (dispname) {
|
||||
unsigned int idx;
|
||||
/* get the library from the object; the rest will be dealt with later */
|
||||
ITypeInfo_GetContainingTypeLib(typeinfo, &typelib, &idx);
|
||||
if (V_VT(&obj->v) == VT_DISPATCH) {
|
||||
IDispatch_GetTypeInfo(V_DISPATCH(&obj->v), 0, LANG_NEUTRAL, &typeinfo);
|
||||
if (dispname) {
|
||||
unsigned int idx;
|
||||
/* get the library from the object; the rest will be dealt with later */
|
||||
ITypeInfo_GetContainingTypeLib(typeinfo, &typelib, &idx);
|
||||
|
||||
if (typelib) {
|
||||
ITypeInfo_Release(typeinfo);
|
||||
typeinfo = NULL;
|
||||
if (typelib) {
|
||||
ITypeInfo_Release(typeinfo);
|
||||
typeinfo = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Bug #62474 (com_event_sink crashes on certain arguments)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('com_dotnet')) die('skip com_dotnet extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(com_event_sink(new variant, function() {}, array()));
|
||||
var_dump(com_event_sink(new variant, new variant, 'a'));
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -1,6 +1,7 @@
|
||||
// vim:ft=javascript
|
||||
|
||||
EXTENSION("date", "php_date.c", false, "/Iext/date/lib /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 /DHAVE_TIMELIB_CONFIG_H=1");
|
||||
PHP_DATE = "yes";
|
||||
ADD_SOURCES("ext/date/lib", "astro.c timelib.c dow.c parse_date.c parse_tz.c tm2unixtime.c unixtime2tm.c parse_iso_intervals.c interval.c", "date");
|
||||
AC_DEFINE('HAVE_DATE', 1, 'Have date/time support');
|
||||
|
||||
|
||||
+795
-923
File diff suppressed because it is too large.
Load diff
@@ -4,7 +4,7 @@ Bug #48097 (date_timezone_set function produces wrong datetime result)
|
||||
date.timezone=UTC
|
||||
--FILE--
|
||||
<?php
|
||||
$d = date_create( "Mon, 23 May 1955 00:00:00 +0200" );
|
||||
$d = date_create( "Sun, 22 May 1955 02:00:00 +0200" );
|
||||
var_dump( $d );
|
||||
echo $d->format( DATE_ISO8601 ), "\n";
|
||||
echo $d->format( 'U' ), "\n\n";
|
||||
@@ -16,23 +16,23 @@ echo $d->format( 'U' ), "\n\n";
|
||||
--EXPECT--
|
||||
object(DateTime)#1 (3) {
|
||||
["date"]=>
|
||||
string(26) "1955-05-23 00:00:00.000000"
|
||||
string(26) "1955-05-22 02:00:00.000000"
|
||||
["timezone_type"]=>
|
||||
int(1)
|
||||
["timezone"]=>
|
||||
string(6) "+02:00"
|
||||
}
|
||||
1955-05-23T00:00:00+0200
|
||||
-461124000
|
||||
1955-05-22T02:00:00+0200
|
||||
-461203200
|
||||
|
||||
object(DateTime)#1 (3) {
|
||||
["date"]=>
|
||||
string(26) "1955-05-22 23:00:00.000000"
|
||||
string(26) "1955-05-22 01:00:00.000000"
|
||||
["timezone_type"]=>
|
||||
int(3)
|
||||
["timezone"]=>
|
||||
string(15) "Europe/Budapest"
|
||||
}
|
||||
1955-05-22T23:00:00+0100
|
||||
1955-05-22T01:00:00+0100
|
||||
|
||||
-461124000
|
||||
-461203200
|
||||
@@ -2024,7 +2024,6 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
|
||||
}
|
||||
ctxt = htmlCreateFileParserCtxt(source, NULL);
|
||||
} else {
|
||||
source_len = xmlStrlen((xmlChar *) source);
|
||||
if (ZEND_SIZE_T_INT_OVFL(source_len)) {
|
||||
php_error_docref(NULL, E_WARNING, "Input string is too long");
|
||||
RETURN_FALSE;
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Bug #80268 (loadHTML() truncates at NUL bytes)
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$doc = new DOMDocument;
|
||||
$doc->loadHTML("<p>foo\0bar</p>");
|
||||
$html = $doc->saveHTML();
|
||||
var_dump(strpos($html, '<p>foo</p>') !== false);
|
||||
|
||||
file_put_contents(__DIR__ . '/80268.html', "<p>foo\0bar</p>");
|
||||
$doc = new DOMDocument;
|
||||
$doc->loadHTMLFile(__DIR__ . '/80268.html');
|
||||
$html = $doc->saveHTML();
|
||||
var_dump(strpos($html, '<p>foo</p>') !== false);
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
unlink(__DIR__ . '/80268.html');
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(true)
|
||||
@@ -218,6 +218,7 @@ PHP_MINIT_FUNCTION(finfo)
|
||||
memcpy(&finfo_object_handlers, &std_object_handlers, sizeof(zend_object_handlers));
|
||||
finfo_object_handlers.offset = XtOffsetOf(finfo_object, zo);
|
||||
finfo_object_handlers.free_obj = finfo_objects_free;
|
||||
finfo_object_handlers.clone_obj = NULL;
|
||||
|
||||
le_fileinfo = zend_register_list_destructors_ex(finfo_resource_destructor, NULL, "file_info", module_number);
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
--TEST--
|
||||
Cloning and serializing finfo is not supported
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$finfo = new finfo;
|
||||
var_dump($finfo->buffer("Test string"));
|
||||
try {
|
||||
$finfo2 = clone $finfo;
|
||||
var_dump($finfo2->buffer("Test string"));
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
try {
|
||||
$finfo3 = unserialize(serialize($finfo));
|
||||
var_dump($finfo3->buffer("Test string"));
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(%d) "%s"
|
||||
Trying to clone an uncloneable object of class finfo
|
||||
|
||||
Warning: finfo::buffer(): The invalid fileinfo object. in %s on line %d
|
||||
bool(false)
|
||||
+2
-2
@@ -1155,7 +1155,7 @@ ZEND_FUNCTION(gmp_export)
|
||||
FETCH_GMP_ZVAL(gmpnumber, gmpnumber_arg, temp_a);
|
||||
|
||||
if (mpz_sgn(gmpnumber) == 0) {
|
||||
RETURN_EMPTY_STRING();
|
||||
RETVAL_EMPTY_STRING();
|
||||
} else {
|
||||
size_t bits_per_word = size * 8;
|
||||
size_t count = (mpz_sizeinbase(gmpnumber, 2) + bits_per_word - 1) / bits_per_word;
|
||||
@@ -1164,7 +1164,7 @@ ZEND_FUNCTION(gmp_export)
|
||||
mpz_export(ZSTR_VAL(out_string), NULL, order, size, endian, 0, gmpnumber);
|
||||
ZSTR_VAL(out_string)[ZSTR_LEN(out_string)] = '\0';
|
||||
|
||||
RETURN_NEW_STR(out_string);
|
||||
RETVAL_NEW_STR(out_string);
|
||||
}
|
||||
|
||||
FREE_GMP_TEMP(temp_a);
|
||||
|
||||
@@ -50,6 +50,9 @@ foreach ($export as $k => $test) {
|
||||
|
||||
var_dump($passed);
|
||||
|
||||
// Argument converted from int to GMP
|
||||
var_dump(bin2hex(gmp_export(0xff)));
|
||||
|
||||
// Invalid arguments (zpp failure)
|
||||
var_dump(gmp_export());
|
||||
|
||||
@@ -62,6 +65,7 @@ var_dump(gmp_export(123, 1, GMP_MSW_FIRST | GMP_LSW_FIRST));
|
||||
var_dump(gmp_export(123, 1, GMP_BIG_ENDIAN | GMP_LITTLE_ENDIAN));
|
||||
--EXPECTF--
|
||||
bool(true)
|
||||
string(2) "ff"
|
||||
|
||||
Warning: gmp_export() expects at least 1 parameter, 0 given in %s on line %d
|
||||
NULL
|
||||
|
||||
+1
-1
@@ -129,7 +129,7 @@ int main() {
|
||||
|
||||
int main() {
|
||||
iconv_t cd;
|
||||
cd = iconv_open( "*blahblah*", "*blahblah*" );
|
||||
cd = iconv_open( "*blahblah*", "*blahblahblah*" );
|
||||
if (cd == (iconv_t)(-1)) {
|
||||
if (errno == EINVAL) {
|
||||
return 0;
|
||||
|
||||
+68
-33
@@ -1315,7 +1315,7 @@ PHP_FUNCTION(imap_reopen)
|
||||
|
||||
imap_le_struct->imap_stream = mail_open(imap_le_struct->imap_stream, ZSTR_VAL(mailbox), flags);
|
||||
if (imap_le_struct->imap_stream == NIL) {
|
||||
zend_list_delete(Z_RES_P(streamind));
|
||||
zend_list_close(Z_RES_P(streamind));
|
||||
php_error_docref(NULL, E_WARNING, "Couldn't re-open stream");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -2692,8 +2692,9 @@ PHP_FUNCTION(imap_rfc822_write_address)
|
||||
if (string) {
|
||||
RETVAL_STR(string);
|
||||
} else {
|
||||
RETURN_FALSE;
|
||||
RETVAL_FALSE;
|
||||
}
|
||||
mail_free_address(&addr);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -3181,6 +3182,9 @@ PHP_FUNCTION(imap_sort)
|
||||
} else {
|
||||
spg = mail_newsearchpgm();
|
||||
}
|
||||
if (spg == NIL) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
mypgm = mail_newsortpgm();
|
||||
mypgm->reverse = rev;
|
||||
@@ -3189,6 +3193,7 @@ PHP_FUNCTION(imap_sort)
|
||||
|
||||
slst = mail_sort(imap_le_struct->imap_stream, (argc == 6 ? ZSTR_VAL(charset) : NIL), spg, mypgm, (argc >= 4 ? flags : NIL));
|
||||
|
||||
mail_free_sortpgm(&mypgm);
|
||||
if (spg && !(flags & SE_FREE)) {
|
||||
mail_free_searchpgm(&spg);
|
||||
}
|
||||
@@ -3544,7 +3549,7 @@ PHP_FUNCTION(imap_mail_compose)
|
||||
int toppart = 0;
|
||||
int first;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "aa", &envelope, &body) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/a/", &envelope, &body) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3602,6 +3607,7 @@ PHP_FUNCTION(imap_mail_compose)
|
||||
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(envelope), "custom_headers", sizeof("custom_headers") - 1)) != NULL) {
|
||||
if (Z_TYPE_P(pvalue) == IS_ARRAY) {
|
||||
custom_headers_param = tmp_param = NULL;
|
||||
SEPARATE_ARRAY(pvalue);
|
||||
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(pvalue), env_data) {
|
||||
custom_headers_param = mail_newbody_parameter();
|
||||
convert_to_string_ex(env_data);
|
||||
@@ -3621,17 +3627,25 @@ PHP_FUNCTION(imap_mail_compose)
|
||||
|
||||
if (Z_TYPE_P(data) != IS_ARRAY) {
|
||||
php_error_docref(NULL, E_WARNING, "body parameter must be a non-empty array");
|
||||
RETURN_FALSE;
|
||||
RETVAL_FALSE;
|
||||
goto done;
|
||||
}
|
||||
SEPARATE_ARRAY(data);
|
||||
|
||||
bod = mail_newbody();
|
||||
topbod = bod;
|
||||
|
||||
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "type", sizeof("type") - 1)) != NULL) {
|
||||
bod->type = (short) zval_get_long(pvalue);
|
||||
zend_long type = zval_get_long(pvalue);
|
||||
if (type >= 0 && type <= TYPEMAX && body_types[type] != NULL) {
|
||||
bod->type = (short) type;
|
||||
}
|
||||
}
|
||||
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "encoding", sizeof("encoding") - 1)) != NULL) {
|
||||
bod->encoding = (short) zval_get_long(pvalue);
|
||||
zend_long encoding = zval_get_long(pvalue);
|
||||
if (encoding >= 0 && encoding <= ENCMAX && body_encodings[encoding] != NULL) {
|
||||
bod->encoding = (short) encoding;
|
||||
}
|
||||
}
|
||||
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "charset", sizeof("charset") - 1)) != NULL) {
|
||||
convert_to_string_ex(pvalue);
|
||||
@@ -3644,7 +3658,9 @@ PHP_FUNCTION(imap_mail_compose)
|
||||
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "type.parameters", sizeof("type.parameters") - 1)) != NULL) {
|
||||
if(Z_TYPE_P(pvalue) == IS_ARRAY) {
|
||||
disp_param = tmp_param = NULL;
|
||||
SEPARATE_ARRAY(pvalue);
|
||||
ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(pvalue), key, disp_data) {
|
||||
if (key == NULL) continue;
|
||||
disp_param = mail_newbody_parameter();
|
||||
disp_param->attribute = cpystr(ZSTR_VAL(key));
|
||||
convert_to_string_ex(disp_data);
|
||||
@@ -3676,7 +3692,9 @@ PHP_FUNCTION(imap_mail_compose)
|
||||
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "disposition", sizeof("disposition") - 1)) != NULL) {
|
||||
if (Z_TYPE_P(pvalue) == IS_ARRAY) {
|
||||
disp_param = tmp_param = NULL;
|
||||
SEPARATE_ARRAY(pvalue);
|
||||
ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(pvalue), key, disp_data) {
|
||||
if (key == NULL) continue;
|
||||
disp_param = mail_newbody_parameter();
|
||||
disp_param->attribute = cpystr(ZSTR_VAL(key));
|
||||
convert_to_string_ex(disp_data);
|
||||
@@ -3688,15 +3706,19 @@ PHP_FUNCTION(imap_mail_compose)
|
||||
bod->disposition.parameter = disp_param;
|
||||
}
|
||||
}
|
||||
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "contents.data", sizeof("contents.data") - 1)) != NULL) {
|
||||
convert_to_string_ex(pvalue);
|
||||
bod->contents.text.data = fs_get(Z_STRLEN_P(pvalue) + 1);
|
||||
memcpy(bod->contents.text.data, Z_STRVAL_P(pvalue), Z_STRLEN_P(pvalue)+1);
|
||||
bod->contents.text.size = Z_STRLEN_P(pvalue);
|
||||
if (bod->type == TYPEMESSAGE && bod->subtype && !strcmp(bod->subtype, "RFC822")) {
|
||||
bod->nested.msg = mail_newmsg();
|
||||
} else {
|
||||
bod->contents.text.data = fs_get(1);
|
||||
memcpy(bod->contents.text.data, "", 1);
|
||||
bod->contents.text.size = 0;
|
||||
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "contents.data", sizeof("contents.data") - 1)) != NULL) {
|
||||
convert_to_string_ex(pvalue);
|
||||
bod->contents.text.data = fs_get(Z_STRLEN_P(pvalue) + 1);
|
||||
memcpy(bod->contents.text.data, Z_STRVAL_P(pvalue), Z_STRLEN_P(pvalue)+1);
|
||||
bod->contents.text.size = Z_STRLEN_P(pvalue);
|
||||
} else {
|
||||
bod->contents.text.data = fs_get(1);
|
||||
memcpy(bod->contents.text.data, "", 1);
|
||||
bod->contents.text.size = 0;
|
||||
}
|
||||
}
|
||||
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "lines", sizeof("lines") - 1)) != NULL) {
|
||||
bod->size.lines = zval_get_long(pvalue);
|
||||
@@ -3708,10 +3730,14 @@ PHP_FUNCTION(imap_mail_compose)
|
||||
convert_to_string_ex(pvalue);
|
||||
bod->md5 = cpystr(Z_STRVAL_P(pvalue));
|
||||
}
|
||||
} else if (Z_TYPE_P(data) == IS_ARRAY) {
|
||||
short type = -1;
|
||||
} else if (Z_TYPE_P(data) == IS_ARRAY && topbod->type == TYPEMULTIPART) {
|
||||
short type = 0;
|
||||
SEPARATE_ARRAY(data);
|
||||
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "type", sizeof("type") - 1)) != NULL) {
|
||||
type = (short) zval_get_long(pvalue);
|
||||
zend_long tmp_type = zval_get_long(pvalue);
|
||||
if (tmp_type >= 0 && tmp_type <= TYPEMAX && tmp_type != TYPEMULTIPART && body_types[tmp_type] != NULL) {
|
||||
type = (short) tmp_type;
|
||||
}
|
||||
}
|
||||
|
||||
if (!toppart) {
|
||||
@@ -3724,13 +3750,13 @@ PHP_FUNCTION(imap_mail_compose)
|
||||
}
|
||||
|
||||
bod = &mypart->body;
|
||||
|
||||
if (type != TYPEMULTIPART) {
|
||||
bod->type = type;
|
||||
}
|
||||
bod->type = type;
|
||||
|
||||
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "encoding", sizeof("encoding") - 1)) != NULL) {
|
||||
bod->encoding = (short) zval_get_long(pvalue);
|
||||
zend_long encoding = zval_get_long(pvalue);
|
||||
if (encoding >= 0 && encoding <= ENCMAX && body_encodings[encoding] != NULL) {
|
||||
bod->encoding = (short) encoding;
|
||||
}
|
||||
}
|
||||
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "charset", sizeof("charset") - 1)) != NULL) {
|
||||
convert_to_string_ex(pvalue);
|
||||
@@ -3744,7 +3770,9 @@ PHP_FUNCTION(imap_mail_compose)
|
||||
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "type.parameters", sizeof("type.parameters") - 1)) != NULL) {
|
||||
if (Z_TYPE_P(pvalue) == IS_ARRAY) {
|
||||
disp_param = tmp_param = NULL;
|
||||
SEPARATE_ARRAY(pvalue);
|
||||
ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(pvalue), key, disp_data) {
|
||||
if (key == NULL) continue;
|
||||
disp_param = mail_newbody_parameter();
|
||||
disp_param->attribute = cpystr(ZSTR_VAL(key));
|
||||
convert_to_string_ex(disp_data);
|
||||
@@ -3776,7 +3804,9 @@ PHP_FUNCTION(imap_mail_compose)
|
||||
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "disposition", sizeof("disposition") - 1)) != NULL) {
|
||||
if (Z_TYPE_P(pvalue) == IS_ARRAY) {
|
||||
disp_param = tmp_param = NULL;
|
||||
SEPARATE_ARRAY(pvalue);
|
||||
ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(pvalue), key, disp_data) {
|
||||
if (key == NULL) continue;
|
||||
disp_param = mail_newbody_parameter();
|
||||
disp_param->attribute = cpystr(ZSTR_VAL(key));
|
||||
convert_to_string_ex(disp_data);
|
||||
@@ -3788,15 +3818,19 @@ PHP_FUNCTION(imap_mail_compose)
|
||||
bod->disposition.parameter = disp_param;
|
||||
}
|
||||
}
|
||||
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "contents.data", sizeof("contents.data") - 1)) != NULL) {
|
||||
convert_to_string_ex(pvalue);
|
||||
bod->contents.text.data = fs_get(Z_STRLEN_P(pvalue) + 1);
|
||||
memcpy(bod->contents.text.data, Z_STRVAL_P(pvalue), Z_STRLEN_P(pvalue) + 1);
|
||||
bod->contents.text.size = Z_STRLEN_P(pvalue);
|
||||
if (bod->type == TYPEMESSAGE && bod->subtype && !strcmp(bod->subtype, "RFC822")) {
|
||||
bod->nested.msg = mail_newmsg();
|
||||
} else {
|
||||
bod->contents.text.data = fs_get(1);
|
||||
memcpy(bod->contents.text.data, "", 1);
|
||||
bod->contents.text.size = 0;
|
||||
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "contents.data", sizeof("contents.data") - 1)) != NULL) {
|
||||
convert_to_string_ex(pvalue);
|
||||
bod->contents.text.data = fs_get(Z_STRLEN_P(pvalue) + 1);
|
||||
memcpy(bod->contents.text.data, Z_STRVAL_P(pvalue), Z_STRLEN_P(pvalue) + 1);
|
||||
bod->contents.text.size = Z_STRLEN_P(pvalue);
|
||||
} else {
|
||||
bod->contents.text.data = fs_get(1);
|
||||
memcpy(bod->contents.text.data, "", 1);
|
||||
bod->contents.text.size = 0;
|
||||
}
|
||||
}
|
||||
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "lines", sizeof("lines") - 1)) != NULL) {
|
||||
bod->size.lines = zval_get_long(pvalue);
|
||||
@@ -3813,7 +3847,8 @@ PHP_FUNCTION(imap_mail_compose)
|
||||
|
||||
if (first) {
|
||||
php_error_docref(NULL, E_WARNING, "body parameter must be a non-empty array");
|
||||
RETURN_FALSE;
|
||||
RETVAL_FALSE;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (bod && bod->type == TYPEMULTIPART && (!bod->nested.part || !bod->nested.part->next)) {
|
||||
@@ -3896,7 +3931,7 @@ PHP_FUNCTION(imap_mail_compose)
|
||||
|
||||
bod=&part->body;
|
||||
|
||||
spprintf(&tempstring, 0, "%s%s%s", mystring, bod->contents.text.data, CRLF);
|
||||
spprintf(&tempstring, 0, "%s%s%s", mystring, bod->contents.text.data ? (char *) bod->contents.text.data : "", CRLF);
|
||||
efree(mystring);
|
||||
mystring=tempstring;
|
||||
} while ((part = part->next)); /* until done */
|
||||
@@ -3906,7 +3941,7 @@ PHP_FUNCTION(imap_mail_compose)
|
||||
efree(mystring);
|
||||
mystring=tempstring;
|
||||
} else if (bod) {
|
||||
spprintf(&tempstring, 0, "%s%s%s", mystring, bod->contents.text.data, CRLF);
|
||||
spprintf(&tempstring, 0, "%s%s%s", mystring, bod->contents.text.data ? (char *) bod->contents.text.data : "", CRLF);
|
||||
efree(mystring);
|
||||
mystring=tempstring;
|
||||
} else {
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
Bug #64076 (imap_sort() does not return FALSE on failure)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once __DIR__ . '/skipif.inc';
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once __DIR__ . '/imap_include.inc';
|
||||
$stream = setup_test_mailbox('', 2);
|
||||
imap_errors(); // clear error stack
|
||||
var_dump(imap_sort($stream, SORTFROM, 0, 0, 'UNSUPPORTED SEARCH CRITERIUM'));
|
||||
var_dump(imap_errors() !== false);
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require_once __DIR__ . '/clean.inc';
|
||||
?>
|
||||
--EXPECT--
|
||||
Create a temporary mailbox and add 2 msgs
|
||||
.. mailbox '{127.0.0.1:143/norsh}INBOX.phpttest' created
|
||||
bool(false)
|
||||
bool(true)
|
||||
@@ -11,5 +11,5 @@ imap_mail('1', 1, NULL);
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Warning: imap_mail(): No message string in mail command in %s on line %d
|
||||
%s
|
||||
%A
|
||||
===DONE===
|
||||
@@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
Bug #80213 (imap_mail_compose() segfaults on certain $bodies)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('imap')) die('skip imap extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$envelope = [];
|
||||
$body = [[
|
||||
'type.parameters' => ['param'],
|
||||
'disposition' => ['disp'],
|
||||
], [
|
||||
'type.parameters' => ['param'],
|
||||
'disposition' => ['disp'],
|
||||
]];
|
||||
imap_mail_compose($envelope, $body);
|
||||
echo "done\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
done
|
||||
@@ -0,0 +1,69 @@
|
||||
--TEST--
|
||||
Bug #80215 (imap_mail_compose() may modify by-val parameters)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('imap')) die('skip imap extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$envelope = [
|
||||
"from" => 1,
|
||||
"to" => 2,
|
||||
"custom_headers" => [3],
|
||||
];
|
||||
$body = [[
|
||||
"contents.data" => 4,
|
||||
"type.parameters" => ['foo' => 5],
|
||||
"disposition" => ['bar' => 6],
|
||||
], [
|
||||
"contents.data" => 7,
|
||||
"type.parameters" => ['foo' => 8],
|
||||
"disposition" => ['bar' => 9],
|
||||
]];
|
||||
imap_mail_compose($envelope, $body);
|
||||
var_dump($envelope, $body);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(3) {
|
||||
["from"]=>
|
||||
int(1)
|
||||
["to"]=>
|
||||
int(2)
|
||||
["custom_headers"]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(3)
|
||||
}
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
["contents.data"]=>
|
||||
int(4)
|
||||
["type.parameters"]=>
|
||||
array(1) {
|
||||
["foo"]=>
|
||||
int(5)
|
||||
}
|
||||
["disposition"]=>
|
||||
array(1) {
|
||||
["bar"]=>
|
||||
int(6)
|
||||
}
|
||||
}
|
||||
[1]=>
|
||||
array(3) {
|
||||
["contents.data"]=>
|
||||
int(7)
|
||||
["type.parameters"]=>
|
||||
array(1) {
|
||||
["foo"]=>
|
||||
int(8)
|
||||
}
|
||||
["disposition"]=>
|
||||
array(1) {
|
||||
["bar"]=>
|
||||
int(9)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #80216 (imap_mail_compose() does not validate types/encodings)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('imap')) die('skip imap extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
imap_mail_compose([], [['type' => TYPEMULTIPART], []]);
|
||||
imap_mail_compose([], [['type' => 12]]);
|
||||
imap_mail_compose([], [['type' => TYPEMULTIPART], ['type' => 12]]);
|
||||
imap_mail_compose([], [['encoding' => 8]]);
|
||||
imap_mail_compose([], [['type' => TYPEMULTIPART], ['encoding' => 8]]);
|
||||
echo "done\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
done
|
||||
@@ -0,0 +1,34 @@
|
||||
--TEST--
|
||||
Bug #80220 (imap_mail_compose() may leak memory) - message/rfc822 regression
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('imap')) die('skip imap extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$bodies = [[
|
||||
'type' => TYPEMESSAGE,
|
||||
'subtype' => 'RFC822',
|
||||
], [
|
||||
'contents.data' => 'asd',
|
||||
]];
|
||||
var_dump(imap_mail_compose([], $bodies));
|
||||
|
||||
$bodies = [[
|
||||
'type' => TYPEMESSAGE,
|
||||
], [
|
||||
'contents.data' => 'asd',
|
||||
]];
|
||||
var_dump(imap_mail_compose([], $bodies));
|
||||
?>
|
||||
--EXPECT--
|
||||
string(53) "MIME-Version: 1.0
|
||||
Content-Type: MESSAGE/RFC822
|
||||
|
||||
|
||||
"
|
||||
string(53) "MIME-Version: 1.0
|
||||
Content-Type: MESSAGE/RFC822
|
||||
|
||||
|
||||
"
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #80223 (imap_mail_compose() leaks envelope on malformed bodies)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('imap')) die('skip imap extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
imap_mail_compose([], []);
|
||||
imap_mail_compose([], [1]);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: imap_mail_compose(): body parameter must be a non-empty array in %s on line %d
|
||||
|
||||
Warning: imap_mail_compose(): body parameter must be a non-empty array in %s on line %d
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Bug #80226 (imap_sort() leaks sortpgm memory)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once(__DIR__.'/imap_include.inc');
|
||||
$stream = imap_open($default_mailbox, $username, $password);
|
||||
imap_sort($stream, SORTFROM, 0);
|
||||
?>
|
||||
--EXPECT--
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #80242 (imap_mail_compose() segfaults for multipart with rfc822)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('imap')) die('skip imap extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$bodies = [[
|
||||
'type' => TYPEMULTIPART,
|
||||
], [
|
||||
'type' => TYPETEXT,
|
||||
'contents.data' => 'some text',
|
||||
], [
|
||||
'type' => TYPEMESSAGE,
|
||||
'subtype' => 'RFC822',
|
||||
]];
|
||||
imap_mail_compose([], $bodies);
|
||||
echo "done\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
done
|
||||
@@ -106,7 +106,7 @@ Create a temporary mailbox and add 1 msgs
|
||||
.. mailbox '%s.phpttest' created
|
||||
|
||||
-- Iteration 1 --
|
||||
string(71) "From: %s
|
||||
string(%d) "From: %s
|
||||
To: %s
|
||||
Subject: test1
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
imap_rfc822_write_address() : basic functionality
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('imap')) die('skip imap extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(imap_rfc822_write_address('me', 'example.com', 'My Name'));
|
||||
?>
|
||||
--EXPECT--
|
||||
string(24) "My Name <me@example.com>"
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
MySQL 5.6 EXPIRE PASSWORD protocol change
|
||||
MySQL 5.6 / MariaDB 10.4.3 EXPIRE PASSWORD protocol change
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
@@ -14,6 +14,18 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
|
||||
if ($link->server_version < 50610)
|
||||
die(sprintf("SKIP Needs MySQL 5.6.10 or newer, found MySQL %s\n", $link->server_info));
|
||||
|
||||
if ($link->server_version >= 100000) {
|
||||
if ($link->server_version < 100403)
|
||||
die(sprintf("SKIP Needs MariaDB 10.4.3 or newer, found MariaDB %s\n", $link->server_info));
|
||||
$result = $link->query("select @@disconnect_on_expired_password");
|
||||
if (!$result)
|
||||
die("SKIP Failed to query MariaDB @@disconnect_on_expired_password value");
|
||||
$row = mysqli_fetch_row($result);
|
||||
if ($row[0] == 0)
|
||||
die("SKIP Cannot run in MariaDB @@disconnect_on_expired_password=OFF state");
|
||||
|
||||
}
|
||||
|
||||
if (!$IS_MYSQLND && (mysqli_get_client_version() < 50610)) {
|
||||
die(sprintf("SKIP Needs libmysql 5.6.10 or newer, found %s\n", mysqli_get_client_version()));
|
||||
}
|
||||
@@ -21,15 +33,15 @@ if (!$IS_MYSQLND && (mysqli_get_client_version() < 50610)) {
|
||||
mysqli_query($link, 'DROP USER expiretest');
|
||||
mysqli_query($link, 'DROP USER expiretest@localhost');
|
||||
|
||||
if (!mysqli_query($link, 'CREATE USER expiretest@"%"') ||
|
||||
!mysqli_query($link, 'CREATE USER expiretest@"localhost"')) {
|
||||
if (!mysqli_query($link, 'CREATE USER expiretest IDENTIFIED BY \'expiredpassword\'') ||
|
||||
!mysqli_query($link, 'CREATE USER expiretest@localhost IDENTIFIED BY \'expiredpassword\'')) {
|
||||
printf("skip Cannot create second DB user [%d] %s", mysqli_errno($link), mysqli_error($link));
|
||||
mysqli_close($link);
|
||||
die("skip CREATE USER failed");
|
||||
}
|
||||
|
||||
if (!mysqli_query($link, 'ALTER USER expiretest@"%" PASSWORD EXPIRE') ||
|
||||
!mysqli_query($link, 'ALTER USER expiretest@"localhost" PASSWORD EXPIRE')) {
|
||||
if (!mysqli_query($link, 'ALTER USER expiretest PASSWORD EXPIRE') ||
|
||||
!mysqli_query($link, 'ALTER USER expiretest@localhost PASSWORD EXPIRE')) {
|
||||
printf("skip Cannot modify second DB user [%d] %s", mysqli_errno($link), mysqli_error($link));
|
||||
mysqli_close($link);
|
||||
die("skip ALTER USER failed");
|
||||
@@ -54,7 +66,7 @@ if (!mysqli_query($link, sprintf("GRANT SELECT ON TABLE %s.test TO expiretest@'%
|
||||
require_once('table.inc');
|
||||
|
||||
/* default */
|
||||
if (!$link = my_mysqli_connect($host, 'expiretest', "", $db, $port, $socket)) {
|
||||
if (!$link = my_mysqli_connect($host, 'expiretest', 'expiredpassword', $db, $port, $socket)) {
|
||||
printf("[001] Cannot connect [%d] %s\n",
|
||||
mysqli_connect_errno(), mysqli_connect_error());
|
||||
} else {
|
||||
@@ -65,7 +77,7 @@ if (!mysqli_query($link, sprintf("GRANT SELECT ON TABLE %s.test TO expiretest@'%
|
||||
/* explicitly requesting default */
|
||||
$link = mysqli_init();
|
||||
$link->options(MYSQLI_OPT_CAN_HANDLE_EXPIRED_PASSWORDS, 0);
|
||||
if (!my_mysqli_real_connect($link, $host, 'expiretest', "", $db, $port, $socket)) {
|
||||
if (!my_mysqli_real_connect($link, $host, 'expiretest', 'expiredpassword', $db, $port, $socket)) {
|
||||
printf("[003] Cannot connect [%d] %s\n",
|
||||
mysqli_connect_errno(), mysqli_connect_error());
|
||||
} else {
|
||||
@@ -76,7 +88,7 @@ if (!mysqli_query($link, sprintf("GRANT SELECT ON TABLE %s.test TO expiretest@'%
|
||||
/* allow connect */
|
||||
$link = mysqli_init();
|
||||
$link->options(MYSQLI_OPT_CAN_HANDLE_EXPIRED_PASSWORDS, 1);
|
||||
if (!my_mysqli_real_connect($link, $host, 'expiretest', "", $db, $port, $socket)) {
|
||||
if (!my_mysqli_real_connect($link, $host, 'expiretest', 'expiredpassword', $db, $port, $socket)) {
|
||||
printf("[005] Cannot connect [%d] %s\n",
|
||||
mysqli_connect_errno(), mysqli_connect_error());
|
||||
} else {
|
||||
@@ -88,7 +100,7 @@ if (!mysqli_query($link, sprintf("GRANT SELECT ON TABLE %s.test TO expiretest@'%
|
||||
/* allow connect, fix pw */
|
||||
$link = mysqli_init();
|
||||
$link->options(MYSQLI_OPT_CAN_HANDLE_EXPIRED_PASSWORDS, 1);
|
||||
if (!my_mysqli_real_connect($link, $host, 'expiretest', "", $db, $port, $socket)) {
|
||||
if (!my_mysqli_real_connect($link, $host, 'expiretest', 'expiredpassword', $db, $port, $socket)) {
|
||||
printf("[007] Cannot connect [%d] %s\n",
|
||||
mysqli_connect_errno(), mysqli_connect_error());
|
||||
} else {
|
||||
@@ -122,11 +134,11 @@ if (!mysqli_query($link, sprintf("GRANT SELECT ON TABLE %s.test TO expiretest@'%
|
||||
mysqli_query($link, 'DROP USER expiretest@localhost');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: mysqli%sconnect(): (HY000/1862): %s in %s on line %d
|
||||
[001] Cannot connect [1862] %s
|
||||
Warning: mysqli%sconnect(): (HY000/%d): %s in %s on line %d
|
||||
[001] Cannot connect [%d] %s
|
||||
|
||||
Warning: mysqli%sconnect(): (HY000/1862): %s in %s on line %d
|
||||
[003] Cannot connect [1862] %s
|
||||
Warning: mysqli%sconnect(): (HY000/%d): %s in %s on line %d
|
||||
[003] Cannot connect [%d] %s
|
||||
[006] Connect allowed, query fail, [1820] %s
|
||||
[008] Connect allowed, pw set, [0%A
|
||||
array(1) {
|
||||
|
||||
@@ -666,7 +666,7 @@ mysqli.allow_local_infile=1
|
||||
$info = $new_info;
|
||||
|
||||
|
||||
// CREATE, ALTER, RENAME, DROP DATABASE
|
||||
// CREATE, ALTER, DROP DATABASE
|
||||
if (mysqli_query($link, "CREATE DATABASE mysqli_get_client_stats")) {
|
||||
|
||||
if (!is_array($new_info = mysqli_get_client_stats()) || empty($new_info))
|
||||
@@ -685,25 +685,13 @@ mysqli.allow_local_infile=1
|
||||
mysqli_get_client_stats_assert_eq('non_result_set_queries', $new_info, (string)($info['non_result_set_queries'] + 1), $test_counter, 'CREATE DATABASE');
|
||||
$info = $new_info;
|
||||
|
||||
if (mysqli_get_server_version($link) > 51700) {
|
||||
if (!mysqli_query($link, "RENAME DATABASE mysqli_get_client_stats TO mysqli_get_client_stats_"))
|
||||
printf("[%03d] RENAME DATABASE failed, [%d] %s\n", ++$test_counter,
|
||||
mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!is_array($new_info = mysqli_get_client_stats()) || empty($new_info))
|
||||
printf("[%03d] Expecting array/any_non_empty, got %s/%s\n",
|
||||
++$test_counter, gettype($new_info), $new_info);
|
||||
mysqli_get_client_stats_assert_eq('non_result_set_queries', $new_info, (string)($info['non_result_set_queries'] + 1), $test_counter, 'CREATE DATABASE');
|
||||
$info = $new_info;
|
||||
} else {
|
||||
if (!mysqli_query($link, "CREATE DATABASE mysqli_get_client_stats_"))
|
||||
printf("[%03d] CREATE DATABASE failed, [%d] %s\n", ++$test_counter,
|
||||
mysqli_errno($link), mysqli_error($link));
|
||||
if (!is_array($new_info = mysqli_get_client_stats()) || empty($new_info))
|
||||
printf("[%03d] Expecting array/any_non_empty, got %s/%s\n",
|
||||
++$test_counter, gettype($new_info), $new_info);
|
||||
$info = $new_info;
|
||||
}
|
||||
if (!mysqli_query($link, "CREATE DATABASE mysqli_get_client_stats_"))
|
||||
printf("[%03d] CREATE DATABASE failed, [%d] %s\n", ++$test_counter,
|
||||
mysqli_errno($link), mysqli_error($link));
|
||||
if (!is_array($new_info = mysqli_get_client_stats()) || empty($new_info))
|
||||
printf("[%03d] Expecting array/any_non_empty, got %s/%s\n",
|
||||
++$test_counter, gettype($new_info), $new_info);
|
||||
$info = $new_info;
|
||||
|
||||
if (!mysqli_query($link, "DROP DATABASE mysqli_get_client_stats_"))
|
||||
printf("[%03d] DROP DATABASE failed, [%d] %s\n", ++$test_counter,
|
||||
|
||||
+23
-4
@@ -1810,6 +1810,9 @@ static void php_odbc_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type)
|
||||
|
||||
if (rc == SQL_SUCCESS_WITH_INFO) {
|
||||
ZVAL_STRINGL(&tmp, buf, result->longreadlen);
|
||||
} else if (rc != SQL_SUCCESS) {
|
||||
php_error_docref(NULL, E_WARNING, "Cannot get data of column #%d (retcode %u)", i + 1, rc);
|
||||
ZVAL_FALSE(&tmp);
|
||||
} else if (result->values[i].vallen == SQL_NULL_DATA) {
|
||||
ZVAL_NULL(&tmp);
|
||||
break;
|
||||
@@ -1962,6 +1965,9 @@ PHP_FUNCTION(odbc_fetch_into)
|
||||
}
|
||||
if (rc == SQL_SUCCESS_WITH_INFO) {
|
||||
ZVAL_STRINGL(&tmp, buf, result->longreadlen);
|
||||
} else if (rc != SQL_SUCCESS) {
|
||||
php_error_docref(NULL, E_WARNING, "Cannot get data of column #%d (retcode %u)", i + 1, rc);
|
||||
ZVAL_FALSE(&tmp);
|
||||
} else if (result->values[i].vallen == SQL_NULL_DATA) {
|
||||
ZVAL_NULL(&tmp);
|
||||
break;
|
||||
@@ -2199,12 +2205,13 @@ PHP_FUNCTION(odbc_result)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (result->values[field_ind].vallen == SQL_NULL_DATA) {
|
||||
if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
|
||||
zend_string_efree(field_str);
|
||||
php_error_docref(NULL, E_WARNING, "Cannot get data of column #%d (retcode %u)", field_ind + 1, rc);
|
||||
RETURN_FALSE;
|
||||
} else if (result->values[field_ind].vallen == SQL_NULL_DATA) {
|
||||
zend_string_efree(field_str);
|
||||
RETURN_NULL();
|
||||
} else if (rc == SQL_NO_DATA_FOUND) {
|
||||
zend_string_efree(field_str);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
/* Reduce fieldlen by 1 if we have char data. One day we might
|
||||
have binary strings... */
|
||||
@@ -2250,6 +2257,12 @@ PHP_FUNCTION(odbc_result)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
|
||||
php_error_docref(NULL, E_WARNING, "Cannot get data of column #%d (retcode %u)", field_ind + 1, rc);
|
||||
efree(field);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (result->values[field_ind].vallen == SQL_NULL_DATA) {
|
||||
efree(field);
|
||||
RETURN_NULL();
|
||||
@@ -2359,6 +2372,11 @@ PHP_FUNCTION(odbc_result_all)
|
||||
}
|
||||
if (rc == SQL_SUCCESS_WITH_INFO) {
|
||||
PHPWRITE(buf, result->longreadlen);
|
||||
} else if (rc != SQL_SUCCESS) {
|
||||
php_printf("</td></tr></table>");
|
||||
php_error_docref(NULL, E_WARNING, "Cannot get data of column #%zu (retcode %u)", i + 1, rc);
|
||||
efree(buf);
|
||||
RETURN_FALSE;
|
||||
} else if (result->values[i].vallen == SQL_NULL_DATA) {
|
||||
php_printf("<td>NULL</td>");
|
||||
break;
|
||||
@@ -2773,6 +2791,7 @@ PHP_FUNCTION(odbc_next_result)
|
||||
}
|
||||
efree(result->values);
|
||||
result->values = NULL;
|
||||
result->numcols = 0;
|
||||
}
|
||||
|
||||
result->fetched = 0;
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
--TEST--
|
||||
Bug #44618 (Fetching may rely on uninitialized data)
|
||||
--SKIPIF--
|
||||
<?php include 'skipif.inc'; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
include __DIR__ . "/config.inc";
|
||||
$conn = odbc_connect($dsn, $user, $pass, SQL_CUR_USE_ODBC);
|
||||
|
||||
odbc_exec($conn, "CREATE TABLE bug44618(ID INT, real1 REAL, text1 TEXT)");
|
||||
odbc_exec($conn, "INSERT INTO bug44618 VALUES (1, 10.0199995, 'testing 1,2,3')");
|
||||
|
||||
$result = odbc_exec($conn, "SELECT * FROM bug44618");
|
||||
var_dump(odbc_fetch_array($result));
|
||||
$result = null;
|
||||
|
||||
$result = odbc_exec($conn, "SELECT * FROM bug44618");
|
||||
odbc_fetch_into($result, $array);
|
||||
var_dump($array);
|
||||
$result = null;
|
||||
|
||||
$result = odbc_exec($conn, "SELECT * FROM bug44618");
|
||||
odbc_fetch_row($result);
|
||||
var_dump(odbc_result($result, "text1"));
|
||||
$result = null;
|
||||
|
||||
$result = odbc_exec($conn, "SELECT * FROM bug44618");
|
||||
odbc_result_all($result);
|
||||
$result = null;
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
include __DIR__ . "/config.inc";
|
||||
$conn = odbc_connect($dsn, $user, $pass);
|
||||
odbc_exec($conn, "DROP TABLE bug44618");
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: odbc_fetch_array(): Cannot get data of column #3 (retcode 100) in %s on line %d
|
||||
array(3) {
|
||||
["ID"]=>
|
||||
string(1) "1"
|
||||
["real1"]=>
|
||||
string(5) "10.02"
|
||||
["text1"]=>
|
||||
bool(false)
|
||||
}
|
||||
|
||||
Warning: odbc_fetch_into(): Cannot get data of column #3 (retcode 100) in %s on line %d
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(1) "1"
|
||||
[1]=>
|
||||
string(5) "10.02"
|
||||
[2]=>
|
||||
bool(false)
|
||||
}
|
||||
|
||||
Warning: odbc_result(): Cannot get data of column #3 (retcode 100) in %s on line %d
|
||||
bool(false)
|
||||
<table><tr><th>ID</th><th>real1</th><th>text1</th></tr>
|
||||
<tr><td>1</td><td>10.02</td><td></td></tr></table>
|
||||
Warning: odbc_result_all(): Cannot get data of column #3 (retcode 100) in %s on line %d
|
||||
@@ -0,0 +1,27 @@
|
||||
--TEST--
|
||||
Bug #46050 (odbc_next_result corrupts prepared resource)
|
||||
--SKIPIF--
|
||||
<?php include 'skipif.inc'; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
include __DIR__ . "/config.inc";
|
||||
$conn = odbc_connect($dsn, $user, $pass);
|
||||
$stmt = odbc_prepare($conn, "SELECT 1");
|
||||
var_dump(odbc_execute($stmt));
|
||||
var_dump(odbc_fetch_array($stmt));
|
||||
var_dump(odbc_next_result($stmt));
|
||||
var_dump(odbc_execute($stmt));
|
||||
var_dump(odbc_fetch_array($stmt));
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
array(1) {
|
||||
["1"]=>
|
||||
string(1) "1"
|
||||
}
|
||||
bool(false)
|
||||
bool(true)
|
||||
array(1) {
|
||||
["1"]=>
|
||||
string(1) "1"
|
||||
}
|
||||
@@ -9,7 +9,8 @@ if (getenv('SKIP_ONLINE_TESTS')) die('skip online test');
|
||||
default_socket_timeout=-1
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump((bool) file_get_contents('https://php.net'));
|
||||
$clientCtx = stream_context_create(['ssl' => ['verify_peer' => false]]);
|
||||
var_dump((bool) file_get_contents('https://www.php.net', false, $clientCtx));
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
+4
-1
@@ -1208,10 +1208,13 @@ static int netsnmp_session_set_sec_level(struct snmp_session *s, char *level)
|
||||
Set the authentication protocol in the snmpv3 session */
|
||||
static int netsnmp_session_set_auth_protocol(struct snmp_session *s, char *prot)
|
||||
{
|
||||
#ifndef DISABLE_MD5
|
||||
if (!strcasecmp(prot, "MD5")) {
|
||||
s->securityAuthProto = usmHMACMD5AuthProtocol;
|
||||
s->securityAuthProtoLen = USM_AUTH_PROTO_MD5_LEN;
|
||||
} else if (!strcasecmp(prot, "SHA")) {
|
||||
} else
|
||||
#endif
|
||||
if (!strcasecmp(prot, "SHA")) {
|
||||
s->securityAuthProto = usmHMACSHA1AuthProtocol;
|
||||
s->securityAuthProtoLen = USM_AUTH_PROTO_SHA_LEN;
|
||||
} else {
|
||||
|
||||
@@ -1614,8 +1614,6 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp
|
||||
attr = get_attribute(attrs, "default");
|
||||
if (attr) {
|
||||
if (ref != NULL) {
|
||||
soap_error0(E_ERROR, "Parsing Schema: element has both 'ref' and 'fixed' attributes");
|
||||
} else if (ref != NULL) {
|
||||
soap_error0(E_ERROR, "Parsing Schema: element has both 'default' and 'fixed' attributes");
|
||||
}
|
||||
cur_type->def = estrdup((char*)attr->children->content);
|
||||
|
||||
+2
-2
@@ -2325,8 +2325,8 @@ PHP_METHOD(SoapClient, SoapClient)
|
||||
}
|
||||
|
||||
if ((tmp = zend_hash_str_find(ht, "soap_version", sizeof("soap_version")-1)) != NULL) {
|
||||
if (Z_TYPE_P(tmp) == IS_LONG ||
|
||||
(Z_LVAL_P(tmp) == SOAP_1_1 && Z_LVAL_P(tmp) == SOAP_1_2)) {
|
||||
if (Z_TYPE_P(tmp) == IS_LONG &&
|
||||
(Z_LVAL_P(tmp) == SOAP_1_1 || Z_LVAL_P(tmp) == SOAP_1_2)) {
|
||||
soap_version = Z_LVAL_P(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
+26
-12
@@ -7,6 +7,8 @@ AC_CACHE_CHECK([whether flush should be called explicitly after a buffered io],
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
@@ -61,6 +63,8 @@ fi
|
||||
|
||||
AC_CACHE_CHECK(for standard DES crypt, ac_cv_crypt_des,[
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <string.h>
|
||||
|
||||
#if HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
@@ -72,9 +76,9 @@ AC_CACHE_CHECK(for standard DES crypt, ac_cv_crypt_des,[
|
||||
int main() {
|
||||
#if HAVE_CRYPT
|
||||
char *encrypted = crypt("rasmuslerdorf","rl");
|
||||
exit(!encrypted || strcmp(encrypted,"rl.3StKT.4T8M"));
|
||||
return !encrypted || strcmp(encrypted,"rl.3StKT.4T8M");
|
||||
#else
|
||||
exit(1);
|
||||
return 1;
|
||||
#endif
|
||||
}]])],[
|
||||
ac_cv_crypt_des=yes
|
||||
@@ -86,6 +90,8 @@ int main() {
|
||||
|
||||
AC_CACHE_CHECK(for extended DES crypt, ac_cv_crypt_ext_des,[
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <string.h>
|
||||
|
||||
#if HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
@@ -97,9 +103,9 @@ AC_CACHE_CHECK(for extended DES crypt, ac_cv_crypt_ext_des,[
|
||||
int main() {
|
||||
#if HAVE_CRYPT
|
||||
char *encrypted = crypt("rasmuslerdorf","_J9..rasm");
|
||||
exit(!encrypted || strcmp(encrypted,"_J9..rasmBYk8r9AiWNc"));
|
||||
return !encrypted || strcmp(encrypted,"_J9..rasmBYk8r9AiWNc");
|
||||
#else
|
||||
exit(1);
|
||||
return 1;
|
||||
#endif
|
||||
}]])],[
|
||||
ac_cv_crypt_ext_des=yes
|
||||
@@ -111,6 +117,8 @@ int main() {
|
||||
|
||||
AC_CACHE_CHECK(for MD5 crypt, ac_cv_crypt_md5,[
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <string.h>
|
||||
|
||||
#if HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
@@ -132,9 +140,9 @@ int main() {
|
||||
strcpy(answer,salt);
|
||||
strcat(answer,"rISCgZzpwk3UhDidwXvin0");
|
||||
encrypted = crypt("rasmuslerdorf",salt);
|
||||
exit(!encrypted || strcmp(encrypted,answer));
|
||||
return !encrypted || strcmp(encrypted,answer);
|
||||
#else
|
||||
exit(1);
|
||||
return 1;
|
||||
#endif
|
||||
}]])],[
|
||||
ac_cv_crypt_md5=yes
|
||||
@@ -146,6 +154,8 @@ int main() {
|
||||
|
||||
AC_CACHE_CHECK(for Blowfish crypt, ac_cv_crypt_blowfish,[
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <string.h>
|
||||
|
||||
#if HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
@@ -164,9 +174,9 @@ int main() {
|
||||
strcpy(answer,salt);
|
||||
strcpy(&answer[29],"nIdrcHdxcUxWomQX9j6kvERCFjTg7Ra");
|
||||
encrypted = crypt("rasmuslerdorf",salt);
|
||||
exit(!encrypted || strcmp(encrypted,answer));
|
||||
return !encrypted || strcmp(encrypted,answer);
|
||||
#else
|
||||
exit(1);
|
||||
return 1;
|
||||
#endif
|
||||
}]])],[
|
||||
ac_cv_crypt_blowfish=yes
|
||||
@@ -178,6 +188,8 @@ int main() {
|
||||
|
||||
AC_CACHE_CHECK(for SHA512 crypt, ac_cv_crypt_sha512,[
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <string.h>
|
||||
|
||||
#if HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
@@ -195,9 +207,9 @@ int main() {
|
||||
strcpy(answer, salt);
|
||||
strcat(answer, "EeHCRjm0bljalWuALHSTs1NB9ipEiLEXLhYeXdOpx22gmlmVejnVXFhd84cEKbYxCo.XuUTrW.RLraeEnsvWs/");
|
||||
encrypted = crypt("rasmuslerdorf",salt);
|
||||
exit(!encrypted || strcmp(encrypted,answer));
|
||||
return !encrypted || strcmp(encrypted,answer);
|
||||
#else
|
||||
exit(1);
|
||||
return 1;
|
||||
#endif
|
||||
}]])],[
|
||||
ac_cv_crypt_sha512=yes
|
||||
@@ -209,6 +221,8 @@ int main() {
|
||||
|
||||
AC_CACHE_CHECK(for SHA256 crypt, ac_cv_crypt_sha256,[
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <string.h>
|
||||
|
||||
#if HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
@@ -226,9 +240,9 @@ int main() {
|
||||
strcpy(answer, salt);
|
||||
strcat(answer, "cFAm2puLCujQ9t.0CxiFIIvFi4JyQx5UncCt/xRIX23");
|
||||
encrypted = crypt("rasmuslerdorf",salt);
|
||||
exit(!encrypted || strcmp(encrypted,answer));
|
||||
return !encrypted || strcmp(encrypted,answer);
|
||||
#else
|
||||
exit(1);
|
||||
return 1;
|
||||
#endif
|
||||
}]])],[
|
||||
ac_cv_crypt_sha256=yes
|
||||
|
||||
@@ -37,7 +37,8 @@ EXTENSION("standard", "array.c base64.c basic_functions.c browscap.c \
|
||||
user_filters.c uuencode.c filters.c proc_open.c password.c \
|
||||
streamsfuncs.c http.c flock_compat.c random.c hrtime.c", false /* never shared */,
|
||||
'/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1');
|
||||
PHP_INSTALL_HEADERS("", "ext/standard");
|
||||
PHP_INSTALL_HEADERS("", "ext/standard");
|
||||
PHP_STANDARD = "yes";
|
||||
if (PHP_MBREGEX != "no") {
|
||||
CHECK_HEADER_ADD_INCLUDE("oniguruma.h", "CFLAGS_STANDARD", PHP_MBREGEX + ";ext\\mbstring\\oniguruma")
|
||||
}
|
||||
|
||||
@@ -442,7 +442,7 @@ PHP_FUNCTION(stream_get_contents)
|
||||
Z_PARAM_LONG(desiredpos)
|
||||
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
||||
|
||||
if (maxlen < 0 && maxlen != PHP_STREAM_COPY_ALL) {
|
||||
if (maxlen < 0 && maxlen != (ssize_t)PHP_STREAM_COPY_ALL) {
|
||||
php_error_docref(NULL, E_WARNING, "Length must be greater than or equal to zero, or -1");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -859,11 +859,13 @@ echo "Done";
|
||||
string(3) "%:x"
|
||||
}
|
||||
|
||||
--> https://example.com:0/: array(3) {
|
||||
--> https://example.com:0/: array(4) {
|
||||
["scheme"]=>
|
||||
string(5) "https"
|
||||
["host"]=>
|
||||
string(11) "example.com"
|
||||
["port"]=>
|
||||
int(0)
|
||||
["path"]=>
|
||||
string(1) "/"
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ echo "Done";
|
||||
--> / : NULL
|
||||
--> /rest/Users?filter={"id":"123"} : NULL
|
||||
--> %:x : NULL
|
||||
--> https://example.com:0/ : NULL
|
||||
--> https://example.com:0/ : int(0)
|
||||
--> http:///blah.com : bool(false)
|
||||
--> http://:80 : bool(false)
|
||||
--> http://user@:80 : bool(false)
|
||||
|
||||
@@ -861,11 +861,13 @@ echo "Done";
|
||||
string(3) "%:x"
|
||||
}
|
||||
|
||||
--> https://example.com:0/: array(3) {
|
||||
--> https://example.com:0/: array(4) {
|
||||
["scheme"]=>
|
||||
string(5) "https"
|
||||
["host"]=>
|
||||
string(11) "example.com"
|
||||
["port"]=>
|
||||
int(0)
|
||||
["path"]=>
|
||||
string(1) "/"
|
||||
}
|
||||
|
||||
+15
-5
@@ -102,14 +102,21 @@ static const char *binary_strcspn(const char *s, const char *e, const char *char
|
||||
return e;
|
||||
}
|
||||
|
||||
/* {{{ php_url_parse
|
||||
*/
|
||||
PHPAPI php_url *php_url_parse_ex(char const *str, size_t length)
|
||||
{
|
||||
zend_bool has_port;
|
||||
return php_url_parse_ex2(str, length, &has_port);
|
||||
}
|
||||
|
||||
/* {{{ php_url_parse_ex2
|
||||
*/
|
||||
PHPAPI php_url *php_url_parse_ex2(char const *str, size_t length, zend_bool *has_port)
|
||||
{
|
||||
char port_buf[6];
|
||||
php_url *ret = ecalloc(1, sizeof(php_url));
|
||||
char const *s, *e, *p, *pp, *ue;
|
||||
|
||||
*has_port = 0;
|
||||
s = str;
|
||||
ue = s + length;
|
||||
|
||||
@@ -199,6 +206,7 @@ PHPAPI php_url *php_url_parse_ex(char const *str, size_t length)
|
||||
port_buf[pp - p] = '\0';
|
||||
port = ZEND_STRTOL(port_buf, &end, 10);
|
||||
if (port >= 0 && port <= 65535 && end != port_buf) {
|
||||
*has_port = 1;
|
||||
ret->port = (unsigned short) port;
|
||||
if (s + 1 < ue && *s == '/' && *(s + 1) == '/') { /* relative-scheme URL */
|
||||
s += 2;
|
||||
@@ -264,6 +272,7 @@ parse_host:
|
||||
port_buf[e - p] = '\0';
|
||||
port = ZEND_STRTOL(port_buf, &end, 10);
|
||||
if (port >= 0 && port <= 65535 && end != port_buf) {
|
||||
*has_port = 1;
|
||||
ret->port = (unsigned short)port;
|
||||
} else {
|
||||
php_url_free(ret);
|
||||
@@ -332,6 +341,7 @@ PHP_FUNCTION(parse_url)
|
||||
php_url *resource;
|
||||
zend_long key = -1;
|
||||
zval tmp;
|
||||
zend_bool has_port;
|
||||
|
||||
ZEND_PARSE_PARAMETERS_START(1, 2)
|
||||
Z_PARAM_STRING(str, str_len)
|
||||
@@ -339,7 +349,7 @@ PHP_FUNCTION(parse_url)
|
||||
Z_PARAM_LONG(key)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
|
||||
resource = php_url_parse_ex(str, str_len);
|
||||
resource = php_url_parse_ex2(str, str_len, &has_port);
|
||||
if (resource == NULL) {
|
||||
/* @todo Find a method to determine why php_url_parse_ex() failed */
|
||||
RETURN_FALSE;
|
||||
@@ -354,7 +364,7 @@ PHP_FUNCTION(parse_url)
|
||||
if (resource->host != NULL) RETVAL_STR_COPY(resource->host);
|
||||
break;
|
||||
case PHP_URL_PORT:
|
||||
if (resource->port != 0) RETVAL_LONG(resource->port);
|
||||
if (has_port) RETVAL_LONG(resource->port);
|
||||
break;
|
||||
case PHP_URL_USER:
|
||||
if (resource->user != NULL) RETVAL_STR_COPY(resource->user);
|
||||
@@ -390,7 +400,7 @@ PHP_FUNCTION(parse_url)
|
||||
ZVAL_STR_COPY(&tmp, resource->host);
|
||||
zend_hash_add_new(Z_ARRVAL_P(return_value), ZSTR_KNOWN(ZEND_STR_HOST), &tmp);
|
||||
}
|
||||
if (resource->port != 0) {
|
||||
if (has_port) {
|
||||
ZVAL_LONG(&tmp, resource->port);
|
||||
zend_hash_add_new(Z_ARRVAL_P(return_value), ZSTR_KNOWN(ZEND_STR_PORT), &tmp);
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ typedef struct 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, size_t length);
|
||||
PHPAPI php_url *php_url_parse_ex2(char const *str, size_t length, zend_bool *has_port);
|
||||
PHPAPI size_t php_url_decode(char *str, size_t len); /* return value: length of decoded string */
|
||||
PHPAPI size_t php_raw_url_decode(char *str, size_t len); /* return value: length of decoded string */
|
||||
PHPAPI zend_string *php_url_encode(char const *s, size_t len);
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
--TEST--
|
||||
Bug #77040 (tidyNode::isHtml() is completely broken)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('tidy')) die('skip tidy extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$tidy = new tidy;
|
||||
$tidy->parseString("<p>text</p><p><![CDATA[cdata]]></p>");
|
||||
$p = $tidy->body()->child[0];
|
||||
var_dump($p->type === TIDY_NODETYPE_START);
|
||||
var_dump($p->isHtml());
|
||||
$text = $p->child[0];
|
||||
var_dump($text->type === TIDY_NODETYPE_TEXT);
|
||||
var_dump($text->isHtml());
|
||||
$cdata = $tidy->body()->child[1]->child[0];
|
||||
var_dump($cdata->type === TIDY_NODETYPE_CDATA);
|
||||
var_dump($cdata->isHtml());
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(false)
|
||||
@@ -0,0 +1,29 @@
|
||||
--TEST--
|
||||
Operations on uninitialized tidy object
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("tidy")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$tidy = new tidy;
|
||||
try {
|
||||
var_dump($tidy->getHtmlVer());
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
try {
|
||||
var_dump($tidy->isXhtml());
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
try {
|
||||
var_dump($tidy->isXml());
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
tidy object is not initialized
|
||||
tidy object is not initialized
|
||||
tidy object is not initialized
|
||||
+17
-7
@@ -66,6 +66,13 @@
|
||||
} \
|
||||
obj = Z_TIDY_P(object); \
|
||||
|
||||
#define TIDY_FETCH_INITIALIZED_OBJECT \
|
||||
TIDY_FETCH_OBJECT; \
|
||||
if (!obj->ptdoc->initialized) { \
|
||||
zend_throw_error(NULL, "tidy object is not initialized"); \
|
||||
return; \
|
||||
}
|
||||
|
||||
#define TIDY_FETCH_ONLY_OBJECT \
|
||||
PHPTidyObj *obj; \
|
||||
TIDY_SET_CONTEXT; \
|
||||
@@ -1474,7 +1481,7 @@ static PHP_FUNCTION(tidy_get_status)
|
||||
Get the Detected HTML version for the specified document. */
|
||||
static PHP_FUNCTION(tidy_get_html_ver)
|
||||
{
|
||||
TIDY_FETCH_OBJECT;
|
||||
TIDY_FETCH_INITIALIZED_OBJECT;
|
||||
|
||||
RETURN_LONG(tidyDetectedHtmlVersion(obj->ptdoc->doc));
|
||||
}
|
||||
@@ -1484,7 +1491,7 @@ static PHP_FUNCTION(tidy_get_html_ver)
|
||||
Indicates if the document is a XHTML document. */
|
||||
static PHP_FUNCTION(tidy_is_xhtml)
|
||||
{
|
||||
TIDY_FETCH_OBJECT;
|
||||
TIDY_FETCH_INITIALIZED_OBJECT;
|
||||
|
||||
RETURN_BOOL(tidyDetectedXhtml(obj->ptdoc->doc));
|
||||
}
|
||||
@@ -1494,7 +1501,7 @@ static PHP_FUNCTION(tidy_is_xhtml)
|
||||
Indicates if the document is a generic (non HTML/XHTML) XML document. */
|
||||
static PHP_FUNCTION(tidy_is_xml)
|
||||
{
|
||||
TIDY_FETCH_OBJECT;
|
||||
TIDY_FETCH_INITIALIZED_OBJECT;
|
||||
|
||||
RETURN_BOOL(tidyDetectedGenericXml(obj->ptdoc->doc));
|
||||
}
|
||||
@@ -1786,11 +1793,14 @@ static TIDY_NODE_METHOD(isHtml)
|
||||
{
|
||||
TIDY_FETCH_ONLY_OBJECT;
|
||||
|
||||
if (tidyNodeGetType(obj->node) & (TidyNode_Start | TidyNode_End | TidyNode_StartEnd)) {
|
||||
RETURN_TRUE;
|
||||
switch (tidyNodeGetType(obj->node)) {
|
||||
case TidyNode_Start:
|
||||
case TidyNode_End:
|
||||
case TidyNode_StartEnd:
|
||||
RETURN_TRUE;
|
||||
default:
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
RETURN_FALSE;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
+4
-4
@@ -2,7 +2,7 @@
|
||||
/* edit configure.ac to change version number */
|
||||
#define PHP_MAJOR_VERSION 7
|
||||
#define PHP_MINOR_VERSION 3
|
||||
#define PHP_RELEASE_VERSION 24
|
||||
#define PHP_EXTRA_VERSION "-dev"
|
||||
#define PHP_VERSION "7.3.24-dev"
|
||||
#define PHP_VERSION_ID 70324
|
||||
#define PHP_RELEASE_VERSION 26
|
||||
#define PHP_EXTRA_VERSION "RC1"
|
||||
#define PHP_VERSION "7.3.26RC1"
|
||||
#define PHP_VERSION_ID 70326
|
||||
Reference in new issue
Block a user