mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-22 08:26:38 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
645f1b4761 | ||
|
|
72d534e791 | ||
|
|
3bc1226804 | ||
|
|
0f3e01f5cc | ||
|
|
49501f8f41 | ||
|
|
3af6201224 | ||
|
|
6275825c68 | ||
|
|
4f8e703854 | ||
|
|
d8c80af71e | ||
|
|
e112d71435 | ||
|
|
2def85688d | ||
|
|
259477826c | ||
|
|
1f3b87dc11 | ||
|
|
ab07265573 | ||
|
|
bd0b0cc8c9 | ||
|
|
71fd58652f | ||
|
|
73d84d4bbd | ||
|
|
4d936c1254 | ||
|
|
f555224743 | ||
|
|
3069ad8dd1 | ||
|
|
207105b1a3 | ||
|
|
f64be0b013 | ||
|
|
de5a5f6fdc | ||
|
|
472b25921e | ||
|
|
4fb7665c09 | ||
|
|
1a23ebc1ff | ||
|
|
e88ab74886 | ||
|
|
b59718bdc4 | ||
|
|
46ecda76ba | ||
|
|
307acb6618 | ||
|
|
b06f8cb58b | ||
|
|
42608a3401 | ||
|
|
afb20f4895 | ||
|
|
315d3910fa | ||
|
|
075986f214 | ||
|
|
86aa1ca990 | ||
|
|
618dcd6520 | ||
|
|
9ebf813ea4 | ||
|
|
4c9fe5a490 | ||
|
|
da966a93ac | ||
|
|
d058e30917 | ||
|
|
aee20e637a | ||
|
|
159e5c1048 | ||
|
|
21c6ba3412 | ||
|
|
9689796c10 | ||
|
|
54e2224df7 | ||
|
|
3e5b8c1e89 | ||
|
|
9ba2cfd33e | ||
|
|
4988e83fe9 | ||
|
|
c2b8066efb | ||
|
|
9871555090 | ||
|
|
9ca1b2a775 | ||
|
|
63607375f5 | ||
|
|
2cc1cbf2f4 | ||
|
|
15abb2b56e | ||
|
|
e78712791d | ||
|
|
1fdc518971 | ||
|
|
b112d09013 | ||
|
|
5f030924c1 | ||
|
|
666cb6c802 | ||
|
|
9c6262f39b | ||
|
|
b2934d2612 | ||
|
|
f0d40286e7 | ||
|
|
cd06b5af09 | ||
|
|
0c0cbb43da | ||
|
|
64e6ddc7f7 | ||
|
|
d9d152b895 | ||
|
|
a8e25fdbf8 | ||
|
|
eab66f9068 | ||
|
|
2d6d1ec55b | ||
|
|
2d96fdd54f | ||
|
|
82e4ad3983 | ||
|
|
74a696d53b | ||
|
|
f213ee5952 | ||
|
|
4d6f808c16 | ||
|
|
c48c638aeb | ||
|
|
e3d25e78eb | ||
|
|
55e7459cea | ||
|
|
b01336814d | ||
|
|
b62fb3aa0c | ||
|
|
34e5d3a87d | ||
|
|
0ddda0dcb7 | ||
|
|
9fcfe52d03 | ||
|
|
efb1be547c | ||
|
|
84a18c4782 | ||
|
|
e36c04ef48 | ||
|
|
80f4297c25 | ||
|
|
c7aa8ba0ee | ||
|
|
4cde48bb73 | ||
|
|
3f9e8e6686 | ||
|
|
3306b3aa60 | ||
|
|
eaf5c7cdd4 | ||
|
|
bd00fe81cc | ||
|
|
bb9ea4e88b | ||
|
|
6b1fbafdf0 | ||
|
|
747f5b23ae | ||
|
|
46a6ae0d45 | ||
|
|
de65a2243f | ||
|
|
3df47c12f7 | ||
|
|
238f837cbc | ||
|
|
3fd7d819b8 | ||
|
|
78ad5e8864 | ||
|
|
69b48f83df | ||
|
|
dbc2ffba82 | ||
|
|
bedd881da6 | ||
|
|
cdf9178c43 | ||
|
|
b44484b912 | ||
|
|
924ff6164e | ||
|
|
2dc81d4a09 | ||
|
|
a769d873f8 | ||
|
|
e2b61eccb9 | ||
|
|
6918a68d9d | ||
|
|
5816ce330c | ||
|
|
23c124ec75 | ||
|
|
642fb44d69 | ||
|
|
c4e11c8ef3 | ||
|
|
f116a88592 | ||
|
|
418da85f15 | ||
|
|
a4e3589966 | ||
|
|
775b4b54d8 | ||
|
|
1229b0f8cb | ||
|
|
c562d44321 | ||
|
|
c068818ff3 | ||
|
|
e0c0007bd2 | ||
|
|
ad12da4908 | ||
|
|
134e713be2 | ||
|
|
bad5d0d6c5 | ||
|
|
4cb1151fff | ||
|
|
e405ff59f9 | ||
|
|
69ec51eb02 | ||
|
|
a8f98fc7f7 | ||
|
|
08177312fb | ||
|
|
256ec5bebb | ||
|
|
3a7b0027f3 | ||
|
|
4b3ed311aa | ||
|
|
9b3c26d4f4 | ||
|
|
e2b240c164 | ||
|
|
84926a0d71 | ||
|
|
95d2908814 | ||
|
|
fa33b065ac | ||
|
|
ce06677069 | ||
|
|
7c21535fb3 | ||
|
|
ecad9a470f | ||
|
|
8ef5a50e2d | ||
|
|
f67a3cc9bd | ||
|
|
a9e8239f45 | ||
|
|
c9fd093127 | ||
|
|
2b36f3d71f | ||
|
|
2cca43b3ab | ||
|
|
4252f14299 | ||
|
|
e5beb4e828 | ||
|
|
8e7c99acf4 | ||
|
|
afc22828ea | ||
|
|
4e9158da76 | ||
|
|
51cdd3dc50 | ||
|
|
6c32d271d2 | ||
|
|
f4323248ec |
No files matched your search
+1
-1
@@ -24,7 +24,7 @@ environment:
|
||||
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
|
||||
PHP_BUILD_OBJ_DIR: c:\obj
|
||||
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.7
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.9
|
||||
# ext and env setup for tests
|
||||
#MYSQL_TEST_PASSWD: Password12!
|
||||
#MYSQL_TEST_USER: root
|
||||
|
||||
@@ -1,6 +1,80 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? 2017, PHP 7.1.8
|
||||
31 Aug 2017, PHP 7.1.9
|
||||
|
||||
- Core:
|
||||
. Fixed bug #74947 (Segfault in scanner on INF number). (Laruence)
|
||||
. Fixed bug #74954 (null deref and segfault in zend_generator_resume()). (Bob)
|
||||
. Fixed bug #74725 (html_errors=1 breaks unhandled exceptions). (Andrea)
|
||||
. Fixed bug #75063 (Main CWD initialized with wrong codepage). (Anatol)
|
||||
|
||||
- cURL:
|
||||
. Fixed bug #74125 (Fixed finding CURL on systems with multiarch support).
|
||||
(cebe)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #75002 (Null Pointer Dereference in timelib_time_clone). (Derick)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #74993 (Wrong reflection on some locale_* functions). (Sara)
|
||||
|
||||
- Mbstring:
|
||||
. Fixed bug #71606 (Segmentation fault mb_strcut with HTML-ENTITIES encoding).
|
||||
(cmb)
|
||||
. Fixed bug #62934 (mb_convert_kana() does not convert iteration marks).
|
||||
(Nikita)
|
||||
. Fixed bug #75001 (Wrong reflection on mb_eregi_replace). (Fabien
|
||||
Villepinte)
|
||||
|
||||
- MySQLi:
|
||||
. Fixed bug #74968 (PHP crashes when calling mysqli_result::fetch_object with
|
||||
an abstract class). (Anatol)
|
||||
|
||||
- OCI8:
|
||||
. Expose oci_unregister_taf_callback() (Tianfang Yang)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #74980 (Narrowing occurred during type inference). (Laruence)
|
||||
|
||||
- phar:
|
||||
. Fixed bug #74991 (include_path has a 4096 char limit in some cases).
|
||||
(bwbroersma)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #74949 (null pointer dereference in _function_string). (Laruence)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #74892 (Url Rewriting (trans_sid) not working on urls that start
|
||||
with "#"). (Andrew Nester)
|
||||
. Fixed bug #74833 (SID constant created with wrong module number). (Anatol)
|
||||
|
||||
- SimpleXML:
|
||||
. Fixed bug #74950 (nullpointer deref in simplexml_element_getDocNamespaces).
|
||||
(Laruence)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #75049 (spl_autoload_unregister can't handle
|
||||
spl_autoload_functions results). (Laruence)
|
||||
. Fixed bug #74669 (Unserialize ArrayIterator broken). (Andrew Nester)
|
||||
. Fixed bug #74977 (Appending AppendIterator leads to segfault).
|
||||
(Andrew Nester)
|
||||
. Fixed bug #75015 (Crash in recursive iterator destructors). (Julien)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #75075 (unpack with X* causes infinity loop). (Laruence)
|
||||
. Fixed bug #74103 (heap-use-after-free when unserializing invalid array
|
||||
size). (Nikita)
|
||||
. Fixed bug #75054 (A Denial of Service Vulnerability was found when
|
||||
performing deserialization). (Nikita)
|
||||
|
||||
- WDDX:
|
||||
. Fixed bug #73793 (WDDX uses wrong decimal seperator). (cmb)
|
||||
|
||||
- XMLRPC:
|
||||
. Fixed bug #74975 (Incorrect xmlrpc serialization for classes with declared
|
||||
properties). (blar)
|
||||
|
||||
03 Aug 2017, PHP 7.1.8
|
||||
|
||||
- Core:
|
||||
. Fixed bug #74832 (Loading PHP extension with already registered function
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
Bug #74947 (Segfault in scanner on INF number)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
echo 200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;
|
||||
|
||||
echo -200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
INF-INF
|
||||
@@ -0,0 +1,45 @@
|
||||
--TEST--
|
||||
Bug #74954 (crash after update of generator yielding from finished generator)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function from() {
|
||||
yield 1;
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
function gen($gen) {
|
||||
try {
|
||||
var_dump(yield from $gen);
|
||||
} catch (Exception $e) { print "Caught exception!\n$e\n"; }
|
||||
}
|
||||
|
||||
$gen = from();
|
||||
$gens[] = gen($gen);
|
||||
$gens[] = gen($gen);
|
||||
|
||||
foreach ($gens as $g) {
|
||||
$g->current();
|
||||
}
|
||||
|
||||
do {
|
||||
foreach ($gens as $i => $g) {
|
||||
$g->next();
|
||||
}
|
||||
} while($gens[0]->valid());
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Caught exception!
|
||||
Exception in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): from()
|
||||
#1 [internal function]: gen(Object(Generator))
|
||||
#2 %s(%d): Generator->next()
|
||||
#3 {main}
|
||||
Caught exception!
|
||||
ClosedGeneratorException: Generator yielded from aborted, no return value available in %s:%d
|
||||
Stack trace:
|
||||
#0 [internal function]: gen(Object(Generator))
|
||||
#1 %s(%d): Generator->next()
|
||||
#2 {main}
|
||||
+5
-1
@@ -660,6 +660,10 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions) /
|
||||
extern zend_php_scanner_globals language_scanner_globals;
|
||||
#endif
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
php_win32_cp_set_by_id(65001);
|
||||
#endif
|
||||
|
||||
start_memory_manager();
|
||||
|
||||
virtual_cwd_startup(); /* Could use shutdown to free the main cwd but it would just slow it down for CGI */
|
||||
@@ -712,7 +716,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions) /
|
||||
zend_compile_file = compile_file;
|
||||
zend_execute_ex = execute_ex;
|
||||
zend_execute_internal = NULL;
|
||||
#endif /* HAVE_SYS_SDT_H */
|
||||
#endif /* HAVE_DTRACE */
|
||||
zend_compile_string = compile_string;
|
||||
zend_throw_exception_hook = NULL;
|
||||
|
||||
|
||||
@@ -757,15 +757,13 @@ failure:
|
||||
|
||||
ZEND_API void zend_generator_resume(zend_generator *orig_generator) /* {{{ */
|
||||
{
|
||||
zend_generator *generator;
|
||||
zend_generator *generator = zend_generator_get_current(orig_generator);
|
||||
|
||||
/* The generator is already closed, thus can't resume */
|
||||
if (UNEXPECTED(!orig_generator->execute_data)) {
|
||||
if (UNEXPECTED(!generator->execute_data)) {
|
||||
return;
|
||||
}
|
||||
|
||||
generator = zend_generator_get_current(orig_generator);
|
||||
|
||||
try_again:
|
||||
if (generator->flags & ZEND_GENERATOR_CURRENTLY_RUNNING) {
|
||||
zend_throw_error(NULL, "Cannot resume an already running generator");
|
||||
|
||||
+194
-196
File diff suppressed because it is too large.
Load diff
@@ -1663,7 +1663,6 @@ NEWLINE ("\r"|"\n"|"\r\n")
|
||||
if (errno == ERANGE) { /* Overflow */
|
||||
errno = 0;
|
||||
if (yytext[0] == '0') { /* octal overflow */
|
||||
errno = 0;
|
||||
ZVAL_DOUBLE(zendlval, zend_oct_strtod(yytext, (const char **)&end));
|
||||
} else {
|
||||
ZVAL_DOUBLE(zendlval, zend_strtod(yytext, (const char **)&end));
|
||||
@@ -1675,7 +1674,6 @@ NEWLINE ("\r"|"\n"|"\r\n")
|
||||
ZVAL_UNDEF(zendlval);
|
||||
RETURN_TOKEN(T_DNUMBER);
|
||||
}
|
||||
ZEND_ASSERT(!errno);
|
||||
RETURN_TOKEN(T_DNUMBER);
|
||||
}
|
||||
/* Also not an assert for the same reason */
|
||||
|
||||
@@ -433,7 +433,7 @@ char *alloca();
|
||||
#define ZEND_STRL(str) (str), (sizeof(str)-1)
|
||||
#define ZEND_STRS(str) (str), (sizeof(str))
|
||||
#define ZEND_NORMALIZE_BOOL(n) \
|
||||
((n) ? (((n)>0) ? 1 : -1) : 0)
|
||||
((n) ? (((n)<0) ? -1 : 1) : 0)
|
||||
#define ZEND_TRUTH(x) ((x) ? 1 : 0)
|
||||
#define ZEND_LOG_XOR(a, b) (ZEND_TRUTH(a) ^ ZEND_TRUTH(b))
|
||||
|
||||
|
||||
@@ -72,6 +72,10 @@ typedef unsigned long int uint32_t;
|
||||
#define NO_INFNAN_CHECK
|
||||
#endif
|
||||
|
||||
#ifndef NO_ERRNO
|
||||
#define NO_ERRNO
|
||||
#endif
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
#define IEEE_BIG_ENDIAN 1
|
||||
#else
|
||||
|
||||
+13
-4
@@ -445,11 +445,15 @@ static void cwd_globals_dtor(virtual_cwd_globals *cwd_g) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
CWD_API void virtual_cwd_startup(void) /* {{{ */
|
||||
void virtual_cwd_main_cwd_init(uint8_t reinit) /* {{{ */
|
||||
{
|
||||
char cwd[MAXPATHLEN];
|
||||
char *result;
|
||||
|
||||
if (reinit) {
|
||||
free(main_cwd_state.cwd);
|
||||
}
|
||||
|
||||
#ifdef NETWARE
|
||||
result = getcwdpath(cwd, NULL, 1);
|
||||
if(result)
|
||||
@@ -461,10 +465,10 @@ CWD_API void virtual_cwd_startup(void) /* {{{ */
|
||||
++c;
|
||||
}
|
||||
}
|
||||
#else
|
||||
#ifdef ZEND_WIN32
|
||||
#elif defined(ZEND_WIN32)
|
||||
ZeroMemory(&cwd, sizeof(cwd));
|
||||
#endif
|
||||
result = php_win32_ioutil_getcwd(cwd, sizeof(cwd));
|
||||
#else
|
||||
result = getcwd(cwd, sizeof(cwd));
|
||||
#endif
|
||||
if (!result) {
|
||||
@@ -478,7 +482,12 @@ CWD_API void virtual_cwd_startup(void) /* {{{ */
|
||||
}
|
||||
#endif
|
||||
main_cwd_state.cwd = strdup(cwd);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
CWD_API void virtual_cwd_startup(void) /* {{{ */
|
||||
{
|
||||
virtual_cwd_main_cwd_init(0);
|
||||
#ifdef ZTS
|
||||
ts_allocate_id(&cwd_globals_id, sizeof(virtual_cwd_globals), (ts_allocate_ctor) cwd_globals_ctor, (ts_allocate_dtor) cwd_globals_dtor);
|
||||
#else
|
||||
|
||||
@@ -251,6 +251,10 @@ CWD_API zend_long realpath_cache_size(void);
|
||||
CWD_API zend_long realpath_cache_max_buckets(void);
|
||||
CWD_API realpath_cache_bucket** realpath_cache_get_buckets(void);
|
||||
|
||||
#ifdef CWD_EXPORTS
|
||||
extern void virtual_cwd_main_cwd_init(uint8_t);
|
||||
#endif
|
||||
|
||||
/* The actual macros to be used in programs using TSRM
|
||||
* If the program defines VIRTUAL_DIR it will use the
|
||||
* virtual_* functions
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
if "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin >NUL 2>NUL
|
||||
if %errorlevel% neq 0 exit /b 3
|
||||
if "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin64 >NUL 2>NUL
|
||||
if %errorlevel% neq 0 exit /b 3
|
||||
if "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw >NUL 2>NUL
|
||||
if %errorlevel% neq 0 exit /b 3
|
||||
if "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw-w64 >NUL 2>NUL
|
||||
|
||||
+2
-2
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=7
|
||||
PHP_MINOR_VERSION=1
|
||||
PHP_RELEASE_VERSION=8
|
||||
PHP_EXTRA_VERSION="-dev"
|
||||
PHP_RELEASE_VERSION=9
|
||||
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`
|
||||
|
||||
|
||||
+19
-3
@@ -17,11 +17,23 @@ if test "$PHP_CURL" != "no"; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$CURL_DIR"; then
|
||||
AC_MSG_RESULT(not found)
|
||||
if which dpkg-architecture>/dev/null; then
|
||||
AC_MSG_CHECKING(for cURL in multiarch path)
|
||||
CURL_MULTIARCH_INCLUDE=/usr/include/$(dpkg-architecture -qDEB_HOST_MULTIARCH)
|
||||
if test -r $CURL_MULTIARCH_INCLUDE/curl/easy.h; then
|
||||
CURL_DIR=/usr
|
||||
AC_MSG_RESULT(found in $CURL_MULTIARCH_INCLUDE)
|
||||
else
|
||||
AC_MSG_RESULT(not found)
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "$CURL_DIR"; then
|
||||
AC_MSG_RESULT(not found)
|
||||
AC_MSG_ERROR(Please reinstall the libcurl distribution -
|
||||
AC_MSG_ERROR(Could not find cURL, please reinstall the libcurl distribution -
|
||||
easy.h should be in <curl-dir>/include/curl/)
|
||||
fi
|
||||
|
||||
@@ -45,7 +57,11 @@ if test "$PHP_CURL" != "no"; then
|
||||
AC_MSG_ERROR(cURL version 7.10.5 or later is required to compile php with cURL support)
|
||||
fi
|
||||
|
||||
PHP_ADD_INCLUDE($CURL_DIR/include)
|
||||
if test -z "$CURL_MULTIARCH_INCLUDE"; then
|
||||
PHP_ADD_INCLUDE($CURL_DIR/include)
|
||||
else
|
||||
PHP_ADD_INCLUDE($CURL_MULTIARCH_INCLUDE)
|
||||
fi
|
||||
PHP_EVAL_LIBLINE($CURL_LIBS, CURL_SHARED_LIBADD)
|
||||
PHP_ADD_LIBRARY_WITH_PATH(curl, $CURL_DIR/$PHP_LIBDIR, CURL_SHARED_LIBADD)
|
||||
|
||||
|
||||
@@ -1944,6 +1944,10 @@ static void date_period_it_rewind(zend_object_iterator *iter)
|
||||
if (iterator->object->current) {
|
||||
timelib_time_dtor(iterator->object->current);
|
||||
}
|
||||
if (!iterator->object->start) {
|
||||
zend_throw_error(NULL, "DatePeriod has not been initialized correctly");
|
||||
return;
|
||||
}
|
||||
iterator->object->current = timelib_time_clone(iterator->object->start);
|
||||
date_period_it_invalidate_current(iter);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #75002 Null Pointer Dereference in timelib_time_clone
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class aaa extends DatePeriod {
|
||||
public function __construct() { }
|
||||
}
|
||||
|
||||
$start=new DateTime( '2012-08-01' );
|
||||
|
||||
foreach (new aaa($start) as $y) {
|
||||
$a=$key;
|
||||
}
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: DatePeriod has not been initialized correctly in %sbug75002.php:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %sbug75002.php on line %d
|
||||
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Test exif_read_data on unavailable file
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
|
||||
--FILE--
|
||||
<?php
|
||||
$infile = dirname(__FILE__).'/bug73115.JPG';
|
||||
exif_read_data($infile);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Warning: exif_read_data(): Unable to open file in %sexif_read_data_0.php on line %d
|
||||
===DONE===
|
||||
|
||||
Binary file not shown.
@@ -1,16 +1,38 @@
|
||||
--TEST--
|
||||
Bug #67647: Bundled libmagic 5.17 does not detect quicktime files correctly
|
||||
--SKIPIF--
|
||||
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
|
||||
<?php
|
||||
require_once(dirname(__FILE__) . '/skipif.inc');
|
||||
|
||||
if (ini_get("default_charset") != "UTF-8") {
|
||||
die("skip require default_charset == UTF-8");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$f = dirname(__FILE__) . DIRECTORY_SEPARATOR . "67647私はガラスを食べられます.mov";
|
||||
$src = dirname(__FILE__) . DIRECTORY_SEPARATOR . "67647.mov";
|
||||
|
||||
$f_base = "67647私はガラスを食べられます.mov";
|
||||
$f = dirname(__FILE__) . DIRECTORY_SEPARATOR . $f_base;
|
||||
|
||||
/* Streams mb path support is tested a lot elsewhere. Copy the existing file
|
||||
therefore, avoid duplication in the repo. */
|
||||
if (!copy($src, $f) || empty(glob($f))) {
|
||||
die("failed to copy '$src' to '$f'");
|
||||
}
|
||||
|
||||
$fi = new finfo(FILEINFO_MIME_TYPE);
|
||||
var_dump($fi->file($f));
|
||||
|
||||
?>
|
||||
+++DONE+++
|
||||
--CLEAN--
|
||||
<?php
|
||||
$f_base = "67647私はガラスを食べられます.mov";
|
||||
$f = dirname(__FILE__) . DIRECTORY_SEPARATOR . $f_base;
|
||||
unlink($f);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(15) "video/quicktime"
|
||||
+++DONE+++
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 384 KiB After Width: | Height: | Size: 7.4 KiB |
@@ -1,5 +1,9 @@
|
||||
--TEST--
|
||||
(Bug #74031) ReflectionFunction for imagepng returns wrong number of parameters
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die("skip gd extension not available\n");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
+25
-25
@@ -173,6 +173,24 @@ ZEND_BEGIN_ARG_INFO_EX(numfmt_parse_currency_arginfo, 0, 0, 3)
|
||||
ZEND_ARG_INFO(1, position)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX( locale_get_loc_in_loc_args, 0, ZEND_RETURN_VALUE, 1 )
|
||||
ZEND_ARG_INFO(0, locale)
|
||||
ZEND_ARG_INFO(0, in_locale)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX( locale_filter_matches_args, 0, ZEND_RETURN_VALUE, 2 )
|
||||
ZEND_ARG_INFO(0, langtag)
|
||||
ZEND_ARG_INFO(0, locale)
|
||||
ZEND_ARG_INFO(0, canonicalize)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX( locale_lookup_args, 0, ZEND_RETURN_VALUE, 2 )
|
||||
ZEND_ARG_INFO(0, langtag)
|
||||
ZEND_ARG_INFO(0, locale)
|
||||
ZEND_ARG_INFO(0, canonicalize)
|
||||
ZEND_ARG_INFO(0, def)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(locale_0_args, 0, 0, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
@@ -180,24 +198,6 @@ ZEND_BEGIN_ARG_INFO_EX(locale_1_arg, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, arg1)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(locale_2_args, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, arg1)
|
||||
ZEND_ARG_INFO(0, arg2)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(locale_3_args, 0, 0, 3)
|
||||
ZEND_ARG_INFO(0, arg1)
|
||||
ZEND_ARG_INFO(0, arg2)
|
||||
ZEND_ARG_INFO(0, arg3)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(locale_4_args, 0, 0, 4)
|
||||
ZEND_ARG_INFO(0, arg1)
|
||||
ZEND_ARG_INFO(0, arg2)
|
||||
ZEND_ARG_INFO(0, arg3)
|
||||
ZEND_ARG_INFO(0, arg4)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define intl_0_args collator_static_0_args
|
||||
#define intl_1_arg collator_static_1_arg
|
||||
|
||||
@@ -670,17 +670,17 @@ zend_function_entry intl_functions[] = {
|
||||
PHP_FE( locale_get_script, locale_1_arg )
|
||||
PHP_FE( locale_get_region, locale_1_arg )
|
||||
PHP_FE( locale_get_keywords, locale_1_arg )
|
||||
PHP_FE( locale_get_display_script, locale_2_args )
|
||||
PHP_FE( locale_get_display_region, locale_2_args )
|
||||
PHP_FE( locale_get_display_name, locale_2_args )
|
||||
PHP_FE( locale_get_display_language, locale_2_args)
|
||||
PHP_FE( locale_get_display_variant, locale_2_args )
|
||||
PHP_FE( locale_get_display_script, locale_get_loc_in_loc_args )
|
||||
PHP_FE( locale_get_display_region, locale_get_loc_in_loc_args )
|
||||
PHP_FE( locale_get_display_name, locale_get_loc_in_loc_args )
|
||||
PHP_FE( locale_get_display_language, locale_get_loc_in_loc_args)
|
||||
PHP_FE( locale_get_display_variant, locale_get_loc_in_loc_args )
|
||||
PHP_FE( locale_compose, locale_1_arg )
|
||||
PHP_FE( locale_parse, locale_1_arg )
|
||||
PHP_FE( locale_get_all_variants, locale_1_arg )
|
||||
PHP_FE( locale_filter_matches, locale_3_args )
|
||||
PHP_FE( locale_filter_matches, locale_filter_matches_args )
|
||||
PHP_FE( locale_canonicalize, locale_1_arg )
|
||||
PHP_FE( locale_lookup, locale_4_args )
|
||||
PHP_FE( locale_lookup, locale_lookup_args )
|
||||
PHP_FE( locale_accept_from_http, locale_1_arg )
|
||||
|
||||
/* MessageFormatter functions */
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
--TEST--
|
||||
Bug #74993 Wrong reflection on some locale_* functions
|
||||
--SKIPIF--
|
||||
<?php
|
||||
extension_loaded('intl') || print 'skip';
|
||||
--FILE--
|
||||
<?php
|
||||
$funcs = [
|
||||
'locale_get_display_language',
|
||||
'locale_get_display_name',
|
||||
'locale_get_display_region',
|
||||
'locale_get_display_script',
|
||||
'locale_get_display_variant',
|
||||
'locale_filter_matches',
|
||||
'locale_lookup',
|
||||
];
|
||||
|
||||
foreach ($funcs as $func) {
|
||||
echo (new ReflectionFunction($func));
|
||||
}
|
||||
--EXPECT--
|
||||
Function [ <internal:intl> function locale_get_display_language ] {
|
||||
|
||||
- Parameters [2] {
|
||||
Parameter #0 [ <required> $locale ]
|
||||
Parameter #1 [ <optional> $in_locale ]
|
||||
}
|
||||
}
|
||||
Function [ <internal:intl> function locale_get_display_name ] {
|
||||
|
||||
- Parameters [2] {
|
||||
Parameter #0 [ <required> $locale ]
|
||||
Parameter #1 [ <optional> $in_locale ]
|
||||
}
|
||||
}
|
||||
Function [ <internal:intl> function locale_get_display_region ] {
|
||||
|
||||
- Parameters [2] {
|
||||
Parameter #0 [ <required> $locale ]
|
||||
Parameter #1 [ <optional> $in_locale ]
|
||||
}
|
||||
}
|
||||
Function [ <internal:intl> function locale_get_display_script ] {
|
||||
|
||||
- Parameters [2] {
|
||||
Parameter #0 [ <required> $locale ]
|
||||
Parameter #1 [ <optional> $in_locale ]
|
||||
}
|
||||
}
|
||||
Function [ <internal:intl> function locale_get_display_variant ] {
|
||||
|
||||
- Parameters [2] {
|
||||
Parameter #0 [ <required> $locale ]
|
||||
Parameter #1 [ <optional> $in_locale ]
|
||||
}
|
||||
}
|
||||
Function [ <internal:intl> function locale_filter_matches ] {
|
||||
|
||||
- Parameters [3] {
|
||||
Parameter #0 [ <required> $langtag ]
|
||||
Parameter #1 [ <required> $locale ]
|
||||
Parameter #2 [ <optional> $canonicalize ]
|
||||
}
|
||||
}
|
||||
Function [ <internal:intl> function locale_lookup ] {
|
||||
|
||||
- Parameters [4] {
|
||||
Parameter #0 [ <required> $langtag ]
|
||||
Parameter #1 [ <required> $locale ]
|
||||
Parameter #2 [ <optional> $canonicalize ]
|
||||
Parameter #3 [ <optional> $def ]
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,8 @@ echo $orstr,"\n";
|
||||
echo $new_str,"\n";
|
||||
echo $recovstr,"\n";
|
||||
|
||||
var_dump(($orstr == $recovstr) == $recovstr2);
|
||||
var_dump($orstr === $recovstr);
|
||||
var_dump($orstr === $recovstr2);
|
||||
|
||||
echo "Done.\n";
|
||||
--EXPECT--
|
||||
@@ -29,4 +30,5 @@ echo "Done.\n";
|
||||
ōshanbyū
|
||||
オーシャンビュー
|
||||
bool(true)
|
||||
bool(true)
|
||||
Done.
|
||||
+1
-1
@@ -17,6 +17,6 @@ if (PHP_JSON != "no") {
|
||||
|
||||
ADD_SOURCES(configure_module_dirname, "json_encoder.c json_parser.tab.c json_scanner.c", "json");
|
||||
|
||||
PHP_INSTALL_HEADERS("ext/json/", "php_json.h");
|
||||
PHP_INSTALL_HEADERS("ext/json/", "php_json.h php_json_parser.h php_json_scanner.h");
|
||||
}
|
||||
|
||||
@@ -88,7 +88,8 @@ const struct mbfl_convert_vtbl vtbl_html_wchar = {
|
||||
mbfl_filt_conv_html_dec_ctor,
|
||||
mbfl_filt_conv_html_dec_dtor,
|
||||
mbfl_filt_conv_html_dec,
|
||||
mbfl_filt_conv_html_dec_flush };
|
||||
mbfl_filt_conv_html_dec_flush,
|
||||
mbfl_filt_conv_html_dec_copy };
|
||||
|
||||
|
||||
#define CK(statement) do { if ((statement) < 0) return (-1); } while (0)
|
||||
@@ -309,4 +310,9 @@ int mbfl_filt_conv_html_dec_flush(mbfl_convert_filter *filter)
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
void mbfl_filt_conv_html_dec_copy(mbfl_convert_filter *src, mbfl_convert_filter *dest)
|
||||
{
|
||||
*dest = *src;
|
||||
dest->opaque = mbfl_malloc(html_enc_buffer_size+1);
|
||||
memcpy(dest->opaque, src->opaque, html_enc_buffer_size+1);
|
||||
}
|
||||
@@ -42,6 +42,7 @@ int mbfl_filt_conv_html_enc(int c, mbfl_convert_filter *filter);
|
||||
int mbfl_filt_conv_html_enc_flush(mbfl_convert_filter *filter);
|
||||
int mbfl_filt_conv_html_dec(int c, mbfl_convert_filter *filter);
|
||||
int mbfl_filt_conv_html_dec_flush(mbfl_convert_filter *filter);
|
||||
void mbfl_filt_conv_html_dec_copy(mbfl_convert_filter *src, mbfl_convert_filter *dest);
|
||||
void mbfl_filt_conv_html_dec_ctor(mbfl_convert_filter *filter);
|
||||
void mbfl_filt_conv_html_dec_dtor(mbfl_convert_filter *filter);
|
||||
|
||||
|
||||
@@ -222,11 +222,11 @@ mbfl_filt_tl_jisx0201_jisx0208(int c, mbfl_convert_filter *filt)
|
||||
} else if (mode & (MBFL_FILT_TL_ZEN2HAN_HIRA2KANA
|
||||
| MBFL_FILT_TL_ZEN2HAN_KANA2HIRA)) {
|
||||
if ((mode & MBFL_FILT_TL_ZEN2HAN_HIRA2KANA) &&
|
||||
c >= 0x3041 && c <= 0x3093) {
|
||||
((c >= 0x3041 && c <= 0x3093) || c == 0x309d || c == 0x309e)) {
|
||||
/* Zenkaku hirangana to Zenkaku katakana */
|
||||
s = c + 0x60;
|
||||
} else if ((mode & MBFL_FILT_TL_ZEN2HAN_KANA2HIRA) &&
|
||||
c >= 0x30a1 && c <= 0x30f3) {
|
||||
((c >= 0x30a1 && c <= 0x30f3) || c == 0x30fd || c == 0x30fe)) {
|
||||
/* Zenkaku katakana to Zenkaku hirangana */
|
||||
s = c - 0x60;
|
||||
}
|
||||
|
||||
@@ -457,6 +457,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_eregi_replace, 0, 0, 3)
|
||||
ZEND_ARG_INFO(0, pattern)
|
||||
ZEND_ARG_INFO(0, replacement)
|
||||
ZEND_ARG_INFO(0, string)
|
||||
ZEND_ARG_INFO(0, option)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_ereg_replace_callback, 0, 0, 3)
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Bug #62934: mb_convert_kana() does not convert iteration marks
|
||||
--FILE--
|
||||
<?php
|
||||
echo mb_convert_kana('あゝすゞめアヽスヾメ', 'C', 'UTF-8') . "\n";
|
||||
echo mb_convert_kana('あゝすゞめアヽスヾメ', 'c', 'UTF-8') . "\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
アヽスヾメアヽスヾメ
|
||||
あゝすゞめあゝすゞめ
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Bug #71606 (Segmentation fault mb_strcut + mb_list_encodings)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('mbstring')) die('skip ext/mbstring not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo mb_strcut('"', 0, 0, 'HTML-ENTITIES');
|
||||
echo 'DONE', PHP_EOL;
|
||||
?>
|
||||
--EXPECT--
|
||||
DONE
|
||||
+7
-2
@@ -1149,7 +1149,7 @@ void php_mysqli_fetch_into_hash_aux(zval *return_value, MYSQL_RES * result, zend
|
||||
{
|
||||
#if !defined(MYSQLI_USE_MYSQLND)
|
||||
MYSQL_ROW row;
|
||||
unsigned int i;
|
||||
unsigned int i, num_fields;
|
||||
MYSQL_FIELD *fields;
|
||||
zend_ulong *field_len;
|
||||
|
||||
@@ -1163,8 +1163,9 @@ void php_mysqli_fetch_into_hash_aux(zval *return_value, MYSQL_RES * result, zend
|
||||
|
||||
array_init(return_value);
|
||||
field_len = mysql_fetch_lengths(result);
|
||||
num_fields = mysql_num_fields(result);
|
||||
|
||||
for (i = 0; i < mysql_num_fields(result); i++) {
|
||||
for (i = 0; i < num_fields; i++) {
|
||||
if (row[i]) {
|
||||
zval res;
|
||||
|
||||
@@ -1244,6 +1245,10 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
|
||||
php_error_docref(NULL, E_WARNING, "Could not find class '%s'", ZSTR_VAL(class_name));
|
||||
return;
|
||||
}
|
||||
if (UNEXPECTED(ce->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_TRAIT|ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS))) {
|
||||
zend_throw_error(NULL, "Class '%s' cannot be instantiated", ZSTR_VAL(ce->name));
|
||||
return;
|
||||
}
|
||||
fetchtype = MYSQLI_ASSOC;
|
||||
} else {
|
||||
if (override_flags) {
|
||||
|
||||
@@ -1210,7 +1210,7 @@ PHP_FUNCTION(mysqli_fetch_fields)
|
||||
zval *mysql_result;
|
||||
zval obj;
|
||||
|
||||
unsigned int i;
|
||||
unsigned int i, num_fields;
|
||||
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
|
||||
return;
|
||||
@@ -1219,8 +1219,9 @@ PHP_FUNCTION(mysqli_fetch_fields)
|
||||
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID);
|
||||
|
||||
array_init(return_value);
|
||||
num_fields = mysql_num_fields(result);
|
||||
|
||||
for (i = 0; i < mysql_num_fields(result); i++) {
|
||||
for (i = 0; i < num_fields; i++) {
|
||||
const MYSQL_FIELD *field = mysql_fetch_field_direct(result, i);
|
||||
|
||||
object_init(&obj);
|
||||
@@ -1266,7 +1267,7 @@ PHP_FUNCTION(mysqli_fetch_lengths)
|
||||
{
|
||||
MYSQL_RES *result;
|
||||
zval *mysql_result;
|
||||
unsigned int i;
|
||||
unsigned int i, num_fields;
|
||||
#if defined(MYSQLI_USE_MYSQLND)
|
||||
const size_t *ret;
|
||||
#else
|
||||
@@ -1284,8 +1285,9 @@ PHP_FUNCTION(mysqli_fetch_lengths)
|
||||
}
|
||||
|
||||
array_init(return_value);
|
||||
num_fields = mysql_num_fields(result);
|
||||
|
||||
for (i = 0; i < mysql_num_fields(result); i++) {
|
||||
for (i = 0; i < num_fields; i++) {
|
||||
add_index_long(return_value, i, ret[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Bug #74968 PHP crashes when calling mysqli_result::fetch_object with an abstract class
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
|
||||
$mysqli = new mysqli("$host:$port", $user, $passwd, $db);
|
||||
abstract class test {
|
||||
public $a;
|
||||
}
|
||||
$mysqli->query("SELECT 1 as a")->fetch_object("test");
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Class 'test' cannot be instantiated in %sbug74968.php:%d
|
||||
Stack trace:
|
||||
#0 %sbug74968.php(%d): mysqli_result->fetch_object('test')
|
||||
#1 {main}
|
||||
thrown in %sbug74968.php on line %d
|
||||
+1
-1
@@ -45,7 +45,7 @@ if (PHP_OCI8 != "no") {
|
||||
if (CHECK_HEADER_ADD_INCLUDE("oci.h", "CFLAGS_OCI8", oci8_inc_paths) &&
|
||||
CHECK_LIB("oci.lib", "oci8", oci8_lib_paths))
|
||||
{
|
||||
EXTENSION('oci8', 'oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c');
|
||||
EXTENSION('oci8', 'oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c oci8_failover.c');
|
||||
|
||||
AC_DEFINE('HAVE_OCI8', 1);
|
||||
AC_DEFINE('HAVE_OCI_INSTANT_CLIENT', 1);
|
||||
|
||||
+7
-1
@@ -509,6 +509,10 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_register_taf_callback, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, connection_resource)
|
||||
ZEND_ARG_INFO(0, function_name)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_unregister_taf_callback, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, connection_resource)
|
||||
ZEND_END_ARG_INFO()
|
||||
/* }}} */
|
||||
|
||||
/* {{{ LOB Method arginfo */
|
||||
@@ -707,6 +711,7 @@ PHP_FUNCTION(oci_collection_size);
|
||||
PHP_FUNCTION(oci_collection_max);
|
||||
PHP_FUNCTION(oci_collection_trim);
|
||||
PHP_FUNCTION(oci_register_taf_callback);
|
||||
PHP_FUNCTION(oci_unregister_taf_callback);
|
||||
/* }}} */
|
||||
|
||||
/* {{{ extension definition structures
|
||||
@@ -790,6 +795,7 @@ static const zend_function_entry php_oci_functions[] = {
|
||||
PHP_FE(oci_collection_trim, arginfo_oci_collection_trim)
|
||||
PHP_FE(oci_new_collection, arginfo_oci_new_collection)
|
||||
PHP_FE(oci_register_taf_callback, arginfo_oci_register_taf_callback)
|
||||
PHP_FE(oci_unregister_taf_callback, arginfo_oci_unregister_taf_callback)
|
||||
|
||||
PHP_FALIAS(oci_free_cursor, oci_free_statement, arginfo_oci_free_statement)
|
||||
PHP_FALIAS(ocifreecursor, oci_free_statement, arginfo_oci_free_statement)
|
||||
@@ -2702,7 +2708,7 @@ static int php_oci_persistent_helper(zval *zv)
|
||||
|
||||
/* Remove TAF callback function as it's bound to current request */
|
||||
if (connection->used_this_request && !Z_ISUNDEF(connection->taf_callback) && !Z_ISNULL(connection->taf_callback)) {
|
||||
php_oci_disable_taf_callback(connection);
|
||||
php_oci_unregister_taf_callback(connection);
|
||||
}
|
||||
|
||||
if (!connection->used_this_request && OCI_G(persistent_timeout) != -1) {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Stig Sæther Bakken <ssb@php.net> |
|
||||
| Authors: Stig Sæther Bakken <ssb@php.net> |
|
||||
| Thies C. Arntzen <thies@thieso.net> |
|
||||
| |
|
||||
| Collection support by Andy Sautins <asautins@veripost.net> |
|
||||
|
||||
+14
-13
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
| PHP Version 7 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2016 The PHP Group |
|
||||
| Copyright (c) 1997-2017 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -42,27 +42,28 @@
|
||||
|
||||
/* {{{ callback_fn()
|
||||
OCI TAF callback function, calling userspace function */
|
||||
sb4 callback_fn(OCISvcCtx *svchp, OCIEnv *envhp, php_oci_connection *fo_ctx, ub4 fo_type, ub4 fo_event)
|
||||
sb4 callback_fn(void *svchp, void *envhp, void *fo_ctx, ub4 fo_type, ub4 fo_event)
|
||||
{
|
||||
/* Create zval */
|
||||
zval retval, params[3];
|
||||
php_oci_connection *connection = (php_oci_connection*)fo_ctx;
|
||||
|
||||
/* Default return value */
|
||||
sb4 returnValue = 0;
|
||||
|
||||
/* Check if userspace callback function was disabled */
|
||||
if (Z_ISUNDEF(fo_ctx->taf_callback) || Z_ISNULL(fo_ctx->taf_callback)) {
|
||||
/* Check if userspace callback function was unregistered */
|
||||
if (Z_ISUNDEF(connection->taf_callback) || Z_ISNULL(connection->taf_callback)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Initialize zval */
|
||||
ZVAL_RES(¶ms[0], fo_ctx->id);
|
||||
ZVAL_RES(¶ms[0], connection->id);
|
||||
ZVAL_LONG(¶ms[1], fo_event);
|
||||
ZVAL_LONG(¶ms[2], fo_type);
|
||||
|
||||
/* Call user function (if possible) */
|
||||
if (call_user_function(EG(function_table), NULL, &fo_ctx->taf_callback, &retval, 3, params) == FAILURE) {
|
||||
php_error_docref(NULL, E_WARNING, "Unable to call taf callback function, is it defined?");
|
||||
if (call_user_function(EG(function_table), NULL, &connection->taf_callback, &retval, 3, params) == FAILURE) {
|
||||
php_error_docref(NULL, E_WARNING, "Unable to call Oracle TAF callback function");
|
||||
}
|
||||
|
||||
/* Set return value */
|
||||
@@ -83,10 +84,10 @@ sb4 callback_fn(OCISvcCtx *svchp, OCIEnv *envhp, php_oci_connection *fo_ctx, ub4
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ php_oci_disable_taf_callback()
|
||||
Disables the userspace callback function for Oracle TAF,
|
||||
/* {{{ php_oci_unregister_taf_callback()
|
||||
Unregister the userspace callback function for Oracle TAF,
|
||||
while keeping the OCI callback alive */
|
||||
int php_oci_disable_taf_callback(php_oci_connection *connection)
|
||||
int php_oci_unregister_taf_callback(php_oci_connection *connection)
|
||||
{
|
||||
return php_oci_register_taf_callback(connection, NULL);
|
||||
}
|
||||
@@ -103,9 +104,9 @@ int php_oci_register_taf_callback(php_oci_connection *connection, zval *callback
|
||||
OCIFocbkStruct failover;
|
||||
|
||||
if (!callback) {
|
||||
/* Disable callback */
|
||||
/* Unregister callback */
|
||||
if (Z_ISUNDEF(connection->taf_callback) || Z_ISNULL(connection->taf_callback)) {
|
||||
return 0; // Nothing to disable
|
||||
return 0; // Nothing to unregister
|
||||
}
|
||||
|
||||
registered = 1;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Stig Sæther Bakken <ssb@php.net> |
|
||||
| Authors: Stig Sæther Bakken <ssb@php.net> |
|
||||
| Thies C. Arntzen <thies@thieso.net> |
|
||||
| |
|
||||
| Collection support by Andy Sautins <asautins@veripost.net> |
|
||||
@@ -56,13 +56,21 @@ PHP_FUNCTION(oci_register_taf_callback)
|
||||
}
|
||||
|
||||
if (callback) {
|
||||
#if PHP_MAJOR_VERSION > 7 || (PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION >= 2)
|
||||
if (!zend_is_callable(callback, 0, 0)) {
|
||||
callback_name = zend_get_callable_name(callback);
|
||||
php_error_docref(NULL, E_WARNING, "function '%s' is not callable", ZSTR_VAL(callback_name));
|
||||
zend_string_release(callback_name);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#else
|
||||
if (!zend_is_callable(callback, 0, &callback_name)) {
|
||||
php_error_docref(NULL, E_WARNING, "function '%s' is not callable", ZSTR_VAL(callback_name));
|
||||
zend_string_release(callback_name);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
zend_string_release(callback_name);
|
||||
#endif
|
||||
}
|
||||
|
||||
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
|
||||
@@ -75,6 +83,27 @@ PHP_FUNCTION(oci_register_taf_callback)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto bool oci_unregister_taf_callback( resource connection )
|
||||
* Unregister a callback function for Oracle Transparent Application Failover (TAF) */
|
||||
PHP_FUNCTION(oci_unregister_taf_callback)
|
||||
{
|
||||
zval *z_connection;
|
||||
php_oci_connection *connection;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_connection) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
|
||||
|
||||
if (php_oci_unregister_taf_callback(connection) == 0) {
|
||||
RETURN_TRUE;
|
||||
} else {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto bool oci_define_by_name(resource stmt, string name, mixed &var [, int type])
|
||||
Define a PHP variable to an Oracle column by name */
|
||||
/* if you want to define a LOB/CLOB etc make sure you allocate it via OCINewDescriptor BEFORE defining!!! */
|
||||
@@ -1587,8 +1616,8 @@ PHP_FUNCTION(oci_close)
|
||||
RefCount value by 1 */
|
||||
zend_list_close(connection->id);
|
||||
|
||||
/* Disable Oracle TAF */
|
||||
php_oci_disable_taf_callback(connection);
|
||||
/* Unregister Oracle TAF */
|
||||
php_oci_unregister_taf_callback(connection);
|
||||
|
||||
/* ZVAL_NULL(z_connection); */
|
||||
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Stig Sæther Bakken <ssb@php.net> |
|
||||
| Authors: Stig Sæther Bakken <ssb@php.net> |
|
||||
| Thies C. Arntzen <thies@thieso.net> |
|
||||
| |
|
||||
| Collection support by Andy Sautins <asautins@veripost.net> |
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Stig Sæther Bakken <ssb@php.net> |
|
||||
| Authors: Stig Sæther Bakken <ssb@php.net> |
|
||||
| Thies C. Arntzen <thies@thieso.net> |
|
||||
| |
|
||||
| Collection support by Andy Sautins <asautins@veripost.net> |
|
||||
|
||||
+27
-5
@@ -12,7 +12,7 @@ Use the OCI8 extension to access Oracle Database. Use 'pecl install
|
||||
oci8' to install for PHP 7. Use 'pecl install oci8-2.0.12' to install
|
||||
for PHP 5.2 - PHP 5.6. Use 'pecl install oci8-1.4.10' to install for
|
||||
PHP 4.3.9 - PHP 5.1. The OCI8 extension can be linked with Oracle
|
||||
client libraries from Oracle Database 12.1, 11, or 10.2. These
|
||||
client libraries from Oracle Database 12, 11, or 10.2. These
|
||||
libraries are found in your database installation, or in the free
|
||||
Oracle Instant Client from
|
||||
http://www.oracle.com/technetwork/database/features/instant-client/.
|
||||
@@ -27,6 +27,12 @@ Interoperability Support" (ID 207303.1) for details.
|
||||
<email>sixd@php.net</email>
|
||||
<active>yes</active>
|
||||
</lead>
|
||||
<lead>
|
||||
<name>Tianfang Yang</name>
|
||||
<user>tianfyan</user>
|
||||
<email>tianfyan@php.net</email>
|
||||
<active>yes</active>
|
||||
</lead>
|
||||
<lead>
|
||||
<name>Antony Dovgal</name>
|
||||
<user>tony2001</user>
|
||||
@@ -46,12 +52,12 @@ Interoperability Support" (ID 207303.1) for details.
|
||||
<active>no</active>
|
||||
</lead>
|
||||
|
||||
<date>2017-06-20</date>
|
||||
<date>2017-08-15</date>
|
||||
<time>12:00:00</time>
|
||||
|
||||
<version>
|
||||
<release>2.1.6</release>
|
||||
<api>2.1.6</api>
|
||||
<release>2.1.7</release>
|
||||
<api>2.1.7</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
@@ -60,7 +66,7 @@ Interoperability Support" (ID 207303.1) for details.
|
||||
<license uri="http://www.php.net/license">PHP</license>
|
||||
<notes>
|
||||
This version is for PHP 7 only.
|
||||
Fixed bug #74625 (Integer overflow in oci_bind_array_by_name). (Ingmar Runge)
|
||||
Added oci_unregister_taf_callback()
|
||||
</notes>
|
||||
<contents>
|
||||
<dir name="/">
|
||||
@@ -470,6 +476,22 @@ Fixed bug #74625 (Integer overflow in oci_bind_array_by_name). (Ingmar Runge)
|
||||
</extsrcrelease>
|
||||
<changelog>
|
||||
|
||||
<release>
|
||||
<version>
|
||||
<release>2.1.6</release>
|
||||
<api>2.1.6</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://www.php.net/license">PHP</license>
|
||||
<notes>
|
||||
This version is for PHP 7 only.
|
||||
Fixed bug #74625 (Integer overflow in oci_bind_array_by_name). (Ingmar Runge)
|
||||
</notes>
|
||||
</release>
|
||||
|
||||
<release>
|
||||
<version>
|
||||
<release>2.1.5</release>
|
||||
|
||||
+2
-2
@@ -12,7 +12,7 @@
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Stig Sæther Bakken <ssb@php.net> |
|
||||
| Authors: Stig Sæther Bakken <ssb@php.net> |
|
||||
| Thies C. Arntzen <thies@thieso.net> |
|
||||
| |
|
||||
| Collection support by Andy Sautins <asautins@veripost.net> |
|
||||
@@ -43,7 +43,7 @@
|
||||
*/
|
||||
#undef PHP_OCI8_VERSION
|
||||
#endif
|
||||
#define PHP_OCI8_VERSION "2.1.6"
|
||||
#define PHP_OCI8_VERSION "2.1.7"
|
||||
|
||||
extern zend_module_entry oci8_module_entry;
|
||||
#define phpext_oci8_ptr &oci8_module_entry
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Stig Sæther Bakken <ssb@php.net> |
|
||||
| Authors: Stig Sæther Bakken <ssb@php.net> |
|
||||
| Thies C. Arntzen <thies@thieso.net> |
|
||||
| |
|
||||
| Collection support by Andy Sautins <asautins@veripost.net> |
|
||||
@@ -536,7 +536,7 @@ ZEND_END_MODULE_GLOBALS(oci) /* }}} */
|
||||
/* {{{ transparent failover related prototypes */
|
||||
|
||||
int php_oci_register_taf_callback(php_oci_connection *connection, zval *callback);
|
||||
int php_oci_disable_taf_callback(php_oci_connection *connection);
|
||||
int php_oci_unregister_taf_callback(php_oci_connection *connection);
|
||||
|
||||
/* }}} */
|
||||
|
||||
|
||||
@@ -1,96 +1,96 @@
|
||||
--TEST--
|
||||
Bug #72524 (Binding null values triggers ORA-24816 error)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$target_dbs = array('oracledb' => true, 'timesten' => true); // test runs on these DBs
|
||||
require(dirname(__FILE__).'/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
|
||||
<?php
|
||||
|
||||
require(dirname(__FILE__).'/connect.inc');
|
||||
|
||||
// Initialize
|
||||
|
||||
$stmtarray = array(
|
||||
"CREATE TABLE mytable (clob_col CLOB DEFAULT NULL, varchar2_col VARCHAR2(255) DEFAULT NULL)"
|
||||
);
|
||||
|
||||
oci8_test_sql_execute($c, $stmtarray);
|
||||
|
||||
// Run test
|
||||
|
||||
$sql = "INSERT INTO mytable VALUES (:clob_col, :varchar2_col)";
|
||||
|
||||
echo "Test 1 - P1 Value: NULL P1 Length: Default P1 Type: Default P2 Value: NULL P2 Length: Default P2 Type: Default\n";
|
||||
$stmt = oci_parse($c, $sql);
|
||||
|
||||
$clob = NULL;
|
||||
$varchar2 = NULL;
|
||||
oci_bind_by_name($stmt, ':clob_col', $clob);
|
||||
oci_bind_by_name($stmt, ':varchar2_col', $varchar2);
|
||||
|
||||
var_dump(oci_execute($stmt));
|
||||
|
||||
echo "Test 2 - P1 Value: '' P1 Length: Default P1 Type: Default P2 Value: '' P2 Length: Default P2 Type: Default\n";
|
||||
|
||||
$clob = '';
|
||||
$varchar2 = '';
|
||||
oci_bind_by_name($stmt, ':clob_col', $clob);
|
||||
oci_bind_by_name($stmt, ':varchar2_col', $varchar2);
|
||||
|
||||
var_dump(oci_execute($stmt));
|
||||
|
||||
echo "Test 3 - P1 Value: 'abc' P1 Length: 0 P1 Type: Default P2 Value: '' P2 Length: 0 P2 Type: Default\n";
|
||||
$clob = 'abc';
|
||||
$varchar2 = 'abc';
|
||||
oci_bind_by_name($stmt, ':clob_col', $clob, 0);
|
||||
oci_bind_by_name($stmt, ':varchar2_col', $varchar2, 0);
|
||||
|
||||
var_dump(oci_execute($stmt));
|
||||
|
||||
echo "Test 4 - P1 Value: NULL P1 Length: -1 P1 Type: SQLT_LNG P2 Value: NULL P2 Length: -1 P2 Type:Default\n";
|
||||
$clob = NULL;
|
||||
$varchar2 = NULL;
|
||||
oci_bind_by_name($stmt, ':clob_col', $clob, -1, SQLT_LNG);
|
||||
oci_bind_by_name($stmt, ':varchar2_col', $varchar2, -1, SQLT_LNG);
|
||||
|
||||
var_dump(oci_execute($stmt));
|
||||
|
||||
echo "Test 5 - P1 Value: NULL P1 Length: 0 P1 Type: SQLT_LNG P2 Value: NULL P2 Length: 0 P2 Type:Default\n";
|
||||
$clob = NULL;
|
||||
$varchar2 = NULL;
|
||||
oci_bind_by_name($stmt, ':clob_col', $clob, 0, SQLT_LNG);
|
||||
oci_bind_by_name($stmt, ':varchar2_col', $varchar2, 0, SQLT_LNG);
|
||||
|
||||
|
||||
var_dump(oci_execute($stmt));
|
||||
|
||||
// Cleanup
|
||||
|
||||
$stmtarray = array(
|
||||
"DROP TABLE mytable"
|
||||
);
|
||||
|
||||
oci8_test_sql_execute($c, $stmtarray);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
<?php exit(0); ?>
|
||||
--EXPECTF--
|
||||
Test 1 - P1 Value: NULL P1 Length: Default P1 Type: Default P2 Value: NULL P2 Length: Default P2 Type: Default
|
||||
bool(true)
|
||||
Test 2 - P1 Value: '' P1 Length: Default P1 Type: Default P2 Value: '' P2 Length: Default P2 Type: Default
|
||||
bool(true)
|
||||
Test 3 - P1 Value: 'abc' P1 Length: 0 P1 Type: Default P2 Value: '' P2 Length: 0 P2 Type: Default
|
||||
bool(true)
|
||||
Test 4 - P1 Value: NULL P1 Length: -1 P1 Type: SQLT_LNG P2 Value: NULL P2 Length: -1 P2 Type:Default
|
||||
|
||||
Warning: oci_execute(): ORA-24816: %s in %s on line %d
|
||||
bool(false)
|
||||
Test 5 - P1 Value: NULL P1 Length: 0 P1 Type: SQLT_LNG P2 Value: NULL P2 Length: 0 P2 Type:Default
|
||||
|
||||
Warning: oci_execute(): ORA-24816: %s in %s on line %d
|
||||
bool(false)
|
||||
===DONE===
|
||||
--TEST--
|
||||
Bug #72524 (Binding null values triggers ORA-24816 error)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$target_dbs = array('oracledb' => true, 'timesten' => true); // test runs on these DBs
|
||||
require(dirname(__FILE__).'/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
|
||||
<?php
|
||||
|
||||
require(dirname(__FILE__).'/connect.inc');
|
||||
|
||||
// Initialize
|
||||
|
||||
$stmtarray = array(
|
||||
"CREATE TABLE mytable (clob_col CLOB DEFAULT NULL, varchar2_col VARCHAR2(255) DEFAULT NULL)"
|
||||
);
|
||||
|
||||
oci8_test_sql_execute($c, $stmtarray);
|
||||
|
||||
// Run test
|
||||
|
||||
$sql = "INSERT INTO mytable VALUES (:clob_col, :varchar2_col)";
|
||||
|
||||
echo "Test 1 - P1 Value: NULL P1 Length: Default P1 Type: Default P2 Value: NULL P2 Length: Default P2 Type: Default\n";
|
||||
$stmt = oci_parse($c, $sql);
|
||||
|
||||
$clob = NULL;
|
||||
$varchar2 = NULL;
|
||||
oci_bind_by_name($stmt, ':clob_col', $clob);
|
||||
oci_bind_by_name($stmt, ':varchar2_col', $varchar2);
|
||||
|
||||
var_dump(oci_execute($stmt));
|
||||
|
||||
echo "Test 2 - P1 Value: '' P1 Length: Default P1 Type: Default P2 Value: '' P2 Length: Default P2 Type: Default\n";
|
||||
|
||||
$clob = '';
|
||||
$varchar2 = '';
|
||||
oci_bind_by_name($stmt, ':clob_col', $clob);
|
||||
oci_bind_by_name($stmt, ':varchar2_col', $varchar2);
|
||||
|
||||
var_dump(oci_execute($stmt));
|
||||
|
||||
echo "Test 3 - P1 Value: 'abc' P1 Length: 0 P1 Type: Default P2 Value: '' P2 Length: 0 P2 Type: Default\n";
|
||||
$clob = 'abc';
|
||||
$varchar2 = 'abc';
|
||||
oci_bind_by_name($stmt, ':clob_col', $clob, 0);
|
||||
oci_bind_by_name($stmt, ':varchar2_col', $varchar2, 0);
|
||||
|
||||
var_dump(oci_execute($stmt));
|
||||
|
||||
echo "Test 4 - P1 Value: NULL P1 Length: -1 P1 Type: SQLT_LNG P2 Value: NULL P2 Length: -1 P2 Type:Default\n";
|
||||
$clob = NULL;
|
||||
$varchar2 = NULL;
|
||||
oci_bind_by_name($stmt, ':clob_col', $clob, -1, SQLT_LNG);
|
||||
oci_bind_by_name($stmt, ':varchar2_col', $varchar2, -1, SQLT_LNG);
|
||||
|
||||
var_dump(oci_execute($stmt));
|
||||
|
||||
echo "Test 5 - P1 Value: NULL P1 Length: 0 P1 Type: SQLT_LNG P2 Value: NULL P2 Length: 0 P2 Type:Default\n";
|
||||
$clob = NULL;
|
||||
$varchar2 = NULL;
|
||||
oci_bind_by_name($stmt, ':clob_col', $clob, 0, SQLT_LNG);
|
||||
oci_bind_by_name($stmt, ':varchar2_col', $varchar2, 0, SQLT_LNG);
|
||||
|
||||
|
||||
var_dump(oci_execute($stmt));
|
||||
|
||||
// Cleanup
|
||||
|
||||
$stmtarray = array(
|
||||
"DROP TABLE mytable"
|
||||
);
|
||||
|
||||
oci8_test_sql_execute($c, $stmtarray);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
<?php exit(0); ?>
|
||||
--EXPECTF--
|
||||
Test 1 - P1 Value: NULL P1 Length: Default P1 Type: Default P2 Value: NULL P2 Length: Default P2 Type: Default
|
||||
bool(true)
|
||||
Test 2 - P1 Value: '' P1 Length: Default P1 Type: Default P2 Value: '' P2 Length: Default P2 Type: Default
|
||||
bool(true)
|
||||
Test 3 - P1 Value: 'abc' P1 Length: 0 P1 Type: Default P2 Value: '' P2 Length: 0 P2 Type: Default
|
||||
bool(true)
|
||||
Test 4 - P1 Value: NULL P1 Length: -1 P1 Type: SQLT_LNG P2 Value: NULL P2 Length: -1 P2 Type:Default
|
||||
|
||||
Warning: oci_execute(): ORA-24816: %s in %s on line %d
|
||||
bool(false)
|
||||
Test 5 - P1 Value: NULL P1 Length: 0 P1 Type: SQLT_LNG P2 Value: NULL P2 Length: 0 P2 Type:Default
|
||||
|
||||
Warning: oci_execute(): ORA-24816: %s in %s on line %d
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -13,7 +13,7 @@ require(dirname(__FILE__).'/skipif.inc');
|
||||
|
||||
require dirname(__FILE__)."/connect.inc";
|
||||
|
||||
$ora_sql = "DROP TYPE ".$type_name;;
|
||||
$ora_sql = "DROP TYPE ".$type_name;
|
||||
$statement = oci_parse($c,$ora_sql);
|
||||
@oci_execute($statement);
|
||||
|
||||
|
||||
@@ -57,11 +57,11 @@ function get_attr($conn)
|
||||
?>
|
||||
--EXPECT--
|
||||
**Test 1.1 - Default values for the attribute **************
|
||||
The value of DRIVER_NAME is PHP OCI8 : 2.1.6
|
||||
The value of DRIVER_NAME is PHP OCI8 : 2.1.7
|
||||
|
||||
***Test 1.2 - Get the values from different connections **************
|
||||
Testing with oci_pconnect()
|
||||
The value of DRIVER_NAME is PHP OCI8 : 2.1.6
|
||||
The value of DRIVER_NAME is PHP OCI8 : 2.1.7
|
||||
Testing with oci_new_connect()
|
||||
The value of DRIVER_NAME is PHP OCI8 : 2.1.6
|
||||
The value of DRIVER_NAME is PHP OCI8 : 2.1.7
|
||||
Done
|
||||
@@ -29,9 +29,9 @@ for ($i = 0; $i < NUMLOBS; $i++) {
|
||||
}
|
||||
|
||||
for ($i = 0; $i < NUMLOBS; $i++) {
|
||||
echo "Row $i Size: " . $row[$i][0]->size() . "\n";;
|
||||
echo "Row $i Size: " . $row[$i][0]->size() . "\n";
|
||||
echo "Pos 1: " . $row[$i][0]->tell() . "\n";
|
||||
echo "Data: " . $row[$i][0]->read(5) . "\n";;
|
||||
echo "Data: " . $row[$i][0]->read(5) . "\n";
|
||||
echo "Pos 2: " . $row[$i][0]->tell() . "\n";
|
||||
echo "Data: " . $row[$i][0]->read(12) . "\n";
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ var_dump($row);
|
||||
|
||||
echo "Test 2 Manipulate the data using SimpleXML\n";
|
||||
|
||||
$sx = simplexml_load_string((binary)$row[0]->load());
|
||||
$sx = simplexml_load_string($row[0]->load());
|
||||
$row[0]->free();
|
||||
var_dump($sx);
|
||||
|
||||
@@ -178,4 +178,4 @@ string(%d) "<?xml version="1.0"?>
|
||||
%sVClearance>10</VClearance>
|
||||
</Warehouse>
|
||||
"
|
||||
===DONE===
|
||||
===DONE===
|
||||
@@ -144,11 +144,11 @@ op1_use:
|
||||
}
|
||||
} else if (opline->op1_type & (IS_VAR|IS_TMP_VAR)) {
|
||||
var_num = EX_VAR_TO_NUM(opline->op1.var);
|
||||
if (!DFG_ISSET(def, set_size, j, var_num)) {
|
||||
DFG_SET(use, set_size, j, var_num);
|
||||
}
|
||||
if (opline->opcode == ZEND_VERIFY_RETURN_TYPE) {
|
||||
DFG_SET(use, set_size, j, var_num);
|
||||
DFG_SET(def, set_size, j, var_num);
|
||||
} else if (!DFG_ISSET(def, set_size, j, var_num)) {
|
||||
DFG_SET(use, set_size, j, var_num);
|
||||
}
|
||||
}
|
||||
if (opline->op2_type == IS_CV) {
|
||||
|
||||
@@ -3279,9 +3279,11 @@ int zend_infer_types_ex(const zend_op_array *op_array, const zend_script *script
|
||||
zend_ssa_var_info *ssa_var_info = ssa->var_info;
|
||||
int ssa_vars_count = ssa->vars_count;
|
||||
int i, j;
|
||||
uint32_t tmp;
|
||||
uint32_t tmp, worklist_len = zend_bitset_len(ssa_vars_count);
|
||||
|
||||
WHILE_WORKLIST(worklist, zend_bitset_len(ssa_vars_count), j) {
|
||||
while (!zend_bitset_empty(worklist, worklist_len)) {
|
||||
j = zend_bitset_first(worklist, worklist_len);
|
||||
zend_bitset_excl(worklist, j);
|
||||
if (ssa_vars[j].definition_phi) {
|
||||
zend_ssa_phi *p = ssa_vars[j].definition_phi;
|
||||
if (p->pi >= 0) {
|
||||
@@ -3340,7 +3342,7 @@ int zend_infer_types_ex(const zend_op_array *op_array, const zend_script *script
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
} WHILE_WORKLIST_END();
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
--TEST--
|
||||
Bug #74980 (Narrowing occurred during type inference)
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A
|
||||
{
|
||||
|
||||
static function foo()
|
||||
{
|
||||
while ($undef) {
|
||||
$arr[][] = NULL;
|
||||
}
|
||||
|
||||
foreach ($arr as $a) {
|
||||
bar($a + []);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
echo "okey";
|
||||
?>
|
||||
--EXPECT--
|
||||
okey
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Incorrect liveness computation for verify-return
|
||||
--FILE--
|
||||
<?php
|
||||
function test($foo): string
|
||||
{
|
||||
switch ($foo) {
|
||||
default: $bar = 'x'; break;
|
||||
case 'z': $bar = 'y'; break;
|
||||
}
|
||||
return (string)$bar;
|
||||
}
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
+14
-22
@@ -87,14 +87,6 @@
|
||||
#define HAVE_EVP_PKEY_EC 1
|
||||
#endif
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_OPENSSL_BIO_MODE_R(flags) (((flags) & PKCS7_BINARY) ? "rb" : "r")
|
||||
#define PHP_OPENSSL_BIO_MODE_W(flags) (((flags) & PKCS7_BINARY) ? "wb" : "w")
|
||||
#else
|
||||
#define PHP_OPENSSL_BIO_MODE_R(flags) "r"
|
||||
#define PHP_OPENSSL_BIO_MODE_W(flags) "w"
|
||||
#endif
|
||||
|
||||
ZEND_DECLARE_MODULE_GLOBALS(openssl)
|
||||
|
||||
/* FIXME: Use the openssl constants instead of
|
||||
@@ -1129,7 +1121,7 @@ static int php_openssl_parse_config(struct php_x509_request * req, zval * option
|
||||
if (str == NULL) {
|
||||
php_openssl_store_errors();
|
||||
} else if (!php_openssl_open_base_dir_chk(str)) {
|
||||
BIO *oid_bio = BIO_new_file(str, "r");
|
||||
BIO *oid_bio = BIO_new_file(str, PHP_OPENSSL_BIO_MODE_R(PKCS7_BINARY));
|
||||
if (oid_bio) {
|
||||
OBJ_create_objects(oid_bio);
|
||||
BIO_free(oid_bio);
|
||||
@@ -1690,7 +1682,7 @@ static X509 * php_openssl_x509_from_zval(zval * val, int makeresource, zend_reso
|
||||
return NULL;
|
||||
}
|
||||
|
||||
in = BIO_new_file(Z_STRVAL_P(val) + (sizeof("file://") - 1), "r");
|
||||
in = BIO_new_file(Z_STRVAL_P(val) + (sizeof("file://") - 1), PHP_OPENSSL_BIO_MODE_R(PKCS7_BINARY));
|
||||
if (in == NULL) {
|
||||
php_openssl_store_errors();
|
||||
return NULL;
|
||||
@@ -1755,7 +1747,7 @@ PHP_FUNCTION(openssl_x509_export_to_file)
|
||||
return;
|
||||
}
|
||||
|
||||
bio_out = BIO_new_file(filename, "w");
|
||||
bio_out = BIO_new_file(filename, PHP_OPENSSL_BIO_MODE_W(PKCS7_BINARY));
|
||||
if (bio_out) {
|
||||
if (!notext && !X509_print(bio_out, cert)) {
|
||||
php_openssl_store_errors();
|
||||
@@ -2466,7 +2458,7 @@ static STACK_OF(X509) * load_all_certs_from_file(char *certfile)
|
||||
goto end;
|
||||
}
|
||||
|
||||
if(!(in=BIO_new_file(certfile, "r"))) {
|
||||
if(!(in=BIO_new_file(certfile, PHP_OPENSSL_BIO_MODE_R(PKCS7_BINARY)))) {
|
||||
php_openssl_store_errors();
|
||||
php_error_docref(NULL, E_WARNING, "error opening the file, %s", certfile);
|
||||
sk_X509_free(stack);
|
||||
@@ -2817,7 +2809,7 @@ PHP_FUNCTION(openssl_pkcs12_export_to_file)
|
||||
|
||||
p12 = PKCS12_create(pass, friendly_name, priv_key, cert, ca, 0, 0, 0, 0, 0);
|
||||
if (p12 != NULL) {
|
||||
bio_out = BIO_new_file(filename, "w");
|
||||
bio_out = BIO_new_file(filename, PHP_OPENSSL_BIO_MODE_W(PKCS7_BINARY));
|
||||
if (bio_out != NULL) {
|
||||
|
||||
i2d_PKCS12_bio(bio_out, p12);
|
||||
@@ -3230,7 +3222,7 @@ static X509_REQ * php_openssl_csr_from_zval(zval * val, int makeresource, zend_r
|
||||
if (php_openssl_open_base_dir_chk(filename)) {
|
||||
return NULL;
|
||||
}
|
||||
in = BIO_new_file(filename, "r");
|
||||
in = BIO_new_file(filename, PHP_OPENSSL_BIO_MODE_R(PKCS7_BINARY));
|
||||
} else {
|
||||
in = BIO_new_mem_buf(Z_STRVAL_P(val), (int)Z_STRLEN_P(val));
|
||||
}
|
||||
@@ -3278,7 +3270,7 @@ PHP_FUNCTION(openssl_csr_export_to_file)
|
||||
return;
|
||||
}
|
||||
|
||||
bio_out = BIO_new_file(filename, "w");
|
||||
bio_out = BIO_new_file(filename, PHP_OPENSSL_BIO_MODE_W(PKCS7_BINARY));
|
||||
if (bio_out != NULL) {
|
||||
if (!notext && !X509_REQ_print(bio_out, csr)) {
|
||||
php_openssl_store_errors();
|
||||
@@ -3803,7 +3795,7 @@ static EVP_PKEY * php_openssl_evp_from_zval(
|
||||
/* not a X509 certificate, try to retrieve public key */
|
||||
BIO* in;
|
||||
if (filename) {
|
||||
in = BIO_new_file(filename, "r");
|
||||
in = BIO_new_file(filename, PHP_OPENSSL_BIO_MODE_R(PKCS7_BINARY));
|
||||
} else {
|
||||
in = BIO_new_mem_buf(Z_STRVAL_P(val), (int)Z_STRLEN_P(val));
|
||||
}
|
||||
@@ -3822,7 +3814,7 @@ static EVP_PKEY * php_openssl_evp_from_zval(
|
||||
if (php_openssl_open_base_dir_chk(filename)) {
|
||||
TMP_CLEAN;
|
||||
}
|
||||
in = BIO_new_file(filename, "r");
|
||||
in = BIO_new_file(filename, PHP_OPENSSL_BIO_MODE_R(PKCS7_BINARY));
|
||||
} else {
|
||||
in = BIO_new_mem_buf(Z_STRVAL_P(val), (int)Z_STRLEN_P(val));
|
||||
}
|
||||
@@ -4499,7 +4491,7 @@ PHP_FUNCTION(openssl_pkey_export_to_file)
|
||||
PHP_SSL_REQ_INIT(&req);
|
||||
|
||||
if (PHP_SSL_REQ_PARSE(&req, args) == SUCCESS) {
|
||||
bio_out = BIO_new_file(filename, "w");
|
||||
bio_out = BIO_new_file(filename, PHP_OPENSSL_BIO_MODE_W(PKCS7_BINARY));
|
||||
if (bio_out == NULL) {
|
||||
php_openssl_store_errors();
|
||||
goto clean_exit;
|
||||
@@ -5035,7 +5027,7 @@ PHP_FUNCTION(openssl_pkcs7_verify)
|
||||
goto clean_exit;
|
||||
}
|
||||
|
||||
dataout = BIO_new_file(datafilename, "w");
|
||||
dataout = BIO_new_file(datafilename, PHP_OPENSSL_BIO_MODE_W(PKCS7_BINARY));
|
||||
if (dataout == NULL) {
|
||||
php_openssl_store_errors();
|
||||
goto clean_exit;
|
||||
@@ -5056,7 +5048,7 @@ PHP_FUNCTION(openssl_pkcs7_verify)
|
||||
goto clean_exit;
|
||||
}
|
||||
|
||||
certout = BIO_new_file(signersfilename, "w");
|
||||
certout = BIO_new_file(signersfilename, PHP_OPENSSL_BIO_MODE_W(PKCS7_BINARY));
|
||||
if (certout) {
|
||||
int i;
|
||||
signers = PKCS7_get0_signers(p7, NULL, (int)flags);
|
||||
@@ -5133,7 +5125,7 @@ PHP_FUNCTION(openssl_pkcs7_encrypt)
|
||||
goto clean_exit;
|
||||
}
|
||||
|
||||
outfile = BIO_new_file(outfilename, "w");
|
||||
outfile = BIO_new_file(outfilename, PHP_OPENSSL_BIO_MODE_W(flags));
|
||||
if (outfile == NULL) {
|
||||
php_openssl_store_errors();
|
||||
goto clean_exit;
|
||||
@@ -5292,7 +5284,7 @@ PHP_FUNCTION(openssl_pkcs7_sign)
|
||||
goto clean_exit;
|
||||
}
|
||||
|
||||
outfile = BIO_new_file(outfilename, "w");
|
||||
outfile = BIO_new_file(outfilename, PHP_OPENSSL_BIO_MODE_W(PKCS7_BINARY));
|
||||
if (outfile == NULL) {
|
||||
php_openssl_store_errors();
|
||||
php_error_docref(NULL, E_WARNING, "error opening output file %s!", outfilename);
|
||||
|
||||
@@ -127,6 +127,15 @@ PHP_FUNCTION(openssl_spki_export);
|
||||
PHP_FUNCTION(openssl_spki_export_challenge);
|
||||
|
||||
PHP_FUNCTION(openssl_get_cert_locations);
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_OPENSSL_BIO_MODE_R(flags) (((flags) & PKCS7_BINARY) ? "rb" : "r")
|
||||
#define PHP_OPENSSL_BIO_MODE_W(flags) (((flags) & PKCS7_BINARY) ? "wb" : "w")
|
||||
#else
|
||||
#define PHP_OPENSSL_BIO_MODE_R(flags) "r"
|
||||
#define PHP_OPENSSL_BIO_MODE_W(flags) "w"
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#define phpext_openssl_ptr NULL
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
--TEST--
|
||||
Bug #74903 openssl_pkcs7_encrypt() uses different EOL than before
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("openssl")) die("skip");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$cert = "-----BEGIN CERTIFICATE-----
|
||||
MIIDXDCCAkSgAwIBAgIKq/f5U3FzthdKUzANBgkqhkiG9w0BAQUFADBcMRIwEAYD
|
||||
VQQDEwlzZXRhcGRmLWExCTAHBgNVBAoTADEJMAcGA1UECxMAMSMwIQYJKoZIhvcN
|
||||
AQkBFhRzdXBwb3J0QHNldGFzaWduLmNvbTELMAkGA1UEBhMCREUwHhcNMTUwOTA4
|
||||
MDkzNDExWhcNMjAwOTA4MDkzNDExWjBcMRIwEAYDVQQDEwlzZXRhcGRmLWExCTAH
|
||||
BgNVBAoTADEJMAcGA1UECxMAMSMwIQYJKoZIhvcNAQkBFhRzdXBwb3J0QHNldGFz
|
||||
aWduLmNvbTELMAkGA1UEBhMCREUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK
|
||||
AoIBAQCkmTLvUIYfqAKC1CHVgABlemrFIVRm4JGeB0jIGofyrm3yVwR4YcK0eUmt
|
||||
/0nbFfsFsU0/C9dXKZYD42t5YpLFsj666Z1EoU1CfSIW2bf0HaWVJ+oNT5twS3dv
|
||||
RTzAcnPM44GxO4y6GUW6un0/bT/MZbFKbb3NI1L0mwY7EoqUXR68XxuHqWETaslm
|
||||
Sbp1XvbLsJjgV9X3ihi7JC7A9kEzrKh+RBsXEXwlSv5JO2TUdwq9P4EbjqvgiaV1
|
||||
vFNAArioX5pIUIm9ahAm8d7jjW6DFfV798rTzaQ3GJs0yC3UD6xhmbTbdC/D9Pot
|
||||
8RGu89Fx6E+O5j4LwGH4kiYjgvYZAgMBAAGjIDAeMA8GCSqGSIb3LwEBCgQCBQAw
|
||||
CwYDVR0PBAQDAgOYMA0GCSqGSIb3DQEBBQUAA4IBAQBCA8iXz7zxAmCWNZ0faiLm
|
||||
aKw8u2PUq+EPKrGKc9Q70Ksw/e/EHvWrghFzmu5MOZRn/QIWq++sbbc8eOiaRDE8
|
||||
lWCW596FLW4habXKw0sjDNcyEBArPgDp17O6NgHqI2U1KL1P2Y40e0YH2BWxNS+f
|
||||
pmWZekjiC6jfId2JGsyPZUTX4USwthG4dFX0/BWYg+K7kXvQzMobes2NxW3Iqn8h
|
||||
FUNgraCzlQMSfE2gwAMSUXTJubUGorj4LFYSiLIIJvf6KlmuR5uOIi5lSjSeZf5E
|
||||
FLEHVhrz3o2icUeyb1K1BTAQRZ/H3GZ0QpgqSK5vmuV9C+rzezQMoy4/8UUnNPMt
|
||||
-----END CERTIFICATE-----
|
||||
";
|
||||
|
||||
$pkey = "-----BEGIN PRIVATE KEY-----
|
||||
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCkmTLvUIYfqAKC
|
||||
1CHVgABlemrFIVRm4JGeB0jIGofyrm3yVwR4YcK0eUmt/0nbFfsFsU0/C9dXKZYD
|
||||
42t5YpLFsj666Z1EoU1CfSIW2bf0HaWVJ+oNT5twS3dvRTzAcnPM44GxO4y6GUW6
|
||||
un0/bT/MZbFKbb3NI1L0mwY7EoqUXR68XxuHqWETaslmSbp1XvbLsJjgV9X3ihi7
|
||||
JC7A9kEzrKh+RBsXEXwlSv5JO2TUdwq9P4EbjqvgiaV1vFNAArioX5pIUIm9ahAm
|
||||
8d7jjW6DFfV798rTzaQ3GJs0yC3UD6xhmbTbdC/D9Pot8RGu89Fx6E+O5j4LwGH4
|
||||
kiYjgvYZAgMBAAECggEABO4JOGF4KOvQanB11HYNXPy4BLA5Pc0RU3M6pvKjen1m
|
||||
sdzRF5Vu/laJIkbchI0xm+Op8X7Wa+gFFBf8RLIS/QyYBCNh2Fe/74M9sYNDFxLJ
|
||||
vjBIOm6VVF1QRhMD7SwoY303adJjpkHCRMPX4z3PjLzJfPYROpsJnaWkf8GwCJ4+
|
||||
kufOhYcE8ekuLX7EzXFU74Uo0OnMEhMJgiAjlHhC21YLkgLoGq45sdktVgvD6sds
|
||||
7BcmH6oUCDCJ8wxUVM1+Ks1D3vKHfeAhCFHvj9M/lf5OWylhmQh4CQf+NMDNsAc6
|
||||
mXNIzUvZEgs/PJpd3SymHchf60m6faJtGv43GsdsgQKBgQDUx8t649O/vGRI26t4
|
||||
4XrzVC2w5271UlhFaRiH03BrV+pECVoH4bw+ZIUuGke2xe+LrNkhMNJSGcbB0WDa
|
||||
Jes+4Gf++AuSXRvMo+xHenfgUWQqYHJPkh5q6gknZ2YDfikFNLdqApXvp0m+FaVP
|
||||
+F/2HMjQfTITQgkAiEn45s4agQKBgQDGCAZkIUcdyXQTplLE0Zx1/uiTBrQGyzsb
|
||||
cDgAQIHt19wIRjoGOFatAj6TQ5gUj9Remn12v6d5Wi02i7hlu8V6O1VXLGqqeQ27
|
||||
0MHBXzrFBVljOz96D7VP5Xx0DB1cGMbtg5ivjd91OUVrwC7fbXE9sfOI1FqlTb7p
|
||||
6xi9Wl+fmQKBgGdzR/vUfqPOvVcq7gBUaAmb2KcUrj65rU753MJUy2h1EuHHRi1k
|
||||
07fl+VZD0rALJf7bp6laajcebyLWYGdPXkNwqT8ua7naaOSiogLSiSvXhoKP56PG
|
||||
H+HNLWwp+lAia2Erky0IWstsow62yWvLDyTCM+QhqlHwnh3TJVvNI1GBAoGAUl+y
|
||||
MOJ6z5Ql2aqc0UwT1i1Tlxz5s73D93Tlho1Ovp3E5Bg6OK4kt9CwMNe0IhF2GGgQ
|
||||
+l1cj6kIF6Fk8cR6r46QwDM0p3a1VMPQZNx0+NFxzkot7FsuY26lJyyG5fFUhiXw
|
||||
VE4ifoN1Mg3+MWg3657jG66hihNd77WgU9uM3TkCgYEAypuvVrfFrrtXnbEUcBHq
|
||||
mguKumn9miD9DPb6gi8ZaKOddGzw+qFPukiqi7rM3oRMg02evfK/VQC87Gmev663
|
||||
RV9sQOlB9gNlMOOw/0R3ABEWDoSRCcrLhb6Z5Y72WVnZvpTPO0cDw2i1hyaEM6d+
|
||||
2WR7c6FhRCLxG0DObEOfiO0=
|
||||
-----END PRIVATE KEY-----
|
||||
";
|
||||
|
||||
$envelopeData = "Test";
|
||||
|
||||
$tmpFileIn = tempnam(sys_get_temp_dir(), 'test');
|
||||
$tmpFileOut = tempnam(sys_get_temp_dir(), 'test');
|
||||
file_put_contents($tmpFileIn, $envelopeData);
|
||||
|
||||
openssl_pkcs7_encrypt($tmpFileIn, $tmpFileOut, [$cert], array(), PKCS7_BINARY, OPENSSL_CIPHER_AES_128_CBC);
|
||||
|
||||
$result = file_get_contents($tmpFileOut);
|
||||
var_dump(strpos($result, "\r\n") === false); // behaviour before 7.2
|
||||
var_dump(strlen($result) === 847);
|
||||
|
||||
unlink($tmpFileIn);
|
||||
unlink($tmpFileOut);
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(true)
|
||||
==DONE==
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
--TEST--
|
||||
openssl_pkcs12_export_to_file() tests
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("openssl")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$pkcsfile = dirname(__FILE__) . "/openssl_pkcs12_export_to_file__pkcsfile.tmp";
|
||||
|
||||
$cert_file = dirname(__FILE__) . "/public.crt";
|
||||
$cert = file_get_contents($cert_file);
|
||||
$cert_path = "file://" . $cert_file;
|
||||
$priv_file = dirname(__FILE__) . "/private.crt";
|
||||
$priv = file_get_contents($priv_file);
|
||||
$priv_path = "file://" . $priv_file;
|
||||
$cert_res = openssl_x509_read($cert);
|
||||
$priv_res = openssl_pkey_get_private($priv);
|
||||
$pass = "test";
|
||||
$invalid = "";
|
||||
$invalid_path = "file:///tmp/php";
|
||||
$opts = [];
|
||||
|
||||
var_dump(openssl_pkcs12_export_to_file($cert, $pkcsfile, $priv, $pass));
|
||||
var_dump(openssl_pkcs12_read(file_get_contents($pkcsfile), $opts, $pass));
|
||||
var_dump(openssl_pkcs12_export_to_file($cert_path, $pkcsfile, $priv_path, $pass));
|
||||
var_dump(openssl_pkcs12_read(file_get_contents($pkcsfile), $opts, $pass));
|
||||
var_dump(openssl_pkcs12_export_to_file($cert_res, $pkcsfile, $priv_res, $pass));
|
||||
var_dump(openssl_pkcs12_read(file_get_contents($pkcsfile), $opts, $pass));
|
||||
var_dump(openssl_pkcs12_export_to_file($cert_res, $pkcsfile, $priv_res, $pass, array($cert)));
|
||||
var_dump(openssl_pkcs12_read(file_get_contents($pkcsfile), $opts, $pass));
|
||||
|
||||
var_dump(openssl_pkcs12_export_to_file($invalid, $pkcsfile, $invalid, $pass));
|
||||
var_dump(openssl_pkcs12_export_to_file($invalid_path, $pkcsfile, $invalid_path, $pass));
|
||||
var_dump(openssl_pkcs12_export_to_file($priv_res, $pkcsfile, $cert_res, $pass));
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
if (file_exists($pkcsfile)) {
|
||||
unlink($pkcsfile);
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
|
||||
Warning: openssl_pkcs12_export_to_file(): cannot get cert from parameter 1 in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: openssl_pkcs12_export_to_file(): cannot get cert from parameter 1 in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: openssl_pkcs12_export_to_file(): supplied resource is not a valid OpenSSL X.509 resource in %s on line %d
|
||||
|
||||
Warning: openssl_pkcs12_export_to_file(): cannot get cert from parameter 1 in %s on line %d
|
||||
bool(false)
|
||||
@@ -1170,7 +1170,7 @@ static int set_server_dh_param(php_stream * stream, SSL_CTX *ctx) /* {{{ */
|
||||
}
|
||||
|
||||
convert_to_string_ex(zdhpath);
|
||||
bio = BIO_new_file(Z_STRVAL_P(zdhpath), "r");
|
||||
bio = BIO_new_file(Z_STRVAL_P(zdhpath), PHP_OPENSSL_BIO_MODE_R(PKCS7_BINARY));
|
||||
|
||||
if (bio == NULL) {
|
||||
php_error_docref(NULL, E_WARNING, "invalid dh_param");
|
||||
|
||||
@@ -327,7 +327,7 @@ static int mysql_handle_commit(pdo_dbh_t *dbh)
|
||||
PDO_DBG_ENTER("mysql_handle_commit");
|
||||
PDO_DBG_INF_FMT("dbh=%p", dbh);
|
||||
#if MYSQL_VERSION_ID >= 40100 || defined(PDO_USE_MYSQLND)
|
||||
PDO_DBG_RETURN(0 <= mysql_commit(((pdo_mysql_db_handle *)dbh->driver_data)->server));
|
||||
PDO_DBG_RETURN(0 == mysql_commit(((pdo_mysql_db_handle *)dbh->driver_data)->server));
|
||||
#else
|
||||
PDO_DBG_RETURN(0 <= mysql_handle_doer(dbh, ZEND_STRL("COMMIT")));
|
||||
#endif
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
.TH PHAR 1 "2016" "The PHP Group" "User Commands"
|
||||
.TH PHAR 1 "2017" "The PHP Group" "User Commands"
|
||||
.SH NAME
|
||||
phar, phar.phar \- PHAR (PHP archive) command line tool
|
||||
.SH SYNOPSIS
|
||||
@@ -507,7 +507,7 @@ contributors all around the world.
|
||||
.SH VERSION INFORMATION
|
||||
This manpage describes \fBphar\fP, version @PHP_VERSION@.
|
||||
.SH COPYRIGHT
|
||||
Copyright \(co 1997\-2016 The PHP Group
|
||||
Copyright \(co 1997\-2017 The PHP Group
|
||||
.LP
|
||||
This source file is subject to version 3.01 of the PHP license,
|
||||
that is bundled with this package in the file LICENSE, and is
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
Phar: PHP bug #74991: include_path has a 4096 char (minus "__DIR__:") limit, in some PHAR cases
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("phar")) die("skip");
|
||||
--INI--
|
||||
phar.readonly=0
|
||||
--FILE--
|
||||
<?php
|
||||
// create a sample file in a custom include_path to lookup from the phar later:
|
||||
mkdir('path');
|
||||
touch('path/needle.php');
|
||||
$p = new Phar('sample.phar');
|
||||
// the use of a sub path is crucial, and make the include_path 1 byte larger (=OVERFLOW) than the MAXPATHLEN, the include_path will then be truncated to 4096 (MAXPATHLEN) into 'phar://..sample.phar/some:xx..xx:pat' so it will fail to find needle.php:
|
||||
$p['some/file'] = "<?php const MAXPATHLEN = 4096, OVERFLOW = 1, PATH = 'path'; set_include_path(str_repeat('x', MAXPATHLEN - strlen(__DIR__ . PATH_SEPARATOR . PATH_SEPARATOR . PATH) + OVERFLOW) . PATH_SEPARATOR . PATH); require('needle.php');";
|
||||
$p->setStub("<?php Phar::mapPhar('sample.phar'); __HALT_COMPILER();");
|
||||
// execute the phar code:
|
||||
require('phar://sample.phar/some/file');
|
||||
--CLEAN--
|
||||
<?php
|
||||
unlink('path/needle.php');
|
||||
unlink('sample.phar');
|
||||
rmdir('path');
|
||||
--EXPECT--
|
||||
+1
-1
@@ -309,7 +309,7 @@ splitted:
|
||||
efree(test);
|
||||
}
|
||||
|
||||
spprintf(&path, MAXPATHLEN, "phar://%s/%s%c%s", arch, PHAR_G(cwd), DEFAULT_DIR_SEPARATOR, PG(include_path));
|
||||
spprintf(&path, MAXPATHLEN + 1 + strlen(PG(include_path)), "phar://%s/%s%c%s", arch, PHAR_G(cwd), DEFAULT_DIR_SEPARATOR, PG(include_path));
|
||||
efree(arch);
|
||||
ret = php_resolve_path(filename, filename_len, path);
|
||||
efree(path);
|
||||
|
||||
@@ -295,6 +295,15 @@ static zend_function *_copy_function(zend_function *fptr) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static void _fix_closure_prototype(zend_function *fptr) /* {{{ */
|
||||
{
|
||||
/* Actually we are setting proxy function's prototype to null
|
||||
* as for it, the prototype is an object not a function
|
||||
* which could cause serias problems, see #74949 */
|
||||
fptr->common.prototype = NULL;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static void _free_function(zend_function *fptr) /* {{{ */
|
||||
{
|
||||
if (fptr
|
||||
@@ -603,6 +612,7 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
|
||||
&& memcmp(ZSTR_VAL(mptr->common.function_name), ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1) == 0
|
||||
&& (closure = zend_get_closure_invoke_method(Z_OBJ_P(obj))) != NULL)
|
||||
{
|
||||
_fix_closure_prototype(closure);
|
||||
mptr = closure;
|
||||
} else {
|
||||
closure = NULL;
|
||||
@@ -2364,7 +2374,6 @@ ZEND_METHOD(reflection_generator, getExecutingGenerator)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ proto public static mixed ReflectionParameter::export(mixed function, mixed parameter [, bool return]) throws ReflectionException
|
||||
Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */
|
||||
ZEND_METHOD(reflection_parameter, export)
|
||||
@@ -2449,6 +2458,7 @@ ZEND_METHOD(reflection_parameter, __construct)
|
||||
{
|
||||
/* nothing to do. don't set is_closure since is the invoke handler,
|
||||
not the closure itself */
|
||||
_fix_closure_prototype(fptr);
|
||||
} else if ((fptr = zend_hash_str_find_ptr(&ce->function_table, lcname, lcname_len)) == NULL) {
|
||||
efree(lcname);
|
||||
zend_throw_exception_ex(reflection_exception_ptr, 0,
|
||||
@@ -3152,6 +3162,7 @@ ZEND_METHOD(reflection_method, __construct)
|
||||
&& (mptr = zend_get_closure_invoke_method(Z_OBJ_P(orig_obj))) != NULL)
|
||||
{
|
||||
/* do nothing, mptr already set */
|
||||
_fix_closure_prototype(mptr);
|
||||
} else if ((mptr = zend_hash_str_find_ptr(&ce->function_table, lcname, name_len)) == NULL) {
|
||||
efree(lcname);
|
||||
zend_throw_exception_ex(reflection_exception_ptr, 0,
|
||||
@@ -4278,6 +4289,7 @@ ZEND_METHOD(reflection_class, getMethod)
|
||||
{
|
||||
/* don't assign closure_object since we only reflect the invoke handler
|
||||
method and not the closure definition itself */
|
||||
_fix_closure_prototype(mptr);
|
||||
reflection_method_factory(ce, mptr, NULL, return_value);
|
||||
efree(lc_name);
|
||||
} else if (ce == zend_ce_closure && Z_ISUNDEF(intern->obj) && (name_len == sizeof(ZEND_INVOKE_FUNC_NAME)-1)
|
||||
@@ -4285,6 +4297,7 @@ ZEND_METHOD(reflection_class, getMethod)
|
||||
&& object_init_ex(&obj_tmp, ce) == SUCCESS && (mptr = zend_get_closure_invoke_method(Z_OBJ(obj_tmp))) != NULL) {
|
||||
/* don't assign closure_object since we only reflect the invoke handler
|
||||
method and not the closure definition itself */
|
||||
_fix_closure_prototype(mptr);
|
||||
reflection_method_factory(ce, mptr, NULL, return_value);
|
||||
zval_dtor(&obj_tmp);
|
||||
efree(lc_name);
|
||||
@@ -4311,6 +4324,7 @@ static void _addmethod(zend_function *mptr, zend_class_entry *ce, zval *retval,
|
||||
&& memcmp(ZSTR_VAL(mptr->common.function_name), ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1) == 0
|
||||
&& (closure = zend_get_closure_invoke_method(Z_OBJ_P(obj))) != NULL)
|
||||
{
|
||||
_fix_closure_prototype(closure);
|
||||
mptr = closure;
|
||||
}
|
||||
/* don't assign closure_object since we only reflect the invoke handler
|
||||
@@ -4362,6 +4376,7 @@ ZEND_METHOD(reflection_class, getMethods)
|
||||
if (Z_TYPE(intern->obj) != IS_UNDEF && instanceof_function(ce, zend_ce_closure)) {
|
||||
zend_function *closure = zend_get_closure_invoke_method(Z_OBJ(intern->obj));
|
||||
if (closure) {
|
||||
_fix_closure_prototype(closure);
|
||||
_addmethod(closure, ce, return_value, filter, &intern->obj);
|
||||
_free_function(closure);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ object(ReflectionClass)#4 (1) {
|
||||
}
|
||||
Parameter #0 [ <required> stdClass $x ]
|
||||
stdClass
|
||||
Method [ <internal, prototype Closure> public method __invoke ] {
|
||||
Method [ <internal> public method __invoke ] {
|
||||
|
||||
- Parameters [1] {
|
||||
Parameter #0 [ <required> stdClass $x ]
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Bug #74949 (null pointer dereference in _function_string)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$f = function () {};
|
||||
|
||||
$r = new ReflectionMethod($f, "__invoke");
|
||||
|
||||
unset($f);
|
||||
|
||||
echo $r, "\n";
|
||||
|
||||
try {
|
||||
echo $r->getPrototype();
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
Method [ <internal> public method __invoke ] {
|
||||
}
|
||||
|
||||
Method Closure::__invoke does not have a prototype
|
||||
@@ -99,6 +99,9 @@ zend_class_entry *php_session_update_timestamp_iface_entry;
|
||||
static void php_session_send_cookie(void);
|
||||
static void php_session_abort(void);
|
||||
|
||||
/* Initialized in MINIT, readonly otherwise. */
|
||||
static int my_module_number = 0;
|
||||
|
||||
/* Dispatched by RINIT and by php_session_destroy */
|
||||
static inline void php_rinit_session_globals(void) /* {{{ */
|
||||
{
|
||||
@@ -111,6 +114,7 @@ static inline void php_rinit_session_globals(void) /* {{{ */
|
||||
PS(mod_user_is_open) = 0;
|
||||
PS(define_sid) = 1;
|
||||
PS(session_vars) = NULL;
|
||||
PS(module_number) = my_module_number;
|
||||
ZVAL_UNDEF(&PS(http_session_vars));
|
||||
}
|
||||
/* }}} */
|
||||
@@ -2620,7 +2624,8 @@ static PHP_MINIT_FUNCTION(session) /* {{{ */
|
||||
|
||||
zend_register_auto_global(zend_string_init("_SESSION", sizeof("_SESSION") - 1, 1), 0, NULL);
|
||||
|
||||
PS(module_number) = module_number; /* if we really need this var we need to init it in zts mode as well! */
|
||||
my_module_number = module_number;
|
||||
PS(module_number) = module_number;
|
||||
|
||||
PS(session_status) = php_session_none;
|
||||
REGISTER_INI_ENTRIES();
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #74833 Session module number is uninitialized when SID is reset
|
||||
--SKIPIF--
|
||||
<?php include('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
ob_start();
|
||||
|
||||
session_start();
|
||||
session_regenerate_id();
|
||||
$c = get_defined_constants(true);
|
||||
/* Ensure the SID constant has correct module number. */
|
||||
var_dump(isset($c['session']['SID']));
|
||||
|
||||
ob_end_flush();
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECTF--
|
||||
bool(true)
|
||||
==DONE==
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
Bug #74892 Url Rewriting (trans_sid) not working on urls that start with #
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set('session.use_cookies', '0');
|
||||
ini_set('session.use_only_cookies',0);
|
||||
ini_set('session.use_trans_sid',1);
|
||||
ini_set('session.trans_sid_hosts','php.net');
|
||||
session_id('sessionidhere');
|
||||
session_start();
|
||||
|
||||
?>
|
||||
<p><a href="index.php">Click This Anchor Tag!</a></p>
|
||||
<p><a href="index.php#place">External link with anchor</a></p>
|
||||
<p><a href="http://php.net#foo">External link with anchor 2</a></p>
|
||||
<p><a href="#place">Internal link</a></p>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
<p><a href="index.php?PHPSESSID=sessionidhere">Click This Anchor Tag!</a></p>
|
||||
<p><a href="index.php?PHPSESSID=sessionidhere#place">External link with anchor</a></p>
|
||||
<p><a href="http://php.net?PHPSESSID=sessionidhere#foo">External link with anchor 2</a></p>
|
||||
<p><a href="#place">Internal link</a></p>
|
||||
===DONE===
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP version 5 |
|
||||
| PHP version 7 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2017 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
@@ -2321,16 +2321,16 @@ SXE_METHOD(__construct)
|
||||
}
|
||||
|
||||
if (ZEND_SIZE_T_INT_OVFL(data_len)) {
|
||||
php_error_docref(NULL, E_WARNING, "Data is too long");
|
||||
RETURN_FALSE;
|
||||
zend_throw_exception(zend_ce_exception, "Data is too long", 0);
|
||||
return;
|
||||
}
|
||||
if (ZEND_SIZE_T_INT_OVFL(ns_len)) {
|
||||
php_error_docref(NULL, E_WARNING, "Namespace is too long");
|
||||
RETURN_FALSE;
|
||||
zend_throw_exception(zend_ce_exception, "Namespace is too long", 0);
|
||||
return;
|
||||
}
|
||||
if (ZEND_LONG_EXCEEDS_INT(options)) {
|
||||
php_error_docref(NULL, E_WARNING, "Invalid options");
|
||||
RETURN_FALSE;
|
||||
zend_throw_exception(zend_ce_exception, "Invalid options", 0);
|
||||
return;
|
||||
}
|
||||
|
||||
docp = is_url ? xmlReadFile(data, NULL, (int)options) : xmlReadMemory(data, (int)data_len, NULL, NULL, (int)options);
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #74950 (null pointer deref in zim_simplexml_element_getDocNamespaces)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("simplexml")) die("skip SimpleXML not available");
|
||||
if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platforms only");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$xml=new SimpleXMLElement(0,9000000000);var_dump($xml->getDocNamespaces())?>
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Exception: Invalid options in %sbug74950.php:%d
|
||||
Stack trace:
|
||||
#0 %sbug74950.php(%d): SimpleXMLElement->__construct('0', 9000000000)
|
||||
#1 {main}
|
||||
thrown in %sbug74950.php on line %d
|
||||
+16
-4
@@ -535,8 +535,14 @@ PHP_FUNCTION(spl_autoload_register)
|
||||
ZSTR_VAL(lc_name)[ZSTR_LEN(lc_name)] = '\0';
|
||||
} else {
|
||||
ZVAL_UNDEF(&alfi.closure);
|
||||
lc_name = zend_string_alloc(ZSTR_LEN(func_name), 0);
|
||||
zend_str_tolower_copy(ZSTR_VAL(lc_name), ZSTR_VAL(func_name), ZSTR_LEN(func_name));
|
||||
/* Skip leading \ */
|
||||
if (ZSTR_VAL(func_name)[0] == '\\') {
|
||||
lc_name = zend_string_alloc(ZSTR_LEN(func_name) - 1, 0);
|
||||
zend_str_tolower_copy(ZSTR_VAL(lc_name), ZSTR_VAL(func_name) + 1, ZSTR_LEN(func_name) - 1);
|
||||
} else {
|
||||
lc_name = zend_string_alloc(ZSTR_LEN(func_name), 0);
|
||||
zend_str_tolower_copy(ZSTR_VAL(lc_name), ZSTR_VAL(func_name), ZSTR_LEN(func_name));
|
||||
}
|
||||
}
|
||||
zend_string_release(func_name);
|
||||
|
||||
@@ -654,8 +660,14 @@ PHP_FUNCTION(spl_autoload_unregister)
|
||||
memcpy(ZSTR_VAL(lc_name) + ZSTR_LEN(func_name), &Z_OBJ_HANDLE_P(zcallable), sizeof(uint32_t));
|
||||
ZSTR_VAL(lc_name)[ZSTR_LEN(lc_name)] = '\0';
|
||||
} else {
|
||||
lc_name = zend_string_alloc(ZSTR_LEN(func_name), 0);
|
||||
zend_str_tolower_copy(ZSTR_VAL(lc_name), ZSTR_VAL(func_name), ZSTR_LEN(func_name));
|
||||
/* Skip leading \ */
|
||||
if (ZSTR_VAL(func_name)[0] == '\\') {
|
||||
lc_name = zend_string_alloc(ZSTR_LEN(func_name) - 1, 0);
|
||||
zend_str_tolower_copy(ZSTR_VAL(lc_name), ZSTR_VAL(func_name) + 1, ZSTR_LEN(func_name) - 1);
|
||||
} else {
|
||||
lc_name = zend_string_alloc(ZSTR_LEN(func_name), 0);
|
||||
zend_str_tolower_copy(ZSTR_VAL(lc_name), ZSTR_VAL(func_name), ZSTR_LEN(func_name));
|
||||
}
|
||||
}
|
||||
zend_string_release(func_name);
|
||||
|
||||
|
||||
+28
-13
@@ -1740,13 +1740,14 @@ SPL_METHOD(Array, serialize)
|
||||
*/
|
||||
SPL_METHOD(Array, unserialize)
|
||||
{
|
||||
spl_array_object *intern = Z_SPLARRAY_P(getThis());
|
||||
zval *object = getThis();
|
||||
spl_array_object *intern = Z_SPLARRAY_P(object);
|
||||
|
||||
char *buf;
|
||||
size_t buf_len;
|
||||
const unsigned char *p, *s;
|
||||
php_unserialize_data_t var_hash;
|
||||
zval *members, *zflags;
|
||||
zval *members, *zflags, *array;
|
||||
zend_long flags;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &buf, &buf_len) == FAILURE) {
|
||||
@@ -1788,24 +1789,38 @@ SPL_METHOD(Array, unserialize)
|
||||
}
|
||||
++p;
|
||||
|
||||
if (*p!='m') {
|
||||
if (*p!='a' && *p!='O' && *p!='C' && *p!='r') {
|
||||
goto outexcept;
|
||||
}
|
||||
if (flags & SPL_ARRAY_IS_SELF) {
|
||||
/* If IS_SELF is used, the flags are not followed by an array/object */
|
||||
intern->ar_flags &= ~SPL_ARRAY_CLONE_MASK;
|
||||
intern->ar_flags |= flags & SPL_ARRAY_CLONE_MASK;
|
||||
zval_ptr_dtor(&intern->array);
|
||||
ZVAL_UNDEF(&intern->array);
|
||||
if (!php_var_unserialize(&intern->array, &p, s + buf_len, &var_hash)
|
||||
|| (Z_TYPE(intern->array) != IS_ARRAY && Z_TYPE(intern->array) != IS_OBJECT)) {
|
||||
} else {
|
||||
if (*p!='a' && *p!='O' && *p!='C' && *p!='r') {
|
||||
goto outexcept;
|
||||
}
|
||||
var_push_dtor(&var_hash, &intern->array);
|
||||
|
||||
array = var_tmp_var(&var_hash);
|
||||
if (!php_var_unserialize(array, &p, s + buf_len, &var_hash)
|
||||
|| (Z_TYPE_P(array) != IS_ARRAY && Z_TYPE_P(array) != IS_OBJECT)) {
|
||||
goto outexcept;
|
||||
}
|
||||
|
||||
intern->ar_flags &= ~SPL_ARRAY_CLONE_MASK;
|
||||
intern->ar_flags |= flags & SPL_ARRAY_CLONE_MASK;
|
||||
|
||||
if (Z_TYPE_P(array) == IS_ARRAY) {
|
||||
zval_ptr_dtor(&intern->array);
|
||||
ZVAL_COPY(&intern->array, array);
|
||||
} else {
|
||||
spl_array_set_array(object, intern, array, 0L, 1);
|
||||
}
|
||||
|
||||
if (*p != ';') {
|
||||
goto outexcept;
|
||||
}
|
||||
++p;
|
||||
}
|
||||
if (*p != ';') {
|
||||
goto outexcept;
|
||||
}
|
||||
++p;
|
||||
|
||||
/* members */
|
||||
if (*p!= 'm' || *++p != ':') {
|
||||
|
||||
@@ -942,6 +942,7 @@ static void spl_RecursiveIteratorIterator_free_storage(zend_object *_object)
|
||||
if (object->iterators) {
|
||||
efree(object->iterators);
|
||||
object->iterators = NULL;
|
||||
object->level = 0;
|
||||
}
|
||||
|
||||
zend_object_std_dtor(&object->std);
|
||||
@@ -3366,7 +3367,7 @@ SPL_METHOD(AppendIterator, __construct)
|
||||
Append an iterator */
|
||||
SPL_METHOD(AppendIterator, append)
|
||||
{
|
||||
spl_dual_it_object *intern;
|
||||
spl_dual_it_object *intern, *appender;
|
||||
zval *it;
|
||||
|
||||
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
|
||||
@@ -3378,6 +3379,11 @@ SPL_METHOD(AppendIterator, append)
|
||||
spl_array_iterator_append(&intern->u.append.zarrayit, it);
|
||||
intern->u.append.iterator->funcs->move_forward(intern->u.append.iterator);
|
||||
}else{
|
||||
appender = Z_SPLDUAL_IT_P(it);
|
||||
if (appender->dit_type == DIT_AppendIterator) {
|
||||
spl_array_iterator_append(&intern->u.append.zarrayit, &appender->u.append.zarrayit);
|
||||
return;
|
||||
}
|
||||
spl_array_iterator_append(&intern->u.append.zarrayit, it);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,45 +8,10 @@ $data = unserialize($exploit);
|
||||
|
||||
var_dump($data);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
object(ArrayObject)#1 (2) {
|
||||
[0]=>
|
||||
int(0)
|
||||
["storage":"ArrayObject":private]=>
|
||||
object(DateInterval)#2 (16) {
|
||||
["y"]=>
|
||||
int(3)
|
||||
["m"]=>
|
||||
int(-1)
|
||||
["d"]=>
|
||||
int(-1)
|
||||
["h"]=>
|
||||
int(-1)
|
||||
["i"]=>
|
||||
int(-1)
|
||||
["s"]=>
|
||||
int(-1)
|
||||
["f"]=>
|
||||
float(-1)
|
||||
["weekday"]=>
|
||||
int(-1)
|
||||
["weekday_behavior"]=>
|
||||
int(-1)
|
||||
["first_last_day_of"]=>
|
||||
int(-1)
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
int(-1)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(-1)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
}
|
||||
===DONE===
|
||||
Fatal error: Uncaught InvalidArgumentException: Overloaded object of type DateInterval is not compatible with ArrayObject in %s
|
||||
Stack trace:
|
||||
%s
|
||||
%s
|
||||
%s
|
||||
%s
|
||||
@@ -0,0 +1,112 @@
|
||||
--TEST--
|
||||
Bug #74669: Unserialize ArrayIterator broken
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Container implements Iterator
|
||||
{
|
||||
public $container;
|
||||
public $iterator;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->container = new ArrayObject();
|
||||
$this->iterator = $this->container->getIterator();
|
||||
}
|
||||
|
||||
public function append($element)
|
||||
{
|
||||
$this->container->append($element);
|
||||
}
|
||||
|
||||
public function current()
|
||||
{
|
||||
return $this->iterator->current();
|
||||
}
|
||||
|
||||
public function next()
|
||||
{
|
||||
$this->iterator->next();
|
||||
}
|
||||
|
||||
public function key()
|
||||
{
|
||||
return $this->iterator->key();
|
||||
}
|
||||
|
||||
public function valid()
|
||||
{
|
||||
return $this->iterator->valid();
|
||||
}
|
||||
|
||||
public function rewind()
|
||||
{
|
||||
$this->iterator->rewind();
|
||||
}
|
||||
}
|
||||
|
||||
class SelfArray extends ArrayObject
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct($this);
|
||||
}
|
||||
}
|
||||
|
||||
$container = new Container();
|
||||
$container->append('test1');
|
||||
$container->append('test2');
|
||||
$container->valid();
|
||||
$serialized = serialize($container);
|
||||
unset($container);
|
||||
|
||||
$container = unserialize($serialized);
|
||||
|
||||
foreach ($container as $key => $value) {
|
||||
echo $key . ' => ' . $value . PHP_EOL;
|
||||
}
|
||||
|
||||
$arObj = new ArrayObject(['test1', 'test2']);
|
||||
$serialized = serialize($container);
|
||||
unset($arObj);
|
||||
|
||||
$arObj = unserialize($serialized);
|
||||
foreach($arObj as $key => $value) {
|
||||
echo $key . ' => ' . $value . PHP_EOL;
|
||||
}
|
||||
|
||||
$payload = 'x:i:33554432;O:8:"stdClass":0:{};m:a:0:{}';
|
||||
$str = 'C:11:"ArrayObject":' . strlen($payload) . ':{' . $payload . '}';
|
||||
|
||||
$ao = unserialize($str);
|
||||
var_dump($ao['foo']);
|
||||
|
||||
$selfArray = new SelfArray();
|
||||
$selfArray['foo'] = 'bar';
|
||||
var_dump($selfArray);
|
||||
$serialized = serialize($selfArray);
|
||||
var_dump($serialized);
|
||||
unset($selfArray);
|
||||
$selfArray = unserialize($serialized);
|
||||
var_dump($selfArray);
|
||||
var_dump($selfArray['foo']);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
0 => test1
|
||||
1 => test2
|
||||
0 => test1
|
||||
1 => test2
|
||||
|
||||
Notice: Undefined index: foo in %s on line %s
|
||||
NULL
|
||||
object(SelfArray)#9 (1) {
|
||||
["foo"]=>
|
||||
string(3) "bar"
|
||||
}
|
||||
string(62) "C:9:"SelfArray":41:{x:i:16777216;m:a:1:{s:3:"foo";s:3:"bar";}}"
|
||||
object(SelfArray)#9 (1) {
|
||||
["foo"]=>
|
||||
string(3) "bar"
|
||||
}
|
||||
string(3) "bar"
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Bug #74977: Recursion leads to crash
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$iterator = new AppendIterator(array("A","A","A"));
|
||||
$iterator->append($iterator);
|
||||
var_dump($iterator);
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(AppendIterator)#1 (0) {
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #75049 (spl_autoload_unregister can't handle spl_autoload_functions results)
|
||||
--FILE--
|
||||
<?php
|
||||
class Auto { public static function loader() {}}
|
||||
$autoloader = '\Auto::loader';
|
||||
|
||||
echo (int)spl_autoload_register($autoloader);
|
||||
echo (int)spl_autoload_unregister($autoloader);
|
||||
echo (int)spl_autoload_register($autoloader);
|
||||
foreach (spl_autoload_functions() as $loader) {
|
||||
echo (int)spl_autoload_unregister($loader);
|
||||
}
|
||||
echo (int)count(spl_autoload_functions());
|
||||
--EXPECTF--
|
||||
11110
|
||||
@@ -10,5 +10,6 @@ if (PHP_SQLITE3 != "no") {
|
||||
ADD_SOURCES(configure_module_dirname + "/libsqlite", "sqlite3.c", "sqlite3");
|
||||
|
||||
AC_DEFINE("HAVE_SQLITE3", 1, "SQLite support");
|
||||
AC_DEFINE("HAVE_SQLITE3_ERRSTR", 1, "have sqlite3_errstr function")
|
||||
PHP_INSTALL_HEADERS("ext/sqlite3", "libsqlite/sqlite3.h");
|
||||
}
|
||||
@@ -53,6 +53,9 @@ if test $PHP_SQLITE3 != "no"; then
|
||||
PHP_CHECK_LIBRARY(sqlite3,sqlite3_column_table_name,[
|
||||
AC_DEFINE(SQLITE_ENABLE_COLUMN_METADATA, 1, [have sqlite3 with column metadata enabled])
|
||||
])
|
||||
PHP_CHECK_LIBRARY(sqlite3,sqlite3_errstr,[
|
||||
AC_DEFINE(HAVE_SQLITE3_ERRSTR, 1, [have sqlite3_errstr function])
|
||||
])
|
||||
|
||||
PHP_CHECK_LIBRARY(sqlite3,sqlite3_load_extension,
|
||||
[],
|
||||
@@ -86,6 +89,7 @@ if test $PHP_SQLITE3 != "no"; then
|
||||
PHP_INSTALL_HEADERS([ext/sqlite3/libsqlite/sqlite3.h])
|
||||
fi
|
||||
|
||||
AC_DEFINE(HAVE_SQLITE3_ERRSTR, 1, [have sqlite3_errstr function])
|
||||
AC_DEFINE(HAVE_SQLITE3,1,[ ])
|
||||
|
||||
sqlite3_sources="sqlite3.c $sqlite3_extra_sources"
|
||||
|
||||
@@ -140,7 +140,11 @@ PHP_METHOD(sqlite3, open)
|
||||
#endif
|
||||
if (rc != SQLITE_OK) {
|
||||
zend_throw_exception_ex(zend_ce_exception, 0, "Unable to open database: %s",
|
||||
#ifdef HAVE_SQLITE3_ERRSTR
|
||||
db_obj->db ? sqlite3_errmsg(db_obj->db) : sqlite3_errstr(rc));
|
||||
#else
|
||||
db_obj->db ? sqlite3_errmsg(db_obj->db) : "");
|
||||
#endif
|
||||
if (fullpath != filename) {
|
||||
efree(fullpath);
|
||||
}
|
||||
|
||||
@@ -792,6 +792,10 @@ PHP_FUNCTION(unpack)
|
||||
/* Never use any input */
|
||||
case 'X':
|
||||
size = -1;
|
||||
if (arg < 0) {
|
||||
php_error_docref(NULL, E_WARNING, "Type %c: '*' ignored", type);
|
||||
arg = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case '@':
|
||||
|
||||
@@ -7,7 +7,7 @@ if (stripos(PHP_OS, 'win') !== 0) die("skip windows required");
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$file = dirname(__FILE__)."/flock.dat";
|
||||
$file = dirname(__FILE__)."/flock_bug65272.dat";
|
||||
|
||||
$fp1 = fopen($file, "w");
|
||||
var_dump(flock($fp1, LOCK_SH));
|
||||
@@ -16,9 +16,13 @@ $fp2 = fopen($file, "r");
|
||||
var_dump(flock($fp2, LOCK_EX|LOCK_NB, $wouldblock));
|
||||
var_dump($wouldblock);
|
||||
|
||||
@unlink($file);
|
||||
echo "Done\n";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$file = dirname(__FILE__)."/flock_bug65272.dat";
|
||||
unlink($file);
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(true)
|
||||
bool(false)
|
||||
|
||||
@@ -29,10 +29,13 @@ foreach ($array as $str) {
|
||||
var_dump(fgetss($fp, 10, "<script>,<a>"));
|
||||
}
|
||||
|
||||
@unlink($filename);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$filename = dirname(__FILE__)."/fgetss1.html";
|
||||
unlink($filename);
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(21) "askasdfasdf<b>aaaaaa
|
||||
"
|
||||
|
||||
@@ -33,9 +33,13 @@ var_dump($would);
|
||||
var_dump(flock($fp, -1));
|
||||
var_dump(flock($fp, 0));
|
||||
|
||||
@unlink($file);
|
||||
echo "Done\n";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$file = dirname(__FILE__)."/flock.dat";
|
||||
unlink($file);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: flock() expects at least 2 parameters, 0 given in %s on line %d
|
||||
NULL
|
||||
|
||||
@@ -13,9 +13,13 @@ fputcsv($fp, $data);
|
||||
|
||||
var_dump($data);
|
||||
|
||||
@unlink($file);
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$file = dirname(__FILE__) .'/fgetcsv-test.csv';
|
||||
unlink($file);
|
||||
?>
|
||||
|
||||
--EXPECTF--
|
||||
Notice: Array to string conversion in %s on line %d
|
||||
array(7) {
|
||||
|
||||
@@ -56,9 +56,13 @@ file_put_contents($filename, "data");
|
||||
$fp = fopen($filename, "rt");
|
||||
var_dump(fscanf($fp, "%s%d", $v));
|
||||
|
||||
@unlink($filename);
|
||||
echo "Done\n";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
$filename = dirname(__FILE__)."/fscanf.dat";
|
||||
unlink($filename);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: fscanf() expects at least 2 parameters, 0 given in %s on line %d
|
||||
NULL
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
--TEST--
|
||||
Bug #75063 Many filesystem-related functions do not work with multibyte file names, cp1251
|
||||
--SKIPIF--
|
||||
<?php
|
||||
include dirname(__FILE__) . DIRECTORY_SEPARATOR . "util.inc";
|
||||
|
||||
skip_if_not_win();
|
||||
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
|
||||
skip_if_no_required_exts();
|
||||
|
||||
?>
|
||||
--INI--
|
||||
default_charset=cp1251
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/* This file is in cp1251. */
|
||||
|
||||
include dirname(__FILE__) . DIRECTORY_SEPARATOR . "util.inc";
|
||||
|
||||
$dir_basename = "ňĺńň";
|
||||
$prefix = dirname(__FILE__) . DIRECTORY_SEPARATOR . "bug75063-cp1251";
|
||||
$d0 = $prefix . DIRECTORY_SEPARATOR . $dir_basename;
|
||||
|
||||
mkdir($prefix);
|
||||
create_verify_dir($prefix, $dir_basename, 1251);
|
||||
|
||||
var_dump(get_basename_with_cp($d0, 1251, false));
|
||||
|
||||
$old_cwd = getcwd();
|
||||
var_dump(chdir($d0));
|
||||
|
||||
$code = <<<CODE
|
||||
<?php
|
||||
|
||||
foreach(["test", "ňŕńň"] as \$fn) {
|
||||
file_put_contents("\$fn.txt", "");
|
||||
}
|
||||
|
||||
var_dump(getcwd());
|
||||
if (\$dh = opendir(getcwd())) {
|
||||
while ((\$file = readdir(\$dh)) !== false) {
|
||||
if ("." == \$file || ".." == \$file) continue;
|
||||
var_dump(\$file);
|
||||
}
|
||||
closedir(\$dh);
|
||||
}
|
||||
CODE;
|
||||
$code_fn = "code.php";
|
||||
file_put_contents($code_fn, $code);
|
||||
|
||||
print(shell_exec(getenv('TEST_PHP_EXECUTABLE') . " -n -d default_charset=cp1251 -f code.php"));
|
||||
|
||||
chdir($old_cwd);
|
||||
|
||||
/* --CLEAN-- section were the right place, but it won't accept default_charset ATM, it seems. */
|
||||
$dir_basename = "ňĺńň";
|
||||
$prefix = dirname(__FILE__) . DIRECTORY_SEPARATOR . "bug75063-cp1251";
|
||||
$d0 = $prefix . DIRECTORY_SEPARATOR . $dir_basename;
|
||||
|
||||
$obj = scandir($d0);
|
||||
foreach ($obj as $file) {
|
||||
if ("." == $file || ".." == $file) continue;
|
||||
unlink($d0 . DIRECTORY_SEPARATOR . $file);
|
||||
}
|
||||
|
||||
rmdir($d0);
|
||||
rmdir($prefix);
|
||||
?>
|
||||
===DONE===
|
||||
|
||||
--EXPECTF--
|
||||
string(4) "ňĺńň"
|
||||
bool(true)
|
||||
string(%d) "%sbug75063-cp1251%eňĺńň"
|
||||
string(8) "code.php"
|
||||
string(8) "test.txt"
|
||||
string(8) "ňŕńň.txt"
|
||||
===DONE===
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
--TEST--
|
||||
Bug #75063 Many filesystem-related functions do not work with multibyte file names, UTF-8
|
||||
--SKIPIF--
|
||||
<?php
|
||||
include dirname(__FILE__) . DIRECTORY_SEPARATOR . "util.inc";
|
||||
|
||||
skip_if_not_win();
|
||||
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
|
||||
skip_if_no_required_exts();
|
||||
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/* This file is in UTF-8. */
|
||||
|
||||
include dirname(__FILE__) . DIRECTORY_SEPARATOR . "util.inc";
|
||||
|
||||
$dir_basename = "тест";
|
||||
$prefix = dirname(__FILE__) . DIRECTORY_SEPARATOR . "bug75063-utf8";
|
||||
$d0 = $prefix . DIRECTORY_SEPARATOR . $dir_basename;
|
||||
|
||||
mkdir($prefix);
|
||||
create_verify_dir($prefix, $dir_basename);
|
||||
|
||||
var_dump(get_basename_with_cp($d0, 65001, false));
|
||||
|
||||
$old_cwd = getcwd();
|
||||
var_dump(chdir($d0));
|
||||
|
||||
$code = <<<CODE
|
||||
<?php
|
||||
|
||||
foreach(["test", "таст"] as \$fn) {
|
||||
file_put_contents("\$fn.txt", "");
|
||||
}
|
||||
|
||||
var_dump(getcwd());
|
||||
if (\$dh = opendir(getcwd())) {
|
||||
while ((\$file = readdir(\$dh)) !== false) {
|
||||
if ("." == \$file || ".." == \$file) continue;
|
||||
var_dump(\$file);
|
||||
}
|
||||
closedir(\$dh);
|
||||
}
|
||||
CODE;
|
||||
$code_fn = "code.php";
|
||||
file_put_contents($code_fn, $code);
|
||||
|
||||
print(shell_exec(getenv('TEST_PHP_EXECUTABLE') . " -nf code.php"));
|
||||
|
||||
chdir($old_cwd);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--CLEAN--
|
||||
<?php
|
||||
$dir_basename = "тест";
|
||||
$prefix = dirname(__FILE__) . DIRECTORY_SEPARATOR . "bug75063-utf8";
|
||||
$d0 = $prefix . DIRECTORY_SEPARATOR . $dir_basename;
|
||||
|
||||
$obj = scandir($d0);
|
||||
foreach ($obj as $file) {
|
||||
if ("." == $file || ".." == $file) continue;
|
||||
unlink($d0 . DIRECTORY_SEPARATOR . $file);
|
||||
}
|
||||
|
||||
rmdir($d0);
|
||||
rmdir($prefix);
|
||||
|
||||
?>
|
||||
|
||||
--EXPECTF--
|
||||
string(8) "тест"
|
||||
bool(true)
|
||||
string(%d) "%sbug75063-utf8%eтест"
|
||||
string(8) "code.php"
|
||||
string(8) "test.txt"
|
||||
string(12) "таст.txt"
|
||||
===DONE===
|
||||
|
||||
@@ -57,13 +57,13 @@ array(16) {
|
||||
["test1bpix.bmp"]=>
|
||||
array(6) {
|
||||
[0]=>
|
||||
int(500)
|
||||
int(1)
|
||||
[1]=>
|
||||
int(345)
|
||||
int(1)
|
||||
[2]=>
|
||||
int(6)
|
||||
[3]=>
|
||||
string(24) "width="500" height="345""
|
||||
string(20) "width="1" height="1""
|
||||
["bits"]=>
|
||||
int(32)
|
||||
["mime"]=>
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 674 KiB After Width: | Height: | Size: 142 B |
@@ -0,0 +1,9 @@
|
||||
--TEST--
|
||||
Bug #74103: heap-use-after-free when unserializing invalid array size
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(unserialize('a:7:{i:0;i:04;s:1:"a";i:2;i:9617006;i:4;s:1:"a";i:4;s:1:"a";R:5;s:1:"7";R:3;s:1:"a";R:5;;s:18;}}'));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: unserialize(): Error at offset 64 of 96 bytes in %s on line %d
|
||||
bool(false)
|
||||
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
Bug #75054: A Denial of Service Vulnerability was found when performing deserialization
|
||||
--FILE--
|
||||
<?php
|
||||
$poc = 'a:9:{i:0;s:4:"0000";i:0;s:4:"0000";i:0;R:2;s:4:"5003";R:2;s:4:"0000";R:2;s:4:"0000";R:2;s:4:"';
|
||||
$poc .= "\x06";
|
||||
$poc .= '000";R:2;s:4:"0000";d:0;s:4:"0000";a:9:{s:4:"0000";';
|
||||
var_dump(unserialize($poc));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: unserialize(): Error at offset 43 of 145 bytes in %s on line %d
|
||||
bool(false)
|
||||
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
Bug#74951 Null pointer dereference in user streams
|
||||
--FILE--
|
||||
<?php
|
||||
trait Stream00ploiter{
|
||||
public function s() {}
|
||||
public function n($_) {}
|
||||
}
|
||||
stream_wrapper_register('e0ploit','Stream00ploiter');
|
||||
$s=fopen('e0ploit://',0);
|
||||
--EXPECTF--
|
||||
Warning: fopen(e0ploit://): failed to open stream: operation failed in %s%ebug74951.php on line 7
|
||||
@@ -6,6 +6,7 @@ Bug #69900 Commandline input/output weird behaviour with STDIO
|
||||
error_reporting(E_ALL);
|
||||
|
||||
$fl = dirname(__FILE__) . DIRECTORY_SEPARATOR . "test69900.php";
|
||||
$max_ms = ((bool)getenv('TRAVIS')) ? 5 : 1;
|
||||
|
||||
$test_content = '<?php
|
||||
|
||||
@@ -33,7 +34,7 @@ for($i = 0; $i < 10; $i++){
|
||||
$t1 = microtime(1);
|
||||
|
||||
echo $s;
|
||||
echo "fgets() took ", (($t1 - $t0)*1000 > 1 ? 'more' : 'less'), " than 1 ms\n";
|
||||
echo "fgets() took ", (($t1 - $t0)*1000 > $max_ms ? 'more' : 'less'), " than $max_ms ms\n";
|
||||
}
|
||||
|
||||
fclose($pipes[0]);
|
||||
@@ -48,25 +49,25 @@ proc_close($process);
|
||||
$fl = dirname(__FILE__) . DIRECTORY_SEPARATOR . "test69900.php";
|
||||
@unlink($fl);
|
||||
?>
|
||||
--EXPECT--
|
||||
--EXPECTF--
|
||||
hello0
|
||||
fgets() took more than 1 ms
|
||||
fgets() took more than %d ms
|
||||
hello1
|
||||
fgets() took less than 1 ms
|
||||
fgets() took less than %d ms
|
||||
hello2
|
||||
fgets() took less than 1 ms
|
||||
fgets() took less than %d ms
|
||||
hello3
|
||||
fgets() took less than 1 ms
|
||||
fgets() took less than %d ms
|
||||
hello4
|
||||
fgets() took less than 1 ms
|
||||
fgets() took less than %d ms
|
||||
hello5
|
||||
fgets() took less than 1 ms
|
||||
fgets() took less than %d ms
|
||||
hello6
|
||||
fgets() took less than 1 ms
|
||||
fgets() took less than %d ms
|
||||
hello7
|
||||
fgets() took less than 1 ms
|
||||
fgets() took less than %d ms
|
||||
hello8
|
||||
fgets() took less than 1 ms
|
||||
fgets() took less than %d ms
|
||||
hello9
|
||||
fgets() took less than 1 ms
|
||||
fgets() took less than %d ms
|
||||
===DONE===
|
||||
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Bug #75075 (unpack with X* causes infinity loop)
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(unpack("X*", ""));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: unpack(): Type X: '*' ignored in %sbug75075.php on line %d
|
||||
array(0) {
|
||||
}
|
||||
@@ -194,6 +194,13 @@ static inline void append_modified_url(smart_str *url, smart_str *dest, smart_st
|
||||
return;
|
||||
}
|
||||
|
||||
/* Don't modify URLs of the format "#mark" */
|
||||
if (url_parts->fragment && '#' == ZSTR_VAL(url->s)[0]) {
|
||||
smart_str_append_smart_str(dest, url);
|
||||
php_url_free(url_parts);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Check protocol. Only http/https is allowed. */
|
||||
if (url_parts->scheme
|
||||
&& strcasecmp("http", url_parts->scheme)
|
||||
@@ -217,13 +224,12 @@ static inline void append_modified_url(smart_str *url, smart_str *dest, smart_st
|
||||
* When URL does not have path and query string add "/?".
|
||||
* i.e. If URL is only "?foo=bar", should not add "/?".
|
||||
*/
|
||||
if (!url_parts->path && !url_parts->query) {
|
||||
if (!url_parts->path && !url_parts->query && !url_parts->fragment) {
|
||||
/* URL is http://php.net or like */
|
||||
smart_str_append_smart_str(dest, url);
|
||||
smart_str_appendc(dest, '/');
|
||||
smart_str_appendc(dest, '?');
|
||||
smart_str_append_smart_str(dest, url_app);
|
||||
/* There should not be fragment. Just return */
|
||||
php_url_free(url_parts);
|
||||
return;
|
||||
}
|
||||
@@ -513,7 +519,7 @@ state_plain_begin:
|
||||
state_plain:
|
||||
start = YYCURSOR;
|
||||
|
||||
#line 517 "ext/standard/url_scanner_ex.c"
|
||||
#line 523 "ext/standard/url_scanner_ex.c"
|
||||
{
|
||||
YYCTYPE yych;
|
||||
static const unsigned char yybm[] = {
|
||||
@@ -563,22 +569,22 @@ yy2:
|
||||
if (yybm[0+yych] & 128) {
|
||||
goto yy2;
|
||||
}
|
||||
#line 520 "ext/standard/url_scanner_ex.re"
|
||||
#line 526 "ext/standard/url_scanner_ex.re"
|
||||
{ passthru(STD_ARGS); goto state_plain; }
|
||||
#line 569 "ext/standard/url_scanner_ex.c"
|
||||
#line 575 "ext/standard/url_scanner_ex.c"
|
||||
yy5:
|
||||
++YYCURSOR;
|
||||
#line 519 "ext/standard/url_scanner_ex.re"
|
||||
#line 525 "ext/standard/url_scanner_ex.re"
|
||||
{ passthru(STD_ARGS); STATE = STATE_TAG; goto state_tag; }
|
||||
#line 574 "ext/standard/url_scanner_ex.c"
|
||||
#line 580 "ext/standard/url_scanner_ex.c"
|
||||
}
|
||||
#line 521 "ext/standard/url_scanner_ex.re"
|
||||
#line 527 "ext/standard/url_scanner_ex.re"
|
||||
|
||||
|
||||
state_tag:
|
||||
start = YYCURSOR;
|
||||
|
||||
#line 582 "ext/standard/url_scanner_ex.c"
|
||||
#line 588 "ext/standard/url_scanner_ex.c"
|
||||
{
|
||||
YYCTYPE yych;
|
||||
static const unsigned char yybm[] = {
|
||||
@@ -621,9 +627,9 @@ state_tag:
|
||||
goto yy11;
|
||||
}
|
||||
++YYCURSOR;
|
||||
#line 527 "ext/standard/url_scanner_ex.re"
|
||||
#line 533 "ext/standard/url_scanner_ex.re"
|
||||
{ passthru(STD_ARGS); goto state_plain_begin; }
|
||||
#line 627 "ext/standard/url_scanner_ex.c"
|
||||
#line 633 "ext/standard/url_scanner_ex.c"
|
||||
yy11:
|
||||
++YYCURSOR;
|
||||
if (YYLIMIT <= YYCURSOR) YYFILL(1);
|
||||
@@ -631,11 +637,11 @@ yy11:
|
||||
if (yybm[0+yych] & 128) {
|
||||
goto yy11;
|
||||
}
|
||||
#line 526 "ext/standard/url_scanner_ex.re"
|
||||
#line 532 "ext/standard/url_scanner_ex.re"
|
||||
{ handle_tag(STD_ARGS); /* Sets STATE */; passthru(STD_ARGS); if (STATE == STATE_PLAIN) goto state_plain; else goto state_next_arg; }
|
||||
#line 637 "ext/standard/url_scanner_ex.c"
|
||||
#line 643 "ext/standard/url_scanner_ex.c"
|
||||
}
|
||||
#line 528 "ext/standard/url_scanner_ex.re"
|
||||
#line 534 "ext/standard/url_scanner_ex.re"
|
||||
|
||||
|
||||
state_next_arg_begin:
|
||||
@@ -644,7 +650,7 @@ state_next_arg_begin:
|
||||
state_next_arg:
|
||||
start = YYCURSOR;
|
||||
|
||||
#line 648 "ext/standard/url_scanner_ex.c"
|
||||
#line 654 "ext/standard/url_scanner_ex.c"
|
||||
{
|
||||
YYCTYPE yych;
|
||||
static const unsigned char yybm[] = {
|
||||
@@ -700,9 +706,9 @@ state_next_arg:
|
||||
yy16:
|
||||
++YYCURSOR;
|
||||
yy17:
|
||||
#line 539 "ext/standard/url_scanner_ex.re"
|
||||
#line 545 "ext/standard/url_scanner_ex.re"
|
||||
{ passthru(STD_ARGS); goto state_plain_begin; }
|
||||
#line 706 "ext/standard/url_scanner_ex.c"
|
||||
#line 712 "ext/standard/url_scanner_ex.c"
|
||||
yy18:
|
||||
++YYCURSOR;
|
||||
if (YYLIMIT <= YYCURSOR) YYFILL(1);
|
||||
@@ -710,30 +716,30 @@ yy18:
|
||||
if (yybm[0+yych] & 128) {
|
||||
goto yy18;
|
||||
}
|
||||
#line 537 "ext/standard/url_scanner_ex.re"
|
||||
#line 543 "ext/standard/url_scanner_ex.re"
|
||||
{ passthru(STD_ARGS); goto state_next_arg; }
|
||||
#line 716 "ext/standard/url_scanner_ex.c"
|
||||
#line 722 "ext/standard/url_scanner_ex.c"
|
||||
yy21:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych != '>') goto yy17;
|
||||
yy22:
|
||||
++YYCURSOR;
|
||||
#line 536 "ext/standard/url_scanner_ex.re"
|
||||
#line 542 "ext/standard/url_scanner_ex.re"
|
||||
{ passthru(STD_ARGS); handle_form(STD_ARGS); goto state_plain_begin; }
|
||||
#line 724 "ext/standard/url_scanner_ex.c"
|
||||
#line 730 "ext/standard/url_scanner_ex.c"
|
||||
yy24:
|
||||
++YYCURSOR;
|
||||
#line 538 "ext/standard/url_scanner_ex.re"
|
||||
#line 544 "ext/standard/url_scanner_ex.re"
|
||||
{ --YYCURSOR; STATE = STATE_ARG; goto state_arg; }
|
||||
#line 729 "ext/standard/url_scanner_ex.c"
|
||||
#line 735 "ext/standard/url_scanner_ex.c"
|
||||
}
|
||||
#line 540 "ext/standard/url_scanner_ex.re"
|
||||
#line 546 "ext/standard/url_scanner_ex.re"
|
||||
|
||||
|
||||
state_arg:
|
||||
start = YYCURSOR;
|
||||
|
||||
#line 737 "ext/standard/url_scanner_ex.c"
|
||||
#line 743 "ext/standard/url_scanner_ex.c"
|
||||
{
|
||||
YYCTYPE yych;
|
||||
static const unsigned char yybm[] = {
|
||||
@@ -778,9 +784,9 @@ state_arg:
|
||||
if (yych <= 'z') goto yy30;
|
||||
yy28:
|
||||
++YYCURSOR;
|
||||
#line 546 "ext/standard/url_scanner_ex.re"
|
||||
#line 552 "ext/standard/url_scanner_ex.re"
|
||||
{ passthru(STD_ARGS); STATE = STATE_NEXT_ARG; goto state_next_arg; }
|
||||
#line 784 "ext/standard/url_scanner_ex.c"
|
||||
#line 790 "ext/standard/url_scanner_ex.c"
|
||||
yy30:
|
||||
++YYCURSOR;
|
||||
if (YYLIMIT <= YYCURSOR) YYFILL(1);
|
||||
@@ -788,17 +794,17 @@ yy30:
|
||||
if (yybm[0+yych] & 128) {
|
||||
goto yy30;
|
||||
}
|
||||
#line 545 "ext/standard/url_scanner_ex.re"
|
||||
#line 551 "ext/standard/url_scanner_ex.re"
|
||||
{ passthru(STD_ARGS); handle_arg(STD_ARGS); STATE = STATE_BEFORE_VAL; goto state_before_val; }
|
||||
#line 794 "ext/standard/url_scanner_ex.c"
|
||||
#line 800 "ext/standard/url_scanner_ex.c"
|
||||
}
|
||||
#line 547 "ext/standard/url_scanner_ex.re"
|
||||
#line 553 "ext/standard/url_scanner_ex.re"
|
||||
|
||||
|
||||
state_before_val:
|
||||
start = YYCURSOR;
|
||||
|
||||
#line 802 "ext/standard/url_scanner_ex.c"
|
||||
#line 808 "ext/standard/url_scanner_ex.c"
|
||||
{
|
||||
YYCTYPE yych;
|
||||
static const unsigned char yybm[] = {
|
||||
@@ -841,9 +847,9 @@ state_before_val:
|
||||
if (yych == '=') goto yy38;
|
||||
++YYCURSOR;
|
||||
yy36:
|
||||
#line 553 "ext/standard/url_scanner_ex.re"
|
||||
#line 559 "ext/standard/url_scanner_ex.re"
|
||||
{ --YYCURSOR; goto state_next_arg_begin; }
|
||||
#line 847 "ext/standard/url_scanner_ex.c"
|
||||
#line 853 "ext/standard/url_scanner_ex.c"
|
||||
yy37:
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
if (yych == ' ') goto yy41;
|
||||
@@ -855,9 +861,9 @@ yy38:
|
||||
if (yybm[0+yych] & 128) {
|
||||
goto yy38;
|
||||
}
|
||||
#line 552 "ext/standard/url_scanner_ex.re"
|
||||
#line 558 "ext/standard/url_scanner_ex.re"
|
||||
{ passthru(STD_ARGS); STATE = STATE_VAL; goto state_val; }
|
||||
#line 861 "ext/standard/url_scanner_ex.c"
|
||||
#line 867 "ext/standard/url_scanner_ex.c"
|
||||
yy41:
|
||||
++YYCURSOR;
|
||||
if (YYLIMIT <= YYCURSOR) YYFILL(1);
|
||||
@@ -867,14 +873,14 @@ yy41:
|
||||
YYCURSOR = YYMARKER;
|
||||
goto yy36;
|
||||
}
|
||||
#line 554 "ext/standard/url_scanner_ex.re"
|
||||
#line 560 "ext/standard/url_scanner_ex.re"
|
||||
|
||||
|
||||
|
||||
state_val:
|
||||
start = YYCURSOR;
|
||||
|
||||
#line 878 "ext/standard/url_scanner_ex.c"
|
||||
#line 884 "ext/standard/url_scanner_ex.c"
|
||||
{
|
||||
YYCTYPE yych;
|
||||
static const unsigned char yybm[] = {
|
||||
@@ -927,15 +933,15 @@ yy46:
|
||||
if (yybm[0+yych] & 32) {
|
||||
goto yy46;
|
||||
}
|
||||
#line 562 "ext/standard/url_scanner_ex.re"
|
||||
#line 568 "ext/standard/url_scanner_ex.re"
|
||||
{ handle_val(STD_ARGS, 0, ' '); goto state_next_arg_begin; }
|
||||
#line 933 "ext/standard/url_scanner_ex.c"
|
||||
#line 939 "ext/standard/url_scanner_ex.c"
|
||||
yy49:
|
||||
++YYCURSOR;
|
||||
yy50:
|
||||
#line 563 "ext/standard/url_scanner_ex.re"
|
||||
#line 569 "ext/standard/url_scanner_ex.re"
|
||||
{ passthru(STD_ARGS); goto state_next_arg_begin; }
|
||||
#line 939 "ext/standard/url_scanner_ex.c"
|
||||
#line 945 "ext/standard/url_scanner_ex.c"
|
||||
yy51:
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
if (yych == '>') goto yy50;
|
||||
@@ -958,9 +964,9 @@ yy55:
|
||||
goto yy50;
|
||||
yy56:
|
||||
++YYCURSOR;
|
||||
#line 560 "ext/standard/url_scanner_ex.re"
|
||||
#line 566 "ext/standard/url_scanner_ex.re"
|
||||
{ handle_val(STD_ARGS, 1, '"'); goto state_next_arg_begin; }
|
||||
#line 964 "ext/standard/url_scanner_ex.c"
|
||||
#line 970 "ext/standard/url_scanner_ex.c"
|
||||
yy58:
|
||||
++YYCURSOR;
|
||||
if (YYLIMIT <= YYCURSOR) YYFILL(1);
|
||||
@@ -971,11 +977,11 @@ yy59:
|
||||
}
|
||||
if (yych >= '(') goto yy55;
|
||||
++YYCURSOR;
|
||||
#line 561 "ext/standard/url_scanner_ex.re"
|
||||
#line 567 "ext/standard/url_scanner_ex.re"
|
||||
{ handle_val(STD_ARGS, 1, '\''); goto state_next_arg_begin; }
|
||||
#line 977 "ext/standard/url_scanner_ex.c"
|
||||
#line 983 "ext/standard/url_scanner_ex.c"
|
||||
}
|
||||
#line 564 "ext/standard/url_scanner_ex.re"
|
||||
#line 570 "ext/standard/url_scanner_ex.re"
|
||||
|
||||
|
||||
stop:
|
||||
|
||||
@@ -197,6 +197,13 @@ static inline void append_modified_url(smart_str *url, smart_str *dest, smart_st
|
||||
return;
|
||||
}
|
||||
|
||||
/* Don't modify URLs of the format "#mark" */
|
||||
if (url_parts->fragment && '#' == ZSTR_VAL(url->s)[0]) {
|
||||
smart_str_append_smart_str(dest, url);
|
||||
php_url_free(url_parts);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Check protocol. Only http/https is allowed. */
|
||||
if (url_parts->scheme
|
||||
&& strcasecmp("http", url_parts->scheme)
|
||||
@@ -220,13 +227,12 @@ static inline void append_modified_url(smart_str *url, smart_str *dest, smart_st
|
||||
* When URL does not have path and query string add "/?".
|
||||
* i.e. If URL is only "?foo=bar", should not add "/?".
|
||||
*/
|
||||
if (!url_parts->path && !url_parts->query) {
|
||||
if (!url_parts->path && !url_parts->query && !url_parts->fragment) {
|
||||
/* URL is http://php.net or like */
|
||||
smart_str_append_smart_str(dest, url);
|
||||
smart_str_appendc(dest, '/');
|
||||
smart_str_appendc(dest, '?');
|
||||
smart_str_append_smart_str(dest, url_app);
|
||||
/* There should not be fragment. Just return */
|
||||
php_url_free(url_parts);
|
||||
return;
|
||||
}
|
||||
|
||||
+536
-523
File diff suppressed because it is too large.
Load diff
Loaded 100 of 119 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user