mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-26 02:15:42 +00:00
Compare commits
65
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0183c29cb3 | ||
|
|
904d2202ea | ||
|
|
24236fb476 | ||
|
|
2cae43d1d6 | ||
|
|
1b8431535d | ||
|
|
f2b5b9d69e | ||
|
|
c5b33c754c | ||
|
|
fdf1231f66 | ||
|
|
7a6e76fd2f | ||
|
|
1433854681 | ||
|
|
264279439b | ||
|
|
ec53b60072 | ||
|
|
93fd9c704b | ||
|
|
5382e156f9 | ||
|
|
3e6d633a0d | ||
|
|
122570443b | ||
|
|
38bf6951b3 | ||
|
|
b8b3bb08b2 | ||
|
|
aa0adce47d | ||
|
|
86c1a26169 | ||
|
|
9e7c2e5906 | ||
|
|
33b104c778 | ||
|
|
b69fd9c9b8 | ||
|
|
77ee200097 | ||
|
|
a85ae16e74 | ||
|
|
be2f547497 | ||
|
|
94a4e0f823 | ||
|
|
142c40f32c | ||
|
|
f63a9f6c11 | ||
|
|
9498cf6194 | ||
|
|
4c38003dbd | ||
|
|
93e35137aa | ||
|
|
930ef9ddd6 | ||
|
|
83864b470b | ||
|
|
b1bf524140 | ||
|
|
c077074c13 | ||
|
|
374ebc8741 | ||
|
|
0510701474 | ||
|
|
3bc7490370 | ||
|
|
4fcf4e0845 | ||
|
|
a4191b0aad | ||
|
|
9b5cb0e805 | ||
|
|
6a065876b9 | ||
|
|
bf9ad4e661 | ||
|
|
1e9a3ed234 | ||
|
|
99d087e5d4 | ||
|
|
d7bac4f5ba | ||
|
|
e5029ac40b | ||
|
|
93d1171c47 | ||
|
|
cddbb98ada | ||
|
|
2111ee3df5 | ||
|
|
ccf15cf2dc | ||
|
|
1a96fe0b32 | ||
|
|
c6203da6c2 | ||
|
|
a06313fe5a | ||
|
|
046ae2f77c | ||
|
|
e1410b5a70 | ||
|
|
36e88d78e6 | ||
|
|
f659ec108f | ||
|
|
dc9f0e70b7 | ||
|
|
d430b5a4eb | ||
|
|
258c76eb41 | ||
|
|
bcd278ad7f | ||
|
|
6a6ec195ac | ||
|
|
12e759c2ea |
No files matched your search
@@ -1,22 +1,61 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? 2012, PHP 5.4.12
|
||||
21 Feb 2012, PHP 5.4.12
|
||||
|
||||
- Core:
|
||||
. Fixed bug #64099 (Wrong TSRM usage in zend_Register_class alias). (Johannes)
|
||||
. Fixed bug #64011 (get_html_translation_table() output incomplete with
|
||||
HTML_ENTITIES and ISO-8859-1). (Gustavo)
|
||||
. Fixed bug #63982 (isset() inconsistently produces a fatal error on
|
||||
protected property). (Stas)
|
||||
. Fixed bug #63943 (Bad warning text from strpos() on empty needle).
|
||||
(Laruence)
|
||||
. Fixed bug #63899 (Use after scope error in zend_compile). (Laruence)
|
||||
. Fixed bug #63893 (Poor efficiency of strtr() using array with keys of very
|
||||
different length). (Gustavo)
|
||||
. Fixed bug #63882 (zend_std_compare_objects crash on recursion). (Dmitry)
|
||||
. Fixed bug #63462 (Magic methods called twice for unset protected
|
||||
properties). (Stas)
|
||||
. Fixed bug #62524 (fopen follows redirects for non-3xx statuses).
|
||||
(Wes Mason)
|
||||
. Support BITMAPV5HEADER in getimagesize(). (AsamK, Lars)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #63699 (Performance improvements for various ext/date functions).
|
||||
(Lars, original patch by njaguar at gmail dot com)
|
||||
. Fixed bug #55397: Comparsion of incomplete DateTime causes SIGSEGV.
|
||||
(Derick)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #63999 (php with fpm fails to build on Solaris 10 or 11). (Adam)
|
||||
|
||||
- Litespeed:
|
||||
. Fixed bug #63228 (-Werror=format-security error in lsapi code). (George)
|
||||
|
||||
?? ??? 2012, PHP 5.4.11
|
||||
- SOAP
|
||||
. Added check that soap.wsdl_cache_dir conforms to open_basedir
|
||||
(CVE-2013-1635). (Dmitry)
|
||||
. Disabled external entities loading (CVE-2013-1643). (Dmitry)
|
||||
|
||||
- sqlite3:
|
||||
. Fixed bug #63921 (sqlite3::bindvalue and relative PHP functions aren't
|
||||
using sqlite3_*_int64 API). (srgoogleguy, Lars)
|
||||
|
||||
- PDO_OCI
|
||||
. Fixed bug #57702 (Multi-row BLOB fetches). (hswong3i, Laruence)
|
||||
. Fixed bug #52958 (Segfault in PDO_OCI on cleanup after running a long
|
||||
testsuite). (hswong3i, Lars)
|
||||
|
||||
- PDO_sqlite:
|
||||
. Fixed bug #63916 (PDO::PARAM_INT casts to 32bit int internally even
|
||||
on 64bit builds in pdo_sqlite). (srgoogleguy, Lars)
|
||||
|
||||
17 Jan 2012, PHP 5.4.11
|
||||
|
||||
- Core:
|
||||
. Fixed bug #63899 (Use after scope error in zend_compile). (Laruence)
|
||||
. Fixed bug #63762 (Sigsegv when Exception::$trace is changed by user).
|
||||
(Johannes)
|
||||
. Fixed bug #43177 (Errors in eval()'ed code produce status code 500).
|
||||
. Fixed bug #43177 (Errors in eval()'ed code produce status code 500).
|
||||
(Todd Ruth, Stas).
|
||||
|
||||
- Filter:
|
||||
@@ -42,10 +81,6 @@ PHP NEWS
|
||||
. Fixed bug #55438 (Curlwapper is not sending http header randomly).
|
||||
(phpnet@lostreality.org, Pierrick)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #63699 (Performance improvements for various ext/date functions).
|
||||
(Lars, original patch by njaguar at gmail dot com)
|
||||
|
||||
20 Dec 2012, PHP 5.4.10
|
||||
|
||||
- Core:
|
||||
|
||||
@@ -15,7 +15,7 @@ $f = fopen("/tmp/blah", "r");
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
fopen(/tmp/blah): failed to open stream: No such file or directory (2) in %s:%d
|
||||
fopen(/tmp/blah): failed to open stream: %s (2) in %s:%d
|
||||
|
||||
Warning: fopen(/tmp/blah): failed to open stream: No such file or directory in %s on line %d
|
||||
Warning: fopen(/tmp/blah): failed to open stream: %s in %s on line %d
|
||||
===DONE===
|
||||
@@ -10,7 +10,7 @@ set_error_handler(function($errno, $errstr, $errfile, $errline){
|
||||
|
||||
require 'notfound.php';
|
||||
--EXPECTF--
|
||||
error(require(notfound.php): failed to open stream: No such file or directory)
|
||||
error(require(notfound.php): failed to open stream: %s)
|
||||
Warning: Uncaught exception 'Exception' with message 'Foo' in %sbug60909_1.php:5
|
||||
Stack trace:
|
||||
#0 %sbug60909_1.php(8): {closure}(2, 'require(notfoun...', '%s', 8, Array)
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
--TEST--
|
||||
Test script to verify that magic methods should be called only once when accessing an unset property.
|
||||
--CREDITS--
|
||||
Marco Pivetta <ocramius@gmail.com>
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
public $publicProperty;
|
||||
protected $protectedProperty;
|
||||
private $privateProperty;
|
||||
|
||||
public function __construct() {
|
||||
unset(
|
||||
$this->publicProperty,
|
||||
$this->protectedProperty,
|
||||
$this->privateProperty
|
||||
);
|
||||
}
|
||||
|
||||
function __get($name) {
|
||||
echo '__get ' . $name . "\n";
|
||||
return $this->$name;
|
||||
}
|
||||
|
||||
function __set($name, $value) {
|
||||
echo '__set ' . $name . "\n";
|
||||
$this->$name = $value;
|
||||
}
|
||||
|
||||
function __isset($name) {
|
||||
echo '__isset ' . $name . "\n";
|
||||
return isset($this->$name);
|
||||
}
|
||||
}
|
||||
|
||||
$test = new Test();
|
||||
|
||||
$test->nonExisting;
|
||||
$test->publicProperty;
|
||||
$test->protectedProperty;
|
||||
$test->privateProperty;
|
||||
isset($test->nonExisting);
|
||||
isset($test->publicProperty);
|
||||
isset($test->protectedProperty);
|
||||
isset($test->privateProperty);
|
||||
$test->nonExisting = 'value';
|
||||
$test->publicProperty = 'value';
|
||||
$test->protectedProperty = 'value';
|
||||
$test->privateProperty = 'value';
|
||||
|
||||
?>
|
||||
|
||||
--EXPECTF--
|
||||
__get nonExisting
|
||||
|
||||
Notice: Undefined property: Test::$nonExisting in %s on line %d
|
||||
__get publicProperty
|
||||
|
||||
Notice: Undefined property: Test::$publicProperty in %s on line %d
|
||||
__get protectedProperty
|
||||
|
||||
Notice: Undefined property: Test::$protectedProperty in %s on line %d
|
||||
__get privateProperty
|
||||
|
||||
Notice: Undefined property: Test::$privateProperty in %s on line %d
|
||||
__isset nonExisting
|
||||
__isset publicProperty
|
||||
__isset protectedProperty
|
||||
__isset privateProperty
|
||||
__set nonExisting
|
||||
__set publicProperty
|
||||
__set protectedProperty
|
||||
__set privateProperty
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #63982 (isset() inconsistently produces a fatal error on protected property)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
protected $protectedProperty;
|
||||
}
|
||||
|
||||
$test = new Test();
|
||||
|
||||
var_dump(isset($test->protectedProperty));
|
||||
var_dump(isset($test->protectedProperty->foo));
|
||||
--EXPECTF--
|
||||
bool(false)
|
||||
bool(false)
|
||||
+2
-2
@@ -279,9 +279,9 @@ ZEND_API void zend_class_implements(zend_class_entry *class_entry TSRMLS_DC, int
|
||||
ZEND_API int zend_register_class_alias_ex(const char *name, int name_len, zend_class_entry *ce TSRMLS_DC);
|
||||
|
||||
#define zend_register_class_alias(name, ce) \
|
||||
zend_register_class_alias_ex(name, sizeof(name)-1, ce TSRMLS_DC)
|
||||
zend_register_class_alias_ex(name, sizeof(name)-1, ce TSRMLS_CC)
|
||||
#define zend_register_ns_class_alias(ns, name, ce) \
|
||||
zend_register_class_alias_ex(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, ce TSRMLS_DC)
|
||||
zend_register_class_alias_ex(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, ce TSRMLS_CC)
|
||||
|
||||
ZEND_API int zend_disable_function(char *function_name, uint function_name_length TSRMLS_DC);
|
||||
ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_DC);
|
||||
|
||||
@@ -393,6 +393,16 @@ static int zend_get_property_guard(zend_object *zobj, zend_property_info *proper
|
||||
info.name = Z_STRVAL_P(member);
|
||||
info.name_length = Z_STRLEN_P(member);
|
||||
info.h = zend_get_hash_value(Z_STRVAL_P(member), Z_STRLEN_P(member) + 1);
|
||||
} else if(property_info->name[0] == '\0'){
|
||||
const char *class_name = NULL, *prop_name = NULL;
|
||||
zend_unmangle_property_name(property_info->name, property_info->name_length, &class_name, &prop_name);
|
||||
if(class_name) {
|
||||
/* use unmangled name for protected properties */
|
||||
info.name = prop_name;
|
||||
info.name_length = strlen(prop_name);
|
||||
info.h = zend_get_hash_value(info.name, info.name_length+1);
|
||||
property_info = &info;
|
||||
}
|
||||
}
|
||||
if (!zobj->guards) {
|
||||
ALLOC_HASHTABLE(zobj->guards);
|
||||
@@ -435,7 +445,7 @@ zval *zend_std_read_property(zval *object, zval *member, int type, const zend_li
|
||||
#endif
|
||||
|
||||
/* make zend_get_property_info silent if we have getter - we may want to use it */
|
||||
property_info = zend_get_property_info_quick(zobj->ce, member, (zobj->ce->__get != NULL), key TSRMLS_CC);
|
||||
property_info = zend_get_property_info_quick(zobj->ce, member, silent || (zobj->ce->__get != NULL), key TSRMLS_CC);
|
||||
|
||||
if (UNEXPECTED(!property_info) ||
|
||||
((EXPECTED((property_info->flags & ZEND_ACC_STATIC) == 0) &&
|
||||
|
||||
+3
-15
@@ -974,27 +974,15 @@ ZEND_VM_HANDLER(40, ZEND_ECHO, CONST|TMP|VAR|CV, ANY)
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_free_op free_op1;
|
||||
zval z_copy;
|
||||
zval *z;
|
||||
|
||||
SAVE_OPLINE();
|
||||
z = GET_OP1_ZVAL_PTR(BP_VAR_R);
|
||||
|
||||
if (OP1_TYPE != IS_CONST &&
|
||||
UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) &&
|
||||
Z_OBJ_HT_P(z)->get_method != NULL) {
|
||||
if (OP1_TYPE == IS_TMP_VAR) {
|
||||
INIT_PZVAL(z);
|
||||
}
|
||||
if (zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
|
||||
zend_print_variable(&z_copy);
|
||||
zval_dtor(&z_copy);
|
||||
} else {
|
||||
zend_print_variable(z);
|
||||
}
|
||||
} else {
|
||||
zend_print_variable(z);
|
||||
if (OP1_TYPE == IS_TMP_VAR && Z_TYPE_P(z) == IS_OBJECT) {
|
||||
INIT_PZVAL(z);
|
||||
}
|
||||
zend_print_variable(z);
|
||||
|
||||
FREE_OP1();
|
||||
CHECK_EXCEPTION();
|
||||
|
||||
+12
-60
@@ -2024,27 +2024,15 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
{
|
||||
USE_OPLINE
|
||||
|
||||
zval z_copy;
|
||||
zval *z;
|
||||
|
||||
SAVE_OPLINE();
|
||||
z = opline->op1.zv;
|
||||
|
||||
if (IS_CONST != IS_CONST &&
|
||||
UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) &&
|
||||
Z_OBJ_HT_P(z)->get_method != NULL) {
|
||||
if (IS_CONST == IS_TMP_VAR) {
|
||||
INIT_PZVAL(z);
|
||||
}
|
||||
if (zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
|
||||
zend_print_variable(&z_copy);
|
||||
zval_dtor(&z_copy);
|
||||
} else {
|
||||
zend_print_variable(z);
|
||||
}
|
||||
} else {
|
||||
zend_print_variable(z);
|
||||
if (IS_CONST == IS_TMP_VAR && Z_TYPE_P(z) == IS_OBJECT) {
|
||||
INIT_PZVAL(z);
|
||||
}
|
||||
zend_print_variable(z);
|
||||
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
@@ -6443,27 +6431,15 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_free_op free_op1;
|
||||
zval z_copy;
|
||||
zval *z;
|
||||
|
||||
SAVE_OPLINE();
|
||||
z = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
|
||||
if (IS_TMP_VAR != IS_CONST &&
|
||||
UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) &&
|
||||
Z_OBJ_HT_P(z)->get_method != NULL) {
|
||||
if (IS_TMP_VAR == IS_TMP_VAR) {
|
||||
INIT_PZVAL(z);
|
||||
}
|
||||
if (zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
|
||||
zend_print_variable(&z_copy);
|
||||
zval_dtor(&z_copy);
|
||||
} else {
|
||||
zend_print_variable(z);
|
||||
}
|
||||
} else {
|
||||
zend_print_variable(z);
|
||||
if (IS_TMP_VAR == IS_TMP_VAR && Z_TYPE_P(z) == IS_OBJECT) {
|
||||
INIT_PZVAL(z);
|
||||
}
|
||||
zend_print_variable(z);
|
||||
|
||||
zval_dtor(free_op1.var);
|
||||
CHECK_EXCEPTION();
|
||||
@@ -10761,27 +10737,15 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_free_op free_op1;
|
||||
zval z_copy;
|
||||
zval *z;
|
||||
|
||||
SAVE_OPLINE();
|
||||
z = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
|
||||
|
||||
if (IS_VAR != IS_CONST &&
|
||||
UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) &&
|
||||
Z_OBJ_HT_P(z)->get_method != NULL) {
|
||||
if (IS_VAR == IS_TMP_VAR) {
|
||||
INIT_PZVAL(z);
|
||||
}
|
||||
if (zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
|
||||
zend_print_variable(&z_copy);
|
||||
zval_dtor(&z_copy);
|
||||
} else {
|
||||
zend_print_variable(z);
|
||||
}
|
||||
} else {
|
||||
zend_print_variable(z);
|
||||
if (IS_VAR == IS_TMP_VAR && Z_TYPE_P(z) == IS_OBJECT) {
|
||||
INIT_PZVAL(z);
|
||||
}
|
||||
zend_print_variable(z);
|
||||
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
CHECK_EXCEPTION();
|
||||
@@ -26741,27 +26705,15 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
{
|
||||
USE_OPLINE
|
||||
|
||||
zval z_copy;
|
||||
zval *z;
|
||||
|
||||
SAVE_OPLINE();
|
||||
z = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
|
||||
|
||||
if (IS_CV != IS_CONST &&
|
||||
UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) &&
|
||||
Z_OBJ_HT_P(z)->get_method != NULL) {
|
||||
if (IS_CV == IS_TMP_VAR) {
|
||||
INIT_PZVAL(z);
|
||||
}
|
||||
if (zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
|
||||
zend_print_variable(&z_copy);
|
||||
zval_dtor(&z_copy);
|
||||
} else {
|
||||
zend_print_variable(z);
|
||||
}
|
||||
} else {
|
||||
zend_print_variable(z);
|
||||
if (IS_CV == IS_TMP_VAR && Z_TYPE_P(z) == IS_OBJECT) {
|
||||
INIT_PZVAL(z);
|
||||
}
|
||||
zend_print_variable(z);
|
||||
|
||||
CHECK_EXCEPTION();
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
|
||||
+1
-1
@@ -120,7 +120,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
PHP_MAJOR_VERSION=5
|
||||
PHP_MINOR_VERSION=4
|
||||
PHP_RELEASE_VERSION=12
|
||||
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`
|
||||
|
||||
|
||||
@@ -838,6 +838,9 @@ PHP_MINIT_FUNCTION(mysqli)
|
||||
REGISTER_LONG_CONSTANT("MYSQLI_REFRESH_BACKUP_LOG", REFRESH_BACKUP_LOG, CONST_CS | CONST_PERSISTENT);
|
||||
#endif
|
||||
|
||||
#if MYSQL_VERSION_ID >= 50611 || defined(MYSQLI_USE_MYSQLND)
|
||||
REGISTER_LONG_CONSTANT("MYSQLI_OPT_CAN_HANDLE_EXPIRED_PASSWORDS", MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS, CONST_CS | CONST_PERSISTENT);
|
||||
#endif
|
||||
|
||||
#ifdef MYSQLI_USE_MYSQLND
|
||||
mysqlnd_reverse_api_register_api(&mysqli_reverse_api TSRMLS_CC);
|
||||
|
||||
@@ -1672,6 +1672,9 @@ static int mysqli_options_get_option_zval_type(int option)
|
||||
#ifdef MYSQL_OPT_SSL_VERIFY_SERVER_CERT
|
||||
REGISTER_LONG_CONSTANT("MYSQLI_OPT_SSL_VERIFY_SERVER_CERT", MYSQL_OPT_SSL_VERIFY_SERVER_CERT, CONST_CS | CONST_PERSISTENT);
|
||||
#endif /* MySQL 5.1.1., mysqlnd @ PHP 5.3.3 */
|
||||
#if MYSQL_VERSION_ID >= 50611 || defined(MYSQLI_USE_MYSQLND)
|
||||
case MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS:
|
||||
#endif
|
||||
return IS_LONG;
|
||||
|
||||
#ifdef MYSQL_SHARED_MEMORY_BASE_NAME
|
||||
|
||||
@@ -176,6 +176,10 @@ require_once('skipifconnectfailure.inc');
|
||||
}
|
||||
}
|
||||
|
||||
if (($IS_MYSQLND && version_compare(PHP_VERSION, ' 5.4.12-dev', '>=')) || (!$IS_MYSQLND && ($version > 50610))) {
|
||||
/* could be that MySQL/libmysql 5.6.9 had the flag already but it was no stable release */
|
||||
$expected_constants["MYSQLI_OPT_CAN_HANDLE_EXPIRED_PASSWORDS"] = true;
|
||||
}
|
||||
|
||||
$unexpected_constants = array();
|
||||
|
||||
|
||||
@@ -0,0 +1,145 @@
|
||||
--TEST--
|
||||
MySQL 5.6 EXPIRE PASSWORD protocol change
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
require_once('skipifemb.inc');
|
||||
require_once('connect.inc');
|
||||
|
||||
if ($IS_MYSQLND && !version_compare(PHP_VERSION, '5.4.12-dev', ">=")) {
|
||||
die("SKIP Available in mysqlnd as of PHP 5.4.12-dev");
|
||||
}
|
||||
|
||||
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
|
||||
die(sprintf("SKIP Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
|
||||
$host, $user, $db, $port, $socket));
|
||||
}
|
||||
|
||||
if ($link->server_version < 50610)
|
||||
die(sprintf("SKIP Needs MySQL 5.6.10 or newer, found MySQL %s\n", $link->server_info));
|
||||
|
||||
if (!$IS_MYSQLND && (mysqli_get_client_version() < 50610)) {
|
||||
die(sprintf("SKIP Needs libmysql 5.6.10 or newer, found %s\n", mysqli_get_client_version()));
|
||||
}
|
||||
|
||||
mysqli_query($link, 'DROP USER expiretest');
|
||||
mysqli_query($link, 'DROP USER expiretest@localhost');
|
||||
|
||||
if (!mysqli_query($link, 'CREATE USER expiretest@"%"') ||
|
||||
!mysqli_query($link, 'CREATE USER expiretest@"localhost"')) {
|
||||
printf("skip Cannot create second DB user [%d] %s", mysqli_errno($link), mysqli_error($link));
|
||||
mysqli_close($link);
|
||||
die("skip CREATE USER failed");
|
||||
}
|
||||
|
||||
if (!mysqli_query($link, 'ALTER USER expiretest@"%" PASSWORD EXPIRE') ||
|
||||
!mysqli_query($link, 'ALTER USER expiretest@"localhost" PASSWORD EXPIRE')) {
|
||||
printf("skip Cannot modify second DB user [%d] %s", mysqli_errno($link), mysqli_error($link));
|
||||
mysqli_close($link);
|
||||
die("skip ALTER USER failed");
|
||||
}
|
||||
|
||||
if (!$link->query("DROP TABLE IF EXISTS test") ||
|
||||
!$link->query("CREATE TABLE test (id INT)") || !$link->query("INSERT INTO test(id) VALUES (1)"))
|
||||
die(sprintf("SKIP [%d] %s\n", $link->errno, $link->error));
|
||||
|
||||
|
||||
|
||||
if (!mysqli_query($link, sprintf("GRANT SELECT ON TABLE %s.test TO expiretest@'%%'", $db)) ||
|
||||
!mysqli_query($link, sprintf("GRANT SELECT ON TABLE %s.test TO expiretest@'localhost'", $db))) {
|
||||
printf("skip Cannot grant SELECT to user [%d] %s", mysqli_errno($link), mysqli_error($link));
|
||||
mysqli_close($link);
|
||||
die("skip GRANT failed");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once('connect.inc');
|
||||
require_once('table.inc');
|
||||
|
||||
/* default */
|
||||
if (!$link = my_mysqli_connect($host, 'expiretest', "", $db, $port, $socket)) {
|
||||
printf("[001] Cannot connect [%d] %s\n",
|
||||
mysqli_connect_errno(), mysqli_connect_error());
|
||||
} else {
|
||||
$link->query("SELECT id FROM test WHERE id = 1");
|
||||
printf("[002] Connect should fail, [%d] %s\n", $link->errno, $link->error);
|
||||
}
|
||||
|
||||
/* explicitly requesting default */
|
||||
$link = mysqli_init();
|
||||
$link->options(MYSQLI_OPT_CAN_HANDLE_EXPIRED_PASSWORDS, 0);
|
||||
if (!my_mysqli_real_connect($link, $host, 'expiretest', "", $db, $port, $socket)) {
|
||||
printf("[003] Cannot connect [%d] %s\n",
|
||||
mysqli_connect_errno(), mysqli_connect_error());
|
||||
} else {
|
||||
$link->query("SELECT id FROM test WHERE id = 1");
|
||||
printf("[004] Connect should fail, [%d] %s\n", $link->errno, $link->error);
|
||||
}
|
||||
|
||||
/* allow connect */
|
||||
$link = mysqli_init();
|
||||
$link->options(MYSQLI_OPT_CAN_HANDLE_EXPIRED_PASSWORDS, 1);
|
||||
if (!my_mysqli_real_connect($link, $host, 'expiretest', "", $db, $port, $socket)) {
|
||||
printf("[005] Cannot connect [%d] %s\n",
|
||||
mysqli_connect_errno(), mysqli_connect_error());
|
||||
} else {
|
||||
$link->query("SELECT id FROM test WHERE id = 1");
|
||||
printf("[006] Connect allowed, query fail, [%d] %s\n", $link->errno, $link->error);
|
||||
$link->close();
|
||||
}
|
||||
|
||||
/* allow connect, fix pw */
|
||||
$link = mysqli_init();
|
||||
$link->options(MYSQLI_OPT_CAN_HANDLE_EXPIRED_PASSWORDS, 1);
|
||||
if (!my_mysqli_real_connect($link, $host, 'expiretest', "", $db, $port, $socket)) {
|
||||
printf("[007] Cannot connect [%d] %s\n",
|
||||
mysqli_connect_errno(), mysqli_connect_error());
|
||||
} else {
|
||||
$link->query("SET PASSWORD=PASSWORD('expiretest')");
|
||||
printf("[008] Connect allowed, pw set, [%d] %s\n", $link->errno, $link->error);
|
||||
if ($res = $link->query("SELECT id FROM test WHERE id = 1"))
|
||||
var_dump($res->fetch_assoc());
|
||||
$link->close();
|
||||
}
|
||||
|
||||
|
||||
/* check login */
|
||||
if (!$link = my_mysqli_connect($host, 'expiretest', "expiretest", $db, $port, $socket)) {
|
||||
printf("[001] Cannot connect [%d] %s\n",
|
||||
mysqli_connect_errno(), mysqli_connect_error());
|
||||
} else {
|
||||
$link->query("SELECT id FROM test WHERE id = 1");
|
||||
if ($res = $link->query("SELECT id FROM test WHERE id = 1"))
|
||||
var_dump($res->fetch_assoc());
|
||||
$link->close();
|
||||
}
|
||||
|
||||
|
||||
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require_once("clean_table.inc");
|
||||
mysqli_query($link, 'DROP USER expiretest');
|
||||
mysqli_query($link, 'DROP USER expiretest@localhost');
|
||||
?>
|
||||
--EXPECTF--
|
||||
|
||||
Warning: mysqli_real_connect(): (HY000/1820): %s in %s on line %d
|
||||
[001] Cannot connect [1820] %s
|
||||
|
||||
Warning: mysqli_real_connect(): (HY000/1820): %s in %s on line %d
|
||||
[003] Cannot connect [1820] %s
|
||||
[006] Connect allowed, query fail, [1820] %s
|
||||
[008] Connect allowed, pw set, [0%A
|
||||
array(1) {
|
||||
["id"]=>
|
||||
string(1) "1"
|
||||
}
|
||||
array(1) {
|
||||
["id"]=>
|
||||
string(1) "1"
|
||||
}
|
||||
done!
|
||||
+10
-1
@@ -774,6 +774,8 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
|
||||
/* we allow load data local infile by default */
|
||||
mysql_flags |= MYSQLND_CAPABILITIES;
|
||||
|
||||
mysql_flags |= conn->options->flags; /* use the flags from set_client_option() */
|
||||
|
||||
if (db) {
|
||||
mysql_flags |= CLIENT_CONNECT_WITH_DB;
|
||||
}
|
||||
@@ -2284,7 +2286,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option)(MYSQLND_CONN_DATA * const c
|
||||
break;
|
||||
#endif
|
||||
case MYSQL_OPT_LOCAL_INFILE:
|
||||
if (!value || (*(unsigned int*) value) ? 1 : 0) {
|
||||
if (value && (*(unsigned int*) value) ? 1 : 0) {
|
||||
conn->options->flags |= CLIENT_LOCAL_FILES;
|
||||
} else {
|
||||
conn->options->flags &= ~CLIENT_LOCAL_FILES;
|
||||
@@ -2368,6 +2370,13 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option)(MYSQLND_CONN_DATA * const c
|
||||
DBG_INF_FMT("auth_protocol=%s", conn->options->auth_protocol);
|
||||
break;
|
||||
}
|
||||
case MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS:
|
||||
if (value && (*(unsigned int*) value) ? 1 : 0) {
|
||||
conn->options->flags |= CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS;
|
||||
} else {
|
||||
conn->options->flags &= ~CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS;
|
||||
}
|
||||
break;
|
||||
#ifdef WHEN_SUPPORTED_BY_MYSQLI
|
||||
case MYSQL_SHARED_MEMORY_BASE_NAME:
|
||||
case MYSQL_OPT_USE_RESULT:
|
||||
|
||||
@@ -95,7 +95,9 @@
|
||||
#define CLIENT_MULTI_RESULTS (1UL << 17) /* Enable/disable multi-results */
|
||||
#define CLIENT_PS_MULTI_RESULTS (1UL << 18) /* Multi-results in PS-protocol */
|
||||
#define CLIENT_PLUGIN_AUTH (1UL << 19) /* Client supports plugin authentication */
|
||||
|
||||
#define CLIENT_CONNECT_ATTRS (1UL << 20) /* Client supports connection attributes */
|
||||
#define CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA (1UL << 21) /* Enable authentication response packet to be larger than 255 bytes. */
|
||||
#define CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS (1UL << 22) /* Don't close the connection for a connection with expired password. */
|
||||
#define CLIENT_SSL_VERIFY_SERVER_CERT (1UL << 30)
|
||||
|
||||
#define MYSQLND_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | CLIENT_TRANSACTIONS | \
|
||||
@@ -164,6 +166,9 @@ typedef enum mysqlnd_option
|
||||
MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
|
||||
MYSQL_PLUGIN_DIR,
|
||||
MYSQL_DEFAULT_AUTH,
|
||||
MYSQL_SERVER_PUBLIC_KEY,
|
||||
MYSQL_ENABLE_CLEARTEXT_PLUGIN,
|
||||
MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS,
|
||||
#if MYSQLND_UNICODE
|
||||
MYSQLND_OPT_NUMERIC_AND_DATETIME_AS_UNICODE = 200,
|
||||
#endif
|
||||
|
||||
@@ -227,8 +227,10 @@ static int oci_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
|
||||
H->server = NULL;
|
||||
}
|
||||
|
||||
OCIHandleFree(H->err, OCI_HTYPE_ERROR);
|
||||
H->err = NULL;
|
||||
if (H->err) {
|
||||
OCIHandleFree(H->err, OCI_HTYPE_ERROR);
|
||||
H->err = NULL;
|
||||
}
|
||||
|
||||
if (H->charset && H->env) {
|
||||
OCIHandleFree(H->env, OCI_HTYPE_ENV);
|
||||
|
||||
@@ -99,7 +99,7 @@ static int oci_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
|
||||
switch (S->cols[i].dtype) {
|
||||
case SQLT_BLOB:
|
||||
case SQLT_CLOB:
|
||||
/* do nothing */
|
||||
OCIDescriptorFree(S->cols[i].data, OCI_DTYPE_LOB);
|
||||
break;
|
||||
default:
|
||||
efree(S->cols[i].data);
|
||||
@@ -654,7 +654,6 @@ static int oci_blob_close(php_stream *stream, int close_handle TSRMLS_DC)
|
||||
|
||||
if (close_handle) {
|
||||
OCILobClose(self->S->H->svc, self->S->err, self->lob);
|
||||
OCIDescriptorFree(self->lob, OCI_DTYPE_LOB);
|
||||
efree(self);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,165 @@
|
||||
--TEST--
|
||||
PDO OCI Bug #57702 (Multi-row BLOB fetches)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('pdo') || !extension_loaded('pdo_oci')) die('skip not loaded');
|
||||
require(dirname(__FILE__).'/../../pdo/tests/pdo_test.inc');
|
||||
PDOTest::skip();
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require('ext/pdo/tests/pdo_test.inc');
|
||||
$db = PDOTest::test_factory('ext/pdo_oci/tests/common.phpt');
|
||||
|
||||
// Note the PDO test setup sets PDO::ATTR_STRINGIFY_FETCHES to true
|
||||
// (and sets PDO::ATTR_CASE to PDO::CASE_LOWER)
|
||||
|
||||
$query = "begin execute immediate 'drop table mytable'; exception when others then if sqlcode <> -942 then raise; end if; end;";
|
||||
$stmt = $db->prepare($query);
|
||||
$stmt->execute();
|
||||
|
||||
$query = "create table bug57702 (id number, data1 blob, data2 blob)";
|
||||
$stmt = $db->prepare($query);
|
||||
$stmt->execute();
|
||||
|
||||
function do_insert($db, $id, $data1, $data2)
|
||||
{
|
||||
$db->beginTransaction();
|
||||
$stmt = $db->prepare("insert into bug57702 (id, data1, data2) values (:id, empty_blob(), empty_blob()) returning data1, data2 into :blob1, :blob2");
|
||||
$stmt->bindParam(':id', $id);
|
||||
$stmt->bindParam(':blob1', $blob1, PDO::PARAM_LOB);
|
||||
$stmt->bindParam(':blob2', $blob2, PDO::PARAM_LOB);
|
||||
$blob1 = null;
|
||||
$blob2 = null;
|
||||
$stmt->execute();
|
||||
|
||||
fwrite($blob1, $data1);
|
||||
fclose($blob1);
|
||||
fwrite($blob2, $data2);
|
||||
fclose($blob2);
|
||||
$db->commit();
|
||||
}
|
||||
|
||||
do_insert($db, 1, "row 1 col 1", "row 1 col 2");
|
||||
do_insert($db, 2, "row 2 col 1", "row 2 col 2");
|
||||
|
||||
////////////////////
|
||||
|
||||
echo "First Query\n";
|
||||
|
||||
// Fetch it back
|
||||
$stmt = $db->prepare('select data1, data2 from bug57702 order by id');
|
||||
$stmt->execute();
|
||||
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
var_dump($row['data1']);
|
||||
var_dump($row['data2']);
|
||||
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
var_dump($row['data1']);
|
||||
var_dump($row['data2']);
|
||||
|
||||
////////////////////
|
||||
|
||||
echo "\nSecond Query\n";
|
||||
|
||||
foreach($db->query("select data1 as d1, data2 as d2 from bug57702 order by id") as $row) {
|
||||
var_dump($row['d1']);
|
||||
var_dump($row['d2']);
|
||||
}
|
||||
|
||||
////////////////////
|
||||
|
||||
echo "\nThird Query\n";
|
||||
|
||||
$stmt = $db->prepare('select data1 as d3_1, data2 as d3_2 from bug57702 order by id');
|
||||
|
||||
$rs = $stmt->execute();
|
||||
$stmt->bindColumn('d3_1' , $clob1, PDO::PARAM_LOB);
|
||||
$stmt->bindColumn('d3_2' , $clob2, PDO::PARAM_LOB);
|
||||
|
||||
while ($stmt->fetch(PDO::FETCH_BOUND)) {
|
||||
var_dump($clob1);
|
||||
var_dump($clob2);
|
||||
}
|
||||
print "done\n";
|
||||
|
||||
////////////////////
|
||||
|
||||
echo "\nFourth Query\n";
|
||||
|
||||
$a = array();
|
||||
$i = 0;
|
||||
foreach($db->query("select data1 as d4_1, data2 as d4_2 from bug57702 order by id") as $row) {
|
||||
$a[$i][0] = $row['d4_1'];
|
||||
$a[$i][1] = $row['d4_2'];
|
||||
$i++;
|
||||
}
|
||||
|
||||
for ($i = 0; $i < count($a); $i++) {
|
||||
var_dump($a[$i][0]);
|
||||
var_dump($a[$i][1]);
|
||||
}
|
||||
|
||||
////////////////////
|
||||
|
||||
echo "\nFifth Query\n";
|
||||
|
||||
$db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false); // Let's use streams
|
||||
|
||||
// Since each column only has one lob descriptor, the last row is
|
||||
// shown twice because the lob descriptor for each column is reused in
|
||||
// the stream
|
||||
|
||||
$a = array();
|
||||
$i = 0;
|
||||
foreach($db->query("select data1 as d4_1, data2 as d4_2 from bug57702 order by id") as $row) {
|
||||
$a[$i][0] = $row['d4_1'];
|
||||
$a[$i][1] = $row['d4_2'];
|
||||
$i++;
|
||||
}
|
||||
|
||||
for ($i = 0; $i < count($a); $i++) {
|
||||
var_dump(stream_get_contents($a[$i][0]));
|
||||
var_dump(stream_get_contents($a[$i][1]));
|
||||
}
|
||||
|
||||
// Cleanup
|
||||
$query = "drop table bug57702";
|
||||
$stmt = $db->prepare($query);
|
||||
$stmt->execute();
|
||||
|
||||
print "done\n";
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
First Query
|
||||
string(11) "row 1 col 1"
|
||||
string(11) "row 1 col 2"
|
||||
string(11) "row 2 col 1"
|
||||
string(11) "row 2 col 2"
|
||||
|
||||
Second Query
|
||||
string(11) "row 1 col 1"
|
||||
string(11) "row 1 col 2"
|
||||
string(11) "row 2 col 1"
|
||||
string(11) "row 2 col 2"
|
||||
|
||||
Third Query
|
||||
string(11) "row 1 col 1"
|
||||
string(11) "row 1 col 2"
|
||||
string(11) "row 2 col 1"
|
||||
string(11) "row 2 col 2"
|
||||
done
|
||||
|
||||
Fourth Query
|
||||
string(11) "row 1 col 1"
|
||||
string(11) "row 1 col 2"
|
||||
string(11) "row 2 col 1"
|
||||
string(11) "row 2 col 2"
|
||||
|
||||
Fifth Query
|
||||
string(11) "row 2 col 1"
|
||||
string(11) "row 2 col 2"
|
||||
string(11) "row 2 col 1"
|
||||
string(11) "row 2 col 2"
|
||||
done
|
||||
@@ -112,9 +112,15 @@ static int pdo_sqlite_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_d
|
||||
}
|
||||
} else {
|
||||
convert_to_long(param->parameter);
|
||||
#if LONG_MAX > 2147483647
|
||||
if (SQLITE_OK == sqlite3_bind_int64(S->stmt, param->paramno + 1, Z_LVAL_P(param->parameter))) {
|
||||
return 1;
|
||||
}
|
||||
#else
|
||||
if (SQLITE_OK == sqlite3_bind_int(S->stmt, param->paramno + 1, Z_LVAL_P(param->parameter))) {
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
pdo_sqlite_error_stmt(stmt);
|
||||
return 0;
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
--TEST--
|
||||
Bug #63916 PDO::PARAM_INT casts to 32bit int internally even on 64bit builds in pdo_sqlite
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('pdo_sqlite')) die('skip');
|
||||
if (PHP_INT_SIZE > 4) die('skip');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$num = PHP_INT_MAX; // 32 bits
|
||||
$conn = new PDO('sqlite::memory:');
|
||||
$conn->query('CREATE TABLE users (id INTEGER NOT NULL, num INTEGER NOT NULL, PRIMARY KEY(id))');
|
||||
|
||||
$stmt = $conn->prepare('insert into users (id, num) values (:id, :num)');
|
||||
$stmt->bindValue(':id', 1, PDO::PARAM_INT);
|
||||
$stmt->bindValue(':num', $num, PDO::PARAM_INT);
|
||||
$stmt->execute();
|
||||
|
||||
$stmt = $conn->query('SELECT num FROM users');
|
||||
$result = $stmt->fetchAll(PDO::FETCH_COLUMN);
|
||||
|
||||
var_dump($num,$result[0]);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(2147483647)
|
||||
string(10) "2147483647"
|
||||
@@ -0,0 +1,27 @@
|
||||
--TEST--
|
||||
Bug #63916 PDO::PARAM_INT casts to 32bit int internally even on 64bit builds in pdo_sqlite
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('pdo_sqlite')) die('skip');
|
||||
if (PHP_INT_SIZE < 8) die('skip');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$num = 100004313234244; // exceeds 32 bits
|
||||
$conn = new PDO('sqlite::memory:');
|
||||
$conn->query('CREATE TABLE users (id INTEGER NOT NULL, num INTEGER NOT NULL, PRIMARY KEY(id))');
|
||||
|
||||
$stmt = $conn->prepare('insert into users (id, num) values (:id, :num)');
|
||||
$stmt->bindValue(':id', 1, PDO::PARAM_INT);
|
||||
$stmt->bindValue(':num', $num, PDO::PARAM_INT);
|
||||
$stmt->execute();
|
||||
|
||||
$stmt = $conn->query('SELECT num FROM users');
|
||||
$result = $stmt->fetchAll(PDO::FETCH_COLUMN);
|
||||
|
||||
var_dump($num,$result[0]);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(100004313234244)
|
||||
string(15) "100004313234244"
|
||||
@@ -92,6 +92,7 @@ xmlDocPtr soap_xmlParseFile(const char *filename TSRMLS_DC)
|
||||
PG(allow_url_fopen) = old_allow_url_fopen;
|
||||
if (ctxt) {
|
||||
ctxt->keepBlanks = 0;
|
||||
ctxt->options &= ~XML_PARSE_DTDLOAD;
|
||||
ctxt->sax->ignorableWhitespace = soap_ignorableWhitespace;
|
||||
ctxt->sax->comment = soap_Comment;
|
||||
ctxt->sax->warning = NULL;
|
||||
@@ -133,6 +134,7 @@ xmlDocPtr soap_xmlParseMemory(const void *buf, size_t buf_size)
|
||||
*/
|
||||
ctxt = xmlCreateMemoryParserCtxt(buf, buf_size);
|
||||
if (ctxt) {
|
||||
ctxt->options &= ~XML_PARSE_DTDLOAD;
|
||||
ctxt->sax->ignorableWhitespace = soap_ignorableWhitespace;
|
||||
ctxt->sax->comment = soap_Comment;
|
||||
ctxt->sax->warning = NULL;
|
||||
|
||||
+31
-1
@@ -479,10 +479,40 @@ ZEND_INI_MH(OnUpdateCacheMode)
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
static PHP_INI_MH(OnUpdateCacheDir)
|
||||
{
|
||||
/* Only do the open_basedir check at runtime */
|
||||
if (stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) {
|
||||
char *p;
|
||||
|
||||
if (memchr(new_value, '\0', new_value_length) != NULL) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
/* we do not use zend_memrchr() since path can contain ; itself */
|
||||
if ((p = strchr(new_value, ';'))) {
|
||||
char *p2;
|
||||
p++;
|
||||
if ((p2 = strchr(p, ';'))) {
|
||||
p = p2 + 1;
|
||||
}
|
||||
} else {
|
||||
p = new_value;
|
||||
}
|
||||
|
||||
if (PG(open_basedir) && *p && php_check_open_basedir(p TSRMLS_CC)) {
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
PHP_INI_BEGIN()
|
||||
STD_PHP_INI_ENTRY("soap.wsdl_cache_enabled", "1", PHP_INI_ALL, OnUpdateBool,
|
||||
cache_enabled, zend_soap_globals, soap_globals)
|
||||
STD_PHP_INI_ENTRY("soap.wsdl_cache_dir", "/tmp", PHP_INI_ALL, OnUpdateString,
|
||||
STD_PHP_INI_ENTRY("soap.wsdl_cache_dir", "/tmp", PHP_INI_ALL, OnUpdateCacheDir,
|
||||
cache_dir, zend_soap_globals, soap_globals)
|
||||
STD_PHP_INI_ENTRY("soap.wsdl_cache_ttl", "86400", PHP_INI_ALL, OnUpdateLong,
|
||||
cache_ttl, zend_soap_globals, soap_globals)
|
||||
|
||||
@@ -1874,6 +1874,10 @@ static int spl_filesystem_object_cast(zval *readobj, zval *writeobj, int type TS
|
||||
spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(readobj TSRMLS_CC);
|
||||
|
||||
if (type == IS_STRING) {
|
||||
if (Z_OBJCE_P(readobj)->__tostring) {
|
||||
return std_object_handlers.cast_object(readobj, writeobj, type TSRMLS_CC);
|
||||
}
|
||||
|
||||
switch (intern->type) {
|
||||
case SPL_FS_INFO:
|
||||
case SPL_FS_FILE:
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #64023: Overloading __toString() in SplFileInfo has no effect
|
||||
--FILE--
|
||||
<?php
|
||||
class A extends \SplFileInfo
|
||||
{
|
||||
public function __toString() {return ' -expected- ';}
|
||||
}
|
||||
|
||||
$a = new A('/');
|
||||
|
||||
// Works
|
||||
echo $a, $a->__toString(), $a->__toString() . '', "\n";
|
||||
|
||||
// Does not work - outputs parent::__toString()
|
||||
echo $a . '', "\n";
|
||||
|
||||
--EXPECT--
|
||||
-expected- -expected- -expected-
|
||||
-expected-
|
||||
@@ -730,7 +730,11 @@ static int sqlite3_do_callback(struct php_sqlite3_fci *fc, zval *cb, int argc, s
|
||||
|
||||
switch (sqlite3_value_type(argv[i])) {
|
||||
case SQLITE_INTEGER:
|
||||
#if LONG_MAX > 2147483647
|
||||
ZVAL_LONG(*zargs[i + is_agg], sqlite3_value_int64(argv[i]));
|
||||
#else
|
||||
ZVAL_LONG(*zargs[i + is_agg], sqlite3_value_int(argv[i]));
|
||||
#endif
|
||||
break;
|
||||
|
||||
case SQLITE_FLOAT:
|
||||
@@ -774,7 +778,11 @@ static int sqlite3_do_callback(struct php_sqlite3_fci *fc, zval *cb, int argc, s
|
||||
if (retval) {
|
||||
switch (Z_TYPE_P(retval)) {
|
||||
case IS_LONG:
|
||||
#if LONG_MAX > 2147483647
|
||||
sqlite3_result_int64(context, Z_LVAL_P(retval));
|
||||
#else
|
||||
sqlite3_result_int(context, Z_LVAL_P(retval));
|
||||
#endif
|
||||
break;
|
||||
|
||||
case IS_NULL:
|
||||
@@ -1493,7 +1501,11 @@ PHP_METHOD(sqlite3stmt, execute)
|
||||
switch (param->type) {
|
||||
case SQLITE_INTEGER:
|
||||
convert_to_long(param->parameter);
|
||||
#if LONG_MAX > 2147483647
|
||||
sqlite3_bind_int64(stmt_obj->stmt, param->param_number, Z_LVAL_P(param->parameter));
|
||||
#else
|
||||
sqlite3_bind_int(stmt_obj->stmt, param->param_number, Z_LVAL_P(param->parameter));
|
||||
#endif
|
||||
break;
|
||||
|
||||
case SQLITE_FLOAT:
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
--TEST--
|
||||
Bug #63921 sqlite3::bindvalue and relative PHP functions aren't using sqlite3_*_int64 API
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('sqlite3')) die('skip');
|
||||
if (PHP_INT_SIZE > 4) die('skip'); // skip for 64bit builds - there is another test for that
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$num = PHP_INT_MAX; // 32 bits
|
||||
$conn = new sqlite3(':memory:');
|
||||
$conn->query('CREATE TABLE users (id INTEGER NOT NULL, num INTEGER NOT NULL, PRIMARY KEY(id))');
|
||||
|
||||
$stmt = $conn->prepare('insert into users (id, num) values (:id, :num)');
|
||||
$stmt->bindValue(':id', 1, SQLITE3_INTEGER);
|
||||
$stmt->bindValue(':num', $num, SQLITE3_INTEGER);
|
||||
$stmt->execute();
|
||||
|
||||
$stmt = $conn->query('SELECT num FROM users');
|
||||
$result = $stmt->fetchArray();
|
||||
|
||||
var_dump($num,$result[0]);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(2147483647)
|
||||
string(10) "2147483647"
|
||||
@@ -0,0 +1,27 @@
|
||||
--TEST--
|
||||
Bug #63921 sqlite3::bindvalue and relative PHP functions aren't using sqlite3_*_int64 API
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('sqlite3')) die('skip');
|
||||
if (PHP_INT_SIZE < 8) die('skip'); // skip for 32bit builds - there is another test for that
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$num = 100004313234244; // notice this exceeds 32 bits
|
||||
$conn = new sqlite3(':memory:');
|
||||
$conn->query('CREATE TABLE users (id INTEGER NOT NULL, num INTEGER NOT NULL, PRIMARY KEY(id))');
|
||||
|
||||
$stmt = $conn->prepare('insert into users (id, num) values (:id, :num)');
|
||||
$stmt->bindValue(':id', 1, SQLITE3_INTEGER);
|
||||
$stmt->bindValue(':num', $num, SQLITE3_INTEGER);
|
||||
$stmt->execute();
|
||||
|
||||
$stmt = $conn->query('SELECT num FROM users');
|
||||
$result = $stmt->fetchArray();
|
||||
|
||||
var_dump($num,$result[0]);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(100004313234244)
|
||||
string(15) "100004313234244"
|
||||
+2
-2
@@ -1628,8 +1628,8 @@ PHP_FUNCTION(get_html_translation_table)
|
||||
unsigned i, j, k,
|
||||
max_i, max_j, max_k;
|
||||
/* no mapping to unicode required */
|
||||
if (CHARSET_SINGLE_BYTE(charset)) {
|
||||
max_i = 1; max_j = 1; max_k = 64;
|
||||
if (CHARSET_SINGLE_BYTE(charset)) { /* ISO-8859-1 */
|
||||
max_i = 1; max_j = 4; max_k = 64;
|
||||
} else {
|
||||
max_i = 0x1E; max_j = 64; max_k = 64;
|
||||
}
|
||||
|
||||
@@ -113,6 +113,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
|
||||
int redirected = ((flags & HTTP_WRAPPER_REDIRECTED) != 0);
|
||||
int follow_location = 1;
|
||||
php_stream_filter *transfer_encoding = NULL;
|
||||
int response_code;
|
||||
|
||||
tmp_line[0] = '\0';
|
||||
|
||||
@@ -657,7 +658,6 @@ finish:
|
||||
|
||||
if (php_stream_get_line(stream, tmp_line, sizeof(tmp_line) - 1, &tmp_line_len) != NULL) {
|
||||
zval *http_response;
|
||||
int response_code;
|
||||
|
||||
if (tmp_line_len > 9) {
|
||||
response_code = atoi(tmp_line + 9);
|
||||
@@ -731,7 +731,9 @@ finish:
|
||||
http_header_line[http_header_line_length] = '\0';
|
||||
|
||||
if (!strncasecmp(http_header_line, "Location: ", 10)) {
|
||||
if (context && php_stream_context_get_option(context, "http", "follow_location", &tmpzval) == SUCCESS) {
|
||||
/* we only care about Location for 300, 301, 302, 303 and 307 */
|
||||
/* see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.1 */
|
||||
if ((response_code >= 300 && response_code < 304 || 307 == response_code) && context && php_stream_context_get_option(context, "http", "follow_location", &tmpzval) == SUCCESS) {
|
||||
SEPARATE_ZVAL(tmpzval);
|
||||
convert_to_long_ex(tmpzval);
|
||||
follow_location = Z_LVAL_PP(tmpzval);
|
||||
|
||||
@@ -159,7 +159,7 @@ static struct gfxinfo *php_handle_bmp (php_stream * stream TSRMLS_DC)
|
||||
result->width = (((unsigned int)dim[ 5]) << 8) + ((unsigned int) dim[ 4]);
|
||||
result->height = (((unsigned int)dim[ 7]) << 8) + ((unsigned int) dim[ 6]);
|
||||
result->bits = ((unsigned int)dim[11]);
|
||||
} else if (size > 12 && (size <= 64 || size == 108)) {
|
||||
} else if (size > 12 && (size <= 64 || size == 108 || size == 124)) {
|
||||
result = (struct gfxinfo *) ecalloc (1, sizeof(struct gfxinfo));
|
||||
result->width = (((unsigned int)dim[ 7]) << 24) + (((unsigned int)dim[ 6]) << 16) + (((unsigned int)dim[ 5]) << 8) + ((unsigned int) dim[ 4]);
|
||||
result->height = (((unsigned int)dim[11]) << 24) + (((unsigned int)dim[10]) << 16) + (((unsigned int)dim[ 9]) << 8) + ((unsigned int) dim[ 8]);
|
||||
|
||||
+367
-90
@@ -23,6 +23,11 @@
|
||||
/* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
|
||||
|
||||
#include <stdio.h>
|
||||
#ifdef PHP_WIN32
|
||||
# include "win32/php_stdint.h"
|
||||
#else
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
#include "php.h"
|
||||
#include "php_rand.h"
|
||||
#include "php_string.h"
|
||||
@@ -57,6 +62,7 @@
|
||||
#include "php_globals.h"
|
||||
#include "basic_functions.h"
|
||||
#include "php_smart_str.h"
|
||||
#include <Zend/zend_exceptions.h>
|
||||
#ifdef ZTS
|
||||
#include "TSRM.h"
|
||||
#endif
|
||||
@@ -132,7 +138,7 @@ static char *php_bin2hex(const unsigned char *old, const size_t oldlen, size_t *
|
||||
size_t i, j;
|
||||
|
||||
result = (unsigned char *) safe_emalloc(oldlen, 2 * sizeof(char), 1);
|
||||
|
||||
|
||||
for (i = j = 0; i < oldlen; i++) {
|
||||
result[j++] = hexconvtab[old[i] >> 4];
|
||||
result[j++] = hexconvtab[old[i] & 15];
|
||||
@@ -2772,112 +2778,383 @@ PHPAPI char *php_strtr(char *str, int len, char *str_from, char *str_to, int trl
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ php_strtr_array
|
||||
*/
|
||||
static void php_strtr_array(zval *return_value, char *str, int slen, HashTable *hash)
|
||||
/* {{{ Definitions for php_strtr_array */
|
||||
typedef size_t STRLEN; /* STRLEN should be unsigned */
|
||||
typedef uint16_t HASH;
|
||||
typedef struct {
|
||||
HASH table_mask;
|
||||
STRLEN entries[1];
|
||||
} SHIFT_TAB;
|
||||
typedef struct {
|
||||
HASH table_mask;
|
||||
int entries[1];
|
||||
} HASH_TAB;
|
||||
typedef struct {
|
||||
const char *s;
|
||||
STRLEN l;
|
||||
} STR;
|
||||
typedef struct _pat_and_repl {
|
||||
STR pat;
|
||||
STR repl;
|
||||
} PATNREPL;
|
||||
|
||||
#define S(a) ((a)->s)
|
||||
#define L(a) ((a)->l)
|
||||
|
||||
#define SHIFT_TAB_BITS 13
|
||||
#define HASH_TAB_BITS 10 /* should be less than sizeof(HASH) * 8 */
|
||||
#define SHIFT_TAB_SIZE (1U << SHIFT_TAB_BITS)
|
||||
#define HASH_TAB_SIZE (1U << HASH_TAB_BITS)
|
||||
|
||||
typedef struct {
|
||||
int B; /* size of suffixes */
|
||||
int Bp; /* size of prefixes */
|
||||
STRLEN m; /* minimum pattern length */
|
||||
int patnum; /* number of patterns */
|
||||
SHIFT_TAB *shift; /* table mapping hash to allowed shift */
|
||||
HASH_TAB *hash; /* table mapping hash to int (pair of pointers) */
|
||||
HASH *prefix; /* array of hashes of prefixes by pattern suffix hash order */
|
||||
PATNREPL *patterns; /* array of prefixes by pattern suffix hash order */
|
||||
} PPRES;
|
||||
/* }}} */
|
||||
|
||||
/* {{{ php_strtr_hash */
|
||||
static inline HASH php_strtr_hash(const char *str, int len)
|
||||
{
|
||||
zval **entry;
|
||||
char *string_key;
|
||||
uint string_key_len;
|
||||
zval **trans;
|
||||
zval ctmp;
|
||||
ulong num_key;
|
||||
int minlen = 128*1024;
|
||||
int maxlen = 0, pos, len, found;
|
||||
char *key;
|
||||
HashPosition hpos;
|
||||
smart_str result = {0};
|
||||
HashTable tmp_hash;
|
||||
|
||||
zend_hash_init(&tmp_hash, zend_hash_num_elements(hash), NULL, NULL, 0);
|
||||
zend_hash_internal_pointer_reset_ex(hash, &hpos);
|
||||
while (zend_hash_get_current_data_ex(hash, (void **)&entry, &hpos) == SUCCESS) {
|
||||
switch (zend_hash_get_current_key_ex(hash, &string_key, &string_key_len, &num_key, 0, &hpos)) {
|
||||
case HASH_KEY_IS_STRING:
|
||||
len = string_key_len-1;
|
||||
if (len < 1) {
|
||||
zend_hash_destroy(&tmp_hash);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
zend_hash_add(&tmp_hash, string_key, string_key_len, entry, sizeof(zval*), NULL);
|
||||
if (len > maxlen) {
|
||||
maxlen = len;
|
||||
}
|
||||
if (len < minlen) {
|
||||
minlen = len;
|
||||
}
|
||||
break;
|
||||
|
||||
case HASH_KEY_IS_LONG:
|
||||
Z_TYPE(ctmp) = IS_LONG;
|
||||
Z_LVAL(ctmp) = num_key;
|
||||
|
||||
convert_to_string(&ctmp);
|
||||
len = Z_STRLEN(ctmp);
|
||||
zend_hash_add(&tmp_hash, Z_STRVAL(ctmp), len+1, entry, sizeof(zval*), NULL);
|
||||
zval_dtor(&ctmp);
|
||||
|
||||
if (len > maxlen) {
|
||||
maxlen = len;
|
||||
}
|
||||
if (len < minlen) {
|
||||
minlen = len;
|
||||
}
|
||||
break;
|
||||
}
|
||||
zend_hash_move_forward_ex(hash, &hpos);
|
||||
HASH res = 0;
|
||||
int i;
|
||||
for (i = 0; i < len; i++) {
|
||||
res = res * 33 + (unsigned char)str[i];
|
||||
}
|
||||
|
||||
key = emalloc(maxlen+1);
|
||||
pos = 0;
|
||||
return res;
|
||||
}
|
||||
/* }}} */
|
||||
/* {{{ php_strtr_populate_shift */
|
||||
static inline void php_strtr_populate_shift(PATNREPL *patterns, int patnum, int B, STRLEN m, SHIFT_TAB *shift)
|
||||
{
|
||||
int i;
|
||||
STRLEN j,
|
||||
max_shift;
|
||||
|
||||
while (pos < slen) {
|
||||
if ((pos + maxlen) > slen) {
|
||||
maxlen = slen - pos;
|
||||
max_shift = m - B + 1;
|
||||
for (i = 0; i < SHIFT_TAB_SIZE; i++) {
|
||||
shift->entries[i] = max_shift;
|
||||
}
|
||||
for (i = 0; i < patnum; i++) {
|
||||
for (j = 0; j < m - B + 1; j++) {
|
||||
HASH h = php_strtr_hash(&S(&patterns[i].pat)[j], B) & shift->table_mask;
|
||||
assert((long long) m - (long long) j - B >= 0);
|
||||
shift->entries[h] = MIN(shift->entries[h], m - j - B);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
/* {{{ php_strtr_compare_hash_suffix */
|
||||
static int php_strtr_compare_hash_suffix(const void *a, const void *b, void *ctx_g)
|
||||
{
|
||||
const PPRES *res = ctx_g;
|
||||
const PATNREPL *pnr_a = a,
|
||||
*pnr_b = b;
|
||||
HASH hash_a = php_strtr_hash(&S(&pnr_a->pat)[res->m - res->B], res->B)
|
||||
& res->hash->table_mask,
|
||||
hash_b = php_strtr_hash(&S(&pnr_b->pat)[res->m - res->B], res->B)
|
||||
& res->hash->table_mask;
|
||||
/* TODO: don't recalculate the hashes all the time */
|
||||
if (hash_a > hash_b) {
|
||||
return 1;
|
||||
} else if (hash_a < hash_b) {
|
||||
return -1;
|
||||
} else {
|
||||
/* longer patterns must be sorted first */
|
||||
if (L(&pnr_a->pat) > L(&pnr_b->pat)) {
|
||||
return -1;
|
||||
} else if (L(&pnr_a->pat) < L(&pnr_b->pat)) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
/* {{{ Sorting (no zend_qsort_r in this PHP version) */
|
||||
#define HS_LEFT(i) ((i) * 2 + 1)
|
||||
#define HS_RIGHT(i) ((i) * 2 + 2)
|
||||
#define HS_PARENT(i) (((i) - 1) / 2);
|
||||
#define HS_OFF(data, i) ((void *)(&((data)->arr)[i]))
|
||||
#define HS_CMP_CALL(data, i1, i2) \
|
||||
(php_strtr_compare_hash_suffix(HS_OFF((data), (i1)), HS_OFF((data), (i2)), (data)->res))
|
||||
struct hs_data {
|
||||
PATNREPL *arr;
|
||||
size_t nel;
|
||||
size_t heapel;
|
||||
PPRES *res;
|
||||
};
|
||||
static inline void php_strtr_swap(PATNREPL *a, PATNREPL *b)
|
||||
{
|
||||
PATNREPL tmp = *a;
|
||||
*a = *b;
|
||||
*b = tmp;
|
||||
}
|
||||
static inline void php_strtr_fix_heap(struct hs_data *data, size_t i)
|
||||
{
|
||||
size_t li = HS_LEFT(i),
|
||||
ri = HS_RIGHT(i),
|
||||
largei;
|
||||
if (li < data->heapel && HS_CMP_CALL(data, li, i) > 0) {
|
||||
largei = li;
|
||||
} else {
|
||||
largei = i;
|
||||
}
|
||||
if (ri < data->heapel && HS_CMP_CALL(data, ri, largei) > 0) {
|
||||
largei = ri;
|
||||
}
|
||||
if (largei != i) {
|
||||
php_strtr_swap(HS_OFF(data, i), HS_OFF(data, largei));
|
||||
php_strtr_fix_heap(data, largei);
|
||||
}
|
||||
}
|
||||
static inline void php_strtr_build_heap(struct hs_data *data)
|
||||
{
|
||||
size_t i;
|
||||
for (i = data->nel / 2; i > 0; i--) {
|
||||
php_strtr_fix_heap(data, i - 1);
|
||||
}
|
||||
}
|
||||
static inline void php_strtr_heapsort(PATNREPL *arr, size_t nel, PPRES *res)
|
||||
{
|
||||
struct hs_data data = { arr, nel, nel, res };
|
||||
size_t i;
|
||||
php_strtr_build_heap(&data);
|
||||
for (i = nel; i > 1; i--) {
|
||||
php_strtr_swap(arr, HS_OFF(&data, i - 1));
|
||||
data.heapel--;
|
||||
php_strtr_fix_heap(&data, 0);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
/* {{{ php_strtr_free_strp */
|
||||
static void php_strtr_free_strp(void *strp)
|
||||
{
|
||||
STR_FREE(*(char**)strp);
|
||||
}
|
||||
/* }}} */
|
||||
/* {{{ php_strtr_array_prepare_repls */
|
||||
static PATNREPL *php_strtr_array_prepare_repls(int slen, HashTable *pats, zend_llist **allocs, int *outsize)
|
||||
{
|
||||
PATNREPL *patterns;
|
||||
HashPosition hpos;
|
||||
zval **entry;
|
||||
int num_pats = zend_hash_num_elements(pats),
|
||||
i;
|
||||
|
||||
found = 0;
|
||||
memcpy(key, str+pos, maxlen);
|
||||
patterns = safe_emalloc(num_pats, sizeof(*patterns), 0);
|
||||
*allocs = emalloc(sizeof **allocs);
|
||||
zend_llist_init(*allocs, sizeof(void*), &php_strtr_free_strp, 0);
|
||||
|
||||
for (len = maxlen; len >= minlen; len--) {
|
||||
key[len] = 0;
|
||||
for (i = 0, zend_hash_internal_pointer_reset_ex(pats, &hpos);
|
||||
zend_hash_get_current_data_ex(pats, (void **)&entry, &hpos) == SUCCESS;
|
||||
zend_hash_move_forward_ex(pats, &hpos)) {
|
||||
char *string_key;
|
||||
uint string_key_len;
|
||||
ulong num_key;
|
||||
zval *tzv = NULL;
|
||||
|
||||
if (zend_hash_find(&tmp_hash, key, len+1, (void**)&trans) == SUCCESS) {
|
||||
char *tval;
|
||||
int tlen;
|
||||
zval tmp;
|
||||
switch (zend_hash_get_current_key_ex(pats, &string_key, &string_key_len, &num_key, 0, &hpos)) {
|
||||
case HASH_KEY_IS_LONG:
|
||||
string_key_len = 1 + zend_spprintf(&string_key, 0, "%ld", (long)num_key);
|
||||
zend_llist_add_element(*allocs, &string_key);
|
||||
/* break missing intentionally */
|
||||
|
||||
if (Z_TYPE_PP(trans) != IS_STRING) {
|
||||
tmp = **trans;
|
||||
zval_copy_ctor(&tmp);
|
||||
convert_to_string(&tmp);
|
||||
tval = Z_STRVAL(tmp);
|
||||
tlen = Z_STRLEN(tmp);
|
||||
} else {
|
||||
tval = Z_STRVAL_PP(trans);
|
||||
tlen = Z_STRLEN_PP(trans);
|
||||
}
|
||||
case HASH_KEY_IS_STRING:
|
||||
string_key_len--; /* exclude final '\0' */
|
||||
if (string_key_len == 0) { /* empty string given as pattern */
|
||||
efree(patterns);
|
||||
zend_llist_destroy(*allocs);
|
||||
efree(*allocs);
|
||||
*allocs = NULL;
|
||||
return NULL;
|
||||
}
|
||||
if (string_key_len > slen) { /* this pattern can never match */
|
||||
continue;
|
||||
}
|
||||
|
||||
smart_str_appendl(&result, tval, tlen);
|
||||
pos += len;
|
||||
found = 1;
|
||||
if (Z_TYPE_PP(entry) != IS_STRING) {
|
||||
tzv = *entry;
|
||||
zval_addref_p(tzv);
|
||||
SEPARATE_ZVAL(&tzv);
|
||||
convert_to_string(tzv);
|
||||
entry = &tzv;
|
||||
zend_llist_add_element(*allocs, &Z_STRVAL_PP(entry));
|
||||
}
|
||||
|
||||
if (Z_TYPE_PP(trans) != IS_STRING) {
|
||||
zval_dtor(&tmp);
|
||||
}
|
||||
break;
|
||||
S(&patterns[i].pat) = string_key;
|
||||
L(&patterns[i].pat) = string_key_len;
|
||||
S(&patterns[i].repl) = Z_STRVAL_PP(entry);
|
||||
L(&patterns[i].repl) = Z_STRLEN_PP(entry);
|
||||
i++;
|
||||
|
||||
if (tzv) {
|
||||
efree(tzv);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (! found) {
|
||||
smart_str_appendc(&result, str[pos++]);
|
||||
*outsize = i;
|
||||
return patterns;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ PPRES *php_strtr_array_prepare(STR *text, PATNREPL *patterns, int patnum, int B, int Bp) */
|
||||
static PPRES *php_strtr_array_prepare(STR *text, PATNREPL *patterns, int patnum, int B, int Bp)
|
||||
{
|
||||
int i;
|
||||
PPRES *res = emalloc(sizeof *res);
|
||||
|
||||
res->m = (STRLEN)-1;
|
||||
for (i = 0; i < patnum; i++) {
|
||||
if (L(&patterns[i].pat) < res->m) {
|
||||
res->m = L(&patterns[i].pat);
|
||||
}
|
||||
}
|
||||
assert(res->m > 0);
|
||||
res->B = B = MIN(B, res->m);
|
||||
res->Bp = Bp = MIN(Bp, res->m);
|
||||
|
||||
res->shift = safe_emalloc(SHIFT_TAB_SIZE, sizeof(*res->shift->entries), sizeof(*res->shift));
|
||||
res->shift->table_mask = SHIFT_TAB_SIZE - 1;
|
||||
php_strtr_populate_shift(patterns, patnum, B, res->m, res->shift);
|
||||
|
||||
res->hash = safe_emalloc(HASH_TAB_SIZE, sizeof(*res->hash->entries), sizeof(*res->hash));
|
||||
res->hash->table_mask = HASH_TAB_SIZE - 1;
|
||||
|
||||
res->patterns = safe_emalloc(patnum, sizeof(*res->patterns), 0);
|
||||
memcpy(res->patterns, patterns, sizeof(*patterns) * patnum);
|
||||
php_strtr_heapsort(res->patterns, patnum, res);
|
||||
|
||||
res->prefix = safe_emalloc(patnum, sizeof(*res->prefix), 0);
|
||||
for (i = 0; i < patnum; i++) {
|
||||
res->prefix[i] = php_strtr_hash(S(&res->patterns[i].pat), Bp);
|
||||
}
|
||||
|
||||
/* Initialize the rest of ->hash */
|
||||
for (i = 0; i < HASH_TAB_SIZE; i++) {
|
||||
res->hash->entries[i] = -1;
|
||||
}
|
||||
{
|
||||
HASH last_h = -1; /* assumes not all bits are used in res->hash */
|
||||
/* res->patterns is already ordered by hash.
|
||||
* Make res->hash->entries[h] de index of the first pattern in
|
||||
* res->patterns that has hash h */
|
||||
for (i = 0; i < patnum; i++) {
|
||||
HASH h = php_strtr_hash(&S(&res->patterns[i].pat)[res->m - res->B], res->B)
|
||||
& res->hash->table_mask;
|
||||
if (h != last_h) {
|
||||
res->hash->entries[h] = i;
|
||||
last_h = h;
|
||||
}
|
||||
}
|
||||
}
|
||||
res->hash->entries[HASH_TAB_SIZE] = patnum; /* OK, we effectively allocated SIZE+1 */
|
||||
for (i = HASH_TAB_SIZE - 1; i >= 0; i--) {
|
||||
if (res->hash->entries[i] == -1) {
|
||||
res->hash->entries[i] = res->hash->entries[i + 1];
|
||||
}
|
||||
}
|
||||
|
||||
efree(key);
|
||||
zend_hash_destroy(&tmp_hash);
|
||||
smart_str_0(&result);
|
||||
RETVAL_STRINGL(result.c, result.len, 0);
|
||||
res->patnum = patnum;
|
||||
|
||||
return res;
|
||||
}
|
||||
/* }}} */
|
||||
/* {{{ php_strtr_array_destroy_ppres(PPRES *d) */
|
||||
static void php_strtr_array_destroy_ppres(PPRES *d)
|
||||
{
|
||||
efree(d->shift);
|
||||
efree(d->hash);
|
||||
efree(d->prefix);
|
||||
efree(d->patterns);
|
||||
efree(d);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ php_strtr_array_do_repl(STR *text, PPRES *d, zval *return_value) */
|
||||
static void php_strtr_array_do_repl(STR *text, PPRES *d, zval *return_value)
|
||||
{
|
||||
STRLEN pos = 0,
|
||||
nextwpos = 0,
|
||||
lastpos = L(text) - d->m;
|
||||
smart_str result = {0};
|
||||
|
||||
while (pos <= lastpos) {
|
||||
HASH h = php_strtr_hash(&S(text)[pos + d->m - d->B], d->B) & d->shift->table_mask;
|
||||
STRLEN shift = d->shift->entries[h];
|
||||
|
||||
if (shift > 0) {
|
||||
pos += shift;
|
||||
} else {
|
||||
HASH h2 = h & d->hash->table_mask,
|
||||
prefix_h = php_strtr_hash(&S(text)[pos], d->Bp);
|
||||
|
||||
int offset_start = d->hash->entries[h2],
|
||||
offset_end = d->hash->entries[h2 + 1], /* exclusive */
|
||||
i = 0;
|
||||
|
||||
for (i = offset_start; i < offset_end; i++) {
|
||||
PATNREPL *pnr;
|
||||
if (d->prefix[i] != prefix_h)
|
||||
continue;
|
||||
|
||||
pnr = &d->patterns[i];
|
||||
if (L(&pnr->pat) > L(text) - pos ||
|
||||
memcmp(S(&pnr->pat), &S(text)[pos], L(&pnr->pat)) != 0)
|
||||
continue;
|
||||
|
||||
smart_str_appendl(&result, &S(text)[nextwpos], pos - nextwpos);
|
||||
smart_str_appendl(&result, S(&pnr->repl), L(&pnr->repl));
|
||||
pos += L(&pnr->pat);
|
||||
nextwpos = pos;
|
||||
goto end_outer_loop;
|
||||
}
|
||||
|
||||
pos++;
|
||||
end_outer_loop: ;
|
||||
}
|
||||
}
|
||||
|
||||
smart_str_appendl(&result, &S(text)[nextwpos], L(text) - nextwpos);
|
||||
|
||||
if (result.c != NULL) {
|
||||
smart_str_0(&result);
|
||||
RETVAL_STRINGL(result.c, result.len, 0);
|
||||
} else {
|
||||
RETURN_EMPTY_STRING();
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ php_strtr_array */
|
||||
static void php_strtr_array(zval *return_value, char *str, int slen, HashTable *pats)
|
||||
{
|
||||
PPRES *data;
|
||||
STR text;
|
||||
PATNREPL *patterns;
|
||||
int patterns_len;
|
||||
zend_llist *allocs;
|
||||
|
||||
S(&text) = str;
|
||||
L(&text) = slen;
|
||||
|
||||
patterns = php_strtr_array_prepare_repls(slen, pats, &allocs, &patterns_len);
|
||||
if (patterns == NULL) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
data = php_strtr_array_prepare(&text, patterns, patterns_len, 2, 2);
|
||||
efree(patterns);
|
||||
php_strtr_array_do_repl(&text, data, return_value);
|
||||
php_strtr_array_destroy_ppres(data);
|
||||
zend_llist_destroy(allocs);
|
||||
efree(allocs);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
@@ -23,7 +23,22 @@ GetImageSize()
|
||||
var_dump($result);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(11) {
|
||||
array(12) {
|
||||
["test1bpix.bmp"]=>
|
||||
array(6) {
|
||||
[0]=>
|
||||
int(500)
|
||||
[1]=>
|
||||
int(345)
|
||||
[2]=>
|
||||
int(6)
|
||||
[3]=>
|
||||
string(24) "width="500" height="345""
|
||||
["bits"]=>
|
||||
int(32)
|
||||
["mime"]=>
|
||||
string(14) "image/x-ms-bmp"
|
||||
}
|
||||
["test1pix.bmp"]=>
|
||||
array(6) {
|
||||
[0]=>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--TEST--
|
||||
image_type_to_mime_type()
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!function_exists('image_type_to_mime_type')) die('skip image_type_to_mime_type() not available');
|
||||
<?php
|
||||
if (!function_exists('image_type_to_mime_type')) die('skip image_type_to_mime_type() not available');
|
||||
require_once('skipif_imagetype.inc');
|
||||
?>
|
||||
--FILE--
|
||||
@@ -25,7 +25,9 @@ image_type_to_mime_type()
|
||||
var_dump($result);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(11) {
|
||||
array(12) {
|
||||
["test1bpix.bmp"]=>
|
||||
string(14) "image/x-ms-bmp"
|
||||
["test1pix.bmp"]=>
|
||||
string(14) "image/x-ms-bmp"
|
||||
["test1pix.jp2"]=>
|
||||
@@ -48,4 +50,4 @@ array(11) {
|
||||
string(29) "application/x-shockwave-flash"
|
||||
["test4pix.tif"]=>
|
||||
string(10) "image/tiff"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 674 KiB |
@@ -0,0 +1,121 @@
|
||||
--TEST--
|
||||
Test get_html_translation_table() function: htmlentities/HTML 4/ISO-8859-1 (bug #64011)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function so($a,$b) { return ord($a) - ord($b); }
|
||||
|
||||
$table = HTML_ENTITIES;
|
||||
$tt = get_html_translation_table($table, ENT_COMPAT, "ISO-8859-1");
|
||||
uksort( $tt, 'so' );
|
||||
var_dump( count($tt) );
|
||||
print_r( $tt );
|
||||
echo "Done\n";
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(100)
|
||||
Array
|
||||
(
|
||||
["] => "
|
||||
[&] => &
|
||||
[<] => <
|
||||
[>] => >
|
||||
[ ] =>
|
||||
[¡] => ¡
|
||||
[¢] => ¢
|
||||
[£] => £
|
||||
[¤] => ¤
|
||||
[¥] => ¥
|
||||
[¦] => ¦
|
||||
[§] => §
|
||||
[¨] => ¨
|
||||
[©] => ©
|
||||
[ª] => ª
|
||||
[«] => «
|
||||
[¬] => ¬
|
||||
[] => ­
|
||||
[®] => ®
|
||||
[¯] => ¯
|
||||
[°] => °
|
||||
[±] => ±
|
||||
[²] => ²
|
||||
[³] => ³
|
||||
[´] => ´
|
||||
[µ] => µ
|
||||
[¶] => ¶
|
||||
[·] => ·
|
||||
[¸] => ¸
|
||||
[¹] => ¹
|
||||
[º] => º
|
||||
[»] => »
|
||||
[¼] => ¼
|
||||
[½] => ½
|
||||
[¾] => ¾
|
||||
[¿] => ¿
|
||||
[À] => À
|
||||
[Á] => Á
|
||||
[Â] => Â
|
||||
[Ã] => Ã
|
||||
[Ä] => Ä
|
||||
[Å] => Å
|
||||
[Æ] => Æ
|
||||
[Ç] => Ç
|
||||
[È] => È
|
||||
[É] => É
|
||||
[Ê] => Ê
|
||||
[Ë] => Ë
|
||||
[Ì] => Ì
|
||||
[Í] => Í
|
||||
[Î] => Î
|
||||
[Ï] => Ï
|
||||
[Ð] => Ð
|
||||
[Ñ] => Ñ
|
||||
[Ò] => Ò
|
||||
[Ó] => Ó
|
||||
[Ô] => Ô
|
||||
[Õ] => Õ
|
||||
[Ö] => Ö
|
||||
[×] => ×
|
||||
[Ø] => Ø
|
||||
[Ù] => Ù
|
||||
[Ú] => Ú
|
||||
[Û] => Û
|
||||
[Ü] => Ü
|
||||
[Ý] => Ý
|
||||
[Þ] => Þ
|
||||
[ß] => ß
|
||||
[à] => à
|
||||
[á] => á
|
||||
[â] => â
|
||||
[ã] => ã
|
||||
[ä] => ä
|
||||
[å] => å
|
||||
[æ] => æ
|
||||
[ç] => ç
|
||||
[è] => è
|
||||
[é] => é
|
||||
[ê] => ê
|
||||
[ë] => ë
|
||||
[ì] => ì
|
||||
[í] => í
|
||||
[î] => î
|
||||
[ï] => ï
|
||||
[ð] => ð
|
||||
[ñ] => ñ
|
||||
[ò] => ò
|
||||
[ó] => ó
|
||||
[ô] => ô
|
||||
[õ] => õ
|
||||
[ö] => ö
|
||||
[÷] => ÷
|
||||
[ø] => ø
|
||||
[ù] => ù
|
||||
[ú] => ú
|
||||
[û] => û
|
||||
[ü] => ü
|
||||
[ý] => ý
|
||||
[þ] => þ
|
||||
[ÿ] => ÿ
|
||||
)
|
||||
Done
|
||||
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.13.5 on Wed Nov 9 19:37:48 2011 */
|
||||
/* Generated by re2c 0.13.5 on Mon Jan 21 11:34:03 2013 */
|
||||
#line 1 "ext/standard/var_unserializer.re"
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
@@ -427,7 +427,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
|
||||
|
||||
|
||||
|
||||
#line 425 "ext/standard/var_unserializer.c"
|
||||
#line 431 "ext/standard/var_unserializer.c"
|
||||
{
|
||||
YYCTYPE yych;
|
||||
static const unsigned char yybm[] = {
|
||||
@@ -487,9 +487,9 @@ yy2:
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
if (yych == ':') goto yy95;
|
||||
yy3:
|
||||
#line 747 "ext/standard/var_unserializer.re"
|
||||
#line 759 "ext/standard/var_unserializer.re"
|
||||
{ return 0; }
|
||||
#line 487 "ext/standard/var_unserializer.c"
|
||||
#line 493 "ext/standard/var_unserializer.c"
|
||||
yy4:
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
if (yych == ':') goto yy89;
|
||||
@@ -532,13 +532,13 @@ yy13:
|
||||
goto yy3;
|
||||
yy14:
|
||||
++YYCURSOR;
|
||||
#line 741 "ext/standard/var_unserializer.re"
|
||||
#line 753 "ext/standard/var_unserializer.re"
|
||||
{
|
||||
/* this is the case where we have less data than planned */
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unexpected end of serialized data");
|
||||
return 0; /* not sure if it should be 0 or 1 here? */
|
||||
}
|
||||
#line 536 "ext/standard/var_unserializer.c"
|
||||
#line 542 "ext/standard/var_unserializer.c"
|
||||
yy16:
|
||||
yych = *++YYCURSOR;
|
||||
goto yy3;
|
||||
@@ -568,7 +568,7 @@ yy20:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych != '"') goto yy18;
|
||||
++YYCURSOR;
|
||||
#line 624 "ext/standard/var_unserializer.re"
|
||||
#line 630 "ext/standard/var_unserializer.re"
|
||||
{
|
||||
size_t len, len2, len3, maxlen;
|
||||
long elements;
|
||||
@@ -691,7 +691,7 @@ yy20:
|
||||
|
||||
return object_common2(UNSERIALIZE_PASSTHRU, elements);
|
||||
}
|
||||
#line 683 "ext/standard/var_unserializer.c"
|
||||
#line 695 "ext/standard/var_unserializer.c"
|
||||
yy25:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= ',') {
|
||||
@@ -716,7 +716,7 @@ yy27:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych != '"') goto yy18;
|
||||
++YYCURSOR;
|
||||
#line 616 "ext/standard/var_unserializer.re"
|
||||
#line 622 "ext/standard/var_unserializer.re"
|
||||
{
|
||||
|
||||
INIT_PZVAL(*rval);
|
||||
@@ -724,7 +724,7 @@ yy27:
|
||||
return object_common2(UNSERIALIZE_PASSTHRU,
|
||||
object_common1(UNSERIALIZE_PASSTHRU, ZEND_STANDARD_CLASS_DEF_PTR));
|
||||
}
|
||||
#line 716 "ext/standard/var_unserializer.c"
|
||||
#line 728 "ext/standard/var_unserializer.c"
|
||||
yy32:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych == '+') goto yy33;
|
||||
@@ -745,7 +745,7 @@ yy34:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych != '{') goto yy18;
|
||||
++YYCURSOR;
|
||||
#line 596 "ext/standard/var_unserializer.re"
|
||||
#line 602 "ext/standard/var_unserializer.re"
|
||||
{
|
||||
long elements = parse_iv(start + 2);
|
||||
/* use iv() not uiv() in order to check data range */
|
||||
@@ -765,7 +765,7 @@ yy34:
|
||||
|
||||
return finish_nested_data(UNSERIALIZE_PASSTHRU);
|
||||
}
|
||||
#line 757 "ext/standard/var_unserializer.c"
|
||||
#line 769 "ext/standard/var_unserializer.c"
|
||||
yy39:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych == '+') goto yy40;
|
||||
@@ -786,7 +786,7 @@ yy41:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych != '"') goto yy18;
|
||||
++YYCURSOR;
|
||||
#line 567 "ext/standard/var_unserializer.re"
|
||||
#line 573 "ext/standard/var_unserializer.re"
|
||||
{
|
||||
size_t len, maxlen;
|
||||
char *str;
|
||||
@@ -815,7 +815,7 @@ yy41:
|
||||
ZVAL_STRINGL(*rval, str, len, 0);
|
||||
return 1;
|
||||
}
|
||||
#line 807 "ext/standard/var_unserializer.c"
|
||||
#line 819 "ext/standard/var_unserializer.c"
|
||||
yy46:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych == '+') goto yy47;
|
||||
@@ -836,7 +836,7 @@ yy48:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych != '"') goto yy18;
|
||||
++YYCURSOR;
|
||||
#line 539 "ext/standard/var_unserializer.re"
|
||||
#line 545 "ext/standard/var_unserializer.re"
|
||||
{
|
||||
size_t len, maxlen;
|
||||
char *str;
|
||||
@@ -864,7 +864,7 @@ yy48:
|
||||
ZVAL_STRINGL(*rval, str, len, 1);
|
||||
return 1;
|
||||
}
|
||||
#line 856 "ext/standard/var_unserializer.c"
|
||||
#line 868 "ext/standard/var_unserializer.c"
|
||||
yy53:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') {
|
||||
@@ -952,7 +952,7 @@ yy61:
|
||||
}
|
||||
yy63:
|
||||
++YYCURSOR;
|
||||
#line 529 "ext/standard/var_unserializer.re"
|
||||
#line 535 "ext/standard/var_unserializer.re"
|
||||
{
|
||||
#if SIZEOF_LONG == 4
|
||||
use_double:
|
||||
@@ -962,7 +962,7 @@ use_double:
|
||||
ZVAL_DOUBLE(*rval, zend_strtod((const char *)start + 2, NULL));
|
||||
return 1;
|
||||
}
|
||||
#line 954 "ext/standard/var_unserializer.c"
|
||||
#line 966 "ext/standard/var_unserializer.c"
|
||||
yy65:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= ',') {
|
||||
@@ -1021,7 +1021,7 @@ yy73:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych != ';') goto yy18;
|
||||
++YYCURSOR;
|
||||
#line 514 "ext/standard/var_unserializer.re"
|
||||
#line 520 "ext/standard/var_unserializer.re"
|
||||
{
|
||||
*p = YYCURSOR;
|
||||
INIT_PZVAL(*rval);
|
||||
@@ -1036,7 +1036,7 @@ yy73:
|
||||
|
||||
return 1;
|
||||
}
|
||||
#line 1028 "ext/standard/var_unserializer.c"
|
||||
#line 1040 "ext/standard/var_unserializer.c"
|
||||
yy76:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych == 'N') goto yy73;
|
||||
@@ -1063,7 +1063,7 @@ yy79:
|
||||
if (yych <= '9') goto yy79;
|
||||
if (yych != ';') goto yy18;
|
||||
++YYCURSOR;
|
||||
#line 487 "ext/standard/var_unserializer.re"
|
||||
#line 493 "ext/standard/var_unserializer.re"
|
||||
{
|
||||
#if SIZEOF_LONG == 4
|
||||
int digits = YYCURSOR - start - 3;
|
||||
@@ -1090,7 +1090,7 @@ yy79:
|
||||
ZVAL_LONG(*rval, parse_iv(start + 2));
|
||||
return 1;
|
||||
}
|
||||
#line 1082 "ext/standard/var_unserializer.c"
|
||||
#line 1094 "ext/standard/var_unserializer.c"
|
||||
yy83:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy18;
|
||||
@@ -1098,24 +1098,24 @@ yy83:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych != ';') goto yy18;
|
||||
++YYCURSOR;
|
||||
#line 480 "ext/standard/var_unserializer.re"
|
||||
#line 486 "ext/standard/var_unserializer.re"
|
||||
{
|
||||
*p = YYCURSOR;
|
||||
INIT_PZVAL(*rval);
|
||||
ZVAL_BOOL(*rval, parse_iv(start + 2));
|
||||
return 1;
|
||||
}
|
||||
#line 1097 "ext/standard/var_unserializer.c"
|
||||
#line 1109 "ext/standard/var_unserializer.c"
|
||||
yy87:
|
||||
++YYCURSOR;
|
||||
#line 473 "ext/standard/var_unserializer.re"
|
||||
#line 479 "ext/standard/var_unserializer.re"
|
||||
{
|
||||
*p = YYCURSOR;
|
||||
INIT_PZVAL(*rval);
|
||||
ZVAL_NULL(*rval);
|
||||
return 1;
|
||||
}
|
||||
#line 1107 "ext/standard/var_unserializer.c"
|
||||
#line 1119 "ext/standard/var_unserializer.c"
|
||||
yy89:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= ',') {
|
||||
@@ -1138,7 +1138,7 @@ yy91:
|
||||
if (yych <= '9') goto yy91;
|
||||
if (yych != ';') goto yy18;
|
||||
++YYCURSOR;
|
||||
#line 450 "ext/standard/var_unserializer.re"
|
||||
#line 456 "ext/standard/var_unserializer.re"
|
||||
{
|
||||
long id;
|
||||
|
||||
@@ -1161,7 +1161,7 @@ yy91:
|
||||
|
||||
return 1;
|
||||
}
|
||||
#line 1153 "ext/standard/var_unserializer.c"
|
||||
#line 1165 "ext/standard/var_unserializer.c"
|
||||
yy95:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= ',') {
|
||||
@@ -1184,7 +1184,7 @@ yy97:
|
||||
if (yych <= '9') goto yy97;
|
||||
if (yych != ';') goto yy18;
|
||||
++YYCURSOR;
|
||||
#line 429 "ext/standard/var_unserializer.re"
|
||||
#line 435 "ext/standard/var_unserializer.re"
|
||||
{
|
||||
long id;
|
||||
|
||||
@@ -1205,9 +1205,9 @@ yy97:
|
||||
|
||||
return 1;
|
||||
}
|
||||
#line 1197 "ext/standard/var_unserializer.c"
|
||||
#line 1209 "ext/standard/var_unserializer.c"
|
||||
}
|
||||
#line 749 "ext/standard/var_unserializer.re"
|
||||
#line 761 "ext/standard/var_unserializer.re"
|
||||
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -678,10 +678,13 @@ object ":" uiv ":" ["] {
|
||||
|
||||
do {
|
||||
/* Try to find class directly */
|
||||
BG(serialize_lock) = 1;
|
||||
if (zend_lookup_class(class_name, len2, &pce TSRMLS_CC) == SUCCESS) {
|
||||
BG(serialize_lock) = 0;
|
||||
ce = *pce;
|
||||
break;
|
||||
}
|
||||
BG(serialize_lock) = 0;
|
||||
|
||||
/* Check for unserialize callback */
|
||||
if ((PG(unserialize_callback_func) == NULL) || (PG(unserialize_callback_func)[0] == '\0')) {
|
||||
@@ -696,7 +699,9 @@ object ":" uiv ":" ["] {
|
||||
args[0] = &arg_func_name;
|
||||
MAKE_STD_ZVAL(arg_func_name);
|
||||
ZVAL_STRING(arg_func_name, class_name, 1);
|
||||
BG(serialize_lock) = 1;
|
||||
if (call_user_function_ex(CG(function_table), NULL, user_func, &retval_ptr, 1, args, 0, NULL TSRMLS_CC) != SUCCESS) {
|
||||
BG(serialize_lock) = 0;
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "defined (%s) but not found", user_func->value.str.val);
|
||||
incomplete_class = 1;
|
||||
ce = PHP_IC_ENTRY;
|
||||
@@ -704,6 +709,7 @@ object ":" uiv ":" ["] {
|
||||
zval_ptr_dtor(&arg_func_name);
|
||||
break;
|
||||
}
|
||||
BG(serialize_lock) = 0;
|
||||
if (retval_ptr) {
|
||||
zval_ptr_dtor(&retval_ptr);
|
||||
}
|
||||
|
||||
+2
-2
@@ -3,6 +3,6 @@
|
||||
#define PHP_MAJOR_VERSION 5
|
||||
#define PHP_MINOR_VERSION 4
|
||||
#define PHP_RELEASE_VERSION 12
|
||||
#define PHP_EXTRA_VERSION "-dev"
|
||||
#define PHP_VERSION "5.4.12-dev"
|
||||
#define PHP_EXTRA_VERSION ""
|
||||
#define PHP_VERSION "5.4.12"
|
||||
#define PHP_VERSION_ID 50412
|
||||
+2
-2
@@ -211,7 +211,7 @@ static void xbuf_format_converter(smart_str *xbuf, const char *fmt, va_list ap)
|
||||
|
||||
double fp_num;
|
||||
wide_int i_num = (wide_int) 0;
|
||||
u_wide_int ui_num;
|
||||
u_wide_int ui_num = (u_wide_int) 0;
|
||||
|
||||
char num_buf[NUM_BUF_SIZE];
|
||||
char char_buf[2]; /* for printing %% and %<unknown> */
|
||||
@@ -560,7 +560,7 @@ static void xbuf_format_converter(smart_str *xbuf, const char *fmt, va_list ap)
|
||||
s = ap_php_conv_p2(ui_num, 4, *fmt,
|
||||
&num_buf[NUM_BUF_SIZE], &s_len);
|
||||
FIX_PRECISION(adjust_precision, precision, s, s_len);
|
||||
if (alternate_form && i_num != 0) {
|
||||
if (alternate_form && ui_num != 0) {
|
||||
*--s = *fmt; /* 'x' or 'X' */
|
||||
*--s = '0';
|
||||
s_len += 2;
|
||||
|
||||
@@ -31,7 +31,7 @@ PHPAPI php_stream *_php_stream_fopen(const char *filename, const char *mode, cha
|
||||
#define php_stream_fopen(filename, mode, opened) _php_stream_fopen((filename), (mode), (opened), 0 STREAMS_CC TSRMLS_CC)
|
||||
|
||||
PHPAPI php_stream *_php_stream_fopen_with_path(char *filename, char *mode, char *path, char **opened_path, int options STREAMS_DC TSRMLS_DC);
|
||||
#define php_stream_fopen_with_path(filename, mode, path, opened) _php_stream_fopen_with_path((filename), (mode), (path), (opened) STREAMS_CC TSRMLS_CC)
|
||||
#define php_stream_fopen_with_path(filename, mode, path, opened) _php_stream_fopen_with_path((filename), (mode), (path), (opened), 0 STREAMS_CC TSRMLS_CC)
|
||||
|
||||
PHPAPI php_stream *_php_stream_fopen_from_file(FILE *file, const char *mode STREAMS_DC TSRMLS_DC);
|
||||
#define php_stream_fopen_from_file(file, mode) _php_stream_fopen_from_file((file), (mode) STREAMS_CC TSRMLS_CC)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
enum fpm_address_domain fpm_sockets_domain_from_address(char *addr);
|
||||
int fpm_sockets_init_main();
|
||||
int fpm_socket_get_listening_queue(int sock, unsigned *cur_lq, unsigned *max_lq);
|
||||
int fpm_socket_unix_test_connect(struct sockaddr_un *sun, size_t socklen);
|
||||
int fpm_socket_unix_test_connect(struct sockaddr_un *sock, size_t socklen);
|
||||
|
||||
|
||||
static inline int fd_set_blocked(int fd, int blocked) /* {{{ */
|
||||
|
||||
@@ -140,15 +140,15 @@ true
|
||||
new publicProperty value via public access
|
||||
|
||||
protectedProperty set
|
||||
__isset "protectedProperty"__isset "protectedProperty"false
|
||||
__isset "protectedProperty"false
|
||||
__get "protectedProperty"
|
||||
__set "protectedProperty" to "new protectedProperty value via setter"
|
||||
__isset "protectedProperty"true
|
||||
new protectedProperty value via setter
|
||||
|
||||
privateProperty set
|
||||
__isset "privateProperty"__isset "privateProperty"false
|
||||
__isset "privateProperty"false
|
||||
__get "privateProperty"
|
||||
__set "privateProperty" to "new privateProperty value via setter"
|
||||
__isset "privateProperty"true
|
||||
new privateProperty value via setter
|
||||
new privateProperty value via setter
|
||||
@@ -91,6 +91,7 @@ static int LoadDirectory(HashTable *directories, HKEY key, char *path, int path_
|
||||
INIT_PZVAL(data);
|
||||
Z_STRVAL_P(data) = zend_strndup(value, value_len-1);
|
||||
Z_STRLEN_P(data) = value_len-1;
|
||||
Z_TYPE_P(data) = IS_STRING;
|
||||
zend_hash_update(ht, name, name_len+1, &data, sizeof(zval*), NULL);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user