mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-09 10:10:50 +00:00
Compare commits
154
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
00f84126d1 | ||
|
|
993f9fbccc | ||
|
|
0351fd5552 | ||
|
|
7ffb77d243 | ||
|
|
7c08232509 | ||
|
|
61099f8585 | ||
|
|
52d1add0fe | ||
|
|
d24ac6953e | ||
|
|
1b58bd39a6 | ||
|
|
064c62e4cf | ||
|
|
1e9bc56775 | ||
|
|
fcd4b5335a | ||
|
|
b5d267aa95 | ||
|
|
7b113d789d | ||
|
|
c16d6befd4 | ||
|
|
bc55a8eb9f | ||
|
|
9a44a9806c | ||
|
|
bae95bd9d4 | ||
|
|
07a13fd9fa | ||
|
|
81e9aa6c8d | ||
|
|
c737b89473 | ||
|
|
8e76d0404b | ||
|
|
021f57ef0e | ||
|
|
afc1debb2f | ||
|
|
cc34dfce16 | ||
|
|
558c5dbe65 | ||
|
|
42437dd870 | ||
|
|
7b0107cc5d | ||
|
|
92b1cb3ca0 | ||
|
|
59b016192d | ||
|
|
263accb626 | ||
|
|
01ae5c3c2f | ||
|
|
375e3c273b | ||
|
|
68fa6a3eb7 | ||
|
|
4b900f4831 | ||
|
|
188c196d4d | ||
|
|
050aae2860 | ||
|
|
e67a2b9e47 | ||
|
|
bfdb889d4f | ||
|
|
0ea83ff847 | ||
|
|
92a7924c1a | ||
|
|
1a18e84822 | ||
|
|
afe98b7829 | ||
|
|
ed6763420c | ||
|
|
702b436ef4 | ||
|
|
cc4c318b0c | ||
|
|
e7ce002c01 | ||
|
|
6533094d9e | ||
|
|
740b823be8 | ||
|
|
643ce95b5b | ||
|
|
0110662ae9 | ||
|
|
73de4d8c68 | ||
|
|
ac6342bbc0 | ||
|
|
40663ede83 | ||
|
|
24e380f970 | ||
|
|
9283b8aea4 | ||
|
|
97d656fc82 | ||
|
|
a100c25ea4 | ||
|
|
0cea9e6843 | ||
|
|
f45a85c386 | ||
|
|
b09f5a4f56 | ||
|
|
9d75bf35e9 | ||
|
|
f7362232f4 | ||
|
|
9d6636364d | ||
|
|
a80fdc47b3 | ||
|
|
836a2b1131 | ||
|
|
4a01ddfb55 | ||
|
|
bb4d11b405 | ||
|
|
321f4f18e5 | ||
|
|
31468401b7 | ||
|
|
09b6e33b40 | ||
|
|
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 | ||
|
|
625000ab44 | ||
|
|
d4650c5d69 | ||
|
|
f9e8678dd3 | ||
|
|
f3b1b85169 | ||
|
|
15aaa9c660 | ||
|
|
c05ee74e7f | ||
|
|
6e684e6a6c | ||
|
|
9c52d09ebc | ||
|
|
0de5fb4165 | ||
|
|
67c662a0a2 | ||
|
|
ba35ae32b7 | ||
|
|
bdc1e2302c | ||
|
|
ff9c1b12ff | ||
|
|
d7da1aa694 | ||
|
|
a426e0b050 | ||
|
|
a3a699e090 | ||
|
|
c2f8e90504 | ||
|
|
bc11e6fdbb | ||
|
|
8e5460ad86 | ||
|
|
67557fcfce | ||
|
|
2feea39a33 | ||
|
|
aff5d084a5 | ||
|
|
c3e6de2227 | ||
|
|
5894aa0950 | ||
|
|
aaecb99c6b | ||
|
|
712710bfec |
No files matched your search
@@ -1,11 +1,103 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
03 Jan 2013, PHP 5.4.11 RC1
|
||||
14 Mar 2012, PHP 5.4.13
|
||||
|
||||
- Core:
|
||||
. Fixed bug #64235 (Insteadof not work for class method in 5.4.11).
|
||||
(Laruence)
|
||||
. Implemented FR #64175 (Added HTTP codes as of RFC 6585). (Jonh Wendell)
|
||||
. Fixed bug #64142 (dval to lval different behavior on ppc64). (Remi)
|
||||
. Fixed bug #64070 (Inheritance with Traits failed with error). (Dmitry)
|
||||
|
||||
- CLI server:
|
||||
. Fixed bug #64128 (buit-in web server is broken on ppc64). (Remi)
|
||||
|
||||
- Mbstring:
|
||||
. mb_split() can now handle empty matches like preg_split() does. (Moriyoshi)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #61930 (openssl corrupts ssl key resource when using
|
||||
openssl_get_publickey()). (Stas)
|
||||
|
||||
- PDO_mysql:
|
||||
. Fixed bug #60840 (undefined symbol: mysqlnd_debug_std_no_trace_funcs).
|
||||
(Johannes)
|
||||
|
||||
- Phar:
|
||||
. Fixed timestamp update on Phar contents modification. (Dmitry)
|
||||
|
||||
- SOAP
|
||||
. Added check that soap.wsdl_cache_dir conforms to open_basedir
|
||||
(CVE-2013-1635). (Dmitry)
|
||||
. Disabled external entities loading (CVE-2013-1643). (Dmitry)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #64264 (SPLFixedArray toArray problem). (Laruence)
|
||||
. Fixed bug #64228 (RecursiveDirectoryIterator always assumes SKIP_DOTS).
|
||||
(patch by kriss@krizalys.com, Laruence)
|
||||
. Fixed bug #64106 (Segfault on SplFixedArray[][x] = y when extended).
|
||||
(Nikita Popov)
|
||||
. Fixed bug #52861 (unset fails with ArrayObject and deep arrays).
|
||||
(Mike Willbanks)
|
||||
|
||||
- SNMP:
|
||||
. Fixed bug #64124 (IPv6 malformed). (Boris Lytochkin)
|
||||
|
||||
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)
|
||||
|
||||
- ext/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)
|
||||
|
||||
- OpenSSL:
|
||||
. New SSL stream context option to prevent CRIME attack vector. (Daniel Lowrey,
|
||||
Lars)
|
||||
|
||||
17 Jan 2012, PHP 5.4.11
|
||||
|
||||
- Core:
|
||||
. 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:
|
||||
|
||||
@@ -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 #63882 (zend_std_compare_objects crash on recursion)
|
||||
--FILE--
|
||||
<?php
|
||||
class Test { public $x = 5; }
|
||||
|
||||
$testobj1 = new Test;
|
||||
$testobj2 = new Test;
|
||||
$testobj1->x = $testobj1;
|
||||
$testobj2->x = $testobj2;
|
||||
|
||||
var_dump($testobj1 == $testobj2);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Nesting level too deep - recursive dependency? in %sbug63882.php on line 9
|
||||
@@ -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)
|
||||
@@ -0,0 +1,36 @@
|
||||
--TEST--
|
||||
Bug #64070 (Inheritance with Traits failed with error)
|
||||
--FILE--
|
||||
<?php
|
||||
trait first_trait
|
||||
{
|
||||
function first_function()
|
||||
{
|
||||
echo "From First Trait\n";
|
||||
}
|
||||
}
|
||||
|
||||
trait second_trait
|
||||
{
|
||||
use first_trait {
|
||||
first_trait::first_function as second_function;
|
||||
}
|
||||
|
||||
function first_function()
|
||||
{
|
||||
echo "From Second Trait\n";
|
||||
}
|
||||
}
|
||||
|
||||
class first_class
|
||||
{
|
||||
use second_trait;
|
||||
}
|
||||
|
||||
$obj = new first_class();
|
||||
$obj->first_function();
|
||||
$obj->second_function();
|
||||
?>
|
||||
--EXPECT--
|
||||
From Second Trait
|
||||
From First Trait
|
||||
@@ -0,0 +1,34 @@
|
||||
--TEST--
|
||||
Bug #64235 (Insteadof not work for class method in 5.4.11)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class TestParentClass
|
||||
{
|
||||
public function method()
|
||||
{
|
||||
print_r('Parent method');
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
|
||||
trait TestTrait
|
||||
{
|
||||
public function method()
|
||||
{
|
||||
print_r('Trait method');
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
|
||||
class TestChildClass extends TestParentClass
|
||||
{
|
||||
use TestTrait
|
||||
{
|
||||
TestTrait::method as methodAlias;
|
||||
TestParentClass::method insteadof TestTrait;
|
||||
}
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Class TestParentClass is not a trait, Only traits may be used in 'as' and 'insteadof' statements in %sbug64235.php on line %d
|
||||
@@ -0,0 +1,35 @@
|
||||
--TEST--
|
||||
Bug #64235 (Insteadof not work for class method in 5.4.11)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class TestParentClass
|
||||
{
|
||||
public function method()
|
||||
{
|
||||
print_r('Parent method');
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
|
||||
trait TestTrait
|
||||
{
|
||||
public function method()
|
||||
{
|
||||
print_r('Trait method');
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
|
||||
class TestChildClass extends TestParentClass
|
||||
{
|
||||
use TestTrait
|
||||
{
|
||||
TestTrait::method as methodAlias;
|
||||
TestParentClass::method as TestParent;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Class TestParentClass is not a trait, Only traits may be used in 'as' and 'insteadof' statements in %sbug64235b.php on line %d
|
||||
@@ -14,4 +14,4 @@ class C {
|
||||
}
|
||||
}
|
||||
--EXPECTF--
|
||||
Fatal error: Trait T2 is not used in %s on line %d
|
||||
Fatal error: Required Trait T2 wasn't added to C in %slanguage015.php on line %d
|
||||
@@ -14,4 +14,4 @@ class C {
|
||||
}
|
||||
}
|
||||
--EXPECTF--
|
||||
Fatal error: Trait T2 is not used in %s on line %d
|
||||
Fatal error: Required Trait T2 wasn't added to C in %slanguage016.php on line %d
|
||||
@@ -14,4 +14,4 @@ class C {
|
||||
}
|
||||
}
|
||||
--EXPECTF--
|
||||
Fatal error: Trait T2 is not used in %s on line %d
|
||||
Fatal error: Required Trait T2 wasn't added to C in %slanguage017.php on line %d
|
||||
+3
-3
@@ -60,7 +60,7 @@ typedef struct _zend_fcall_info_cache {
|
||||
zval *object_ptr;
|
||||
} zend_fcall_info_cache;
|
||||
|
||||
#define ZEND_NS_NAME(ns, name) ns"\\"name
|
||||
#define ZEND_NS_NAME(ns, name) ns "\\" name
|
||||
|
||||
#define ZEND_FN(name) zif_##name
|
||||
#define ZEND_MN(name) zim_##name
|
||||
@@ -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);
|
||||
|
||||
+12
-9
@@ -3786,7 +3786,7 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args,
|
||||
overriden = va_arg(args, HashTable**);
|
||||
exclude_table = va_arg(args, HashTable*);
|
||||
|
||||
fnname_len = strlen(fn->common.function_name);
|
||||
fnname_len = hash_key->nKeyLength - 1;
|
||||
|
||||
/* apply aliases which are qualified with a class name, there should not be any ambiguity */
|
||||
if (ce->trait_aliases) {
|
||||
@@ -3797,7 +3797,7 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args,
|
||||
if (alias->alias != NULL
|
||||
&& (!alias->trait_method->ce || fn->common.scope == alias->trait_method->ce)
|
||||
&& alias->trait_method->mname_len == fnname_len
|
||||
&& (zend_binary_strcasecmp(alias->trait_method->method_name, alias->trait_method->mname_len, fn->common.function_name, fnname_len) == 0)) {
|
||||
&& (zend_binary_strcasecmp(alias->trait_method->method_name, alias->trait_method->mname_len, hash_key->arKey, fnname_len) == 0)) {
|
||||
fn_copy = *fn;
|
||||
|
||||
/* if it is 0, no modifieres has been changed */
|
||||
@@ -3819,7 +3819,7 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args,
|
||||
}
|
||||
}
|
||||
|
||||
lcname = zend_str_tolower_dup(fn->common.function_name, fnname_len);
|
||||
lcname = hash_key->arKey;
|
||||
|
||||
if (exclude_table == NULL || zend_hash_find(exclude_table, lcname, fnname_len, &dummy) == FAILURE) {
|
||||
/* is not in hashtable, thus, function is not to be excluded */
|
||||
@@ -3834,7 +3834,7 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args,
|
||||
if (alias->alias == NULL && alias->modifiers != 0
|
||||
&& (!alias->trait_method->ce || fn->common.scope == alias->trait_method->ce)
|
||||
&& (alias->trait_method->mname_len == fnname_len)
|
||||
&& (zend_binary_strcasecmp(alias->trait_method->method_name, alias->trait_method->mname_len, fn->common.function_name, fnname_len) == 0)) {
|
||||
&& (zend_binary_strcasecmp(alias->trait_method->method_name, alias->trait_method->mname_len, lcname, fnname_len) == 0)) {
|
||||
|
||||
fn_copy.common.fn_flags = alias->modifiers | (fn->common.fn_flags ^ (fn->common.fn_flags & ZEND_ACC_PPP_MASK));
|
||||
|
||||
@@ -3851,8 +3851,6 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args,
|
||||
zend_add_trait_method(ce, fn->common.function_name, lcname, fnname_len+1, &fn_copy, overriden TSRMLS_CC);
|
||||
}
|
||||
|
||||
efree(lcname);
|
||||
|
||||
return ZEND_HASH_APPLY_KEEP;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -3861,12 +3859,16 @@ static void zend_check_trait_usage(zend_class_entry *ce, zend_class_entry *trait
|
||||
{
|
||||
zend_uint i;
|
||||
|
||||
if ((trait->ce_flags & ZEND_ACC_TRAIT) != ZEND_ACC_TRAIT) {
|
||||
zend_error(E_COMPILE_ERROR, "Class %s is not a trait, Only traits may be used in 'as' and 'insteadof' statements", trait->name);
|
||||
}
|
||||
|
||||
for (i = 0; i < ce->num_traits; i++) {
|
||||
if (ce->traits[i] == trait) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
zend_error(E_COMPILE_ERROR, "Trait %s is not used", trait->name);
|
||||
zend_error(E_COMPILE_ERROR, "Required Trait %s wasn't added to %s", trait->name, ce->name);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -4795,10 +4797,11 @@ void zend_do_begin_class_declaration(const znode *class_token, znode *class_name
|
||||
/* Prefix class name with name of current namespace */
|
||||
znode tmp;
|
||||
|
||||
tmp.op_type = IS_CONST;
|
||||
tmp.u.constant = *CG(current_namespace);
|
||||
zval_copy_ctor(&tmp.u.constant);
|
||||
zend_do_build_namespace_name(&tmp, &tmp, class_name TSRMLS_CC);
|
||||
class_name = &tmp;
|
||||
*class_name = tmp;
|
||||
efree(lcname);
|
||||
lcname = zend_str_tolower_dup(Z_STRVAL(class_name->u.constant), Z_STRLEN(class_name->u.constant));
|
||||
}
|
||||
@@ -4931,7 +4934,7 @@ void zend_do_end_class_declaration(const znode *class_token, const znode *parent
|
||||
}
|
||||
|
||||
if (!(ce->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS))
|
||||
&& ((parent_token->op_type != IS_UNUSED) || (ce->num_interfaces > 0))) {
|
||||
&& (parent_token || (ce->num_interfaces > 0))) {
|
||||
zend_verify_abstract_class(ce TSRMLS_CC);
|
||||
if (ce->num_interfaces && !(ce->ce_flags & ZEND_ACC_IMPLEMENT_TRAITS)) {
|
||||
do_verify_abstract_class(TSRMLS_C);
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@
|
||||
#define ZEND_INI_ALL (ZEND_INI_USER|ZEND_INI_PERDIR|ZEND_INI_SYSTEM)
|
||||
|
||||
#ifndef XtOffsetOf
|
||||
# if defined(CRAY) || (defined(__arm) && !defined(LINUX))
|
||||
# if defined(CRAY) || (defined(__ARMCC_VERSION) && !defined(LINUX))
|
||||
# ifdef __STDC__
|
||||
# define XtOffset(p_type, field) _Offsetof(p_type, field)
|
||||
# else
|
||||
|
||||
@@ -375,13 +375,13 @@ unticked_class_declaration_statement:
|
||||
implements_list
|
||||
'{'
|
||||
class_statement_list
|
||||
'}' { zend_do_end_class_declaration(&$1, &$2 TSRMLS_CC); }
|
||||
'}' { zend_do_end_class_declaration(&$1, &$3 TSRMLS_CC); }
|
||||
| interface_entry T_STRING
|
||||
{ zend_do_begin_class_declaration(&$1, &$2, NULL TSRMLS_CC); }
|
||||
interface_extends_list
|
||||
'{'
|
||||
class_statement_list
|
||||
'}' { zend_do_end_class_declaration(&$1, &$2 TSRMLS_CC); }
|
||||
'}' { zend_do_end_class_declaration(&$1, NULL TSRMLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
|
||||
@@ -35,6 +35,17 @@
|
||||
#define Z_OBJ_P(zval_p) \
|
||||
((zend_object*)(EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(zval_p)].bucket.obj.object))
|
||||
|
||||
#define Z_OBJ_PROTECT_RECURSION(zval_p) \
|
||||
do { \
|
||||
if (EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(zval_p)].apply_count++ >= 3) { \
|
||||
zend_error(E_ERROR, "Nesting level too deep - recursive dependency?"); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
||||
#define Z_OBJ_UNPROTECT_RECURSION(zval_p) \
|
||||
EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(zval_p)].apply_count--
|
||||
|
||||
/*
|
||||
__X accessors explanation:
|
||||
|
||||
@@ -382,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);
|
||||
@@ -424,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) &&
|
||||
@@ -1319,28 +1340,43 @@ static int zend_std_compare_objects(zval *o1, zval *o2 TSRMLS_DC) /* {{{ */
|
||||
}
|
||||
if (!zobj1->properties && !zobj2->properties) {
|
||||
int i;
|
||||
|
||||
Z_OBJ_PROTECT_RECURSION(o1);
|
||||
Z_OBJ_PROTECT_RECURSION(o2);
|
||||
for (i = 0; i < zobj1->ce->default_properties_count; i++) {
|
||||
if (zobj1->properties_table[i]) {
|
||||
if (zobj2->properties_table[i]) {
|
||||
zval result;
|
||||
|
||||
if (compare_function(&result, zobj1->properties_table[i], zobj2->properties_table[i] TSRMLS_CC)==FAILURE) {
|
||||
Z_OBJ_UNPROTECT_RECURSION(o1);
|
||||
Z_OBJ_UNPROTECT_RECURSION(o2);
|
||||
return 1;
|
||||
}
|
||||
if (Z_LVAL(result) != 0) {
|
||||
Z_OBJ_UNPROTECT_RECURSION(o1);
|
||||
Z_OBJ_UNPROTECT_RECURSION(o2);
|
||||
return Z_LVAL(result);
|
||||
}
|
||||
} else {
|
||||
Z_OBJ_UNPROTECT_RECURSION(o1);
|
||||
Z_OBJ_UNPROTECT_RECURSION(o2);
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
if (zobj2->properties_table[i]) {
|
||||
Z_OBJ_UNPROTECT_RECURSION(o1);
|
||||
Z_OBJ_UNPROTECT_RECURSION(o2);
|
||||
return 1;
|
||||
} else {
|
||||
Z_OBJ_UNPROTECT_RECURSION(o1);
|
||||
Z_OBJ_UNPROTECT_RECURSION(o2);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Z_OBJ_UNPROTECT_RECURSION(o1);
|
||||
Z_OBJ_UNPROTECT_RECURSION(o2);
|
||||
return 0;
|
||||
} else {
|
||||
if (!zobj1->properties) {
|
||||
|
||||
@@ -117,6 +117,7 @@ ZEND_API zend_object_handle zend_objects_store_put(void *object, zend_objects_st
|
||||
obj = &EG(objects_store).object_buckets[handle].bucket.obj;
|
||||
EG(objects_store).object_buckets[handle].destructor_called = 0;
|
||||
EG(objects_store).object_buckets[handle].valid = 1;
|
||||
EG(objects_store).object_buckets[handle].apply_count = 0;
|
||||
|
||||
obj->refcount = 1;
|
||||
GC_OBJ_INIT(obj);
|
||||
|
||||
@@ -31,6 +31,7 @@ typedef void (*zend_objects_store_clone_t)(void *object, void **object_clone TSR
|
||||
typedef struct _zend_object_store_bucket {
|
||||
zend_bool destructor_called;
|
||||
zend_bool valid;
|
||||
zend_uchar apply_count;
|
||||
union _store_bucket {
|
||||
struct _store_object {
|
||||
void *object;
|
||||
|
||||
@@ -79,7 +79,8 @@ static zend_always_inline long zend_dval_to_lval(double d)
|
||||
#else
|
||||
static zend_always_inline long zend_dval_to_lval(double d)
|
||||
{
|
||||
if (d > LONG_MAX) {
|
||||
/* >= as (double)LONG_MAX is outside signed range */
|
||||
if (d >= LONG_MAX) {
|
||||
return (long)(unsigned long) d;
|
||||
}
|
||||
return (long) d;
|
||||
|
||||
+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();
|
||||
|
||||
Vendored
+1
-1
@@ -897,7 +897,7 @@ case $basic_machine in
|
||||
;;
|
||||
ppc64) basic_machine=powerpc64-unknown
|
||||
;;
|
||||
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
ppc64le | powerpc64little | ppc64-le | powerpc64-little)
|
||||
basic_machine=powerpc64le-unknown
|
||||
|
||||
+2
-2
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=5
|
||||
PHP_MINOR_VERSION=4
|
||||
PHP_RELEASE_VERSION=11
|
||||
PHP_EXTRA_VERSION="RC1"
|
||||
PHP_RELEASE_VERSION=13
|
||||
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`
|
||||
|
||||
|
||||
@@ -38,4 +38,4 @@ curl_close($ch);
|
||||
?>
|
||||
--EXPECTF--
|
||||
== Testing curl_error with a fake URL ==
|
||||
string(%d) "%sfakeURL%s"
|
||||
string(%d) "%sfakeURL%S"
|
||||
+45
-9
@@ -495,9 +495,11 @@ int php_date_global_timezone_db_enabled;
|
||||
/* on 90'35; common sunrise declaration (sun body disappeared) */
|
||||
#define DATE_SUNRISE_ZENITH "90.583333"
|
||||
|
||||
static PHP_INI_MH(OnUpdate_date_timezone);
|
||||
|
||||
/* {{{ INI Settings */
|
||||
PHP_INI_BEGIN()
|
||||
STD_PHP_INI_ENTRY("date.timezone", "", PHP_INI_ALL, OnUpdateString, default_timezone, zend_date_globals, date_globals)
|
||||
STD_PHP_INI_ENTRY("date.timezone", "", PHP_INI_ALL, OnUpdate_date_timezone, default_timezone, zend_date_globals, date_globals)
|
||||
PHP_INI_ENTRY("date.default_latitude", DATE_DEFAULT_LATITUDE, PHP_INI_ALL, NULL)
|
||||
PHP_INI_ENTRY("date.default_longitude", DATE_DEFAULT_LONGITUDE, PHP_INI_ALL, NULL)
|
||||
PHP_INI_ENTRY("date.sunset_zenith", DATE_SUNSET_ZENITH, PHP_INI_ALL, NULL)
|
||||
@@ -599,6 +601,7 @@ static PHP_GINIT_FUNCTION(date)
|
||||
date_globals->default_timezone = NULL;
|
||||
date_globals->timezone = NULL;
|
||||
date_globals->tzcache = NULL;
|
||||
date_globals->timezone_valid = 0;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -844,25 +847,54 @@ timelib_tzinfo *php_date_parse_tzfile_wrapper(char *formal_tzname, const timelib
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* Callback to check the date.timezone only when changed increases performance */
|
||||
/* {{{ static PHP_INI_MH(OnUpdate_date_timezone) */
|
||||
static PHP_INI_MH(OnUpdate_date_timezone)
|
||||
{
|
||||
if (OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC) == FAILURE) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
DATEG(timezone_valid) = 0;
|
||||
if (stage == PHP_INI_STAGE_RUNTIME) {
|
||||
if (!timelib_timezone_id_is_valid(DATEG(default_timezone), DATE_TIMEZONEDB)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, DATE_TZ_ERRMSG);
|
||||
} else {
|
||||
DATEG(timezone_valid) = 1;
|
||||
}
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ Helper functions */
|
||||
static char* guess_timezone(const timelib_tzdb *tzdb TSRMLS_DC)
|
||||
{
|
||||
/* Checking configure timezone */
|
||||
if (DATEG(timezone) && (strlen(DATEG(timezone)) > 0)) {
|
||||
if (DATEG(timezone) && (strlen(DATEG(timezone))) > 0) {
|
||||
return DATEG(timezone);
|
||||
}
|
||||
/* Check config setting for default timezone */
|
||||
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)) {
|
||||
|
||||
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)) {
|
||||
} else if (*DATEG(default_timezone)) {
|
||||
if (DATEG(timezone_valid) == 1) {
|
||||
return DATEG(default_timezone);
|
||||
}
|
||||
|
||||
if (!timelib_timezone_id_is_valid(DATEG(default_timezone), tzdb)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid date.timezone value '%s', we selected the timezone 'UTC' for now.", DATEG(default_timezone));
|
||||
return "UTC";
|
||||
}
|
||||
|
||||
DATEG(timezone_valid) = 1;
|
||||
return DATEG(default_timezone);
|
||||
}
|
||||
/* Fallback to UTC */
|
||||
@@ -2013,7 +2045,11 @@ static int date_object_compare_date(zval *d1, zval *d2 TSRMLS_DC)
|
||||
instanceof_function(Z_OBJCE_P(d2), date_ce_date TSRMLS_CC)) {
|
||||
php_date_obj *o1 = zend_object_store_get_object(d1 TSRMLS_CC);
|
||||
php_date_obj *o2 = zend_object_store_get_object(d2 TSRMLS_CC);
|
||||
|
||||
|
||||
if (!o1->time || !o2->time) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Trying to compare an incomplete DateTime object");
|
||||
return 1;
|
||||
}
|
||||
if (!o1->time->sse_uptodate) {
|
||||
timelib_update_ts(o1->time, o1->time->tz_info);
|
||||
}
|
||||
|
||||
+4
-3
@@ -150,10 +150,11 @@ struct _php_period_obj {
|
||||
};
|
||||
|
||||
ZEND_BEGIN_MODULE_GLOBALS(date)
|
||||
char *default_timezone;
|
||||
char *timezone;
|
||||
HashTable *tzcache;
|
||||
char *default_timezone;
|
||||
char *timezone;
|
||||
HashTable *tzcache;
|
||||
timelib_error_container *last_errors;
|
||||
int timezone_valid;
|
||||
ZEND_END_MODULE_GLOBALS(date)
|
||||
|
||||
#ifdef ZTS
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--TEST--
|
||||
Bug #55397 (comparsion of incomplete DateTime causes SIGSEGV)
|
||||
--INI--
|
||||
--FILE--
|
||||
<?php
|
||||
date_default_timezone_set('Europe/Prague');
|
||||
var_dump(unserialize('O:8:"DateTime":0:{}') == new DateTime);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: %s: Trying to compare an incomplete DateTime object in %s on line %d
|
||||
bool(false)
|
||||
@@ -0,0 +1,11 @@
|
||||
--TEST--
|
||||
date_default_timezone_get() function [4]
|
||||
--INI--
|
||||
date.timezone=Incorrect/Zone
|
||||
--FILE--
|
||||
<?php
|
||||
echo date_default_timezone_get(), "\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: date_default_timezone_get(): Invalid date.timezone value 'Incorrect/Zone', we selected the timezone 'UTC' for now. in %sdate_default_timezone_get-4.php on line %d
|
||||
UTC
|
||||
+15
-18
@@ -270,6 +270,7 @@ static PHP_GINIT_FUNCTION(libxml)
|
||||
libxml_globals->error_buffer.c = NULL;
|
||||
libxml_globals->error_list = NULL;
|
||||
libxml_globals->entity_loader.fci.size = 0;
|
||||
libxml_globals->entity_loader_disabled = 0;
|
||||
}
|
||||
|
||||
static void _php_libxml_destroy_fci(zend_fcall_info *fci)
|
||||
@@ -368,17 +369,16 @@ static int php_libxml_streams_IO_close(void *context)
|
||||
return php_stream_close((php_stream*)context);
|
||||
}
|
||||
|
||||
static xmlParserInputBufferPtr
|
||||
php_libxml_input_buffer_noload(const char *URI, xmlCharEncoding enc)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static xmlParserInputBufferPtr
|
||||
php_libxml_input_buffer_create_filename(const char *URI, xmlCharEncoding enc)
|
||||
{
|
||||
xmlParserInputBufferPtr ret;
|
||||
void *context = NULL;
|
||||
TSRMLS_FETCH();
|
||||
|
||||
if (LIBXML(entity_loader_disabled)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (URI == NULL)
|
||||
return(NULL);
|
||||
@@ -1052,28 +1052,25 @@ static PHP_FUNCTION(libxml_clear_errors)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
PHP_LIBXML_API zend_bool php_libxml_disable_entity_loader(zend_bool disable TSRMLS_DC)
|
||||
{
|
||||
zend_bool old = LIBXML(entity_loader_disabled);
|
||||
|
||||
LIBXML(entity_loader_disabled) = disable;
|
||||
return old;
|
||||
}
|
||||
|
||||
/* {{{ proto bool libxml_disable_entity_loader([boolean disable])
|
||||
Disable/Enable ability to load external entities */
|
||||
static PHP_FUNCTION(libxml_disable_entity_loader)
|
||||
{
|
||||
zend_bool disable = 1;
|
||||
xmlParserInputBufferCreateFilenameFunc old;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &disable) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (disable == 0) {
|
||||
old = xmlParserInputBufferCreateFilenameDefault(php_libxml_input_buffer_create_filename);
|
||||
} else {
|
||||
old = xmlParserInputBufferCreateFilenameDefault(php_libxml_input_buffer_noload);
|
||||
}
|
||||
|
||||
if (old == php_libxml_input_buffer_noload) {
|
||||
RETURN_TRUE;
|
||||
}
|
||||
|
||||
RETURN_FALSE;
|
||||
RETURN_BOOL(php_libxml_disable_entity_loader(disable TSRMLS_CC));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ ZEND_BEGIN_MODULE_GLOBALS(libxml)
|
||||
zend_fcall_info fci;
|
||||
zend_fcall_info_cache fcc;
|
||||
} entity_loader;
|
||||
zend_bool entity_loader_disabled;
|
||||
ZEND_END_MODULE_GLOBALS(libxml)
|
||||
|
||||
typedef struct _libxml_doc_props {
|
||||
@@ -97,6 +98,7 @@ PHP_LIBXML_API void php_libxml_ctx_error(void *ctx, const char *msg, ...);
|
||||
PHP_LIBXML_API int php_libxml_xmlCheckUTF8(const unsigned char *s);
|
||||
PHP_LIBXML_API zval *php_libxml_switch_context(zval *context TSRMLS_DC);
|
||||
PHP_LIBXML_API void php_libxml_issue_error(int level, const char *msg TSRMLS_DC);
|
||||
PHP_LIBXML_API zend_bool php_libxml_disable_entity_loader(zend_bool disable TSRMLS_DC);
|
||||
|
||||
/* Init/shutdown functions*/
|
||||
PHP_LIBXML_API void php_libxml_initialize(void);
|
||||
|
||||
+22
-23
@@ -1055,7 +1055,7 @@ PHP_FUNCTION(mb_split)
|
||||
php_mb_regex_t *re;
|
||||
OnigRegion *regs = NULL;
|
||||
char *string;
|
||||
OnigUChar *pos;
|
||||
OnigUChar *pos, *chunk_pos;
|
||||
int string_len;
|
||||
|
||||
int n, err;
|
||||
@@ -1065,8 +1065,8 @@ PHP_FUNCTION(mb_split)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (count == 0) {
|
||||
count = 1;
|
||||
if (count > 0) {
|
||||
count--;
|
||||
}
|
||||
|
||||
/* create regex pattern buffer */
|
||||
@@ -1076,31 +1076,30 @@ PHP_FUNCTION(mb_split)
|
||||
|
||||
array_init(return_value);
|
||||
|
||||
pos = (OnigUChar *)string;
|
||||
chunk_pos = pos = (OnigUChar *)string;
|
||||
err = 0;
|
||||
regs = onig_region_new();
|
||||
/* churn through str, generating array entries as we go */
|
||||
while ((--count != 0) &&
|
||||
(err = onig_search(re, (OnigUChar *)string, (OnigUChar *)(string + string_len), pos, (OnigUChar *)(string + string_len), regs, 0)) >= 0) {
|
||||
if (regs->beg[0] == regs->end[0]) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty regular expression");
|
||||
while (count != 0 && (pos - (OnigUChar *)string) < string_len) {
|
||||
int beg, end;
|
||||
err = onig_search(re, (OnigUChar *)string, (OnigUChar *)(string + string_len), pos, (OnigUChar *)(string + string_len), regs, 0);
|
||||
if (err < 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
beg = regs->beg[0], end = regs->end[0];
|
||||
/* add it to the array */
|
||||
if (regs->beg[0] < string_len && regs->beg[0] >= (pos - (OnigUChar *)string)) {
|
||||
add_next_index_stringl(return_value, (char *)pos, ((OnigUChar *)(string + regs->beg[0]) - pos), 1);
|
||||
if ((pos - (OnigUChar *)string) < end) {
|
||||
if (beg < string_len && beg >= (chunk_pos - (OnigUChar *)string)) {
|
||||
add_next_index_stringl(return_value, (char *)chunk_pos, ((OnigUChar *)(string + beg) - chunk_pos), 1);
|
||||
--count;
|
||||
} else {
|
||||
err = -2;
|
||||
break;
|
||||
}
|
||||
/* point at our new starting point */
|
||||
chunk_pos = pos = (OnigUChar *)string + end;
|
||||
} else {
|
||||
err = -2;
|
||||
break;
|
||||
}
|
||||
/* point at our new starting point */
|
||||
n = regs->end[0];
|
||||
if ((pos - (OnigUChar *)string) < n) {
|
||||
pos = (OnigUChar *)string + n;
|
||||
}
|
||||
if (count < 0) {
|
||||
count = 0;
|
||||
pos++;
|
||||
}
|
||||
onig_region_free(regs, 0);
|
||||
}
|
||||
@@ -1117,9 +1116,9 @@ PHP_FUNCTION(mb_split)
|
||||
}
|
||||
|
||||
/* otherwise we just have one last element to add to the array */
|
||||
n = ((OnigUChar *)(string + string_len) - pos);
|
||||
n = ((OnigUChar *)(string + string_len) - chunk_pos);
|
||||
if (n > 0) {
|
||||
add_next_index_stringl(return_value, (char *)pos, n, 1);
|
||||
add_next_index_stringl(return_value, (char *)chunk_pos, n, 1);
|
||||
} else {
|
||||
add_next_index_stringl(return_value, "", 0, 1);
|
||||
}
|
||||
|
||||
@@ -13,6 +13,4 @@ mb_ereg_search_regs();
|
||||
--EXPECTF--
|
||||
Warning: mb_ereg_search_init(): Empty pattern in %s on line %d
|
||||
|
||||
Warning: mb_split(): Empty regular expression in %s on line %d
|
||||
|
||||
Warning: mb_ereg_search_regs(): No regex given in %s on line %d
|
||||
@@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
mb_split() empty match
|
||||
--
|
||||
--SKIPIF--
|
||||
<?php
|
||||
extension_loaded('mbstring') or die('skip');
|
||||
function_exists('mb_split') or die("skip mb_split() is not available in this build");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
mb_regex_set_options('m');
|
||||
var_dump(mb_split('^', "a\nb\nc"));
|
||||
--EXPECT--
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(2) "a
|
||||
"
|
||||
[1]=>
|
||||
string(2) "b
|
||||
"
|
||||
[2]=>
|
||||
string(1) "c"
|
||||
}
|
||||
@@ -156,16 +156,12 @@ array(1) {
|
||||
}
|
||||
|
||||
-- Iteration 10 --
|
||||
|
||||
Warning: mb_split(): Empty regular expression in %s on line %d
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(13) "a b c d e f g"
|
||||
}
|
||||
|
||||
-- Iteration 11 --
|
||||
|
||||
Warning: mb_split(): Empty regular expression in %s on line %d
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(13) "a b c d e f g"
|
||||
@@ -178,8 +174,6 @@ array(1) {
|
||||
}
|
||||
|
||||
-- Iteration 13 --
|
||||
|
||||
Warning: mb_split(): Empty regular expression in %s on line %d
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(13) "a b c d e f g"
|
||||
@@ -192,24 +186,18 @@ array(1) {
|
||||
}
|
||||
|
||||
-- Iteration 15 --
|
||||
|
||||
Warning: mb_split(): Empty regular expression in %s on line %d
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(13) "a b c d e f g"
|
||||
}
|
||||
|
||||
-- Iteration 16 --
|
||||
|
||||
Warning: mb_split(): Empty regular expression in %s on line %d
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(13) "a b c d e f g"
|
||||
}
|
||||
|
||||
-- Iteration 17 --
|
||||
|
||||
Warning: mb_split(): Empty regular expression in %s on line %d
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(13) "a b c d e f g"
|
||||
@@ -240,16 +228,12 @@ array(1) {
|
||||
}
|
||||
|
||||
-- Iteration 22 --
|
||||
|
||||
Warning: mb_split(): Empty regular expression in %s on line %d
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(13) "a b c d e f g"
|
||||
}
|
||||
|
||||
-- Iteration 23 --
|
||||
|
||||
Warning: mb_split(): Empty regular expression in %s on line %d
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(13) "a b c d e f g"
|
||||
@@ -259,4 +243,4 @@ array(1) {
|
||||
|
||||
Warning: mb_split() expects parameter 1 to be string, resource given in %s on line %d
|
||||
bool(false)
|
||||
Done
|
||||
Done
|
||||
@@ -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!
|
||||
+19
-3
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -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;
|
||||
@@ -2319,7 +2321,14 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option)(MYSQLND_CONN_DATA * const c
|
||||
break;
|
||||
case MYSQL_SET_CHARSET_NAME:
|
||||
{
|
||||
char * new_charset_name = mnd_pestrdup(value, conn->persistent);
|
||||
char * new_charset_name;
|
||||
if (!mysqlnd_find_charset_name(value)) {
|
||||
SET_CLIENT_ERROR(*conn->error_info, CR_CANT_FIND_CHARSET, UNKNOWN_SQLSTATE, "Unknown character set");
|
||||
ret = FAIL;
|
||||
break;
|
||||
}
|
||||
|
||||
new_charset_name = mnd_pestrdup(value, conn->persistent);
|
||||
if (!new_charset_name) {
|
||||
goto oom;
|
||||
}
|
||||
@@ -2368,6 +2377,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:
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -42,7 +42,7 @@ static const char mysqlnd_free_name[] = "_mysqlnd_free";
|
||||
static const char mysqlnd_pestrndup_name[] = "_mysqlnd_pestrndup";
|
||||
static const char mysqlnd_pestrdup_name[] = "_mysqlnd_pestrdup";
|
||||
|
||||
const char * mysqlnd_debug_std_no_trace_funcs[] =
|
||||
PHPAPI const char * mysqlnd_debug_std_no_trace_funcs[] =
|
||||
{
|
||||
mysqlnd_emalloc_name,
|
||||
mysqlnd_ecalloc_name,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -24,7 +24,7 @@
|
||||
#ifndef MYSQLND_ALLOC_H
|
||||
#define MYSQLND_ALLOC_H
|
||||
|
||||
extern const char * mysqlnd_debug_std_no_trace_funcs[];
|
||||
PHPAPI extern const char * mysqlnd_debug_std_no_trace_funcs[];
|
||||
|
||||
#define MYSQLND_MEM_D TSRMLS_DC ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC
|
||||
#define MYSQLND_MEM_C TSRMLS_CC ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -504,12 +504,14 @@ const MYSQLND_CHARSET mysqlnd_charsets[] =
|
||||
{ 53, "macroman", "macroman_bin", 1, 1, "", NULL, NULL},
|
||||
{ 54, "utf16", "utf16_general_ci", 2, 4, "UTF-16 Unicode", mysqlnd_mbcharlen_utf16, check_mb_utf16},
|
||||
{ 55, "utf16", "utf16_bin", 2, 4, "UTF-16 Unicode", mysqlnd_mbcharlen_utf16, check_mb_utf16},
|
||||
{ 56, "utf16le", "utf16le_general_ci", 2, 4, "UTF-16LE Unicode", mysqlnd_mbcharlen_utf16, check_mb_utf16},
|
||||
{ 58, "cp1257", "cp1257_bin", 1, 1, "", NULL, NULL},
|
||||
#ifdef USED_TO_BE_SO_BEFORE_MYSQL_5_5
|
||||
{ 60, "armascii8", "armascii8_bin", 1, 1, "", NULL, NULL},
|
||||
#endif
|
||||
/*55*/{ 60, "utf32", "utf32_general_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
|
||||
/*55*/{ 61, "utf32", "utf32_bin", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
|
||||
{ 62, "utf16le", "utf16le_bin", 2, 4, "UTF-16LE Unicode", mysqlnd_mbcharlen_utf16, check_mb_utf16},
|
||||
{ 65, "ascii", "ascii_bin", 1, 1, "", NULL, NULL},
|
||||
{ 66, "cp1250", "cp1250_bin", 1, 1, "", NULL, NULL},
|
||||
{ 67, "cp1256", "cp1256_bin", 1, 1, "", NULL, NULL},
|
||||
@@ -669,14 +671,15 @@ PHPAPI const MYSQLND_CHARSET * mysqlnd_find_charset_nr(unsigned int charsetnr)
|
||||
/* {{{ mysqlnd_find_charset_name */
|
||||
PHPAPI const MYSQLND_CHARSET * mysqlnd_find_charset_name(const char * const name)
|
||||
{
|
||||
const MYSQLND_CHARSET * c = mysqlnd_charsets;
|
||||
|
||||
do {
|
||||
if (!strcasecmp(c->name, name)) {
|
||||
return c;
|
||||
}
|
||||
++c;
|
||||
} while (c[0].nr != 0);
|
||||
if (name) {
|
||||
const MYSQLND_CHARSET * c = mysqlnd_charsets;
|
||||
do {
|
||||
if (!strcasecmp(c->name, name)) {
|
||||
return c;
|
||||
}
|
||||
++c;
|
||||
} while (c[0].nr != 0);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -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
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -3204,6 +3204,7 @@ PHP_FUNCTION(openssl_pkey_get_public)
|
||||
if (pkey == NULL) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
zend_list_addref(Z_LVAL_P(return_value));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -3240,6 +3241,7 @@ PHP_FUNCTION(openssl_pkey_get_private)
|
||||
if (pkey == NULL) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
zend_list_addref(Z_LVAL_P(return_value));
|
||||
}
|
||||
|
||||
/* }}} */
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Bug #61930: openssl corrupts ssl key resource when using openssl_get_publickey()
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("openssl")) die("skip");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$cert = file_get_contents(__DIR__.'/cert.crt');
|
||||
|
||||
$data = <<<DATA
|
||||
Please verify me
|
||||
DATA;
|
||||
|
||||
$sig = 'f9Gyb6NV/ENn7GUa37ygTLcF93XHf5fbFTnoYF/O+fXbq3iChGUbET0RuhOsptlAODi6JsDLnJO4ikcVZo0tC1fFTj3LyCuPy3ZdgJbbVxQ/rviROCmuMFTqUW/Xa2LQYiapeCCgLQeWTLg7TM/BoHEkKbKLG/XT5jHvep1758A=';
|
||||
|
||||
$key = openssl_get_publickey($cert);
|
||||
var_dump(openssl_get_publickey($key));
|
||||
var_dump(openssl_verify($data, base64_decode($sig), $key));
|
||||
?>
|
||||
--EXPECTF--
|
||||
resource(%d) of type (OpenSSL key)
|
||||
int(1)
|
||||
|
||||
@@ -395,6 +395,18 @@ static inline int php_openssl_setup_crypto(php_stream *stream,
|
||||
}
|
||||
#endif
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x10000000L
|
||||
{
|
||||
zval **val;
|
||||
|
||||
if (stream->context && SUCCESS == php_stream_context_get_option(
|
||||
stream->context, "ssl", "disable_compression", &val) &&
|
||||
zval_is_true(*val)) {
|
||||
SSL_CTX_set_options(sslsock->ctx, SSL_OP_NO_COMPRESSION);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
sslsock->ssl_handle = php_SSL_new_from_context(sslsock->ctx, stream TSRMLS_CC);
|
||||
if (sslsock->ssl_handle == NULL) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to create an SSL handle");
|
||||
|
||||
@@ -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"
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| phar:// stream wrapper support |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2005-2012 The PHP Group |
|
||||
| Copyright (c) 2005-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| phar php single-file executable PHP extension |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| phar php single-file executable PHP extension |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2005-2012 The PHP Group |
|
||||
| Copyright (c) 2005-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| phar php single-file executable PHP extension |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| phar php single-file executable PHP extension |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2005-2012 The PHP Group |
|
||||
| Copyright (c) 2005-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| phar php single-file executable PHP extension |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| phar php single-file executable PHP extension |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2005-2012 The PHP Group |
|
||||
| Copyright (c) 2005-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| phar php single-file executable PHP extension |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2007-2012 The PHP Group |
|
||||
| Copyright (c) 2007-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| phar php single-file executable PHP extension |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2007-2012 The PHP Group |
|
||||
| Copyright (c) 2007-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| phar php single-file executable PHP extension |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| phar php single-file executable PHP extension |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2005-2012 The PHP Group |
|
||||
| Copyright (c) 2005-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+6
-3
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| phar:// stream wrapper support |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2005-2012 The PHP Group |
|
||||
| Copyright (c) 2005-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -458,8 +458,11 @@ static int phar_stream_flush(php_stream *stream TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
char *error;
|
||||
int ret;
|
||||
if (stream->mode[0] == 'w' || (stream->mode[0] == 'r' && stream->mode[1] == '+')) {
|
||||
ret = phar_flush(((phar_entry_data *)stream->abstract)->phar, 0, 0, 0, &error TSRMLS_CC);
|
||||
phar_entry_data *data = (phar_entry_data *) stream->abstract;
|
||||
|
||||
if (data->internal_file->is_modified) {
|
||||
data->internal_file->timestamp = time(0);
|
||||
ret = phar_flush(data->phar, 0, 0, 0, &error TSRMLS_CC);
|
||||
if (error) {
|
||||
php_stream_wrapper_log_error(stream->wrapper, REPORT_ERRORS TSRMLS_CC, "%s", error);
|
||||
efree(error);
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| phar php single-file executable PHP extension |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2012 The PHP Group |
|
||||
| Copyright (c) 2006-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| phar php single-file executable PHP extension generated stub |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2005-2012 The PHP Group |
|
||||
| Copyright (c) 2005-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| TAR archive support for Phar |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2005-2012 The PHP Group |
|
||||
| Copyright (c) 2005-2013 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
Loaded 100 of 152 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user