Compare commits

...
87 Commits
Author SHA1 Message Date
Johannes Schlüter b4cb0265a1 PHP 5.3.1 2009-11-18 20:08:14 +00:00
Johannes Schlüter cdcb2d7497 PHP 5.3.1 2009-11-18 19:43:33 +00:00
Johannes Schlüter f1d11e8e39 Merge 5.3.1 NEWS 2009-11-18 17:29:05 +00:00
Johannes Schlüter dd8b782bc8 Merge 290606 (fixes the skipif) (David C) 2009-11-12 17:59:18 +00:00
Johannes Schlüter b1997d6557 Merge 290570 (Fix bug #49098). (Rasmus) 2009-11-12 17:48:36 +00:00
Johannes Schlüter 368e8230de Merge 290527 (fix PHP Bug #49910: no support for ././@LongLink for long
filenames in phar tar support) (Greg)
2009-11-12 17:43:23 +00:00
Johannes Schlüter b3ba19db6b merge 290306 (Make sure that max_file_uploads is set to 20 by-default in all places), Ilia 2009-11-12 17:20:01 +00:00
Johannes Schlüter bd92b11df6 Merge: Updated to version 2009.18 (2009r) (Derick) 2009-11-12 15:19:43 +00:00
Johannes Schlüter 5aaebd65a4 5.3.1RC4 2009-11-12 15:09:20 +00:00
Johannes Schlüter b8635add77 Fix #50063 (safe_mode_include_dir fails) 2009-11-12 15:05:03 +00:00
Johannes Schlüter 0915cc1302 Back to -dev 2009-11-03 19:16:27 +00:00
Johannes Schlüter bc2f6df355 PHP 5.3.0RC3 2009-11-03 15:36:55 +00:00
Pierre Joye 4fd26968bc - fix lenght for alloc and cpy (Kanwal) 2009-11-03 10:48:12 +00:00
Pierre Joye 915560bb93 - Fixed #50052, Different Hashes on Windows and Linux on wrong Salt size 2009-11-02 20:46:52 +00:00
Pierre Joye df2e5b8d25 - Merge 290129, Fixed bug #49908 (throwing exception in __autoload crashes when interface is not defined) 2009-11-02 18:11:33 +00:00
Pierre Joye e2d2290c0b - Merge 290147, Updated to version 2009.17 (2009q) 2009-11-02 17:56:20 +00:00
Pierre Joye 4f674c6ee4 - Merge 290029, Lower the max upload default to 20 2009-10-28 15:19:32 +00:00
Pierre Joye 5122938742 - Merge revision 289987, Fixed bug #49142 (crash when exception thrown from __tostring()) 2009-10-28 11:08:33 +00:00
Pierre Joye d3c66d56fa - Merge revision 289990, introduce new INI setting max_file_uploads [DOC] added to 5.2 as well 2009-10-28 11:03:36 +00:00
Pierre Joye eb1db15ac3 - Fixed crash in com_print_typeinfo when an invalid typelib is given 2009-10-27 19:16:55 +00:00
Pierre Joye 178a023ce2 - Updated to version 2009.16 (2009p) 2009-10-27 10:50:06 +00:00
Pierre Joye 0234cbb6f8 - #48752 2009-10-27 10:44:11 +00:00
Pierre Joye b13b1c94a6 - #48752, crash during date parsing with invalid date 2009-10-27 10:41:45 +00:00
Pierre Joye ff348d64ee - #49986, fix ICU DLLs path 2009-10-24 19:52:23 +00:00
Johannes Schlüter 70e4bdbbba Back to -dev 2009-10-20 22:02:58 +00:00
Johannes Schlüter b5c273c916 5.3.1RC2 2009-10-20 18:17:22 +00:00
Antony Dovgal cdcfd12108 fix crash on empty doc_root 2009-10-20 12:57:44 +00:00
Pierre Joye 432f0d1380 - Merge: Fix ACL support and add support for ACL for TS SAPI. Be sure to get the impersonated token when the impersonation has been done. Add the SID as part of the key for the cache (so each SID gets its cache and not previous requests run under other SID) 2009-10-19 23:38:55 +00:00
Johannes Schlüter 9fea178a1b Merge 289776: Fix test 2009-10-19 21:51:59 +00:00
Johannes Schlüter 7b06c28ea2 Merge #289581 (Fixed PDORow and PDOStatement crashes when instantiating throught
Reflection (Felipe)
2009-10-19 21:43:34 +00:00
Johannes Schlüter 122d4aee9c Merge NEWS for merged stuff from PHP_5_3 to PHP_5_3_1 2009-10-19 21:16:07 +00:00
Pierre Joye c3cc057418 - Merge: we don't distribute the crt9 dll, don't try to add it 2009-10-19 20:02:05 +00:00
Pierre Joye e9c850b1a3 - Merge: add custom DLL to the package and fix the path to the deps bin (needs absolute path in some cases) 2009-10-19 19:05:58 +00:00
Pierre Joye 6dba114cfd - Merge: Update libsqlite to 3.6.19 2009-10-19 17:11:05 +00:00
Pierre Joye f9333d925c - Merge: improve fix for #49767 and #47627 - make PHP report 'no script' on 404 again 2009-10-19 17:04:44 +00:00
Pierre Joye 2b94eccbd2 - Merge: Updated to version 2009.15 (2009o) 2009-10-19 16:59:40 +00:00
Pierre Joye f937a5ac8d - Merge: Upgraded bundled sqlite to versio 3.6.18 2009-10-15 21:40:36 +00:00
Pierre Joye 60926976a1 - Merge: #49847 2009-10-15 21:36:42 +00:00
Pierre Joye 1a95b4a034 - Merge: fix crash for bug #47627 2009-10-15 21:32:24 +00:00
Pierre Joye c6126625e0 - Merge: Updated to version 2009.14 (2009n) 2009-10-15 21:29:00 +00:00
Pierre Joye c631df654b - Merge: #49809 (time_sleep_until is not available on solaris) 2009-10-15 21:06:51 +00:00
Pierre Joye b62a6be2ac - Merge: - #49855 ^# ^author ^date ^msg ^merge^ 2009-10-15 14:10:03 +00:00
Pierre Joye b40451bb33 - Merge: - #48779, fix another use case where / usage may differ 2009-10-15 13:28:55 +00:00
Johannes Schlüter 0f74febfad svn merge mysql-related fixes
# I hope svn adds some more info in the history/commit mail
2009-10-14 13:51:25 +00:00
Pierre Joye fdd16ecd9b - Merge: Fixed possible crash when calling SQLiteDatabase::{ArrayQuery, SingleQuery} methods using Reflection 2009-10-12 22:37:52 +00:00
Pierre Joye 78cf3608a6 - Merge: fix dictionnary path issues, add functions to define their path [DOC] (approved by RM) 2009-10-12 22:35:36 +00:00
Pierre Joye f7a4997e48 - Merge: fix possible issue in TS environment and fix handle leak (we don't have to do that anymore anyway in 5.3+) 2009-10-12 14:55:50 +00:00
Pierre Joye 25819c72da - Merge: #48779 2009-10-12 14:51:24 +00:00
Pierre Joye 692e2b7d8b - Merge: Updated to version 2009.13 (2009m) 2009-10-12 14:26:47 +00:00
Pierre Joye 22c6c9ac87 - Merge: fix test 2009-10-12 14:23:29 +00:00
Pierre Joye 419ad36db8 - check max colors while loading gd2 palette image (patch by Tomas Hoger) 2009-10-12 10:01:37 +00:00
Felipe Pena 35381b7f40 - Fix compiler warning 2009-10-11 15:39:48 +00:00
Pierre Joye 6425b074be - Merge: Fixed bug #48805 (IPv6 socket transport is not working) 2009-10-10 12:21:08 +00:00
Pierre Joye 3897a8a32a - Merge: Fixed bug #49517 (cURL's CURLOPT_FILE prevents file from being deleted after fclose) 2009-10-10 09:29:34 +00:00
Pierre Joye 957f2e9e5e - Merge: Fixed bug #49517 (cURL's CURLOPT_FILE prevents file from being deleted after fclose) 2009-10-10 09:24:59 +00:00
Pierre Joye 03042693bc - Merge: Fixed bug #49531 (CURLOPT_INFILESIZE sometimes causes warning “CURLPROTO_FILE cannot be set …) 2009-10-10 09:17:01 +00:00
Pierre Joye fc0f16cb5c - Merge: Fixed memleak in tests/lang/engine_assignExecutionOrder_001.phpt 2009-10-10 09:12:58 +00:00
Pierre Joye 36a817b592 - Merge: fix leak 2009-10-09 19:13:33 +00:00
Pierre Joye 04d802a79e - Merge: Fixed certificate validation inside php_openssl_apply_verification_policy 2009-10-09 19:08:56 +00:00
Pierre Joye 362b334456 - Merge: Fixed bug #49627 (error_log to specified file does not log time according to date.timezone) 2009-10-09 19:06:10 +00:00
Pierre Joye a2e7c6d2f0 - Merege: Fix bug #49558 And as Colin mentioned in the bug report, this means date_sunrise() and date_sunset() have been off by 26 seconds in most cases until now 2009-10-09 18:59:14 +00:00
Pierre Joye 1ed8a4d6d6 - Possible fix for bug #49344 on Windows (pdo_mssql fails to connect,throws PDOException SQLSTATE[] (null) (severity 0)) 2009-10-09 18:56:19 +00:00
Pierre Joye 9058ae8ef0 - Merge: fix mem leak 2009-10-09 18:52:59 +00:00
Pierre Joye 1a57cb01e6 - Merge: Fixed bug #49470 (FILTER_SANITIZE_EMAIL allows disallowed characters) 2009-10-09 17:50:17 +00:00
Pierre Joye 883aa84f8a - Merge: Fixed bug #49572 (use of C++ style comments causes build failure) 2009-10-09 17:45:03 +00:00
Pierre Joye 2fc07dcac4 - Merge: long2ip() can return wrong value in a multi-threaded applications 2009-10-09 17:41:29 +00:00
Pierre Joye 1aa6a85609 - Merge: Fixed bug #49630 (imap_listscan function missing) 2009-10-09 17:38:19 +00:00
Pierre Joye e1855006a0 - Merge: fix #49274, filter_var does not accept object without a toString implementation 2009-10-09 17:32:53 +00:00
Pierre Joye 8263990a67 - Merge: Fixed bug #49738 (calling mcrypt after mcrypt_generic_deinit crashes) 2009-10-09 17:28:52 +00:00
Pierre Joye 23dfb5f6f7 - Merge: don't hide early declaration 2009-10-09 17:23:01 +00:00
Pierre Joye 94655dc8d2 - Merge: don't hide early declaration 2009-10-09 17:21:20 +00:00
Pierre Joye 6392009183 - Merge: fix #40013, php_uname() doesnt return nodename (MFH) 2009-10-09 17:15:46 +00:00
Pierre Joye 49873a87aa - Merge: Fixed bug #49182 (PHP CGI always outputs the shebang line), kill unused var 2009-10-09 17:03:56 +00:00
Pierre Joye 65eb7558ba - Merge: Fix #49732, Crashes in fileinfo when corrupted files are given (timestamp fails) 2009-10-09 14:51:25 +00:00
Pierre Joye 6cba66fa78 - Merge: Add missing open_basedir check in posix_mkfifo 2009-10-09 14:46:48 +00:00
Pierre Joye 7772923062 - Merge: Pecl #16842 2009-10-09 14:44:43 +00:00
Pierre Joye 78f24c74c0 - Merge: Make tempnam() return FALSE on error as documented 2009-10-09 14:37:45 +00:00
Pierre Joye 83d52ff5e9 - Merge: Fixed a safe_mode bypass in tempnam() identified by Grzegorz Stachowiak 2009-10-09 14:37:09 +00:00
Pierre Joye d8f010ee63 - Merge: throw some credit around 2009-10-09 14:34:18 +00:00
Pierre Joye b00125dd99 - Merge: Fix for bug #49698 2009-10-09 14:33:38 +00:00
Pierre Joye e7590db152 - Merge: Fixed bug #49483 (preg_replace 'subject' parameter listed as optional) 2009-10-09 14:25:51 +00:00
Pierre Joye cdee41505c - merge: #49464, fix build 2009-10-09 14:22:29 +00:00
Pierre Joye 7e262e737d - Merge: Fixed bug #49447 php engine need to correctly check for socket API 2009-10-09 14:20:17 +00:00
Pierre Joye d12e89e730 - Merge revision 288028, use of the user token by default, and fix for touch and directory on windows 2009-10-09 14:06:35 +00:00
Pierre Joye a0a40fa408 - Merge Fix for #48746, improve fix for junctions/symlink/etc. 2009-10-09 14:05:13 +00:00
Johannes Schlüter 1613a7561c Back to -dev 2009-09-03 23:27:53 +00:00
Johannes Schlüter 4d593727a2 Create a 5.3.1 release branch
# details on process will follow on internals
2009-09-03 21:30:56 +00:00
336 changed files with 11687 additions and 5693 deletions

No files matched your search

+77 -10
View File
@@ -1,21 +1,30 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2009, PHP 5.3.1
- Upgraded bundled sqlite to version 3.6.17. (Scott)
19 Nov 2009, PHP 5.3.1
- Added "max_file_uploads" INI directive, which can be set to limit the
number of file uploads per-request to 20 by default, to prevent possible
DOS via temporary file exhaustion. (Ilia)
- Added missing sanity checks around exif processing. (Ilia)
- Added error constant when json_encode() detects an invalid UTF-8 sequence.
(Scott)
- Added support for ACL on Windows for thread safe SAPI (Apache2 for example)
and fix its support on NTS. (Pierre)
- Improved readlink on Windows, suppress \??\ and use the drive syntax only.
(Pierre)
- Improved dns_get_record() AAAA support on windows. Always available when
IPv6 is support is installed, format is now the same than on unix. (Pierre)
- Improved the DNS functions on OSX to use newer APIs, also use Bind 9 API
where available on other platforms. (Scott)
- Improved shared extension loading on OSX to use the standard Unix dlopen()
API. (Scott)
- Upgraded bundled sqlite to version 3.6.19. (Scott)
- Updated timezone database to version 2009.17 (2009q). (Derick)
- Fixed crash in com_print_typeinfo when an invalid typelib is given. (Pierre)
- Fixed a safe_mode bypass in tempnam() identified by Grzegorz Stachowiak.
(Rasmus)
- Fixed a open_basedir bypass in posix_mkfifo() identified by Grzegorz
Stachowiak. (Rasmus)
- Fixed certificate validation inside php_openssl_apply_verification_policy
(Ryan Sleevi, Ilia)
- Fixed crash in SQLiteDatabase::ArrayQuery() and SQLiteDatabase::SingleQuery()
when calling using Reflection. (Felipe)
- Fixed crash when instantiating PDORow and PDOStatement through Reflection.
(Felipe)
- Fixed sanity check for the color index in imagecolortransparent. (Pierre)
- Fixed scandir/readdir when used mounted points on Windows. (Pierre)
- Fixed zlib.deflate compress filter to actually accept level parameter. (Jani)
@@ -32,6 +41,51 @@ PHP NEWS
- Fixed memory leak in stream_is_local(). (Felipe, Tony)
- Fixed BC break in mime_content_type(), removes the content encoding. (Scott)
- Changed ini file directives [PATH=](on Win32) and [HOST=](on all) to be case
insensitive (garretts)
- Restored shebang line check to CGI sapi (not checked by scanner anymore).
(Jani)
- Improve symbolic, mounted volume and junctions support for realpath on
Windows. (Pierre)
- Improved readlink on Windows, suppress \??\ and use the drive syntax only.
(Pierre)
- Improved dns_get_record() AAAA support on windows. Always available when
IPv6 is support is installed, format is now the same than on unix. (Pierre)
- Improved the DNS functions on OSX to use newer APIs, also use Bind 9 API
where available on other platforms. (Scott)
- Improved shared extension loading on OSX to use the standard Unix dlopen()
API. (Scott)
- Fixed bug #50063 (safe_mode_include_dir fails). (Johannes, christian at
elmerot dot se)
- Fixed bug #50052 (Different Hashes on Windows and Linux on wrong Salt size).
(Pierre)
- Fixed bug #49910 (no support for ././@LongLink for long filenames in phar
tar support). (Greg)
- Fixed bug #49908 (throwing exception in __autoload crashes when interface
is not defined). (Felipe)
- Fixed bug #49847 (exec() fails to return data inside 2nd parameter, given
output lines >4095 bytes). (Ilia)
- Fixed bug #49809 (time_sleep_until() is not available on OpenSolaris). (Jani)
- Fixed bug #49757 (long2ip() can return wrong value in a multi-threaded
applications). (Ilia, Florian Anderiasch)
- Fixed bug #49738 (calling mcrypt after mcrypt_generic_deinit crashes).
(Sriram Natarajan)
- Fixed bug #49732 (crashes when using fileinfo when timestamp conversion
fails). (Pierre)
- Fixed bug #49698 (Unexpected change in strnatcasecmp()). (Rasmus)
- Fixed bug #49630 (imap_listscan function missing). (Felipe)
- Fixed bug #49572 (use of C++ style comments causes build failure).
(Sriram Natarajan)
- Fixed bug #49531 (CURLOPT_INFILESIZE sometimes causes warning "CURLPROTO_FILE
cannot be set"). (Felipe)
- Fixed bug #49517 (cURL's CURLOPT_FILE prevents file from being deleted after
fclose). (Ilia)
- Fixed bug #49470 (FILTER_SANITIZE_EMAIL allows disallowed characters).
(Ilia)
- Fixed bug #49447 (php engine need to correctly check for socket API
return status on windows). (Sriram Natarajan)
- Fixed bug #49391 (ldap.c utilizing deprecated ldap_modify_s). (Ilia)
- Fixed bug #49361 (wordwrap() wraps incorrectly on end of line boundaries).
(Ilia, code-it at mail dot ru)
@@ -50,12 +104,16 @@ PHP NEWS
- Fixed bug #49183 (dns_get_record does not return NAPTR records). (Pierre)
- Fixed bug #49144 (Import of schema from different host transmits original
authentication details). (Dmitry)
- Fixed bug #49142 (crash when exception thrown from __tostring()).
(David Soria Parra)
- Fixed bug #49986 (Missing ICU DLLs on windows package). (Pierre)
- Fixed bug #49132 (posix_times returns false without error).
(phpbugs at gunnu dot us)
- Fixed bug #49125 (Error in dba_exists C code). (jdornan at stanford dot edu)
- Fixed bug #49122 (undefined reference to mysqlnd_stmt_next_result on compile
with --with-mysqli and MySQL 6.0). (Jani)
- Fixed bug #49108 (2nd scan_dir produces segfault). (Felipe)
- Fixed bug #49098 (mysqli segfault on error). (Rasmus)
- Fixed bug #49095 (proc_get_status['exitcode'] fails on win32). (Felipe)
- Fixed bug #49092 (ReflectionFunction fails to work with functions in fully
qualified namespaces). (Kalle, Jani)
@@ -98,12 +156,14 @@ PHP NEWS
(naf at altlinux dot ru, Felipe)
- Fixed bug #48912 (Namespace causes unexpected strict behaviour with
extract()). (Dmitry)
- Fixed bug #48909 (Segmentation fault in mysqli_stmt_execute()). (Andrey)
- Fixed bug #48899 (is_callable returns true even if method does not exist in
parent class). (Felipe)
- Fixed bug #48893 (Problems compiling with Curl). (Felipe)
- Fixed bug #48872 (string.c: errors: duplicate case values). (Kalle)
- Fixed bug #48854 (array_merge_recursive modifies arrays after first one).
(Felipe)
- Fixed bug #48805 (IPv6 socket transport is not working). (Ilia)
- Fixed bug #48802 (printf() returns incorrect outputted length). (Jani)
- Fixed bug #48880 (Random Appearing open_basedir problem). (Rasmus, Gwynne)
- Fixed bug #48791 (open office files always reported as corrupted). (Greg)
@@ -119,6 +179,9 @@ PHP NEWS
gmail dot com, Pierre)
- Fixed bug #48762 (IPv6 address filter still rejects valid address). (Felipe)
- Fixed bug #48757 (ReflectionFunction::invoke() parameter issues). (Kalle)
- Fixed bug #48754 (mysql_close() crash php when no handle specified).
(Johannes, Andrey)
- Fixed bug #48752 (Crash during date parsing with invalid date). (Pierre)
- Fixed bug #48746 (Unable to browse directories within Junction Points).
(Pierre, Kanwaljeet Singla)
- Fixed bug #48745 (mysqlnd: mysql_num_fields returns wrong column count for
@@ -175,11 +238,15 @@ PHP NEWS
in fopen). (Jani)
- Fixed bug #42434 (ImageLine w/ antialias = 1px shorter). (wojjie at gmail dot
com, Kalle)
- Fixed bug #40013 (php_uname() does not return nodename on Netware (Guenter
Knauf)
- Fixed bug #38091 (Mail() does not use FQDN when sending SMTP helo).
(Kalle, Rick Yorgason)
- Fixed bug #28038 (Sent incorrect RCPT TO commands to SMTP server) (Garrett)
- Fixed bug #27051 (Impersonation with FastCGI does not exec process as
impersonated user). (Pierre)
- Fixed PECL bug #16842 (oci_error return false when NO_DATA_FOUND is raised).
(Chris Jones)
30 Jun 2009, PHP 5.3.0
- Upgraded bundled PCRE to version 7.9. (Nuno)
+109 -31
View File
@@ -428,6 +428,31 @@ CWD_API char *virtual_getcwd(char *buf, size_t size TSRMLS_DC) /* {{{ */
}
/* }}} */
#ifdef PHP_WIN32
static inline unsigned long realpath_cache_key(const char *path, int path_len TSRMLS_DC) /* {{{ */
{
register unsigned long h;
char *bucket_key = tsrm_win32_get_path_sid_key(path TSRMLS_CC);
char *bucket_key_start = (char *)bucket_key;
const char *e = bucket_key + strlen(bucket_key);
if (!bucket_key) {
return 0;
}
for (h = 2166136261U; bucket_key < e;) {
h *= 16777619;
h ^= *bucket_key++;
}
/* if no SID were present the path is returned. Otherwise a Heap
allocated string is returned. */
if (bucket_key_start != path) {
LocalFree(bucket_key_start);
}
return h;
}
/* }}} */
#else
static inline unsigned long realpath_cache_key(const char *path, int path_len) /* {{{ */
{
register unsigned long h;
@@ -441,6 +466,7 @@ static inline unsigned long realpath_cache_key(const char *path, int path_len) /
return h;
}
/* }}} */
#endif /* defined(PHP_WIN32) */
CWD_API void realpath_cache_clean(TSRMLS_D) /* {{{ */
{
@@ -461,7 +487,11 @@ CWD_API void realpath_cache_clean(TSRMLS_D) /* {{{ */
CWD_API void realpath_cache_del(const char *path, int path_len TSRMLS_DC) /* {{{ */
{
#ifdef PHP_WIN32
unsigned long key = realpath_cache_key(path, path_len TSRMLS_CC);
#else
unsigned long key = realpath_cache_key(path, path_len);
#endif
unsigned long n = key % (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0]));
realpath_cache_bucket **bucket = &CWDG(realpath_cache)[n];
@@ -494,8 +524,12 @@ static inline void realpath_cache_add(const char *path, int path_len, const char
if (CWDG(realpath_cache_size) + size <= CWDG(realpath_cache_size_limit)) {
realpath_cache_bucket *bucket = malloc(size);
unsigned long n;
#ifdef PHP_WIN32
bucket->key = realpath_cache_key(path, path_len TSRMLS_CC);
#else
bucket->key = realpath_cache_key(path, path_len);
#endif
bucket->path = (char*)bucket + sizeof(realpath_cache_bucket);
memcpy(bucket->path, path, path_len+1);
bucket->path_len = path_len;
@@ -524,7 +558,12 @@ static inline void realpath_cache_add(const char *path, int path_len, const char
static inline realpath_cache_bucket* realpath_cache_find(const char *path, int path_len, time_t t TSRMLS_DC) /* {{{ */
{
#ifdef PHP_WIN32
unsigned long key = realpath_cache_key(path, path_len TSRMLS_CC);
#else
unsigned long key = realpath_cache_key(path, path_len);
#endif
unsigned long n = key % (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0]));
realpath_cache_bucket **bucket = &CWDG(realpath_cache)[n];
@@ -667,11 +706,14 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
/* File is a reparse point. Get the target */
HANDLE hLink = NULL;
REPARSE_DATA_BUFFER * pbuffer;
unsigned int retlength = 0, rname_off = 0;
int bufindex = 0, rname_len = 0, isabsolute = 0;
unsigned int retlength = 0;
int bufindex = 0, isabsolute = 0;
wchar_t * reparsetarget;
WCHAR szVolumePathNames[MAX_PATH];
BOOL isVolume = FALSE;
char printname[MAX_PATH];
char substitutename[MAX_PATH];
int printname_len, substitutename_len;
int substitutename_off = 0;
if(++(*ll) > LINK_MAX) {
return -1;
@@ -692,33 +734,61 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
CloseHandle(hLink);
if(pbuffer->ReparseTag == IO_REPARSE_TAG_SYMLINK) {
rname_len = pbuffer->SymbolicLinkReparseBuffer.PrintNameLength/2;
rname_off = pbuffer->SymbolicLinkReparseBuffer.PrintNameOffset/2;
if(rname_len <= 0) {
rname_len = pbuffer->SymbolicLinkReparseBuffer.SubstituteNameLength/2;
rname_off = pbuffer->SymbolicLinkReparseBuffer.SubstituteNameOffset/2;
}
reparsetarget = pbuffer->SymbolicLinkReparseBuffer.ReparseTarget;
printname_len = pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR);
isabsolute = (pbuffer->SymbolicLinkReparseBuffer.Flags == 0) ? 1 : 0;
if (!WideCharToMultiByte(CP_THREAD_ACP, 0,
reparsetarget + pbuffer->MountPointReparseBuffer.PrintNameOffset / sizeof(WCHAR),
printname_len + 1,
printname, MAX_PATH, NULL, NULL
)) {
tsrm_free_alloca(pbuffer, use_heap_large);
return -1;
};
printname_len = pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR);
printname[printname_len] = 0;
substitutename_len = pbuffer->MountPointReparseBuffer.SubstituteNameLength / sizeof(WCHAR);
if (!WideCharToMultiByte(CP_THREAD_ACP, 0,
reparsetarget + pbuffer->MountPointReparseBuffer.SubstituteNameOffset / sizeof(WCHAR),
substitutename_len + 1,
substitutename, MAX_PATH, NULL, NULL
)) {
tsrm_free_alloca(pbuffer, use_heap_large);
return -1;
};
substitutename[substitutename_len] = 0;
}
else if(pbuffer->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT) {
rname_len = pbuffer->MountPointReparseBuffer.PrintNameLength/2;
rname_off = pbuffer->MountPointReparseBuffer.PrintNameOffset/2;
if(rname_len <= 0) {
rname_len = pbuffer->MountPointReparseBuffer.SubstituteNameLength/2;
rname_off = pbuffer->MountPointReparseBuffer.SubstituteNameOffset/2;
}
reparsetarget = pbuffer->MountPointReparseBuffer.ReparseTarget;
isabsolute = 1;
}
else {
reparsetarget = pbuffer->MountPointReparseBuffer.ReparseTarget;
printname_len = pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR);
if (!WideCharToMultiByte(CP_THREAD_ACP, 0,
reparsetarget + pbuffer->MountPointReparseBuffer.PrintNameOffset / sizeof(WCHAR),
printname_len + 1,
printname, MAX_PATH, NULL, NULL
)) {
tsrm_free_alloca(pbuffer, use_heap_large);
return -1;
};
printname[pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR)] = 0;
substitutename_len = pbuffer->MountPointReparseBuffer.SubstituteNameLength / sizeof(WCHAR);
if (!WideCharToMultiByte(CP_THREAD_ACP, 0,
reparsetarget + pbuffer->MountPointReparseBuffer.SubstituteNameOffset / sizeof(WCHAR),
substitutename_len + 1,
substitutename, MAX_PATH, NULL, NULL
)) {
tsrm_free_alloca(pbuffer, use_heap_large);
return -1;
};
substitutename[substitutename_len] = 0;
} else {
tsrm_free_alloca(pbuffer, use_heap_large);
return -1;
}
if(isabsolute && rname_len > 4) {
if(isabsolute && substitutename_len > 4) {
/* Do not resolve volumes (for now). A mounted point can
target a volume without a drive, it is not certain that
all IO functions we use in php and its deps support
@@ -726,21 +796,22 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
d:\test\mnt\foo
\\?\Volume{62d1c3f8-83b9-11de-b108-806e6f6e6963}\foo
*/
if (wcsncmp(reparsetarget, L"\\??\\Volume{",11) == 0
|| wcsncmp(reparsetarget, L"\\\\?\\Volume{",11) == 0) {
if (strncmp(substitutename, "\\??\\Volume{",11) == 0
|| strncmp(substitutename, "\\\\?\\Volume{",11) == 0) {
isVolume = TRUE;
substitutename_off = 0;
} else
/* do not use the \??\ and \\?\ prefix*/
if (wcsncmp(reparsetarget, L"\\??\\", 4) == 0
|| wcsncmp(reparsetarget, L"\\\\?\\", 4) == 0) {
rname_off += 4;
rname_len -= 4;
if (strncmp(substitutename, "\\??\\", 4) == 0
|| strncmp(substitutename, "\\\\?\\", 4) == 0) {
substitutename_off = 4;
}
}
if (!isVolume) {
/* Convert wide string to narrow string */
for(bufindex = 0; bufindex < rname_len; bufindex++) {
*(path + bufindex) = (char)(reparsetarget[rname_off + bufindex]);
char * tmp = substitutename + substitutename_off;
for(bufindex = 0; bufindex < (substitutename_len - substitutename_off); bufindex++) {
*(path + bufindex) = *(tmp + bufindex);
}
*(path + bufindex) = 0;
@@ -748,6 +819,13 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
} else {
j = len;
}
#if VIRTUAL_CWD_DEBUG
fprintf(stderr, "reparse: print: %s ", printname);
fprintf(stderr, "sub: %s ", substitutename);
fprintf(stderr, "resolved: %s ", path);
#endif
tsrm_free_alloca(pbuffer, use_heap_large);
if(isabsolute == 1) {
+165 -27
View File
@@ -30,7 +30,7 @@
#include "TSRM.h"
#ifdef TSRM_WIN32
#include <Sddl.h>
#include "tsrm_win32.h"
#include "tsrm_virtual_cwd.h"
@@ -42,25 +42,21 @@ static tsrm_win32_globals win32_globals;
static void tsrm_win32_ctor(tsrm_win32_globals *globals TSRMLS_DC)
{
HANDLE process_token = NULL;
globals->process = NULL;
globals->shm = NULL;
globals->process_size = 0;
globals->shm_size = 0;
globals->comspec = _strdup((GetVersion()<0x80000000)?"cmd.exe":"command.com");
globals->impersonation_token = NULL;
/* Access check requires impersonation token. Create a duplicate token. */
if(OpenProcessToken(GetCurrentProcess(), TOKEN_DUPLICATE | TOKEN_QUERY, &process_token)) {
DuplicateToken(process_token, SecurityImpersonation, &globals->impersonation_token);
}
/* impersonation_token will be closed when the process dies */
if(process_token != NULL) {
CloseHandle(process_token);
process_token = NULL;
}
/* Set it to INVALID_HANDLE_VALUE
* It will be initialized correctly in tsrm_win32_access or set to
* NULL if no impersonation has been done.
* the impersonated token can't be set here as the impersonation
* will happen later, in fcgi_accept_request (or whatever is the
* SAPI being used).
*/
globals->impersonation_token = INVALID_HANDLE_VALUE;
globals->impersonation_token_sid = NULL;
}
static void tsrm_win32_dtor(tsrm_win32_globals *globals TSRMLS_DC)
@@ -83,9 +79,12 @@ static void tsrm_win32_dtor(tsrm_win32_globals *globals TSRMLS_DC)
free(globals->comspec);
if(globals->impersonation_token) {
if (globals->impersonation_token && globals->impersonation_token != INVALID_HANDLE_VALUE ) {
CloseHandle(globals->impersonation_token);
}
if (globals->impersonation_token_sid) {
free(globals->impersonation_token_sid);
}
}
TSRM_API void tsrm_win32_startup(void)
@@ -104,8 +103,97 @@ TSRM_API void tsrm_win32_shutdown(void)
#endif
}
char * tsrm_win32_get_path_sid_key(const char *pathname TSRMLS_DC)
{
PSID pSid = TWG(impersonation_token_sid);
DWORD sid_len = pSid ? GetLengthSid(pSid) : 0;
TCHAR *ptcSid = NULL;
char *bucket_key = NULL;
if (!pSid) {
bucket_key = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, strlen(pathname) + 1);
if (!bucket_key) {
return NULL;
}
memcpy(bucket_key, pathname, strlen(pathname));
return bucket_key;
}
if (!ConvertSidToStringSid(pSid, &ptcSid)) {
return NULL;
}
bucket_key = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, strlen(pathname) + strlen(ptcSid) + 1);
if (!bucket_key) {
LocalFree(ptcSid);
return NULL;
}
memcpy(bucket_key, ptcSid, strlen(ptcSid));
memcpy(bucket_key + strlen(ptcSid), pathname, strlen(pathname) + 1);
LocalFree(ptcSid);
return bucket_key;
}
PSID tsrm_win32_get_token_sid(HANDLE hToken)
{
BOOL bSuccess = FALSE;
DWORD dwLength = 0;
PTOKEN_USER pTokenUser = NULL;
PSID sid;
PSID *ppsid = &sid;
DWORD sid_len;
PSID pResultSid = NULL;
/* Get the actual size of the TokenUser structure */
if (!GetTokenInformation(
hToken, TokenUser, (LPVOID) pTokenUser, 0, &dwLength)) {
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) {
goto Finished;
}
pTokenUser = (PTOKEN_USER)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwLength);
if (pTokenUser == NULL) {
goto Finished;
}
}
/* and fetch it now */
if (!GetTokenInformation(
hToken, TokenUser, (LPVOID) pTokenUser, dwLength, &dwLength)) {
goto Finished;
}
sid_len = GetLengthSid(pTokenUser->User.Sid);
/* ConvertSidToStringSid(pTokenUser->User.Sid, &ptcSidOwner); */
pResultSid = malloc(sid_len);
if (!pResultSid) {
goto Finished;
}
if (!CopySid(sid_len, pResultSid, pTokenUser->User.Sid)) {
goto Finished;
}
return pResultSid;
Finished:
if (pResultSid) {
free(pResultSid);
}
/* Free the buffer for the token groups. */
if (pTokenUser != NULL) {
HeapFree(GetProcessHeap(), 0, (LPVOID)pTokenUser);
}
return NULL;
}
TSRM_API int tsrm_win32_access(const char *pathname, int mode)
{
time_t t;
HANDLE thread_token;
PSID token_sid;
SECURITY_INFORMATION sec_info = OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION;
GENERIC_MAPPING gen_map = { FILE_GENERIC_READ, FILE_GENERIC_WRITE, FILE_GENERIC_EXECUTE, FILE_ALL_ACCESS };
DWORD priv_set_length = sizeof(PRIVILEGE_SET);
@@ -114,11 +202,10 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
DWORD sec_desc_length = 0, desired_access = 0, granted_access = 0;
BYTE * psec_desc = NULL;
BOOL fAccess = FALSE;
HANDLE process_token = NULL;
BOOL bucket_key_alloc = FALSE;
realpath_cache_bucket * bucket = NULL;
char * real_path = NULL;
time_t t;
TSRMLS_FETCH();
@@ -126,10 +213,6 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
DWORD type;
return GetBinaryType(pathname, &type) ? 0 : -1;
} else {
if(access(pathname, mode)) {
return errno;
}
if(!IS_ABSOLUTE_PATH(pathname, strlen(pathname)+1)) {
real_path = (char *)malloc(MAX_PATH);
if(tsrm_realpath(pathname, real_path TSRMLS_CC) == NULL) {
@@ -138,6 +221,58 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
pathname = real_path;
}
if(access(pathname, mode)) {
return errno;
}
/* If only existence check is made, return now */
if (mode == 0) {
return 0;
}
/* Only in NTS when impersonate==1 (aka FastCGI) */
/*
AccessCheck() requires an impersonation token. We first get a primary
token and then create a duplicate impersonation token. The
impersonation token is not actually assigned to the thread, but is
used in the call to AccessCheck. Thus, this function itself never
impersonates, but does use the identity of the thread. If the thread
was impersonating already, this function uses that impersonation context.
*/
if(!OpenThreadToken(GetCurrentThread(), TOKEN_ALL_ACCESS, TRUE, &thread_token)) {
DWORD err = GetLastError();
if (GetLastError() == ERROR_NO_TOKEN) {
if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ALL_ACCESS, &thread_token)) {
TWG(impersonation_token) = NULL;
goto Finished;
}
}
}
/* token_sid will be freed in tsrmwin32_dtor */
token_sid = tsrm_win32_get_token_sid(thread_token);
if (!token_sid) {
if (TWG(impersonation_token_sid)) {
free(TWG(impersonation_token_sid));
}
TWG(impersonation_token_sid) = NULL;
goto Finished;
}
/* Different identity, we need a new impersontated token as well */
if (!TWG(impersonation_token_sid) || !EqualSid(token_sid, TWG(impersonation_token_sid))) {
if (TWG(impersonation_token_sid)) {
free(TWG(impersonation_token_sid));
}
TWG(impersonation_token_sid) = token_sid;
/* Duplicate the token as impersonated token */
if (!DuplicateToken(thread_token, SecurityImpersonation, &TWG(impersonation_token))) {
goto Finished;
}
}
if (CWDG(realpath_cache_size_limit)) {
t = time(0);
bucket = realpath_cache_lookup(pathname, strlen(pathname), t TSRMLS_CC);
@@ -151,7 +286,7 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
}
}
}
/* Do a full access check because access() will only check read-only attribute */
if(mode == 0 || mode > 6) {
if(bucket != NULL && bucket->is_rvalid) {
@@ -164,7 +299,7 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
fAccess = bucket->is_writable;
goto Finished;
}
desired_access = FILE_GENERIC_WRITE;
desired_access = FILE_GENERIC_READ | FILE_GENERIC_WRITE;
} else if(mode <= 4) {
if(bucket != NULL && bucket->is_rvalid) {
fAccess = bucket->is_readable;
@@ -194,13 +329,15 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
goto Finished;
}
MapGenericMask(&desired_access, &gen_map);
if(!AccessCheck((PSECURITY_DESCRIPTOR)psec_desc, TWG(impersonation_token), desired_access, &gen_map, &privilege_set, &priv_set_length, &granted_access, &fAccess)) {
goto Finished;
goto Finished_Impersonate;
}
/* Keep the result in realpath_cache */
if(bucket != NULL) {
if(desired_access == FILE_GENERIC_READ) {
if(desired_access == (FILE_GENERIC_READ|FILE_FLAG_BACKUP_SEMANTICS)) {
bucket->is_rvalid = 1;
bucket->is_readable = fAccess;
}
@@ -210,12 +347,13 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
}
}
Finished:
Finished_Impersonate:
if(psec_desc != NULL) {
free(psec_desc);
psec_desc = NULL;
}
Finished:
if(real_path != NULL) {
free(real_path);
real_path = NULL;
@@ -318,7 +456,7 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
char *ptype = (char *)type;
HANDLE thread_token = NULL;
HANDLE token_user = NULL;
BOOL asuser = FALSE;
BOOL asuser = TRUE;
TSRMLS_FETCH();
+2
View File
@@ -64,6 +64,7 @@ typedef struct {
int shm_size;
char *comspec;
HANDLE impersonation_token;
PSID impersonation_token_sid;
} tsrm_win32_globals;
#ifdef ZTS
@@ -89,6 +90,7 @@ typedef struct {
#define SHM_RND FILE_MAP_WRITE
#define SHM_REMAP FILE_MAP_COPY
char * tsrm_win32_get_path_sid_key(const char *pathname TSRMLS_DC);
TSRM_API void tsrm_win32_startup(void);
TSRM_API void tsrm_win32_shutdown(void);
+28
View File
@@ -0,0 +1,28 @@
--TEST--
Bug #49908 (throwing exception in __autoload crashes when interface is not defined)
--FILE--
<?php
function __autoload($className) {
var_dump($className);
if ($className == 'Foo') {
class Foo implements Bar {};
} else {
throw new Exception($className);
}
}
new Foo;
?>
--EXPECTF--
%unicode|string%(3) "Foo"
%unicode|string%(3) "Bar"
Fatal error: Uncaught exception 'Exception' with message 'Bar' in %s:%d
Stack trace:
#0 %s(7): __autoload('Bar')
#1 %s(13): __autoload('Foo')
#2 {main}
thrown in %s on line %d
+9 -3
View File
@@ -1067,9 +1067,15 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
if (!EG(active_symbol_table)) {
zend_rebuild_symbol_table(TSRMLS_C);
}
Z_ARRVAL_P(z_context) = EG(active_symbol_table);
Z_TYPE_P(z_context) = IS_ARRAY;
zval_copy_ctor(z_context);
/* during shutdown the symbol table table can be still null */
if (!EG(active_symbol_table)) {
Z_TYPE_P(z_context) = IS_NULL;
} else {
Z_ARRVAL_P(z_context) = EG(active_symbol_table);
Z_TYPE_P(z_context) = IS_ARRAY;
zval_copy_ctor(z_context);
}
params = (zval ***) emalloc(sizeof(zval **)*5);
params[0] = &z_error_type;
+6 -6
View File
@@ -1038,13 +1038,13 @@ ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC
Z_SET_ISREF_PP(q);
zend_hash_add(CE_STATIC_MEMBERS(class_type), str_index, str_length, (void**)q, sizeof(zval*), NULL);
} else {
zval *q;
zval *r;
ALLOC_ZVAL(q);
*q = **p;
INIT_PZVAL(q);
zval_copy_ctor(q);
zend_hash_add(CE_STATIC_MEMBERS(class_type), str_index, str_length, (void**)&q, sizeof(zval*), NULL);
ALLOC_ZVAL(r);
*r = **p;
INIT_PZVAL(r);
zval_copy_ctor(r);
zend_hash_add(CE_STATIC_MEMBERS(class_type), str_index, str_length, (void**)&r, sizeof(zval*), NULL);
}
zend_hash_move_forward_ex(&class_type->default_static_members, &pos);
}
+10 -10
View File
@@ -5191,31 +5191,31 @@ void zend_do_use(znode *ns_name, znode *new_name, int is_global TSRMLS_DC) /* {{
if (CG(current_namespace)) {
/* Prefix import name with current namespace name to avoid conflicts with classes */
char *ns_name = emalloc(Z_STRLEN_P(CG(current_namespace)) + 1 + Z_STRLEN_P(name) + 1);
char *c_ns_name = emalloc(Z_STRLEN_P(CG(current_namespace)) + 1 + Z_STRLEN_P(name) + 1);
zend_str_tolower_copy(ns_name, Z_STRVAL_P(CG(current_namespace)), Z_STRLEN_P(CG(current_namespace)));
ns_name[Z_STRLEN_P(CG(current_namespace))] = '\\';
memcpy(ns_name+Z_STRLEN_P(CG(current_namespace))+1, lcname, Z_STRLEN_P(name)+1);
if (zend_hash_exists(CG(class_table), ns_name, Z_STRLEN_P(CG(current_namespace)) + 1 + Z_STRLEN_P(name)+1)) {
zend_str_tolower_copy(c_ns_name, Z_STRVAL_P(CG(current_namespace)), Z_STRLEN_P(CG(current_namespace)));
c_ns_name[Z_STRLEN_P(CG(current_namespace))] = '\\';
memcpy(c_ns_name+Z_STRLEN_P(CG(current_namespace))+1, lcname, Z_STRLEN_P(name)+1);
if (zend_hash_exists(CG(class_table), c_ns_name, Z_STRLEN_P(CG(current_namespace)) + 1 + Z_STRLEN_P(name)+1)) {
char *tmp = zend_str_tolower_dup(Z_STRVAL_P(ns), Z_STRLEN_P(ns));
if (Z_STRLEN_P(ns) != Z_STRLEN_P(CG(current_namespace)) + 1 + Z_STRLEN_P(name) ||
memcmp(tmp, ns_name, Z_STRLEN_P(ns))) {
memcmp(tmp, c_ns_name, Z_STRLEN_P(ns))) {
zend_error(E_COMPILE_ERROR, "Cannot use %s as %s because the name is already in use", Z_STRVAL_P(ns), Z_STRVAL_P(name));
}
efree(tmp);
}
efree(ns_name);
efree(c_ns_name);
} else if (zend_hash_find(CG(class_table), lcname, Z_STRLEN_P(name)+1, (void**)&pce) == SUCCESS &&
(*pce)->type == ZEND_USER_CLASS &&
(*pce)->filename == CG(compiled_filename)) {
char *tmp = zend_str_tolower_dup(Z_STRVAL_P(ns), Z_STRLEN_P(ns));
char *c_tmp = zend_str_tolower_dup(Z_STRVAL_P(ns), Z_STRLEN_P(ns));
if (Z_STRLEN_P(ns) != Z_STRLEN_P(name) ||
memcmp(tmp, lcname, Z_STRLEN_P(ns))) {
memcmp(c_tmp, lcname, Z_STRLEN_P(ns))) {
zend_error(E_COMPILE_ERROR, "Cannot use %s as %s because the name is already in use", Z_STRVAL_P(ns), Z_STRVAL_P(name));
}
efree(tmp);
efree(c_tmp);
}
if (zend_hash_add(CG(current_import), lcname, Z_STRLEN_P(name)+1, &ns, sizeof(zval*), NULL) != SUCCESS) {
+1 -1
View File
@@ -49,7 +49,7 @@ ZEND_API void zend_object_std_dtor(zend_object *object TSRMLS_DC)
ZEND_API void zend_objects_destroy_object(zend_object *object, zend_object_handle handle TSRMLS_DC)
{
zend_function *destructor = object->ce->destructor;
zend_function *destructor = object ? object->ce->destructor : NULL;
if (destructor) {
zval *obj;
+6 -4
View File
@@ -940,6 +940,7 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMP|VAR|CV, ANY, int type
if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
retval = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0 TSRMLS_CC);
FREE_OP1();
} else {
target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), type, varname TSRMLS_CC);
/*
@@ -4244,12 +4245,13 @@ ZEND_VM_HANDLER(144, ZEND_ADD_INTERFACE, ANY, CONST)
zend_class_entry *ce = EX_T(opline->op1.u.var).class_entry;
zend_class_entry *iface = zend_fetch_class(Z_STRVAL(opline->op2.u.constant), Z_STRLEN(opline->op2.u.constant), opline->extended_value TSRMLS_CC);
if (!(iface->ce_flags & ZEND_ACC_INTERFACE)) {
zend_error_noreturn(E_ERROR, "%s cannot implement %s - it is not an interface", ce->name, iface->name);
if (iface) {
if (!(iface->ce_flags & ZEND_ACC_INTERFACE)) {
zend_error_noreturn(E_ERROR, "%s cannot implement %s - it is not an interface", ce->name, iface->name);
}
zend_do_implement_interface(ce, iface TSRMLS_CC);
}
zend_do_implement_interface(ce, iface TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
}
+7 -4
View File
@@ -889,12 +889,13 @@ static int ZEND_FASTCALL ZEND_ADD_INTERFACE_SPEC_CONST_HANDLER(ZEND_OPCODE_HAND
zend_class_entry *ce = EX_T(opline->op1.u.var).class_entry;
zend_class_entry *iface = zend_fetch_class(Z_STRVAL(opline->op2.u.constant), Z_STRLEN(opline->op2.u.constant), opline->extended_value TSRMLS_CC);
if (!(iface->ce_flags & ZEND_ACC_INTERFACE)) {
zend_error_noreturn(E_ERROR, "%s cannot implement %s - it is not an interface", ce->name, iface->name);
if (iface) {
if (!(iface->ce_flags & ZEND_ACC_INTERFACE)) {
zend_error_noreturn(E_ERROR, "%s cannot implement %s - it is not an interface", ce->name, iface->name);
}
zend_do_implement_interface(ce, iface TSRMLS_CC);
}
zend_do_implement_interface(ce, iface TSRMLS_CC);
ZEND_VM_NEXT_OPCODE();
}
@@ -4607,6 +4608,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP(int type, ZEND_O
if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
retval = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0 TSRMLS_CC);
zval_dtor(free_op1.var);
} else {
target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), type, varname TSRMLS_CC);
/*
@@ -7848,6 +7850,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR(int type, ZEND_O
if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
retval = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0 TSRMLS_CC);
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
} else {
target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), type, varname TSRMLS_CC);
/*
+3 -2
View File
@@ -42,7 +42,7 @@ AC_CONFIG_HEADER(main/php_config.h)
PHP_MAJOR_VERSION=5
PHP_MINOR_VERSION=3
PHP_RELEASE_VERSION=1
PHP_EXTRA_VERSION="-dev"
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`
@@ -402,6 +402,8 @@ dnl Check for inet_aton
dnl in -lc, -lbind and -lresolv
PHP_CHECK_FUNC(inet_aton, resolv, bind)
dnl Some systems (like OpenSolaris) do not have nanosleep in libc
PHP_CHECK_FUNC(nanosleep, rt)
dnl Then headers.
dnl -------------------------------------------------------------------------
@@ -621,7 +623,6 @@ tzset \
unlockpt \
unsetenv \
usleep \
nanosleep \
utime \
vsnprintf \
vasprintf \
+1 -1
View File
@@ -309,7 +309,7 @@ ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj
}
} else if (typelibname) {
/* Fetch the typelibrary and use that to look things up */
typelib = php_com_load_typelib(typelibname, obj->code_page TSRMLS_CC);
typelib = php_com_load_typelib(typelibname, CP_THREAD_ACP TSRMLS_CC);
}
if (!gotguid && dispname && typelib) {
+30 -4
View File
@@ -1424,10 +1424,22 @@ PHP_FUNCTION(curl_copy_handle)
dupch->cp = cp;
dupch->uses = 0;
if (ch->handlers->write->stream) {
Z_ADDREF_P(dupch->handlers->write->stream);
dupch->handlers->write->stream = ch->handlers->write->stream;
}
dupch->handlers->write->method = ch->handlers->write->method;
dupch->handlers->write->type = ch->handlers->write->type;
if (ch->handlers->read->stream) {
Z_ADDREF_P(ch->handlers->read->stream);
}
dupch->handlers->read->stream = ch->handlers->read->stream;
dupch->handlers->read->method = ch->handlers->read->method;
dupch->handlers->write_header->method = ch->handlers->write_header->method;
if (ch->handlers->write_header->stream) {
Z_ADDREF_P(ch->handlers->write_header->stream);
}
dupch->handlers->write_header->stream = ch->handlers->write_header->stream;
dupch->handlers->write->fp = ch->handlers->write->fp;
dupch->handlers->write_header->fp = ch->handlers->write_header->fp;
@@ -1563,7 +1575,8 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
#endif
convert_to_long_ex(zvalue);
#if LIBCURL_VERSION_NUM >= 0x71304
if (((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) && (Z_LVAL_PP(zvalue) & CURLPROTO_FILE)) {
if ((option == CURLOPT_PROTOCOLS || option == CURLOPT_REDIR_PROTOCOLS) &&
((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) && (Z_LVAL_PP(zvalue) & CURLPROTO_FILE)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLPROTO_FILE cannot be activated when in safe_mode or an open_basedir is set");
RETVAL_FALSE;
return 1;
@@ -1672,9 +1685,10 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
switch (option) {
case CURLOPT_FILE:
if (((php_stream *) what)->mode[0] != 'r' || ((php_stream *) what)->mode[1] == '+') {
zend_list_addref(Z_LVAL_PP(zvalue));
Z_ADDREF_PP(zvalue);
ch->handlers->write->fp = fp;
ch->handlers->write->method = PHP_CURL_FILE;
ch->handlers->write->stream = *zvalue;
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "the provided file handle is not writable");
RETVAL_FALSE;
@@ -1683,9 +1697,10 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
break;
case CURLOPT_WRITEHEADER:
if (((php_stream *) what)->mode[0] != 'r' || ((php_stream *) what)->mode[1] == '+') {
zend_list_addref(Z_LVAL_PP(zvalue));
Z_ADDREF_PP(zvalue);
ch->handlers->write_header->fp = fp;
ch->handlers->write_header->method = PHP_CURL_FILE;
ch->handlers->write_header->stream = *zvalue;
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "the provided file handle is not writable");
RETVAL_FALSE;
@@ -1693,9 +1708,10 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
}
break;
case CURLOPT_INFILE:
zend_list_addref(Z_LVAL_PP(zvalue));
Z_ADDREF_PP(zvalue);
ch->handlers->read->fp = fp;
ch->handlers->read->fd = Z_LVAL_PP(zvalue);
ch->handlers->read->stream = *zvalue;
break;
case CURLOPT_STDERR:
if (((php_stream *) what)->mode[0] != 'r' || ((php_stream *) what)->mode[1] == '+') {
@@ -2356,6 +2372,16 @@ static void _php_curl_close_ex(php_curl *ch TSRMLS_DC)
efree(ch->header.str);
}
if (ch->handlers->write_header->stream) {
zval_ptr_dtor(&ch->handlers->write_header->stream);
}
if (ch->handlers->write->stream) {
zval_ptr_dtor(&ch->handlers->write->stream);
}
if (ch->handlers->read->stream) {
zval_ptr_dtor(&ch->handlers->read->stream);
}
efree(ch->handlers->write);
efree(ch->handlers->write_header);
efree(ch->handlers->read);
+2
View File
@@ -86,6 +86,7 @@ typedef struct {
smart_str buf;
int method;
int type;
zval *stream;
} php_curl_write;
typedef struct {
@@ -94,6 +95,7 @@ typedef struct {
FILE *fp;
long fd;
int method;
zval *stream;
} php_curl_read;
typedef struct {
+762 -795
View File
File diff suppressed because it is too large. Load diff
+18 -3
View File
@@ -619,6 +619,7 @@ PHP_RINIT_FUNCTION(date)
}
DATEG(timezone) = NULL;
DATEG(tzcache) = NULL;
DATEG(last_errors) = NULL;
return SUCCESS;
}
@@ -636,6 +637,11 @@ PHP_RSHUTDOWN_FUNCTION(date)
FREE_HASHTABLE(DATEG(tzcache));
DATEG(tzcache) = NULL;
}
if (DATEG(last_errors)) {
timelib_error_container_dtor(DATEG(last_errors));
DATEG(last_errors) = NULL;
}
return SUCCESS;
}
/* }}} */
@@ -777,7 +783,6 @@ PHP_MINIT_FUNCTION(date)
php_date_global_timezone_db = NULL;
php_date_global_timezone_db_enabled = 0;
DATEG(last_errors) = NULL;
return SUCCESS;
}
@@ -849,7 +854,17 @@ static char* guess_timezone(const timelib_tzdb *tzdb TSRMLS_DC)
return env;
}
/* Check config setting for default timezone */
if (DATEG(default_timezone) && (strlen(DATEG(default_timezone)) > 0) && timelib_timezone_id_is_valid(DATEG(default_timezone), tzdb)) {
if (!DATEG(default_timezone)) {
/* Special case: ext/date wasn't initialized yet */
zval ztz;
if (SUCCESS == zend_get_configuration_directive("date.timezone", sizeof("date.timezone"), &ztz) &&
Z_TYPE(ztz) == IS_STRING &&
Z_STRLEN(ztz) > 0 &&
timelib_timezone_id_is_valid(Z_STRVAL(ztz), tzdb)) {
return Z_STRVAL(ztz);
}
} else if (*DATEG(default_timezone) && timelib_timezone_id_is_valid(DATEG(default_timezone), tzdb)) {
return DATEG(default_timezone);
}
#if HAVE_TM_ZONE
@@ -3927,7 +3942,7 @@ static void php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAMETERS, int calc_su
}
timelib_unixtime2local(t, time);
rs = timelib_astro_rise_set_altitude(t, longitude, latitude, altitude, altitude > -1 ? 1 : 0, &h_rise, &h_set, &rise, &set, &transit);
rs = timelib_astro_rise_set_altitude(t, longitude, latitude, altitude, 1, &h_rise, &h_set, &rise, &set, &transit);
timelib_time_dtor(t);
if (rs != 0) {
+4 -4
View File
@@ -113,13 +113,13 @@ bool(false)
bool(false)
--int 12345--
string(5) "09:52"
float(9.882%d)
int(1218169377)
string(5) "09:51"
float(9.855%d)
int(1218169278)
--int -12345--
string(5) "09:54"
float(9.909%d)
float(9.9097820911118)
int(1218169475)
--empty array--
+3 -3
View File
@@ -113,9 +113,9 @@ bool(false)
bool(false)
--int 12345--
string(5) "19:19"
float(19.319%d)
int(1218203349)
string(5) "19:20"
float(19.340%d)
int(1218203424)
--int -12345--
bool(false)
+1 -3
View File
@@ -190,7 +190,6 @@ int dom_documenttype_internal_subset_read(dom_object *obj, zval **retval TSRMLS_
xmlDtdPtr dtdptr;
xmlDtd *intsubset;
xmlOutputBuffer *buff = NULL;
xmlChar *strintsubset;
dtdptr = (xmlDtdPtr) dom_object_get_node(obj);
@@ -206,9 +205,8 @@ int dom_documenttype_internal_subset_read(dom_object *obj, zval **retval TSRMLS_
if (buff != NULL) {
xmlNodeDumpOutput (buff, NULL, (xmlNodePtr) intsubset, 0, 0, NULL);
xmlOutputBufferFlush(buff);
strintsubset = xmlStrndup(buff->buffer->content, buff->buffer->use);
ZVAL_STRINGL(*retval, buff->buffer->content, buff->buffer->use, 1);
(void)xmlOutputBufferClose(buff);
ZVAL_STRING(*retval, (char *) strintsubset, 1);
return SUCCESS;
}
}
+6
View File
@@ -33,4 +33,10 @@ if test "$PHP_ENCHANT" != "no"; then
PHP_SUBST(ENCHANT_SHARED_LIBADD)
PHP_ADD_LIBRARY_WITH_PATH(enchant, $ENCHANT_LIBDIR, ENCHANT_SHARED_LIBADD)
PHP_ADD_INCLUDE($ENCHANT_INCDIR)
PHP_CHECK_LIBRARY(enchant, enchant_broker_set_param,
[
AC_DEFINE(HAVE_ENCHANT_BROKER_SET_PARAM, 1, [ ])
AC_DEFINE(ENCHANT_VERSION_STRING, "1.5.x", [ ])
], [], [ -L$ENCHANT_LIB $ENCHANT_SHARED_LIBADD])
fi
+1
View File
@@ -9,6 +9,7 @@ if (PHP_ENCHANT == "yes") {
CHECK_LIB("libenchant.lib", "enchant", PHP_ENCHANT) ) {
EXTENSION("enchant", "enchant.c");
AC_DEFINE('HAVE_ENCHANT', 1, 'Have Enchant support', false);
AC_DEFINE('HAVE_ENCHANT_BROKER_SET_PARAM', 1);
ADD_FLAG("CFLAG_ENCHANT", "/D _WIN32");
} else {
WARNING('Could not find enchant.h; skipping');
+1 -1
View File
@@ -13,7 +13,7 @@ if (enchant_broker_dict_exists($r,$tag)) {
$spellerrors = enchant_dict_check($d, "soong");
print_r($dprovides);
echo "found $spellerrors spell errors\n";
if ($spellerrors) {
if (spellerrors) {
$suggs = enchant_dict_suggest($d, "soong");
echo "Suggestions for 'soong':";
print_r($suggs);
+113 -9
View File
@@ -22,17 +22,13 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef PHP_WIN32
#include <glib/glist.h>
#include <glib/ghash.h>
#endif
#include <enchant.h>
#include "php.h"
#include "php_ini.h"
#include "ext/standard/info.h"
#include "php_enchant.h"
typedef EnchantBroker * EnchantBrokerPtr;
typedef struct _broker_struct enchant_broker;
typedef struct _dict_struct enchant_dict;
@@ -64,6 +60,9 @@ static int le_enchant_dict;
/* If you declare any globals in php_enchant.h uncomment this:*/
/*ZEND_DECLARE_MODULE_GLOBALS(enchant)*/
#define PHP_ENCHANT_MYSPELL 1
#define PHP_ENCHANT_ISPELL 2
/* {{{ arginfo */
ZEND_BEGIN_ARG_INFO(arginfo_enchant_broker_init, 0)
ZEND_END_ARG_INFO()
@@ -72,6 +71,17 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_enchant_broker_free, 0, 0, 1)
ZEND_ARG_INFO(0, broker)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_enchant_broker_set_dict_path, 0, 0, 3)
ZEND_ARG_INFO(0, broker)
ZEND_ARG_INFO(0, name)
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_enchant_broker_get_dict_path, 0, 0, 2)
ZEND_ARG_INFO(0, broker)
ZEND_ARG_INFO(0, name)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_enchant_broker_request_dict, 0, 0, 2)
ZEND_ARG_INFO(0, broker)
ZEND_ARG_INFO(0, tag)
@@ -118,6 +128,8 @@ function_entry enchant_functions[] = {
PHP_FE(enchant_broker_init, arginfo_enchant_broker_init)
PHP_FE(enchant_broker_free, arginfo_enchant_broker_free)
PHP_FE(enchant_broker_get_error, arginfo_enchant_broker_free)
PHP_FE(enchant_broker_set_dict_path, arginfo_enchant_broker_set_dict_path)
PHP_FE(enchant_broker_get_dict_path, arginfo_enchant_broker_get_dict_path)
PHP_FE(enchant_broker_list_dicts, arginfo_enchant_broker_free)
PHP_FE(enchant_broker_request_dict, arginfo_enchant_broker_request_dict)
PHP_FE(enchant_broker_request_pwl_dict, arginfo_enchant_broker_request_pwl_dict)
@@ -277,7 +289,8 @@ PHP_MINIT_FUNCTION(enchant)
{
le_enchant_broker = zend_register_list_destructors_ex(php_enchant_broker_free, NULL, "enchant_broker", module_number);
le_enchant_dict = zend_register_list_destructors_ex(php_enchant_dict_free, NULL, "enchant_dict", module_number);
REGISTER_LONG_CONSTANT("ENCHANT_MYSPELL", PHP_ENCHANT_MYSPELL, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("ENCHANT_ISPELL", PHP_ENCHANT_ISPELL, CONST_CS | CONST_PERSISTENT);
return SUCCESS;
}
/* }}} */
@@ -309,6 +322,11 @@ PHP_MINFO_FUNCTION(enchant)
php_info_print_table_start();
php_info_print_table_header(2, "enchant support", "enabled");
php_info_print_table_row(2, "Version", PHP_ENCHANT_VERSION);
#ifdef ENCHANT_VERSION_STRING
php_info_print_table_row(2, "Libenchant Version", ENCHANT_VERSION_STRING);
#elif defined(HAVE_ENCHANT_BROKER_SET_PARAM)
php_info_print_table_row(2, "Libenchant Version", "1.5.0 or later");
#endif
php_info_print_table_row(2, "Revision", "$Revision$");
php_info_print_table_end();
@@ -397,15 +415,101 @@ PHP_FUNCTION(enchant_broker_get_error)
}
/* }}} */
#if HAVE_ENCHANT_BROKER_SET_PARAM
/* {{{ proto bool enchant_broker_set_dict_path(resource broker, int dict_type, string value)
Set the directory path for a given backend, works with ispell and myspell */
PHP_FUNCTION(enchant_broker_set_dict_path)
{
zval *broker;
enchant_broker *pbroker;
long dict_type;
char *value;
int value_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rls", &broker, &dict_type, &value, &value_len) == FAILURE) {
RETURN_FALSE;
}
if (!value_len) {
RETURN_FALSE;
}
switch (dict_type) {
case PHP_ENCHANT_MYSPELL:
PHP_ENCHANT_GET_BROKER;
enchant_broker_set_param(pbroker->pbroker, "enchant.myspell.dictionary.path", (const char *)value);
RETURN_TRUE;
break;
case PHP_ENCHANT_ISPELL:
PHP_ENCHANT_GET_BROKER;
enchant_broker_set_param(pbroker->pbroker, "enchant.ispell.dictionary.path", (const char *)value);
RETURN_TRUE;
break;
default:
RETURN_FALSE;
}
}
/* }}} */
/* {{{ proto string enchant_broker_get_dict_path(resource broker, int dict_type)
Get the directory path for a given backend, works with ispell and myspell */
PHP_FUNCTION(enchant_broker_get_dict_path)
{
zval *broker;
enchant_broker *pbroker;
long dict_type;
char *value;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &broker, &dict_type) == FAILURE) {
RETURN_FALSE;
}
switch (dict_type) {
case PHP_ENCHANT_MYSPELL:
PHP_ENCHANT_GET_BROKER;
value = enchant_broker_get_param(pbroker->pbroker, "enchant.myspell.dictionary.path");
break;
case PHP_ENCHANT_ISPELL:
PHP_ENCHANT_GET_BROKER;
value = enchant_broker_get_param(pbroker->pbroker, "enchant.ispell.dictionary.path");
break;
default:
RETURN_FALSE;
}
RETURN_STRING(value, 1);
}
/* }}} */
#else
/* {{{ proto bool enchant_broker_set_dict_path(resource broker, int dict_type, string value)
Set the directory path for a given backend, works with ispell and myspell */
PHP_FUNCTION(enchant_broker_set_dict_path)
{
RETURN_FALSE;
}
/* }}} */
/* {{{ proto string enchant_broker_get_dict_path(resource broker, int dict_type)
Get the directory path for a given backend, works with ispell and myspell */
PHP_FUNCTION(enchant_broker_get_dict_path)
{
RETURN_FALSE;
}
/* }}} */
#endif
/* {{{ proto string enchant_broker_list_dicts(resource broker)
Lists the dictionaries available for the given broker */
PHP_FUNCTION(enchant_broker_list_dicts)
{
zval *broker;
enchant_broker *pbroker;
EnchantDictDescribeFn describetozval = php_enchant_list_dicts_fn;
char *msg;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &broker) == FAILURE) {
RETURN_FALSE;
+3 -4
View File
@@ -24,7 +24,7 @@
extern zend_module_entry enchant_module_entry;
#define phpext_enchant_ptr &enchant_module_entry
#define PHP_ENCHANT_VERSION "1.0.2-dev"
#define PHP_ENCHANT_VERSION "1.1.0"
#ifdef PHP_WIN32
#define PHP_ENCHANT_API __declspec(dllexport)
@@ -36,9 +36,6 @@ extern zend_module_entry enchant_module_entry;
#include "TSRM.h"
#endif
static void php_enchant_broker_free(zend_rsrc_list_entry *rsrc TSRMLS_DC);
static void php_enchant_dict_free(zend_rsrc_list_entry *rsrc TSRMLS_DC);
PHP_MINIT_FUNCTION(enchant);
PHP_MSHUTDOWN_FUNCTION(enchant);
PHP_MINFO_FUNCTION(enchant);
@@ -46,6 +43,8 @@ PHP_MINFO_FUNCTION(enchant);
PHP_FUNCTION(enchant_broker_init);
PHP_FUNCTION(enchant_broker_free);
PHP_FUNCTION(enchant_broker_get_error);
PHP_FUNCTION(enchant_broker_set_dict_path);
PHP_FUNCTION(enchant_broker_get_dict_path);
PHP_FUNCTION(enchant_broker_list_dicts);
PHP_FUNCTION(enchant_broker_request_dict);
PHP_FUNCTION(enchant_broker_request_pwl_dict);
+4 -1
View File
@@ -125,7 +125,10 @@ cdf_file_property_info(struct magic_set *ms, const cdf_property_info_t *info,
return -1;
} else {
char *c, *ec;
cdf_timestamp_to_timespec(&ts, tp);
if (cdf_timestamp_to_timespec(&ts, tp) == -1) {
return -1;
}
c = ctime(&ts.tv_sec);
if ((ec = strchr(c, '\n')) != NULL)
*ec = '\0';
+13
View File
@@ -365,6 +365,19 @@ static void php_zval_filter(zval **value, long filter, long flags, zval *options
if (copy) {
SEPARATE_ZVAL(value);
}
/* #49274, fatal error with object without a toString method
Fails nicely instead of getting a recovarable fatal error. */
if (Z_TYPE_PP(value) == IS_OBJECT) {
zend_class_entry *ce;
ce = Z_OBJCE_PP(value);
if (!ce->__tostring) {
ZVAL_FALSE(*value);
return;
}
}
/* Here be strings */
convert_to_string(*value);
+1 -1
View File
@@ -275,7 +275,7 @@ void php_filter_unsafe_raw(PHP_INPUT_FILTER_PARAM_DECL)
void php_filter_email(PHP_INPUT_FILTER_PARAM_DECL)
{
/* Check section 6 of rfc 822 http://www.faqs.org/rfcs/rfc822.html */
const unsigned char allowed_list[] = LOWALPHA HIALPHA DIGIT "!#$%&'*+-/=?^_`{|}~@.[]";
const unsigned char allowed_list[] = LOWALPHA HIALPHA DIGIT "!#$%&'*+-=?^_`{|}~@.[]";
filter_map map;
filter_map_init(&map);
+10
View File
@@ -0,0 +1,10 @@
--TEST--
#49274, fatal error when an object does not implement toString
--SKIPIF--
<?php if (!extension_loaded("filter")) die("skip"); ?>
--FILE--
<?php
var_dump(filter_var(new stdClass, FILTER_VALIDATE_EMAIL));
?>
--EXPECTF--
bool(false)
+1 -1
View File
@@ -147,7 +147,7 @@ ftp_open(const char *host, short port, long timeout_sec TSRMLS_DC)
size = sizeof(ftp->localaddr);
memset(&ftp->localaddr, 0, size);
if (getsockname(ftp->fd, (struct sockaddr*) &ftp->localaddr, &size) == -1) {
if (getsockname(ftp->fd, (struct sockaddr*) &ftp->localaddr, &size) != 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "getsockname failed: %s (%d)", strerror(errno), errno);
goto bail;
}
+3
View File
@@ -39,6 +39,9 @@ int _gdGetColors (gdIOCtx * in, gdImagePtr im, int gd2xFlag)
if (!gdGetWord(&im->colorsTotal, in)) {
goto fail1;
}
if (im->colorsTotal > gdMaxColors) {
goto fail1;
}
}
/* Int to accommodate truecolor single-color transparency */
if (!gdGetInt(&im->transparent, in)) {
Binary file not shown.
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Test max colors for a gd image.
--SKIPIF--
<?php
if (!extension_loaded('gd')) {
die("skip gd extension not available\n");
}
?>
--FILE--
<?php
imagecreatefromgd(dirname(__FILE__) . '/crafted.gd2');
?>
--EXPECTF--
Warning: imagecreatefromgd(): '%scrafted.gd2' is not a valid GD file in %s on line %d
+1
View File
@@ -487,6 +487,7 @@ const zend_function_entry imap_functions[] = {
PHP_FE(imap_delete, arginfo_imap_delete)
PHP_FE(imap_undelete, arginfo_imap_undelete)
PHP_FE(imap_check, arginfo_imap_check)
PHP_FE(imap_listscan, arginfo_imap_listscan)
PHP_FE(imap_mail_copy, arginfo_imap_mail_copy)
PHP_FE(imap_mail_move, arginfo_imap_mail_move)
PHP_FE(imap_mail_compose, arginfo_imap_mail_compose)
+1
View File
@@ -780,6 +780,7 @@ PHP_FUNCTION(mcrypt_generic_deinit)
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not terminate encryption specifier");
RETURN_FALSE
}
pm->init = 0;
RETURN_TRUE
}
/* }}} */
+13
View File
@@ -0,0 +1,13 @@
--TEST--
Bug #49738 (calling mcrypt after mcrypt_generic_deinit crashes)
--SKIPIF--
<?php if (!extension_loaded("mcrypt")) print "skip"; ?>
--FILE--
<?php
$td = mcrypt_module_open(MCRYPT_DES, '', MCRYPT_MODE_ECB, '');
mcrypt_generic_init($td, 'aaaaaaaa', 'aaaaaaaa');
mcrypt_generic_deinit($td);
echo mcrypt_generic($td, 'aaaaaaaa');
?>
--EXPECTF--
Warning: mcrypt_generic(): Operation disallowed prior to mcrypt_generic_init(). in %sbug49738.php on line 5
+15 -8
View File
@@ -971,6 +971,7 @@ PHP_FUNCTION(mysql_pconnect)
Close a MySQL connection */
PHP_FUNCTION(mysql_close)
{
int resource_id;
zval *mysql_link=NULL;
php_mysql_conn *mysql;
@@ -984,24 +985,25 @@ PHP_FUNCTION(mysql_close)
ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, NULL, MySG(default_link), "MySQL-Link", le_link, le_plink);
}
resource_id = mysql_link ? Z_RESVAL_P(mysql_link) : MySG(default_link);
PHPMY_UNBUFFERED_QUERY_CHECK();
#ifdef MYSQL_USE_MYSQLND
{
int tmp;
if ((mysql = zend_list_find(Z_RESVAL_P(mysql_link), &tmp)) && tmp == le_plink) {
if ((mysql = zend_list_find(resource_id, &tmp)) && tmp == le_plink) {
mysqlnd_end_psession(mysql->conn);
}
}
#endif
if (mysql_link) { /* explicit resource number */
PHPMY_UNBUFFERED_QUERY_CHECK();
zend_list_delete(Z_RESVAL_P(mysql_link));
}
zend_list_delete(resource_id);
if (!mysql_link
|| (mysql_link && Z_RESVAL_P(mysql_link)==MySG(default_link))) {
PHPMY_UNBUFFERED_QUERY_CHECK();
zend_list_delete(MySG(default_link));
MySG(default_link) = -1;
if (mysql_link) {
/* on an explicit close of the default connection it had a refcount of 2 so we need one more call */
zend_list_delete(resource_id);
}
}
RETURN_TRUE;
@@ -1970,7 +1972,7 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type,
}
}
if ((result_type & MYSQL_BOTH) == 0) {
if (result_type & ~MYSQL_BOTH) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The result type should be either MYSQL_NUM, MYSQL_ASSOC or MYSQL_BOTH");
result_type = MYSQL_BOTH;
}
@@ -2147,6 +2149,11 @@ PHP_FUNCTION(mysql_fetch_array)
}
ZEND_FETCH_RESOURCE(result, MYSQL_RES *, &mysql_result, -1, "MySQL result", le_result);
if (mode & ~MYSQL_BOTH) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The result type should be either MYSQL_NUM, MYSQL_ASSOC or MYSQL_BOTH");
mode = MYSQL_BOTH;
}
mysqlnd_fetch_into(result, mode, return_value, MYSQLND_MYSQL);
#endif
}
+92
View File
@@ -0,0 +1,92 @@
--TEST--
Bug #48754 (mysql_close() crash php when no handle specified)
--SKIPIF--
<?php
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
?>
--FILE--
<?php
require_once('connect.inc');
function my_mysql_pconnect($host, $user, $passwd, $db, $port, $socket) {
if ($socket)
$host = sprintf("%s:%s", $host, $socket);
else if ($port)
$host = sprintf("%s:%s", $host, $port);
if (!$link = mysql_pconnect($host, $user, $passwd, true)) {
printf("[000-a] Cannot connect using host '%s', user '%s', password '****', [%d] %s\n",
$host, $user, $passwd,
mysql_errno(), mysql_error());
return false;
}
return $link;
}
echo "Explicit connection on close\n";
$link = my_mysql_connect($host, $user, $passwd, $db, $port, $socket);
$link1_thread_id = mysql_thread_id($link);
$default1_thread_id = mysql_thread_id();
echo 'Expect same thread id for $link and default conn: ';
var_dump($link1_thread_id == $default1_thread_id);
var_dump($link);
mysql_close($link);
var_dump($link);
// we sohuld have no default link anymore
mysql_close();
echo "\nClosing default link\n";
$link = my_mysql_connect($host, $user, $passwd, $db, $port, $socket);
$link2_thread_id = mysql_thread_id($link);
$default2_thread_id = mysql_thread_id();
echo 'Expect same thread id for $link and default conn but not the previous: ';
var_dump($link1_thread_id == $default1_thread_id && $link1_thread_id != $link2_thread_id);
var_dump($link);
mysql_close();
var_dump($link);
mysql_close($link);
var_dump($link);
echo "\nExplicit resource and pconnect\n";
$link = my_mysql_pconnect($host, $user, $passwd, $db, $port, $socket);
var_dump($link);
mysql_close($link);
var_dump($link);
// we sohuld have no default link
mysql_close();
echo "\nDefault link and pconnect\n";
$link = my_mysql_pconnect($host, $user, $passwd, $db, $port, $socket);
var_dump($link);
mysql_close();
var_dump($link);
mysql_close($link);
var_dump($link);
?>
--EXPECTF--
Explicit connection on close
Expect same thread id for $link and default conn: bool(true)
resource(%d) of type (mysql link)
resource(%d) of type (Unknown)
Warning: mysql_close(): no MySQL-Link resource supplied in %s on line %d
Closing default link
Expect same thread id for $link and default conn but not the previous: bool(true)
resource(%d) of type (mysql link)
resource(%d) of type (mysql link)
resource(%d) of type (Unknown)
Explicit resource and pconnect
resource(%d) of type (mysql link persistent)
resource(%d) of type (Unknown)
Warning: mysql_close(): no MySQL-Link resource supplied in %s on line %d
Default link and pconnect
resource(%d) of type (mysql link persistent)
resource(%d) of type (mysql link persistent)
resource(%d) of type (Unknown)
+6 -2
View File
@@ -20,14 +20,17 @@ if (!function_exists('sys_get_temp_dir')) {
}
/* wrapper to simplify test porting */
function my_mysql_connect($host, $user, $passwd, $db, $port, $socket) {
function my_mysql_connect($host, $user, $passwd, $db, $port, $socket, $flags = NULL) {
global $connect_flags;
$flags = ($flags === NULL) ? $connect_flags : $flags;
if ($socket)
$host = sprintf("%s:%s", $host, $socket);
else if ($port)
$host = sprintf("%s:%s", $host, $port);
if (!$link = mysql_connect($host, $user, $passwd, true)) {
if (!$link = mysql_connect($host, $user, $passwd, true, $flags)) {
printf("[000-a] Cannot connect using host '%s', user '%s', password '****', [%d] %s\n",
$host, $user, $passwd,
mysql_errno(), mysql_error());
@@ -55,6 +58,7 @@ $db = getenv("MYSQL_TEST_DB") ? getenv("MYSQL_TEST_DB") : "test";
$engine = getenv("MYSQL_TEST_ENGINE") ? getenv("MYSQL_TEST_ENGINE") : "MyISAM";
$socket = getenv("MYSQL_TEST_SOCKET") ? getenv("MYSQL_TEST_SOCKET") : null;
$skip_on_connect_failure = getenv("MYSQL_TEST_SKIP_CONNECT_FAILURE") ? getenv("MYSQL_TEST_SKIP_CONNECT_FAILURE") : true;
$connect_flags = getenv("MYSQL_TEST_CONNECT_FLAGS") ? (int)getenv("MYSQL_TEST_CONNECT_FLAGS") : 0;
/* Development setting: test experimal features and/or feature requests that never worked before? */
$TEST_EXPERIMENTAL = (in_array(getenv("MYSQL_TEST_EXPERIMENTAL"), array(0, 1))) ?
+22 -9
View File
@@ -20,17 +20,23 @@ if (!$link = mysql_connect($myhost, $user, $passwd, true))
mysql_close($link);
if (!$link = mysql_connect($myhost, $user, $passwd, true))
printf("[003] Cannot connect to the server using host=%s/%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
$host, $myhost, $user, $db, $port, $socket);
mysql_close();
if ($link = mysql_connect($myhost, $user . 'unknown_really', $passwd . 'non_empty', true))
printf("[003] Can connect to the server using host=%s/%s, user=%s, passwd=***non_empty, dbname=%s, port=%s, socket=%s\n",
printf("[004] Can connect to the server using host=%s/%s, user=%s, passwd=***non_empty, dbname=%s, port=%s, socket=%s\n",
$host, $myhost, $user . 'unknown_really', $db, $port, $socket);
if (false !== $link)
printf("[004] Expecting boolean/false, got %s/%s\n", gettype($link), $link);
printf("[005] Expecting boolean/false, got %s/%s\n", gettype($link), $link);
// Run the following tests without an anoynmous MySQL user and use a password for the test user!
ini_set('mysql.default_socket', $socket);
if (!is_resource($link = mysql_connect($host, $user, $passwd, true))) {
printf("[005] Usage of mysql.default_socket failed\n");
printf("[006] Usage of mysql.default_socket failed\n");
} else {
mysql_close($link);
}
@@ -39,42 +45,49 @@ if (!ini_get('sql.safe_mode')) {
ini_set('mysql.default_port', $port);
if (!is_resource($link = mysql_connect($host, $user, $passwd, true))) {
printf("[006] Usage of mysql.default_port failed\n");
printf("[007] Usage of mysql.default_port failed\n");
} else {
mysql_close($link);
}
ini_set('mysql.default_password', $passwd);
if (!is_resource($link = mysql_connect($myhost, $user))) {
printf("[007] Usage of mysql.default_password failed\n");
printf("[008] Usage of mysql.default_password failed\n");
} else {
mysql_close($link);
}
ini_set('mysql.default_user', $user);
if (!is_resource($link = mysql_connect($myhost))) {
printf("[008] Usage of mysql.default_user failed\n");
printf("[009] Usage of mysql.default_user failed\n");
} else {
mysql_close($link);
}
ini_set('mysql.default_host', $myhost);
if (!is_resource($link = mysql_connect())) {
printf("[009] Usage of mysql.default_host failed\n") ;
printf("[010] Usage of mysql.default_host failed\n") ;
} else {
mysql_close($link);
}
if (!is_resource($link = mysql_connect()) || !is_resource($link2 = mysql_connect())) {
printf("[011] Usage of mysql.default_host failed\n") ;
} else {
mysql_close();
mysql_close($link2);
}
if (!stristr(PHP_OS, 'win') && !stristr(PHP_OS, 'netware')) {
ini_set('mysql.default_port', -1);
if (putenv(sprintf('MYSQL_TCP_PORT=%d', $port))) {
if (!is_resource($link = mysql_connect())) {
printf("[010] Usage of env MYSQL_TCP_PORT failed\n") ;
printf("[012] Usage of env MYSQL_TCP_PORT failed\n") ;
} else {
mysql_close($link);
}
} else if (putenv(sprintf('MYSQL_TCP_PORT=%d', $port + 1))) {
if (!is_resource($link = mysql_connect())) {
printf("[011] Usage of env MYSQL_TCP_PORT=%d should have failed\n", $port + 1) ;
printf("[013] Usage of env MYSQL_TCP_PORT=%d should have failed\n", $port + 1) ;
mysql_close($link);
}
}
+3 -1
View File
@@ -56,7 +56,7 @@ exit(1);
do {
$illegal_mode = mt_rand(0, 10000);
} while (in_array($illegal_mode, array(MYSQL_ASSOC, MYSQL_NUM, MYSQL_BOTH)));
$tmp = @mysql_fetch_array($res, $illegal_mode);
$tmp = mysql_fetch_array($res, $illegal_mode);
if (!is_array($tmp))
printf("[013] Expecting array, got %s/%s. [%d] %s\n",
gettype($tmp), $tmp, mysql_errno($link), mysql_error($link));
@@ -355,5 +355,7 @@ array(11) {
%unicode|string%(1) "1"
}
Warning: mysql_fetch_array(): The result type should be either MYSQL_NUM, MYSQL_ASSOC or MYSQL_BOTH in %s on line %d
Warning: mysql_fetch_array(): %d is not a valid MySQL result resource in %s on line %d
done!
+10 -2
View File
@@ -124,9 +124,16 @@ require_once('skipifconnectfailure.inc');
printf("[017] [%d] %s\n", mysql_errno($link), mysql_error($link));
}
$res = mysql_list_fields($db, 'test');
while ($tmp = mysql_fetch_field($res))
if ($tmp->name == 'id')
$found = false;
while ($tmp = mysql_fetch_field($res)) {
if ($tmp->name == 'id') {
printf("Fetch field from mysql_list_fields result set.\n");
$found = true;
var_dump($tmp);
}
}
if (!$found)
printf("[018] mysqli_list_fields result set processing has failed.\n");
mysql_free_result($res);
@@ -227,6 +234,7 @@ object(stdClass)#%d (13) {
[%u|b%"zerofill"]=>
int(0)
}
Fetch field from mysql_list_fields result set.
object(stdClass)#%d (13) {
[%u|b%"name"]=>
%unicode|string%(2) "id"
+28 -9
View File
@@ -12,29 +12,36 @@ require_once 'connect.inc';
$tmp = NULL;
$link = NULL;
// This will implicitly try to connect, and we don't want it
//if (false !== ($tmp = mysql_list_fields($link, $link)))
// printf("[002] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp);
require 'table.inc';
if (!$res = mysql_list_fields($db, 'test', $link))
printf("[003] [%d] %s\n", mysql_errno($link), mysql_error($link));
if (2 !== ($num = mysql_num_fields($res)))
printf("[004] Expecting two fields, got %d. [%d] %s\n", $num, mysql_errno($link), mysql_error($link));
printf("[004] Expecting two fields from 'test', got %d. [%d] %s\n", $num, mysql_errno($link), mysql_error($link));
mysql_free_result($res);
if (!mysql_query("DROP TABLE IF EXISTS test2", $link) ||
!mysql_query("CREATE TABLE test2(id INT)", $link))
if (!mysql_query("DROP TABLE IF EXISTS test2", $link))
printf("[005] [%d] %s\n", mysql_errno($link), mysql_error($link));
if (!$res = mysql_list_fields($db, 'test', $link))
if (!$res = @mysql_list_fields($db, 'test2', $link))
printf("[006] [%d] %s\n", mysql_errno($link), mysql_error($link));
if (!$res = mysql_list_fields($db, 'test', $link))
printf("[007] [%d] %s\n", mysql_errno($link), mysql_error($link));
if (2 !== ($num = mysql_num_fields($res)))
printf("[007] Expecting 3 fields from test and test2, got %d. [%d] %s\n", $num, mysql_errno($link), mysql_error($link));
printf("[008] Expecting 2 fields from 'test', got %d. [%d] %s\n", $num, mysql_errno($link), mysql_error($link));
var_dump(mysql_fetch_assoc($res));
for ($field_offset = 0; $field_offset < mysql_num_fields($res); $field_offset++) {
printf("Field Offset %d\n", $field_offset);
printf("mysql_field_flags(): %s\n", mysql_field_flags($res, $field_offset));
printf("mysql_field_len(): %s\n", mysql_field_len($res, $field_offset));
printf("mysql_field_name(): %s\n", mysql_field_name($res, $field_offset));
printf("mysql_field_type(): %s\n", mysql_field_type($res, $field_offset));
}
mysql_free_result($res);
mysql_close($link);
@@ -57,4 +64,16 @@ if (!mysql_query("DROP TABLE IF EXISTS test2", $link))
mysql_close($link);
?>
--EXPECTF--
[006] [%d] %s
bool(false)
Field Offset 0
mysql_field_flags()%s
mysql_field_len(): 11
mysql_field_name(): id
mysql_field_type(): int
Field Offset 1
mysql_field_flags()%s
mysql_field_len(): 1
mysql_field_name(): label
mysql_field_type(): string
done!
@@ -0,0 +1,37 @@
--TEST--
mysqlnd.net_read_timeout > default_socket_timeout
--SKIPIF--
<?php
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
require_once('connect.inc');
?>
--INI--
default_socket_timeout=1
mysqlnd.net_read_timeout=12
max_execution_time=12
--FILE--
<?php
set_time_limit(12);
include ("connect.inc");
if (!$link = my_mysql_connect($host, $user, $passwd, $db, $port, $socket)) {
printf("[001] Connect failed, [%d] %s\n", mysql_errno(), mysqlerror());
}
if (!$res = mysql_query("SELECT SLEEP(6)", $link))
printf("[002] [%d] %s\n", mysql_errno($link), mysql_error($link));
var_dump(mysql_fetch_assoc($res));
mysql_free_result($res);
mysql_close($link);
print "done!";
?>
--EXPECTF--
array(1) {
[%u|b%"SLEEP(6)"]=>
%unicode|string%(1) "0"
}
done!
+48 -24
View File
@@ -18,26 +18,35 @@ Persistent connections and mysql.max_persistent
if (!mysql_select_db($db, $link))
die(sprintf("skip [%d] %s", mysql_errno($link), mysql_error($link)));
if (!$res = mysql_query("SELECT CURRENT_USER() AS _user", $link))
die(sprintf("skip [%d] %s", mysql_errno($link), mysql_error($link)));
$row = mysql_fetch_assoc($res);
mysql_free_result($res);
$host = substr($row['_user'], strrpos($row['_user'], "@") + 1, strlen($row['_user']));
mysql_query('DROP USER pcontest', $link);
if (!mysql_query('CREATE USER pcontest IDENTIFIED BY "pcontest"', $link)) {
mysql_query(sprintf('DROP USER pcontest@"%s"', mysql_real_escape_string($host, $link)), $link);
if (!mysql_query(sprintf('CREATE USER pcontest@"%s" IDENTIFIED BY "pcontest"', mysql_real_escape_string($host, $link)), $link)) {
printf("skip Cannot create second DB user [%d] %s", mysql_errno($link), mysql_error($link));
mysql_close($link);
die();
}
// we might be able to specify the host using CURRENT_USER(), but...
if (!mysql_query(sprintf("GRANT SELECT ON TABLE %s.test TO pcontest@'%%'", $db), $link)) {
if (!mysql_query(sprintf('GRANT SELECT ON TABLE %s.test TO pcontest@"%s"', $db, mysql_real_escape_string($host, $link)), $link)) {
printf("skip Cannot GRANT SELECT to second DB user [%d] %s", mysql_errno($link), mysql_error($link));
mysql_query('REVOKE ALL PRIVILEGES, GRANT OPTION FROM pcontest', $link);
mysql_query('DROP USER pcontest', $link);
mysql_query(sprintf('REVOKE ALL PRIVILEGES, GRANT OPTION FROM pcontest@"%s"', mysql_real_escape_string($host, $link)), $link);
mysql_query(sprintf('DROP USER pcontest@"%s"', mysql_real_escape_string($host, $link)), $link);
mysql_close($link);
die();
}
mysql_close($link);
?>
--INI--
mysql.max_links=2
mysql.max_persistent=1
mysql.max_links=3
mysql.max_persistent=2
mysql.allow_persistent=1
--FILE--
<?php
@@ -76,18 +85,26 @@ mysql.allow_persistent=1
var_dump($row);
// change the password for the second DB user and kill the persistent connection
if (!mysql_query('SET PASSWORD FOR pcontest = PASSWORD("newpass")', $link))
printf("[006] Cannot change PW of second DB user, [%d] %s\n", mysql_errno($link), mysql_error($link));
if (!$res = mysql_query("SELECT CURRENT_USER() AS _user", $link))
printf("[006] [%d] %s", mysql_errno($link), mysql_error($link));
$row = mysql_fetch_assoc($res);
mysql_free_result($res);
$host = substr($row['_user'], strrpos($row['_user'], "@") + 1, strlen($row['_user']));
$sql = sprintf('SET PASSWORD FOR pcontest@"%s" = PASSWORD("newpass")', mysql_real_escape_string($host, $link));
if (!mysql_query($sql, $link))
printf("[007] Cannot change PW of second DB user, [%d] %s\n", mysql_errno($link), mysql_error($link));
// persistent connections cannot be closed but only be killed
$pthread_id = mysql_thread_id($plink);
if (!mysql_query(sprintf('KILL %d', $pthread_id), $link))
printf("[007] Cannot KILL persistent connection of second DB user, [%d] %s\n", mysql_errno($link), mysql_error($link));
printf("[008] Cannot KILL persistent connection of second DB user, [%d] %s\n", mysql_errno($link), mysql_error($link));
// give the server a second to really kill the thread
sleep(1);
if (!$res = mysql_query("SHOW FULL PROCESSLIST", $link))
printf("[008] [%d] %s\n", mysql_errno($link), mysql_error($link));
printf("[009] [%d] %s\n", mysql_errno($link), mysql_error($link));
$running_threads = array();
while ($row = mysql_fetch_assoc($res))
@@ -95,11 +112,11 @@ mysql.allow_persistent=1
mysql_free_result($res);
if (isset($running_threads[$pthread_id]))
printf("[009] Persistent connection has not been killed");
printf("[010] Persistent connection has not been killed\n");
// we might get the old handle
if ($plink = @mysql_pconnect($host, 'pcontest', 'pcontest'))
printf("[010] Can connect using the old password, [%d] %s\n",
printf("[011] Can connect using the old password, [%d] %s\n",
mysql_errno(), mysql_error());
ob_start();
@@ -108,34 +125,34 @@ mysql.allow_persistent=1
ob_end_clean();
$phpinfo = substr($phpinfo, strpos($phpinfo, 'MySQL Support => enabled'), 500);
if (!preg_match('@Active Persistent Links\s+=>\s+(\d+)@ismU', $phpinfo, $matches))
printf("[011] Cannot get # active persistent links from phpinfo()");
printf("[012] Cannot get # active persistent links from phpinfo()\n");
$num_plinks_kill = $matches[1];
if ($num_plinks_kill >= $num_plinks)
printf("[012] Statistics seems to be wrong, got %d active persistent links, expecting < %d links",
if ($num_plinks_kill > $num_plinks)
printf("[013] Statistics seems to be wrong, got %d active persistent links, expecting < %d links\n",
$num_plinks_kill, $num_plinks);
// The first connection has been closed, the last pconnect() was unable to connect -> no connection open
// We must be able to connect because max_persistent limit has not been reached
if (!$plink = mysql_pconnect($host, 'pcontest', 'newpass'))
printf("[013] Cannot connect using the second DB, [%d] %s\n",
mysql_errno(), mysql_error());
die(sprintf("[014] Cannot connect using the second DB, [%d] %s\n",
mysql_errno(), mysql_error()));
if (!mysql_select_db($db, $plink))
printf("[014] [%d] %s\n", mysql_errno($plink), mysql_error($plink));
printf("[015] [%d] %s\n", mysql_errno($plink), mysql_error($plink));
if (!$res = mysql_query('SELECT id, label FROM test WHERE id = 1', $plink))
printf("[015] Cannot run query on persistent connection of second DB user, [%d] %s\n",
printf("[016] Cannot run query on persistent connection of second DB user, [%d] %s\n",
mysql_errno($plink), mysql_error($plink));
if (!$row = mysql_fetch_assoc($res))
printf("[016] Cannot run fetch result, [%d] %s\n",
printf("[017] Cannot run fetch result, [%d] %s\n",
mysql_errno($plink), mysql_error($plink));
mysql_free_result($res);
var_dump($row);
mysql_query('REVOKE ALL PRIVILEGES, GRANT OPTION FROM pcontest', $link);
mysql_query('DROP USER pcontest', $link);
mysql_query(sprintf('REVOKE ALL PRIVILEGES, GRANT OPTION FROM pcontest@"%s"', mysql_real_escape_string($host, $link)), $link);
mysql_query(sprintf('DROP USER pcontest@"%s"', mysql_real_escape_string($host, $link)), $link);
mysql_close($link);
print "done!";
?>
@@ -148,8 +165,15 @@ if (!$link = my_mysql_connect($host, $user, $passwd, $db, $port, $socket)) {
$host, $myhost, $user, $db, $port, $socket);
}
@mysql_query('REVOKE ALL PRIVILEGES, GRANT OPTION FROM pcontest', $link);
@mysql_query('DROP USER pcontest', $link);
if (!$res = mysql_query("SELECT CURRENT_USER() AS _user", $link))
printf("[c002] [%d] %s", mysql_errno($link), mysql_error($link));
$row = mysql_fetch_assoc($res);
mysql_free_result($res);
$host = substr($row['_user'], strrpos($row['_user'], "@") + 1, strlen($row['_user']));
@mysql_query(sprintf('REVOKE ALL PRIVILEGES, GRANT OPTION FROM pcontest@"%s"', mysql_real_escape_string($host, $link)), $link);
@mysql_query(sprintf('DROP USER pcontest@"%s"', mysql_real_escape_string($host, $link)), $link);
mysql_close($link);
?>
+1 -1
View File
@@ -6,7 +6,7 @@ if ($skip_on_connect_failure) {
else if ($port)
$myhost = sprintf("%s:%s", $host, $port);
if (!$link = @mysql_connect($myhost, $user, $passwd, true))
if (!$link = @mysql_connect($myhost, $user, $passwd, true, $connect_flags))
die(sprintf("skip Can't connect to MySQL Server - [%d] %s", mysql_errno(), mysql_error()));
if (!@mysql_select_db($db, $link))
+32 -7
View File
@@ -32,6 +32,7 @@
#include "ext/standard/php_string.h"
#include "php_mysqli_structs.h"
#include "zend_exceptions.h"
#include "ext/mysqlnd/mysqlnd_portability.h"
ZEND_DECLARE_MODULE_GLOBALS(mysqli)
static PHP_GINIT_FUNCTION(mysqli);
@@ -379,7 +380,6 @@ void mysqli_write_property(zval *object, zval *member, zval *value TSRMLS_DC)
zval tmp_member;
mysqli_object *obj;
mysqli_prop_handler *hnd;
zend_object_handlers *std_hnd;
int ret;
if (member->type != IS_STRING) {
@@ -1201,12 +1201,37 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
MAKE_STD_ZVAL(res);
/* check if we need magic quotes */
if (PG(magic_quotes_runtime)) {
Z_TYPE_P(res) = IS_STRING;
Z_STRVAL_P(res) = php_addslashes(row[i], field_len[i], &Z_STRLEN_P(res), 0 TSRMLS_CC);
} else {
ZVAL_STRINGL(res, row[i], field_len[i], 1);
#if MYSQL_VERSION_ID > 50002
if (mysql_fetch_field_direct(result, i)->type == MYSQL_TYPE_BIT) {
my_ulonglong llval;
char tmp[22];
switch (field_len[i]) {
case 8:llval = (my_ulonglong) bit_uint8korr(row[i]);break;
case 7:llval = (my_ulonglong) bit_uint7korr(row[i]);break;
case 6:llval = (my_ulonglong) bit_uint6korr(row[i]);break;
case 5:llval = (my_ulonglong) bit_uint5korr(row[i]);break;
case 4:llval = (my_ulonglong) bit_uint4korr(row[i]);break;
case 3:llval = (my_ulonglong) bit_uint3korr(row[i]);break;
case 2:llval = (my_ulonglong) bit_uint2korr(row[i]);break;
case 1:llval = (my_ulonglong) uint1korr(row[i]);break;
}
/* even though lval is declared as unsigned, the value
* may be negative. Therefor we cannot use MYSQLI_LLU_SPEC and must
* use MYSQLI_LL_SPEC.
*/
snprintf(tmp, sizeof(tmp), (mysql_fetch_field_direct(result, i)->flags & UNSIGNED_FLAG)? MYSQLI_LLU_SPEC : MYSQLI_LL_SPEC, llval);
ZVAL_STRING(res, tmp, 1);
} else
#endif
{
/* check if we need magic quotes */
if (PG(magic_quotes_runtime)) {
Z_TYPE_P(res) = IS_STRING;
Z_STRVAL_P(res) = php_addslashes(row[i], field_len[i], &Z_STRLEN_P(res), 0 TSRMLS_CC);
} else {
ZVAL_STRINGL(res, row[i], field_len[i], 1);
}
}
if (fetchtype & MYSQLI_NUM) {
+39 -17
View File
@@ -31,6 +31,7 @@
#include "php_globals.h"
#include "ext/standard/info.h"
#include "php_mysqli_structs.h"
#include "ext/mysqlnd/mysqlnd_portability.h"
/* {{{ proto mixed mysqli_affected_rows(object link)
Get number of affected rows in previous MySQL operation */
@@ -356,6 +357,7 @@ mysqli_stmt_bind_result_do_bind(MY_STMT *stmt, zval ***args, unsigned int argc,
bind[ofs].is_null = &stmt->result.is_null[ofs];
bind[ofs].buffer_length = stmt->result.buf[ofs].buflen;
bind[ofs].is_unsigned = (stmt->stmt->fields[ofs].flags & UNSIGNED_FLAG) ? 1 : 0;
bind[ofs].length = &stmt->result.buf[ofs].output_len;
break;
case MYSQL_TYPE_DATE:
@@ -370,6 +372,7 @@ mysqli_stmt_bind_result_do_bind(MY_STMT *stmt, zval ***args, unsigned int argc,
case MYSQL_TYPE_LONG_BLOB:
case MYSQL_TYPE_TIMESTAMP:
case MYSQL_TYPE_DECIMAL:
case MYSQL_TYPE_GEOMETRY:
#ifdef FIELD_TYPE_NEWDECIMAL
case MYSQL_TYPE_NEWDECIMAL:
#endif
@@ -395,7 +398,9 @@ mysqli_stmt_bind_result_do_bind(MY_STMT *stmt, zval ***args, unsigned int argc,
different lengths and you will see that we get different lengths in stmt->stmt->fields[ofs].length
The just take 256 and saves us from realloc-ing.
*/
stmt->result.buf[ofs].buflen = 256;
stmt->result.buf[ofs].buflen =
(stmt->stmt->fields) ? (stmt->stmt->fields[ofs].length) ? stmt->stmt->fields[ofs].length + 1: 256: 256;
} else {
/*
the user has called store_result(). if he does not there is no way to determine the
@@ -409,7 +414,7 @@ mysqli_stmt_bind_result_do_bind(MY_STMT *stmt, zval ***args, unsigned int argc,
bind[ofs].buffer = stmt->result.buf[ofs].val;
bind[ofs].is_null = &stmt->result.is_null[ofs];
bind[ofs].buffer_length = stmt->result.buf[ofs].buflen;
bind[ofs].length = &stmt->result.buf[ofs].buflen;
bind[ofs].length = &stmt->result.buf[ofs].output_len;
break;
}
default:
@@ -732,7 +737,7 @@ PHP_FUNCTION(mysqli_stmt_execute)
for (i = 0; i < stmt->param.var_cnt; i++) {
for (j = i + 1; j < stmt->param.var_cnt; j++) {
/* Oops, someone binding the same variable - clone */
if (stmt->param.vars[j] == stmt->param.vars[i]) {
if (stmt->param.vars[j] == stmt->param.vars[i] && stmt->param.vars[i]) {
php_mysqli_stmt_copy_it(&copies, stmt->param.vars[i], stmt->param.var_cnt, i);
break;
}
@@ -877,9 +882,29 @@ void mysqli_stmt_fetch_libmysql(INTERNAL_FUNCTION_PARAMETERS)
ZVAL_DOUBLE(stmt->result.vars[i], *(double *)stmt->result.buf[i].val);
break;
case IS_STRING:
if (stmt->stmt->bind[i].buffer_type == MYSQL_TYPE_LONGLONG) {
if (stmt->stmt->bind[i].buffer_type == MYSQL_TYPE_LONGLONG
#if MYSQL_VERSION_ID > 50002
|| stmt->stmt->bind[i].buffer_type == MYSQL_TYPE_BIT
#endif
) {
my_bool uns= (stmt->stmt->fields[i].flags & UNSIGNED_FLAG)? 1:0;
llval= *(my_ulonglong *) stmt->result.buf[i].val;
#if MYSQL_VERSION_ID > 50002
if (stmt->stmt->bind[i].buffer_type == MYSQL_TYPE_BIT) {
switch (stmt->result.buf[i].output_len) {
case 8:llval = (my_ulonglong) bit_uint8korr(stmt->result.buf[i].val);break;
case 7:llval = (my_ulonglong) bit_uint7korr(stmt->result.buf[i].val);break;
case 6:llval = (my_ulonglong) bit_uint6korr(stmt->result.buf[i].val);break;
case 5:llval = (my_ulonglong) bit_uint5korr(stmt->result.buf[i].val);break;
case 4:llval = (my_ulonglong) bit_uint4korr(stmt->result.buf[i].val);break;
case 3:llval = (my_ulonglong) bit_uint3korr(stmt->result.buf[i].val);break;
case 2:llval = (my_ulonglong) bit_uint2korr(stmt->result.buf[i].val);break;
case 1:llval = (my_ulonglong) uint1korr(stmt->result.buf[i].val);break;
}
} else
#endif
{
llval= *(my_ulonglong *) stmt->result.buf[i].val;
}
#if SIZEOF_LONG==8
if (uns && llval > 9223372036854775807L) {
#elif SIZEOF_LONG==4
@@ -898,14 +923,7 @@ void mysqli_stmt_fetch_libmysql(INTERNAL_FUNCTION_PARAMETERS)
} else {
ZVAL_LONG(stmt->result.vars[i], llval);
}
}
#if MYSQL_VERSION_ID > 50002
else if (stmt->stmt->bind[i].buffer_type == MYSQL_TYPE_BIT) {
llval = *(my_ulonglong *)stmt->result.buf[i].val;
ZVAL_LONG(stmt->result.vars[i], llval);
}
#endif
else {
} else {
#if defined(MYSQL_DATA_TRUNCATED) && MYSQL_VERSION_ID > 50002
if (ret == MYSQL_DATA_TRUNCATED && *(stmt->stmt->bind[i].error) != 0) {
/* result was truncated */
@@ -916,7 +934,7 @@ void mysqli_stmt_fetch_libmysql(INTERNAL_FUNCTION_PARAMETERS)
{
#endif
ZVAL_STRINGL(stmt->result.vars[i], stmt->result.buf[i].val,
stmt->result.buf[i].buflen, 1);
stmt->result.buf[i].output_len, 1);
}
}
break;
@@ -2097,7 +2115,6 @@ PHP_FUNCTION(mysqli_stmt_attr_set)
long mode_in;
ulong mode;
ulong attr;
int rc;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll", &mysql_stmt, mysqli_stmt_class_entry, &attr, &mode_in) == FAILURE) {
return;
@@ -2110,7 +2127,11 @@ PHP_FUNCTION(mysqli_stmt_attr_set)
}
mode = mode_in;
if ((rc = mysql_stmt_attr_set(stmt->stmt, attr, (void *)&mode))) {
#if !defined(MYSQLI_USE_MYSQLND)
if (FALSE == mysql_stmt_attr_set(stmt->stmt, attr, (void *)&mode)) {
#else
if (FAIL == mysql_stmt_attr_set(stmt->stmt, attr, (void *)&mode)) {
#endif
RETURN_FALSE;
}
RETURN_TRUE;
@@ -2281,7 +2302,8 @@ PHP_FUNCTION(mysqli_stmt_store_result)
for (i = mysql_stmt_field_count(stmt->stmt) - 1; i >=0; --i) {
if (stmt->stmt->fields && (stmt->stmt->fields[i].type == MYSQL_TYPE_BLOB ||
stmt->stmt->fields[i].type == MYSQL_TYPE_MEDIUM_BLOB ||
stmt->stmt->fields[i].type == MYSQL_TYPE_LONG_BLOB))
stmt->stmt->fields[i].type == MYSQL_TYPE_LONG_BLOB ||
stmt->stmt->fields[i].type == MYSQL_TYPE_GEOMETRY))
{
my_bool tmp=1;
mysql_stmt_attr_set(stmt->stmt, STMT_ATTR_UPDATE_MAX_LENGTH, &tmp);
+6 -2
View File
@@ -46,7 +46,11 @@ static void php_mysqli_set_error(long mysql_errno, char *mysql_err TSRMLS_DC)
if (MyG(error_msg)) {
efree(MyG(error_msg));
}
MyG(error_msg) = estrdup(mysql_err);
if(mysql_err && *mysql_err) {
MyG(error_msg) = estrdup(mysql_err);
} else {
MyG(error_msg) = NULL;
}
}
/* }}} */
@@ -217,7 +221,7 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne
MyG(num_active_persistent) + MyG(num_inactive_persistent));
goto err;
}
if (!is_real_connect && !mysql->mysql) {
if (!mysql->mysql) {
#if !defined(MYSQLI_USE_MYSQLND)
if (!(mysql->mysql = mysql_init(NULL))) {
#else
+2 -1
View File
@@ -73,8 +73,9 @@ enum mysqli_status {
};
typedef struct {
ulong buflen;
char *val;
ulong buflen;
ulong output_len;
ulong type;
} VAR_BUFFER;
+8 -8
View File
@@ -1,8 +1,8 @@
--TEST--
mysqli connect
--SKIPIF--
<?php
require_once('skipif.inc');
<?php
require_once('skipif.inc');
require_once('skipifemb.inc');
require_once('skipifconnectfailure.inc');
?>
@@ -13,25 +13,25 @@ require_once('skipifconnectfailure.inc');
$test = "";
/*** test mysqli_connect localhost:port ***/
$link = mysqli_connect($host, $user, $passwd, "", $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, "", $port, $socket);
$test .= ($link) ? "1" : "0";
mysqli_close($link);
/*** test mysqli_real_connect ***/
$link = mysqli_init();
$test.= (mysqli_real_connect($link, $host, $user, $passwd, "", $port, $socket) )
$test.= (my_mysqli_real_connect($link, $host, $user, $passwd, "", $port, $socket) )
? "1" : "0";
mysqli_close($link);
/*** test mysqli_real_connect with db ***/
$link = mysqli_init();
$test .= (mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket))
$test .= (my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket))
? "1" : "0";
mysqli_close($link);
/*** test mysqli_real_connect with port ***/
$link = mysqli_init();
$test .= (mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket))
$test .= (my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket))
? "1":"0";
mysqli_close($link);
@@ -40,7 +40,7 @@ require_once('skipifconnectfailure.inc');
if (!$link = mysqli_init())
printf("[001 + %d] mysqli_init() failed, [%d] %s\n", $i, mysqli_connect_errno(), mysqli_connect_error());
if (!mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket))
if (!my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket))
printf("[002 + %d] mysqli_real_connect() failed, [%d] %s\n", $i, mysqli_connect_errno(), mysqli_connect_error());
mysqli_close($link);
@@ -49,7 +49,7 @@ require_once('skipifconnectfailure.inc');
/*** test mysqli_real_connect compressed ***/
/*
$link = mysqli_init();
$test .= (mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket, MYSQLI_CLIENT_COMPRESS))
$test .= (my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket, MYSQLI_CLIENT_COMPRESS))
? "1" : "0";
mysqli_close($link);
*/
+2 -2
View File
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_fetch_null"))
@@ -49,7 +49,7 @@ require_once('skipifconnectfailure.inc');
--CLEAN--
<?php
include "connect.inc";
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_fetch_null"))
+2 -2
View File
@@ -9,7 +9,7 @@ require_once('skipifconnectfailure.inc');
<?php
include "connect.inc";
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
mysqli_query($link, "SET sql_mode=''");
@@ -75,7 +75,7 @@ require_once('skipifconnectfailure.inc');
--CLEAN--
<?php
include "connect.inc";
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result"))
+2 -2
View File
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
include ("connect.inc");
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
mysqli_select_db($link, $db);
@@ -50,7 +50,7 @@ require_once('skipifconnectfailure.inc');
--CLEAN--
<?php
include "connect.inc";
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
+5 -2
View File
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
@@ -32,6 +32,9 @@ require_once('skipifconnectfailure.inc');
var_dump($test);
/* this will crash with libmysql from PHP 5.0.6 (or earlier) to 5.3.0 */
mysqli_fetch($stmt);
mysqli_stmt_close($stmt);
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch");
mysqli_close($link);
@@ -40,7 +43,7 @@ require_once('skipifconnectfailure.inc');
--CLEAN--
<?php
include "connect.inc";
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
+2 -2
View File
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
if (!mysqli_query($link, "SET sql_mode=''"))
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
@@ -48,7 +48,7 @@ require_once('skipifconnectfailure.inc');
--CLEAN--
<?php
include "connect.inc";
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
+2 -2
View File
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
if (!mysqli_query($link, "SET sql_mode=''"))
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
@@ -48,7 +48,7 @@ require_once('skipifconnectfailure.inc');
--CLEAN--
<?php
include "connect.inc";
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
+2 -2
View File
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
if (!mysqli_query($link, "SET sql_mode=''"))
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
@@ -48,7 +48,7 @@ require_once('skipifconnectfailure.inc');
--CLEAN--
<?php
include "connect.inc";
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
+2 -2
View File
@@ -14,7 +14,7 @@ mysqli fetch bigint values (ok to fail with 4.1.x)
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
if (!mysqli_query($link, "SET sql_mode=''"))
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
@@ -81,7 +81,7 @@ mysqli fetch bigint values (ok to fail with 4.1.x)
--CLEAN--
<?php
include "connect.inc";
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
+2 -2
View File
@@ -12,7 +12,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
if (!mysqli_query($link, "SET sql_mode=''"))
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
@@ -51,7 +51,7 @@ require_once('skipifconnectfailure.inc');
--CLEAN--
<?php
include "connect.inc";
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
+2 -2
View File
@@ -12,7 +12,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result"))
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
@@ -48,7 +48,7 @@ require_once('skipifconnectfailure.inc');
--CLEAN--
<?php
include "connect.inc";
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result"))
+2 -2
View File
@@ -12,7 +12,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result"))
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
@@ -47,7 +47,7 @@ require_once('skipifconnectfailure.inc');
--CLEAN--
<?php
include "connect.inc";
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result"))
+2 -2
View File
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result"))
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
@@ -59,7 +59,7 @@ require_once('skipifconnectfailure.inc');
--CLEAN--
<?php
include "connect.inc";
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result"))
+2 -2
View File
@@ -5,7 +5,7 @@ mysqli autocommit/commit/rollback
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
include "connect.inc";
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
if (!$result = mysqli_query($link, "SHOW VARIABLES LIKE 'have_innodb'")) {
die("skip Cannot check for required InnoDB suppot");
}
@@ -22,7 +22,7 @@ mysqli autocommit/commit/rollback
--FILE--
<?php
include "connect.inc";
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
if (!mysqli_autocommit($link, TRUE))
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
+2 -2
View File
@@ -5,7 +5,7 @@ mysqli autocommit/commit/rollback with innodb
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
include "connect.inc";
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$result = mysqli_query($link, "SHOW VARIABLES LIKE 'have_innodb'");
$row = mysqli_fetch_row($result);
mysqli_free_result($result);
@@ -19,7 +19,7 @@ mysqli autocommit/commit/rollback with innodb
<?php
include "connect.inc";
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
if (!$link)
printf("[001] Cannot connect, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
+1 -1
View File
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
if (!mysqli_query($link, "SET @dummy='foobar'"))
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
+1 -1
View File
@@ -11,7 +11,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
if (!$stmt = mysqli_prepare($link, "SELECT md5('bar'), database(), 'foo'"))
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
+3 -3
View File
@@ -1,8 +1,8 @@
--TEST--
mysqli fetch system variables
--SKIPIF--
<?php
require_once('skipif.inc');
<?php
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
?>
--FILE--
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
if (!mysqli_query($link, "SET AUTOCOMMIT=0"))
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
+2 -2
View File
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
if (!mysqli_query($link, "DROP TABLE IF EXISTS insert_read"))
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
@@ -58,7 +58,7 @@ require_once('skipifconnectfailure.inc');
--CLEAN--
<?php
include "connect.inc";
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
if (!mysqli_query($link, "DROP TABLE IF EXISTS insert_read"))
+2 -2
View File
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
mysqli_select_db($link, $db);
mysqli_query($link, "SET sql_mode=''");
@@ -70,7 +70,7 @@ require_once('skipifconnectfailure.inc');
--CLEAN--
<?php
include "connect.inc";
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result"))
+2 -2
View File
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
mysqli_select_db($link, $db);
@@ -41,7 +41,7 @@ require_once('skipifconnectfailure.inc');
--CLEAN--
<?php
include "connect.inc";
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
+2 -2
View File
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
mysqli_select_db($link, $db);
@@ -46,7 +46,7 @@ require_once('skipifconnectfailure.inc');
--CLEAN--
<?php
include "connect.inc";
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
+2 -2
View File
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
mysqli_select_db($link, $db);
mysqli_query($link, "SET sql_mode=''");
@@ -55,7 +55,7 @@ require_once('skipifconnectfailure.inc');
--CLEAN--
<?php
include "connect.inc";
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
+2 -2
View File
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
mysqli_select_db($link, $db);
mysqli_query($link, "SET sql_mode=''");
@@ -55,7 +55,7 @@ require_once('skipifconnectfailure.inc');
--CLEAN--
<?php
include "connect.inc";
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
+2 -2
View File
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
mysqli_select_db($link, $db);
mysqli_query($link, "SET sql_mode=''");
@@ -60,7 +60,7 @@ require_once('skipifconnectfailure.inc');
--CLEAN--
<?php
include "connect.inc";
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
+2 -2
View File
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
mysqli_select_db($link, $db);
mysqli_query($link, "SET sql_mode=''");
@@ -47,7 +47,7 @@ require_once('skipifconnectfailure.inc');
--CLEAN--
<?php
include "connect.inc";
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
+3 -3
View File
@@ -1,8 +1,8 @@
--TEST--
function test: mysqli_stat
--SKIPIF--
<?php
require_once('skipif.inc');
<?php
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
?>
--FILE--
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$status = mysqli_stat($link);
+1 -1
View File
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$cset = substr(mysqli_character_set_name($link),0,6);
+2 -2
View File
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
mysqli_select_db($link, $db);
@@ -29,7 +29,7 @@ require_once('skipifconnectfailure.inc');
--CLEAN--
<?php
include "connect.inc";
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
if (!mysqli_query($link, "DROP TABLE IF EXISTS general_test"))
+1 -1
View File
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$errno = mysqli_errno($link);
var_dump($errno);
+1 -1
View File
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$error = mysqli_error($link);
var_dump($error);
+2 -2
View File
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
mysqli_select_db($link, $db);
@@ -29,7 +29,7 @@ require_once('skipifconnectfailure.inc');
--CLEAN--
<?php
include "connect.inc";
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
if (!mysqli_query($link, "DROP TABLE IF EXISTS general_test"))
+1 -1
View File
@@ -11,7 +11,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$hinfo = mysqli_get_host_info($link);
+3 -3
View File
@@ -1,8 +1,8 @@
--TEST--
function test: mysqli_get_proto_info
--SKIPIF--
<?php
require_once('skipif.inc');
<?php
require_once('skipif.inc');
require_once('skipifemb.inc');
require_once('skipifconnectfailure.inc');
?>
@@ -11,7 +11,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$pinfo = mysqli_get_proto_info($link);
+3 -3
View File
@@ -1,8 +1,8 @@
--TEST--
function test: mysqli_get_server_info
--SKIPIF--
<?php
require_once('skipif.inc');
<?php
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
?>
--FILE--
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$sinfo = substr(mysqli_get_server_info($link),0,1);
+2 -2
View File
@@ -14,7 +14,7 @@ function test: mysqli_insert_id()
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
mysqli_select_db($link, $db);
@@ -45,7 +45,7 @@ function test: mysqli_insert_id()
--CLEAN--
<?php
include "connect.inc";
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
if (!mysqli_query($link, "DROP TABLE IF EXISTS t036"))
+2 -2
View File
@@ -11,7 +11,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
mysqli_select_db($link, $db);
@@ -35,7 +35,7 @@ require_once('skipifconnectfailure.inc');
--CLEAN--
<?php
include "connect.inc";
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_result"))
+2 -2
View File
@@ -11,7 +11,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
mysqli_select_db($link, $db);
@@ -36,7 +36,7 @@ require_once('skipifconnectfailure.inc');
--CLEAN--
<?php
include "connect.inc";
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_result"))
+1 -1
View File
@@ -11,7 +11,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
mysqli_real_query($link, "SHOW VARIABLES");
+2 -2
View File
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
mysqli_select_db($link, $db);
@@ -34,7 +34,7 @@ require_once('skipifconnectfailure.inc');
--CLEAN--
<?php
include "connect.inc";
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_result"))
+2 -2
View File
@@ -11,7 +11,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
mysqli_select_db($link, $db);
mysqli_query($link, "DROP TABLE IF EXISTS test_warnings");
@@ -25,7 +25,7 @@ require_once('skipifconnectfailure.inc');
--CLEAN--
<?php
include "connect.inc";
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_warnings"))
+2 -2
View File
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
mysqli_select_db($link, $db);
mysqli_query($link, "SET sql_mode=''");
@@ -51,7 +51,7 @@ require_once('skipifconnectfailure.inc');
--CLEAN--
<?php
include "connect.inc";
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
+2 -2
View File
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
mysqli_select_db($link, $db);
@@ -43,7 +43,7 @@ require_once('skipifconnectfailure.inc');
--CLEAN--
<?php
include "connect.inc";
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_update"))
+3 -3
View File
@@ -1,8 +1,8 @@
--TEST--
mysqli_get_server_version
--SKIPIF--
<?php
require_once('skipif.inc');
<?php
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
?>
--FILE--
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$i = mysqli_get_server_version($link);
+2 -2
View File
@@ -7,7 +7,7 @@ mysqli_bind_result (SHOW)
require_once('skipifconnectfailure.inc');
include "connect.inc";
$link = mysqli_connect($host, $user, $passwd);
$link = my_mysqli_connect($host, $user, $passwd);
$stmt = mysqli_prepare($link, "SHOW VARIABLES LIKE 'port'");
mysqli_execute($stmt);
@@ -23,7 +23,7 @@ mysqli_bind_result (SHOW)
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$stmt = mysqli_prepare($link, "SHOW VARIABLES LIKE 'port'");
mysqli_execute($stmt);
+2 -2
View File
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
mysqli_select_db($link, $db);
@@ -37,7 +37,7 @@ require_once('skipifconnectfailure.inc');
--CLEAN--
<?php
include "connect.inc";
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_affected"))
+2 -2
View File
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
mysqli_select_db($link, $db);
@@ -48,7 +48,7 @@ require_once('skipifconnectfailure.inc');
--CLEAN--
<?php
include "connect.inc";
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_affected"))
+2 -2
View File
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$mysql = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$mysql = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$mysql->select_db($db);
$mysql->query("DROP TABLE IF EXISTS test_fetch_null");
@@ -43,7 +43,7 @@ require_once('skipifconnectfailure.inc');
--CLEAN--
<?php
include "connect.inc";
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_fetch_null"))
+3 -1
View File
@@ -11,7 +11,7 @@ require_once('skipifconnectfailure.inc');
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
$mysql = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$mysql = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$mysql->select_db($db);
$result = $mysql->query("SELECT DATABASE()");
@@ -19,6 +19,8 @@ require_once('skipifconnectfailure.inc');
$result->close();
var_dump($row);
if ($row[0] != $db)
printf("[001] Expecting '%s' got '%s'\n", $db, $row[0]);
$mysql->close();
print "done!";
+3 -3
View File
@@ -1,8 +1,8 @@
--TEST--
non freed statement test
--SKIPIF--
<?php
require_once('skipif.inc');
<?php
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
?>
--FILE--
@@ -12,7 +12,7 @@ require_once('skipifconnectfailure.inc');
/************************
* non freed stamement
************************/
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$stmt = mysqli_prepare($link, "SELECT CURRENT_USER()");
mysqli_execute($stmt);
Loaded 100 of 336 files, more files were not shown because too many files have changed in this diff. Show more