mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-09 10:10:50 +00:00
Compare commits
94
Commits
php-5.5.3
...
php-5.4.21
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
69a5d2ca2a | ||
|
|
2fad4c7375 | ||
|
|
33fd0e0b78 | ||
|
|
cd1cab3f47 | ||
|
|
18b04b480e | ||
|
|
679bf479b6 | ||
|
|
2b78edfba2 | ||
|
|
e9e63f9223 | ||
|
|
f0c926564c | ||
|
|
d143c2b60f | ||
|
|
7e35004e39 | ||
|
|
0ad0a2f56e | ||
|
|
7a1a1aec8c | ||
|
|
ac05cfb499 | ||
|
|
9aa904c375 | ||
|
|
b4b4372c88 | ||
|
|
30e0442c54 | ||
|
|
34fc79bd61 | ||
|
|
cc66eaa04b | ||
|
|
d5ba2d8a99 | ||
|
|
7a24ee13ec | ||
|
|
7e9044b6a2 | ||
|
|
9bfd55cda3 | ||
|
|
dfd7d1063a | ||
|
|
7c279df6ae | ||
|
|
6a0b90da84 | ||
|
|
1939d9e3db | ||
|
|
18b54a2366 | ||
|
|
8a936e8eb9 | ||
|
|
c0afe829e3 | ||
|
|
a475b2c1db | ||
|
|
7bb8cbcdee | ||
|
|
160cd8d0a7 | ||
|
|
3c3b2b5bdc | ||
|
|
7beef74a82 | ||
|
|
6c48c6bc78 | ||
|
|
ed038d2ee3 | ||
|
|
bfb1fe10cb | ||
|
|
d69513afec | ||
|
|
7da6498342 | ||
|
|
5bff1286b6 | ||
|
|
dfc6feb6e8 | ||
|
|
15694f66b2 | ||
|
|
747daa5354 | ||
|
|
72027cd084 | ||
|
|
1fdcc705a4 | ||
|
|
3745bdadc0 | ||
|
|
e6424d89e9 | ||
|
|
b378b0b081 | ||
|
|
e22c139fe0 | ||
|
|
6b8dade6dc | ||
|
|
3f9af558e7 | ||
|
|
768c34e7cd | ||
|
|
5ab6d215fc | ||
|
|
7109f369e8 | ||
|
|
f2ceb4963e | ||
|
|
d5987478a8 | ||
|
|
54d4a28003 | ||
|
|
1af111dd68 | ||
|
|
d0bede2efa | ||
|
|
f38bd22ed2 | ||
|
|
d8023d13eb | ||
|
|
540f325664 | ||
|
|
696852f2bd | ||
|
|
5c06e5c2e0 | ||
|
|
e9b12bedc3 | ||
|
|
9c9fee3f43 | ||
|
|
d82f9339fe | ||
|
|
eba85f91d8 | ||
|
|
b455ba971c | ||
|
|
27c803aaed | ||
|
|
72d1ec883e | ||
|
|
d487f5e9ac | ||
|
|
dc384a571d | ||
|
|
c60067c09a | ||
|
|
1ac4d8f2c6 | ||
|
|
aa7d3d8e6d | ||
|
|
a4862503d4 | ||
|
|
71c24f4c2e | ||
|
|
4bad49e3bc | ||
|
|
cf96aa155e | ||
|
|
c1c49d6e39 | ||
|
|
14f5732096 | ||
|
|
9973658a44 | ||
|
|
0154db1c5f | ||
|
|
98d29d20a1 | ||
|
|
a3fa25e857 | ||
|
|
3da2fb335d | ||
|
|
ac2d2b9b72 | ||
|
|
4a0e87e497 | ||
|
|
cb539b3e96 | ||
|
|
6993ca5bd7 | ||
|
|
0ebef462ce | ||
|
|
060fadca31 |
No files matched your search
@@ -1,19 +1,82 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? 2013, PHP 5.4.19
|
||||
17 Oct 2013, PHP 5.4.21
|
||||
|
||||
- Core:
|
||||
. Fixed bug #65322 (compile time errors won't trigger auto loading). (Nikita)
|
||||
|
||||
- CLI server:
|
||||
. Fixed bug #65633 (built-in server treat some http headers as
|
||||
case-sensitive). (Adam)
|
||||
|
||||
- Datetime:
|
||||
. Fixed bug #64157 (DateTime::createFromFormat() reports confusing error
|
||||
message). (Boro Sitnikovski)
|
||||
|
||||
- DBA extension:
|
||||
. Fixed bug #65708 (dba functions cast $key param to string in-place,
|
||||
bypassing copy on write). (Adam)
|
||||
|
||||
- Filter:
|
||||
. Add RFC 6598 IPs to reserved addresses. (Sebastian Nohn)
|
||||
. Fixed bug #64441 (FILTER_VALIDATE_URL rejects fully qualified domain names).
|
||||
(Syra)
|
||||
|
||||
- IMAP:
|
||||
. Fixed bug #65721 (configure script broken in 5.5.4 and 5.4.20 when enabling
|
||||
imap). (ryotakatsuki at gmail dot com)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #61548 (content-type must appear at the end of headers for 201
|
||||
Location to work in http). (Mike)
|
||||
|
||||
- Build system:
|
||||
. Fixed bug #62396 ('make test' crashes starting with 5.3.14 (missing
|
||||
gzencode())). (Mike)
|
||||
|
||||
|
||||
19 Sep 2013, PHP 5.4.20
|
||||
|
||||
- Core:
|
||||
. Fixed bug #60598 (cli/apache sapi segfault on objects manipulation).
|
||||
(Laruence)
|
||||
. Fixed bug #65579 (Using traits with get_class_methods causes segfault).
|
||||
(Adam)
|
||||
. Fixed bug #65490 (Duplicate calls to get lineno & filename for
|
||||
DTRACE_FUNCTION_*). (Chris Jones)
|
||||
. Fixed bug #65483 (quoted-printable encode stream filter incorrectly encoding
|
||||
spaces). (Michael M Slusarz)
|
||||
. Fixed bug #65481 (shutdown segfault due to serialize) (Mike)
|
||||
. Fixed bug #65470 (Segmentation fault in zend_error() with
|
||||
--enable-dtrace). (Chris Jones, Kris Van Hees)
|
||||
. Fixed bug #65372 (Segfault in gc_zval_possible_root when return reference
|
||||
fails). (Laruence)
|
||||
. Fixed bug #65304 (Use of max int in array_sum). (Laruence)
|
||||
. Fixed bug #65291 (get_defined_constants() causes PHP to crash in a very
|
||||
limited case). (Arpad)
|
||||
. Fixed bug #65225 (PHP_BINARY incorrectly set). (Patrick Allaert)
|
||||
. Improved fix for bug #63186 (compile failure on netbsd). (Matteo)
|
||||
. Fixed bug #62692 (PHP fails to build with DTrace). (Chris Jones, Kris Van Hees)
|
||||
. Fixed bug #61759 (class_alias() should accept classes with leading
|
||||
backslashes). (Julien)
|
||||
. Fixed bug #61345 (CGI mode - make install don't work). (Michael Heimpold)
|
||||
. Cherry-picked some DTrace build commits (allowing builds on Linux,
|
||||
bug #62691, and bug #63706) from PHP 5.5 branch
|
||||
. Fixed bug #61268 (--enable-dtrace leads make to clobber
|
||||
Zend/zend_dtrace.d) (Chris Jones)
|
||||
. Cherry picked some DTrace build commits (allowing builds on Linux,
|
||||
bug 62691, and bug 63706) from PHP 5.5 branch
|
||||
|
||||
- cURL:
|
||||
. Fixed bug #65458 (curl memory leak). (Adam)
|
||||
|
||||
- Datetime:
|
||||
. Fixed bug #65554 (createFromFormat broken when weekday name is followed
|
||||
by some delimiters). (Valentin Logvinskiy, Stas).
|
||||
. Fixed bug #65564 (stack-buffer-overflow in DateTimeZone stuff caught
|
||||
by AddressSanitizer). (Remi).
|
||||
|
||||
- Openssl:
|
||||
. Fixed bug #64802 (openssl_x509_parse fails to parse subject properly in
|
||||
some cases). (Mark Jones)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #62129 (rfc1867 crashes php even though turned off). (gxd305 at
|
||||
@@ -30,6 +93,10 @@ PHP NEWS
|
||||
- SPL:
|
||||
. Fixed bug #65328 (Segfault when getting SplStack object Value). (Laruence)
|
||||
|
||||
- PDO:
|
||||
. Fixed bug #64953 (Postgres prepared statement positional parameter
|
||||
casting). (Mike)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #65028 (Phar::buildFromDirectory creates corrupt archives for
|
||||
some specific contents). (Stas)
|
||||
@@ -44,7 +111,16 @@ PHP NEWS
|
||||
. Fixed bug #65391 (Unable to send vary header user-agent when
|
||||
ob_start('ob_gzhandler') is called) (Mike)
|
||||
|
||||
?? ??? 2013, PHP 5.4.18
|
||||
22 Aug 2013, PHP 5.4.19
|
||||
|
||||
- Core:
|
||||
. Fixed bug #64503 (Compilation fails with error: conflicting types for
|
||||
'zendparse'). (Laruence)
|
||||
|
||||
- Openssl:
|
||||
. Fixed UMR in fix for CVE-2013-4248.
|
||||
|
||||
15 Aug 2013, PHP 5.4.18
|
||||
|
||||
- Core:
|
||||
. Fixed value of FILTER_SANITIZE_FULL_SPECIAL_CHARS constant (previously was
|
||||
@@ -102,7 +178,7 @@ PHP NEWS
|
||||
odbc_fetch_array). (Brandon Kirsch)
|
||||
|
||||
- Openssl:
|
||||
. Fixed handling null bytes in subjectAltName (CVE-2013-4073).
|
||||
. Fixed handling null bytes in subjectAltName (CVE-2013-4248).
|
||||
(Christian Heimes)
|
||||
|
||||
- PDO:
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
--TEST--
|
||||
Bug #60598 (cli/apache sapi segfault on objects manipulation)
|
||||
--FILE--
|
||||
<?php
|
||||
define('OBJECT_COUNT', 10000);
|
||||
|
||||
$containers = array();
|
||||
|
||||
class Object {
|
||||
protected $_guid = 0;
|
||||
public function __construct() {
|
||||
global $containers;
|
||||
$this->guid = 1;
|
||||
$containers[spl_object_hash($this)] = $this;
|
||||
}
|
||||
public function __destruct() {
|
||||
global $containers;
|
||||
$containers[spl_object_hash($this)] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
for ($i = 0; $i < OBJECT_COUNT; ++$i) {
|
||||
new Object();
|
||||
}
|
||||
|
||||
// You probably won't see this because of the "zend_mm_heap corrupted"
|
||||
?>
|
||||
If you see this, try to increase OBJECT_COUNT to 100,000
|
||||
--EXPECT--
|
||||
If you see this, try to increase OBJECT_COUNT to 100,000
|
||||
@@ -0,0 +1,47 @@
|
||||
--TEST--
|
||||
Bug #64896 (Segfault with gc_collect_cycles using unserialize on certain objects)
|
||||
--XFAIL--
|
||||
We can not fix this bug without a significant (performace slow down) change to gc
|
||||
--FILE--
|
||||
<?php
|
||||
$bar = NULL;
|
||||
class bad
|
||||
{
|
||||
private $_private = array();
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->_private[] = 'php';
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
global $bar;
|
||||
$bar = $this;
|
||||
}
|
||||
}
|
||||
|
||||
$foo = new stdclass;
|
||||
$foo->foo = $foo;
|
||||
$foo->bad = new bad;
|
||||
|
||||
gc_disable();
|
||||
|
||||
unserialize(serialize($foo));
|
||||
gc_collect_cycles();
|
||||
var_dump($bar);
|
||||
/* will output:
|
||||
object(bad)#4 (1) {
|
||||
["_private":"bad":private]=>
|
||||
&UNKNOWN:0
|
||||
}
|
||||
*/
|
||||
?>
|
||||
--EXPECTF--
|
||||
bject(bad)#%d (1) {
|
||||
["_private":"bad":private]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(3) "php"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #65322: compile time errors won't trigger auto loading
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
spl_autoload_register(function($class) {
|
||||
var_dump($class);
|
||||
class B {}
|
||||
});
|
||||
|
||||
set_error_handler(function($_, $msg, $file) {
|
||||
var_dump($msg, $file);
|
||||
new B;
|
||||
});
|
||||
|
||||
eval('class A { function a() {} function __construct() {} }');
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(50) "Redefining already defined constructor for class A"
|
||||
string(%d) "%s(%d) : eval()'d code"
|
||||
string(1) "B"
|
||||
@@ -0,0 +1,29 @@
|
||||
--TEST--
|
||||
Bug #65579 (Using traits with get_class_methods causes segfault)
|
||||
--FILE--
|
||||
<?php
|
||||
trait ParentTrait {
|
||||
public function testMethod() { }
|
||||
}
|
||||
|
||||
trait ChildTrait {
|
||||
use ParentTrait {
|
||||
testMethod as testMethodFromParentTrait;
|
||||
}
|
||||
public function testMethod() { }
|
||||
}
|
||||
|
||||
class TestClass {
|
||||
use ChildTrait;
|
||||
}
|
||||
|
||||
$obj = new TestClass();
|
||||
var_dump(get_class_methods($obj));
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(10) "testMethod"
|
||||
[1]=>
|
||||
string(25) "testmethodfromparenttrait"
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Error message in error handler during compilation
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
set_error_handler(function($_, $msg, $file) {
|
||||
var_dump($msg, $file);
|
||||
echo $undefined;
|
||||
});
|
||||
|
||||
eval('class A { function a() {} function __construct() {} }');
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(50) "Redefining already defined constructor for class A"
|
||||
string(%d) "%s(%d) : eval()'d code"
|
||||
|
||||
Notice: Undefined variable: undefined in %s on line %d
|
||||
+7
-3
@@ -1091,17 +1091,19 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
|
||||
error_filename = "Unknown";
|
||||
}
|
||||
|
||||
va_start(args, format);
|
||||
|
||||
#ifdef HAVE_DTRACE
|
||||
if(DTRACE_ERROR_ENABLED()) {
|
||||
char *dtrace_error_buffer;
|
||||
va_start(args, format);
|
||||
zend_vspprintf(&dtrace_error_buffer, 0, format, args);
|
||||
DTRACE_ERROR(dtrace_error_buffer, (char *)error_filename, error_lineno);
|
||||
efree(dtrace_error_buffer);
|
||||
va_end(args);
|
||||
}
|
||||
#endif /* HAVE_DTRACE */
|
||||
|
||||
va_start(args, format);
|
||||
|
||||
/* if we don't have a user defined error handler */
|
||||
if (!EG(user_error_handler)
|
||||
|| !(EG(user_error_handler_error_reporting) & type)
|
||||
@@ -1181,7 +1183,7 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
|
||||
* such scripts recursivly, but some CG() variables may be
|
||||
* inconsistent. */
|
||||
|
||||
in_compilation = zend_is_compiling(TSRMLS_C);
|
||||
in_compilation = CG(in_compilation);
|
||||
if (in_compilation) {
|
||||
saved_class_entry = CG(active_class_entry);
|
||||
CG(active_class_entry) = NULL;
|
||||
@@ -1193,6 +1195,7 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
|
||||
SAVE_STACK(declare_stack);
|
||||
SAVE_STACK(list_stack);
|
||||
SAVE_STACK(context_stack);
|
||||
CG(in_compilation) = 0;
|
||||
}
|
||||
|
||||
if (call_user_function_ex(CG(function_table), NULL, orig_user_error_handler, &retval, 5, params, 1, NULL TSRMLS_CC) == SUCCESS) {
|
||||
@@ -1217,6 +1220,7 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
|
||||
RESTORE_STACK(declare_stack);
|
||||
RESTORE_STACK(list_stack);
|
||||
RESTORE_STACK(context_stack);
|
||||
CG(in_compilation) = 1;
|
||||
}
|
||||
|
||||
if (!EG(user_error_handler)) {
|
||||
|
||||
+15
-9
@@ -2514,7 +2514,12 @@ ZEND_API int zend_register_class_alias_ex(const char *name, int name_len, zend_c
|
||||
char *lcname = zend_str_tolower_dup(name, name_len);
|
||||
int ret;
|
||||
|
||||
ret = zend_hash_add(CG(class_table), lcname, name_len+1, &ce, sizeof(zend_class_entry *), NULL);
|
||||
if (lcname[0] == '\\') {
|
||||
ret = zend_hash_add(CG(class_table), lcname+1, name_len, &ce, sizeof(zend_class_entry *), NULL);
|
||||
} else {
|
||||
ret = zend_hash_add(CG(class_table), lcname, name_len+1, &ce, sizeof(zend_class_entry *), NULL);
|
||||
}
|
||||
|
||||
efree(lcname);
|
||||
if (ret == SUCCESS) {
|
||||
ce->refcount++;
|
||||
@@ -3917,15 +3922,16 @@ ZEND_API const char* zend_find_alias_name(zend_class_entry *ce, const char *name
|
||||
{
|
||||
zend_trait_alias *alias, **alias_ptr;
|
||||
|
||||
alias_ptr = ce->trait_aliases;
|
||||
alias = *alias_ptr;
|
||||
while (alias) {
|
||||
if (alias->alias_len == len &&
|
||||
!strncasecmp(name, alias->alias, alias->alias_len)) {
|
||||
return alias->alias;
|
||||
}
|
||||
alias_ptr++;
|
||||
if ((alias_ptr = ce->trait_aliases)) {
|
||||
alias = *alias_ptr;
|
||||
while (alias) {
|
||||
if (alias->alias_len == len &&
|
||||
!strncasecmp(name, alias->alias, alias->alias_len)) {
|
||||
return alias->alias;
|
||||
}
|
||||
alias_ptr++;
|
||||
alias = *alias_ptr;
|
||||
}
|
||||
}
|
||||
|
||||
return name;
|
||||
|
||||
@@ -1399,15 +1399,8 @@ ZEND_FUNCTION(class_alias)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!autoload) {
|
||||
lc_name = do_alloca(class_name_len + 1, use_heap);
|
||||
zend_str_tolower_copy(lc_name, class_name, class_name_len);
|
||||
found = zend_lookup_class_ex(class_name, class_name_len, NULL, autoload, &ce TSRMLS_CC);
|
||||
|
||||
found = zend_hash_find(EG(class_table), lc_name, class_name_len+1, (void **) &ce);
|
||||
free_alloca(lc_name, use_heap);
|
||||
} else {
|
||||
found = zend_lookup_class(class_name, class_name_len, &ce TSRMLS_CC);
|
||||
}
|
||||
if (found == SUCCESS) {
|
||||
if ((*ce)->type == ZEND_USER_CLASS) {
|
||||
if (zend_register_class_alias_ex(alias_name, alias_name_len, *ce TSRMLS_CC) == SUCCESS) {
|
||||
|
||||
@@ -58,10 +58,8 @@ ZEND_API void dtrace_execute(zend_op_array *op_array TSRMLS_DC)
|
||||
}
|
||||
|
||||
if (DTRACE_FUNCTION_ENTRY_ENABLED() || DTRACE_FUNCTION_RETURN_ENABLED()) {
|
||||
filename = dtrace_get_executed_filename(TSRMLS_C);
|
||||
classname = get_active_class_name(&scope TSRMLS_CC);
|
||||
funcname = get_active_function_name(TSRMLS_C);
|
||||
lineno = zend_get_executed_lineno(TSRMLS_C);
|
||||
}
|
||||
|
||||
if (DTRACE_EXECUTE_ENTRY_ENABLED()) {
|
||||
|
||||
@@ -41,17 +41,19 @@ static YYSIZE_T zend_yytnamerr(char*, const char*);
|
||||
|
||||
#define YYERROR_VERBOSE
|
||||
#define YYSTYPE znode
|
||||
#ifdef ZTS
|
||||
# define YYPARSE_PARAM tsrm_ls
|
||||
# define YYLEX_PARAM tsrm_ls
|
||||
#endif
|
||||
|
||||
|
||||
%}
|
||||
|
||||
%pure_parser
|
||||
%expect 3
|
||||
|
||||
%code requires {
|
||||
#ifdef ZTS
|
||||
# define YYPARSE_PARAM tsrm_ls
|
||||
# define YYLEX_PARAM tsrm_ls
|
||||
#endif
|
||||
}
|
||||
|
||||
%token END 0 "end of file"
|
||||
%left T_INCLUDE T_INCLUDE_ONCE T_EVAL T_REQUIRE T_REQUIRE_ONCE
|
||||
%token T_INCLUDE "include (T_INCLUDE)"
|
||||
|
||||
@@ -57,6 +57,11 @@ ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects TS
|
||||
obj->dtor(obj->object, i TSRMLS_CC);
|
||||
obj = &objects->object_buckets[i].bucket.obj;
|
||||
obj->refcount--;
|
||||
|
||||
if (obj->refcount == 0) {
|
||||
/* in case gc_collect_cycle is triggered before free_storage */
|
||||
GC_REMOVE_ZOBJ_FROM_BUFFER(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+38
-4
@@ -2925,17 +2925,17 @@ dnl providerdesc
|
||||
dnl header-file
|
||||
ac_hdrobj=$2
|
||||
|
||||
dnl Add providerdesc.o into global objects when needed
|
||||
dnl Add providerdesc.o or .lo into global objects when needed
|
||||
case $host_alias in
|
||||
*freebsd*)
|
||||
PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.o"
|
||||
PHP_LDFLAGS="$PHP_LDFLAGS -lelf"
|
||||
;;
|
||||
*solaris*)
|
||||
PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.o"
|
||||
PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.lo"
|
||||
;;
|
||||
*linux*)
|
||||
PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.o"
|
||||
PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.lo"
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -2969,12 +2969,46 @@ dnl in GNU Make which causes the .d file to be overwritten (Bug 61268)
|
||||
$abs_srcdir/$ac_provsrc:;
|
||||
|
||||
$ac_bdir[$]ac_hdrobj: $abs_srcdir/$ac_provsrc
|
||||
CFLAGS="\$(CFLAGS_CLEAN)" dtrace -h -C -s $ac_srcdir[$]ac_provsrc -o \$[]@.bak && \$(SED) 's,PHP_,DTRACE_,g' \$[]@.bak > \$[]@
|
||||
CFLAGS="\$(CFLAGS_CLEAN)" dtrace -h -C -s $ac_srcdir[$]ac_provsrc -o \$[]@.bak && \$(SED) -e 's,PHP_,DTRACE_,g' \$[]@.bak > \$[]@
|
||||
|
||||
\$(PHP_DTRACE_OBJS): $ac_bdir[$]ac_hdrobj
|
||||
|
||||
EOF
|
||||
|
||||
case $host_alias in
|
||||
*solaris*|*linux*)
|
||||
dtrace_prov_name="`echo $ac_provsrc | $SED -e 's#\(.*\)\/##'`.o"
|
||||
dtrace_lib_dir="`echo $ac_bdir[$]ac_provsrc | $SED -e 's#\(.*\)/[^/]*#\1#'`/.libs"
|
||||
dtrace_d_obj="`echo $ac_bdir[$]ac_provsrc | $SED -e 's#\(.*\)/\([^/]*\)#\1/.libs/\2#'`.o"
|
||||
dtrace_nolib_objs='$(PHP_DTRACE_OBJS:.lo=.o)'
|
||||
for ac_lo in $PHP_DTRACE_OBJS; do
|
||||
dtrace_lib_objs="[$]dtrace_lib_objs `echo $ac_lo | $SED -e 's,\.lo$,.o,' -e 's#\(.*\)\/#\1\/.libs\/#'`"
|
||||
done;
|
||||
dnl Always attempt to create both PIC and non-PIC DTrace objects (Bug 63692)
|
||||
cat>>Makefile.objects<<EOF
|
||||
$ac_bdir[$]ac_provsrc.lo: \$(PHP_DTRACE_OBJS)
|
||||
echo "[#] Generated by Makefile for libtool" > \$[]@
|
||||
@test -d "$dtrace_lib_dir" || mkdir $dtrace_lib_dir
|
||||
if CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o $dtrace_d_obj -s $abs_srcdir/$ac_provsrc $dtrace_lib_objs 2> /dev/null && test -f "$dtrace_d_obj"; then [\\]
|
||||
echo "pic_object=['].libs/$dtrace_prov_name[']" >> \$[]@ [;\\]
|
||||
else [\\]
|
||||
echo "pic_object='none'" >> \$[]@ [;\\]
|
||||
fi
|
||||
if CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o $ac_bdir[$]ac_provsrc.o -s $abs_srcdir/$ac_provsrc $dtrace_nolib_objs 2> /dev/null && test -f "$ac_bdir[$]ac_provsrc.o"; then [\\]
|
||||
echo "non_pic_object=[']$dtrace_prov_name[']" >> \$[]@ [;\\]
|
||||
else [\\]
|
||||
echo "non_pic_object='none'" >> \$[]@ [;\\]
|
||||
fi
|
||||
|
||||
EOF
|
||||
|
||||
;;
|
||||
*)
|
||||
cat>>Makefile.objects<<EOF
|
||||
$ac_bdir[$]ac_provsrc.o: \$(PHP_DTRACE_OBJS)
|
||||
CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o \$[]@ -s $abs_srcdir/$ac_provsrc $dtrace_objs
|
||||
|
||||
EOF
|
||||
;;
|
||||
esac
|
||||
])
|
||||
+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=19
|
||||
PHP_EXTRA_VERSION="-dev"
|
||||
PHP_RELEASE_VERSION=21
|
||||
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`
|
||||
|
||||
|
||||
@@ -1068,7 +1068,6 @@ static size_t curl_progress(void *clientp, double dltotal, double dlnow, double
|
||||
{
|
||||
php_curl *ch = (php_curl *) clientp;
|
||||
php_curl_progress *t = ch->handlers->progress;
|
||||
int length = -1;
|
||||
size_t rval = 0;
|
||||
|
||||
#if PHP_CURL_DEBUG
|
||||
@@ -1118,7 +1117,6 @@ static size_t curl_progress(void *clientp, double dltotal, double dlnow, double
|
||||
ch->in_callback = 0;
|
||||
if (error == FAILURE) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot call the CURLOPT_PROGRESSFUNCTION");
|
||||
length = -1;
|
||||
} else if (retval_ptr) {
|
||||
if (Z_TYPE_P(retval_ptr) != IS_LONG) {
|
||||
convert_to_long_ex(&retval_ptr);
|
||||
@@ -1373,9 +1371,9 @@ static void curl_free_post(void **post)
|
||||
|
||||
/* {{{ curl_free_slist
|
||||
*/
|
||||
static void curl_free_slist(void **slist)
|
||||
static void curl_free_slist(void *slist)
|
||||
{
|
||||
curl_slist_free_all((struct curl_slist *) *slist);
|
||||
curl_slist_free_all(*((struct curl_slist **) slist));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -1443,8 +1441,10 @@ static void alloc_curl_handle(php_curl **ch)
|
||||
(*ch)->handlers->read->stream = NULL;
|
||||
|
||||
zend_llist_init(&(*ch)->to_free->str, sizeof(char *), (llist_dtor_func_t) curl_free_string, 0);
|
||||
zend_llist_init(&(*ch)->to_free->slist, sizeof(struct curl_slist), (llist_dtor_func_t) curl_free_slist, 0);
|
||||
zend_llist_init(&(*ch)->to_free->post, sizeof(struct HttpPost), (llist_dtor_func_t) curl_free_post, 0);
|
||||
|
||||
(*ch)->to_free->slist = emalloc(sizeof(HashTable));
|
||||
zend_hash_init((*ch)->to_free->slist, 4, NULL, curl_free_slist, 0);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -1675,6 +1675,7 @@ PHP_FUNCTION(curl_copy_handle)
|
||||
curl_easy_setopt(dupch->cp, CURLOPT_WRITEHEADER, (void *) dupch);
|
||||
curl_easy_setopt(dupch->cp, CURLOPT_PROGRESSDATA, (void *) dupch);
|
||||
|
||||
efree(dupch->to_free->slist);
|
||||
efree(dupch->to_free);
|
||||
dupch->to_free = ch->to_free;
|
||||
|
||||
@@ -2184,7 +2185,7 @@ string_copy:
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
zend_llist_add_element(&ch->to_free->slist, &slist);
|
||||
zend_hash_index_update(ch->to_free->slist, (ulong) option, &slist, sizeof(struct curl_slist *), NULL);
|
||||
|
||||
error = curl_easy_setopt(ch->cp, option, slist);
|
||||
|
||||
@@ -2680,8 +2681,9 @@ static void _php_curl_close_ex(php_curl *ch TSRMLS_DC)
|
||||
/* cURL destructors should be invoked only by last curl handle */
|
||||
if (Z_REFCOUNT_P(ch->clone) <= 1) {
|
||||
zend_llist_clean(&ch->to_free->str);
|
||||
zend_llist_clean(&ch->to_free->slist);
|
||||
zend_llist_clean(&ch->to_free->post);
|
||||
zend_hash_destroy(ch->to_free->slist);
|
||||
efree(ch->to_free->slist);
|
||||
efree(ch->to_free);
|
||||
FREE_ZVAL(ch->clone);
|
||||
} else {
|
||||
|
||||
+1
-1
@@ -126,7 +126,7 @@ struct _php_curl_send_headers {
|
||||
struct _php_curl_free {
|
||||
zend_llist str;
|
||||
zend_llist post;
|
||||
zend_llist slist;
|
||||
HashTable *slist;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
Bug #65458 (curl memory leak)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('curl')) exit("skip curl extension not loaded");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$ch = curl_init();
|
||||
$init = memory_get_usage();
|
||||
for ($i = 0; $i < 10000; $i++) {
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, [ "SOAPAction: getItems" ]);
|
||||
}
|
||||
|
||||
$preclose = memory_get_usage();
|
||||
curl_close($ch);
|
||||
|
||||
// This is a slightly tricky heuristic, but basically, we want to ensure
|
||||
// $preclose - $init has a delta in the order of bytes, not megabytes. Given
|
||||
// the number of iterations in the loop, if we're wasting memory here, we
|
||||
// should have megs and megs of extra allocations.
|
||||
var_dump(($preclose - $init) < 10000);
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
+102
-101
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.13.5 on Sun Sep 30 20:14:42 2012 */
|
||||
/* Generated by re2c 0.13.5 on Sun Aug 25 14:46:08 2013 */
|
||||
#line 1 "ext/date/lib/parse_date.re"
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
@@ -651,7 +651,8 @@ static const timelib_relunit* timelib_lookup_relunit(char **ptr)
|
||||
char *begin = *ptr, *end;
|
||||
const timelib_relunit *tp, *value = NULL;
|
||||
|
||||
while (**ptr != '\0' && **ptr != ' ' && **ptr != ',' && **ptr != '\t') {
|
||||
while (**ptr != '\0' && **ptr != ' ' && **ptr != ',' && **ptr != '\t' && **ptr != ';' && **ptr != ':' &&
|
||||
**ptr != '/' && **ptr != '.' && **ptr != '-' && **ptr != '(' && **ptr != ')' ) {
|
||||
++*ptr;
|
||||
}
|
||||
end = *ptr;
|
||||
@@ -871,11 +872,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper)
|
||||
std:
|
||||
s->tok = cursor;
|
||||
s->len = 0;
|
||||
#line 997 "ext/date/lib/parse_date.re"
|
||||
#line 998 "ext/date/lib/parse_date.re"
|
||||
|
||||
|
||||
|
||||
#line 879 "ext/date/lib/parse_date.c"
|
||||
#line 880 "ext/date/lib/parse_date.c"
|
||||
{
|
||||
YYCTYPE yych;
|
||||
unsigned int yyaccept = 0;
|
||||
@@ -995,7 +996,7 @@ std:
|
||||
}
|
||||
yy2:
|
||||
YYDEBUG(2, *YYCURSOR);
|
||||
#line 1083 "ext/date/lib/parse_date.re"
|
||||
#line 1084 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("firstdayof | lastdayof");
|
||||
TIMELIB_INIT;
|
||||
@@ -1011,7 +1012,7 @@ yy2:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_LF_DAY_OF_MONTH;
|
||||
}
|
||||
#line 1015 "ext/date/lib/parse_date.c"
|
||||
#line 1016 "ext/date/lib/parse_date.c"
|
||||
yy3:
|
||||
YYDEBUG(3, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -1034,7 +1035,7 @@ yy3:
|
||||
}
|
||||
yy4:
|
||||
YYDEBUG(4, *YYCURSOR);
|
||||
#line 1677 "ext/date/lib/parse_date.re"
|
||||
#line 1678 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("tzcorrection | tz");
|
||||
@@ -1047,7 +1048,7 @@ yy4:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_TIMEZONE;
|
||||
}
|
||||
#line 1051 "ext/date/lib/parse_date.c"
|
||||
#line 1052 "ext/date/lib/parse_date.c"
|
||||
yy5:
|
||||
YYDEBUG(5, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -1358,12 +1359,12 @@ yy12:
|
||||
if (yych <= '9') goto yy1385;
|
||||
yy13:
|
||||
YYDEBUG(13, *YYCURSOR);
|
||||
#line 1772 "ext/date/lib/parse_date.re"
|
||||
#line 1773 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
add_error(s, "Unexpected character");
|
||||
goto std;
|
||||
}
|
||||
#line 1367 "ext/date/lib/parse_date.c"
|
||||
#line 1368 "ext/date/lib/parse_date.c"
|
||||
yy14:
|
||||
YYDEBUG(14, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -2420,11 +2421,11 @@ yy49:
|
||||
if (yych <= '9') goto yy55;
|
||||
yy50:
|
||||
YYDEBUG(50, *YYCURSOR);
|
||||
#line 1761 "ext/date/lib/parse_date.re"
|
||||
#line 1762 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
goto std;
|
||||
}
|
||||
#line 2428 "ext/date/lib/parse_date.c"
|
||||
#line 2429 "ext/date/lib/parse_date.c"
|
||||
yy51:
|
||||
YYDEBUG(51, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -2433,12 +2434,12 @@ yy52:
|
||||
YYDEBUG(52, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(53, *YYCURSOR);
|
||||
#line 1766 "ext/date/lib/parse_date.re"
|
||||
#line 1767 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
s->pos = cursor; s->line++;
|
||||
goto std;
|
||||
}
|
||||
#line 2442 "ext/date/lib/parse_date.c"
|
||||
#line 2443 "ext/date/lib/parse_date.c"
|
||||
yy54:
|
||||
YYDEBUG(54, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -2825,7 +2826,7 @@ yy72:
|
||||
if (yych == 's') goto yy74;
|
||||
yy73:
|
||||
YYDEBUG(73, *YYCURSOR);
|
||||
#line 1745 "ext/date/lib/parse_date.re"
|
||||
#line 1746 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_ull i;
|
||||
DEBUG_OUTPUT("relative");
|
||||
@@ -2840,7 +2841,7 @@ yy73:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 2844 "ext/date/lib/parse_date.c"
|
||||
#line 2845 "ext/date/lib/parse_date.c"
|
||||
yy74:
|
||||
YYDEBUG(74, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -3602,7 +3603,7 @@ yy166:
|
||||
}
|
||||
yy167:
|
||||
YYDEBUG(167, *YYCURSOR);
|
||||
#line 1608 "ext/date/lib/parse_date.re"
|
||||
#line 1609 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
const timelib_relunit* relunit;
|
||||
DEBUG_OUTPUT("daytext");
|
||||
@@ -3619,7 +3620,7 @@ yy167:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_WEEKDAY;
|
||||
}
|
||||
#line 3623 "ext/date/lib/parse_date.c"
|
||||
#line 3624 "ext/date/lib/parse_date.c"
|
||||
yy168:
|
||||
YYDEBUG(168, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -4139,7 +4140,7 @@ yy193:
|
||||
}
|
||||
yy194:
|
||||
YYDEBUG(194, *YYCURSOR);
|
||||
#line 1667 "ext/date/lib/parse_date.re"
|
||||
#line 1668 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("monthtext");
|
||||
TIMELIB_INIT;
|
||||
@@ -4148,7 +4149,7 @@ yy194:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_TEXT;
|
||||
}
|
||||
#line 4152 "ext/date/lib/parse_date.c"
|
||||
#line 4153 "ext/date/lib/parse_date.c"
|
||||
yy195:
|
||||
YYDEBUG(195, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -4199,7 +4200,7 @@ yy198:
|
||||
}
|
||||
yy199:
|
||||
YYDEBUG(199, *YYCURSOR);
|
||||
#line 1413 "ext/date/lib/parse_date.re"
|
||||
#line 1414 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("datetextual | datenoyear");
|
||||
@@ -4212,7 +4213,7 @@ yy199:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_TEXT;
|
||||
}
|
||||
#line 4216 "ext/date/lib/parse_date.c"
|
||||
#line 4217 "ext/date/lib/parse_date.c"
|
||||
yy200:
|
||||
YYDEBUG(200, *YYCURSOR);
|
||||
yyaccept = 6;
|
||||
@@ -4481,7 +4482,7 @@ yy222:
|
||||
}
|
||||
yy223:
|
||||
YYDEBUG(223, *YYCURSOR);
|
||||
#line 1715 "ext/date/lib/parse_date.re"
|
||||
#line 1716 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz");
|
||||
@@ -4510,7 +4511,7 @@ yy223:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_SHORTDATE_WITH_TIME;
|
||||
}
|
||||
#line 4514 "ext/date/lib/parse_date.c"
|
||||
#line 4515 "ext/date/lib/parse_date.c"
|
||||
yy224:
|
||||
YYDEBUG(224, *YYCURSOR);
|
||||
yyaccept = 7;
|
||||
@@ -5208,7 +5209,7 @@ yy278:
|
||||
YYDEBUG(278, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(279, *YYCURSOR);
|
||||
#line 1691 "ext/date/lib/parse_date.re"
|
||||
#line 1692 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("dateshortwithtimeshort12 | dateshortwithtimelong12");
|
||||
TIMELIB_INIT;
|
||||
@@ -5231,7 +5232,7 @@ yy278:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_SHORTDATE_WITH_TIME;
|
||||
}
|
||||
#line 5235 "ext/date/lib/parse_date.c"
|
||||
#line 5236 "ext/date/lib/parse_date.c"
|
||||
yy280:
|
||||
YYDEBUG(280, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -5409,7 +5410,7 @@ yy294:
|
||||
++YYCURSOR;
|
||||
yy295:
|
||||
YYDEBUG(295, *YYCURSOR);
|
||||
#line 1385 "ext/date/lib/parse_date.re"
|
||||
#line 1386 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("datenoday");
|
||||
@@ -5422,7 +5423,7 @@ yy295:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_NO_DAY;
|
||||
}
|
||||
#line 5426 "ext/date/lib/parse_date.c"
|
||||
#line 5427 "ext/date/lib/parse_date.c"
|
||||
yy296:
|
||||
YYDEBUG(296, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6642,7 +6643,7 @@ yy362:
|
||||
if (yych <= '9') goto yy365;
|
||||
yy364:
|
||||
YYDEBUG(364, *YYCURSOR);
|
||||
#line 1529 "ext/date/lib/parse_date.re"
|
||||
#line 1530 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("pgtextshort");
|
||||
@@ -6655,7 +6656,7 @@ yy364:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_PG_TEXT;
|
||||
}
|
||||
#line 6659 "ext/date/lib/parse_date.c"
|
||||
#line 6660 "ext/date/lib/parse_date.c"
|
||||
yy365:
|
||||
YYDEBUG(365, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -7293,7 +7294,7 @@ yy392:
|
||||
}
|
||||
yy393:
|
||||
YYDEBUG(393, *YYCURSOR);
|
||||
#line 1587 "ext/date/lib/parse_date.re"
|
||||
#line 1588 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("ago");
|
||||
TIMELIB_INIT;
|
||||
@@ -7313,7 +7314,7 @@ yy393:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_AGO;
|
||||
}
|
||||
#line 7317 "ext/date/lib/parse_date.c"
|
||||
#line 7318 "ext/date/lib/parse_date.c"
|
||||
yy394:
|
||||
YYDEBUG(394, *YYCURSOR);
|
||||
yyaccept = 5;
|
||||
@@ -9063,7 +9064,7 @@ yy454:
|
||||
++YYCURSOR;
|
||||
yy455:
|
||||
YYDEBUG(455, *YYCURSOR);
|
||||
#line 1290 "ext/date/lib/parse_date.re"
|
||||
#line 1291 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("iso8601date4 | iso8601date2 | iso8601dateslash | dateslash");
|
||||
TIMELIB_INIT;
|
||||
@@ -9074,7 +9075,7 @@ yy455:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
#line 9078 "ext/date/lib/parse_date.c"
|
||||
#line 9079 "ext/date/lib/parse_date.c"
|
||||
yy456:
|
||||
YYDEBUG(456, *YYCURSOR);
|
||||
yyaccept = 0;
|
||||
@@ -9634,7 +9635,7 @@ yy475:
|
||||
}
|
||||
yy476:
|
||||
YYDEBUG(476, *YYCURSOR);
|
||||
#line 1427 "ext/date/lib/parse_date.re"
|
||||
#line 1428 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("datenoyearrev");
|
||||
TIMELIB_INIT;
|
||||
@@ -9645,7 +9646,7 @@ yy476:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_TEXT;
|
||||
}
|
||||
#line 9649 "ext/date/lib/parse_date.c"
|
||||
#line 9650 "ext/date/lib/parse_date.c"
|
||||
yy477:
|
||||
YYDEBUG(477, *YYCURSOR);
|
||||
yyaccept = 10;
|
||||
@@ -9786,7 +9787,7 @@ yy488:
|
||||
YYDEBUG(488, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(489, *YYCURSOR);
|
||||
#line 1145 "ext/date/lib/parse_date.re"
|
||||
#line 1146 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("timetiny12 | timeshort12 | timelong12");
|
||||
TIMELIB_INIT;
|
||||
@@ -9802,7 +9803,7 @@ yy488:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_TIME12;
|
||||
}
|
||||
#line 9806 "ext/date/lib/parse_date.c"
|
||||
#line 9807 "ext/date/lib/parse_date.c"
|
||||
yy490:
|
||||
YYDEBUG(490, *YYCURSOR);
|
||||
yyaccept = 11;
|
||||
@@ -9815,7 +9816,7 @@ yy490:
|
||||
}
|
||||
yy491:
|
||||
YYDEBUG(491, *YYCURSOR);
|
||||
#line 1182 "ext/date/lib/parse_date.re"
|
||||
#line 1183 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("timeshort24 | timelong24 | iso8601long");
|
||||
@@ -9840,7 +9841,7 @@ yy491:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_TIME24_WITH_ZONE;
|
||||
}
|
||||
#line 9844 "ext/date/lib/parse_date.c"
|
||||
#line 9845 "ext/date/lib/parse_date.c"
|
||||
yy492:
|
||||
YYDEBUG(492, *YYCURSOR);
|
||||
yyaccept = 11;
|
||||
@@ -10150,7 +10151,7 @@ yy523:
|
||||
YYDEBUG(523, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(524, *YYCURSOR);
|
||||
#line 1162 "ext/date/lib/parse_date.re"
|
||||
#line 1163 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("mssqltime");
|
||||
TIMELIB_INIT;
|
||||
@@ -10169,7 +10170,7 @@ yy523:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_TIME24_WITH_ZONE;
|
||||
}
|
||||
#line 10173 "ext/date/lib/parse_date.c"
|
||||
#line 10174 "ext/date/lib/parse_date.c"
|
||||
yy525:
|
||||
YYDEBUG(525, *YYCURSOR);
|
||||
yyaccept = 11;
|
||||
@@ -10275,7 +10276,7 @@ yy534:
|
||||
if (yych <= '9') goto yy541;
|
||||
yy535:
|
||||
YYDEBUG(535, *YYCURSOR);
|
||||
#line 1344 "ext/date/lib/parse_date.re"
|
||||
#line 1345 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("datefull");
|
||||
@@ -10289,7 +10290,7 @@ yy535:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_FULL;
|
||||
}
|
||||
#line 10293 "ext/date/lib/parse_date.c"
|
||||
#line 10294 "ext/date/lib/parse_date.c"
|
||||
yy536:
|
||||
YYDEBUG(536, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -11026,7 +11027,7 @@ yy605:
|
||||
YYDEBUG(606, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(607, *YYCURSOR);
|
||||
#line 1359 "ext/date/lib/parse_date.re"
|
||||
#line 1360 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("pointed date YYYY");
|
||||
TIMELIB_INIT;
|
||||
@@ -11037,7 +11038,7 @@ yy605:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_FULL_POINTED;
|
||||
}
|
||||
#line 11041 "ext/date/lib/parse_date.c"
|
||||
#line 11042 "ext/date/lib/parse_date.c"
|
||||
yy608:
|
||||
YYDEBUG(608, *YYCURSOR);
|
||||
yyaccept = 11;
|
||||
@@ -11073,7 +11074,7 @@ yy611:
|
||||
if (yych <= '9') goto yy605;
|
||||
yy612:
|
||||
YYDEBUG(612, *YYCURSOR);
|
||||
#line 1371 "ext/date/lib/parse_date.re"
|
||||
#line 1372 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("pointed date YY");
|
||||
@@ -11086,7 +11087,7 @@ yy612:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_FULL_POINTED;
|
||||
}
|
||||
#line 11090 "ext/date/lib/parse_date.c"
|
||||
#line 11091 "ext/date/lib/parse_date.c"
|
||||
yy613:
|
||||
YYDEBUG(613, *YYCURSOR);
|
||||
yyaccept = 11;
|
||||
@@ -11727,7 +11728,7 @@ yy656:
|
||||
}
|
||||
yy657:
|
||||
YYDEBUG(657, *YYCURSOR);
|
||||
#line 1330 "ext/date/lib/parse_date.re"
|
||||
#line 1331 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("gnudateshort");
|
||||
@@ -11740,7 +11741,7 @@ yy657:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
#line 11744 "ext/date/lib/parse_date.c"
|
||||
#line 11745 "ext/date/lib/parse_date.c"
|
||||
yy658:
|
||||
YYDEBUG(658, *YYCURSOR);
|
||||
yyaccept = 13;
|
||||
@@ -11846,7 +11847,7 @@ yy666:
|
||||
}
|
||||
yy667:
|
||||
YYDEBUG(667, *YYCURSOR);
|
||||
#line 1274 "ext/date/lib/parse_date.re"
|
||||
#line 1275 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("americanshort | american");
|
||||
@@ -11861,7 +11862,7 @@ yy667:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_AMERICAN;
|
||||
}
|
||||
#line 11865 "ext/date/lib/parse_date.c"
|
||||
#line 11866 "ext/date/lib/parse_date.c"
|
||||
yy668:
|
||||
YYDEBUG(668, *YYCURSOR);
|
||||
yyaccept = 14;
|
||||
@@ -12094,7 +12095,7 @@ yy700:
|
||||
if (yych <= ':') goto yy704;
|
||||
yy701:
|
||||
YYDEBUG(701, *YYCURSOR);
|
||||
#line 1557 "ext/date/lib/parse_date.re"
|
||||
#line 1558 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("clf");
|
||||
@@ -12114,7 +12115,7 @@ yy701:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_CLF;
|
||||
}
|
||||
#line 12118 "ext/date/lib/parse_date.c"
|
||||
#line 12119 "ext/date/lib/parse_date.c"
|
||||
yy702:
|
||||
YYDEBUG(702, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -12666,7 +12667,7 @@ yy763:
|
||||
}
|
||||
yy764:
|
||||
YYDEBUG(764, *YYCURSOR);
|
||||
#line 1302 "ext/date/lib/parse_date.re"
|
||||
#line 1303 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("iso8601date2");
|
||||
@@ -12679,7 +12680,7 @@ yy764:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
#line 12683 "ext/date/lib/parse_date.c"
|
||||
#line 12684 "ext/date/lib/parse_date.c"
|
||||
yy765:
|
||||
YYDEBUG(765, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -12718,7 +12719,7 @@ yy771:
|
||||
YYDEBUG(771, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(772, *YYCURSOR);
|
||||
#line 1543 "ext/date/lib/parse_date.re"
|
||||
#line 1544 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("pgtextreverse");
|
||||
@@ -12731,7 +12732,7 @@ yy771:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_PG_TEXT;
|
||||
}
|
||||
#line 12735 "ext/date/lib/parse_date.c"
|
||||
#line 12736 "ext/date/lib/parse_date.c"
|
||||
yy773:
|
||||
YYDEBUG(773, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -12869,7 +12870,7 @@ yy783:
|
||||
}
|
||||
yy784:
|
||||
YYDEBUG(784, *YYCURSOR);
|
||||
#line 1578 "ext/date/lib/parse_date.re"
|
||||
#line 1579 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("year4");
|
||||
TIMELIB_INIT;
|
||||
@@ -12877,7 +12878,7 @@ yy784:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_CLF;
|
||||
}
|
||||
#line 12881 "ext/date/lib/parse_date.c"
|
||||
#line 12882 "ext/date/lib/parse_date.c"
|
||||
yy785:
|
||||
YYDEBUG(785, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -13028,7 +13029,7 @@ yy793:
|
||||
}
|
||||
yy794:
|
||||
YYDEBUG(794, *YYCURSOR);
|
||||
#line 1399 "ext/date/lib/parse_date.re"
|
||||
#line 1400 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("datenodayrev");
|
||||
@@ -13041,7 +13042,7 @@ yy794:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_NO_DAY;
|
||||
}
|
||||
#line 13045 "ext/date/lib/parse_date.c"
|
||||
#line 13046 "ext/date/lib/parse_date.c"
|
||||
yy795:
|
||||
YYDEBUG(795, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -13256,7 +13257,7 @@ yy814:
|
||||
if (yych <= '7') goto yy817;
|
||||
yy815:
|
||||
YYDEBUG(815, *YYCURSOR);
|
||||
#line 1510 "ext/date/lib/parse_date.re"
|
||||
#line 1511 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll w, d;
|
||||
DEBUG_OUTPUT("isoweek");
|
||||
@@ -13274,7 +13275,7 @@ yy815:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_WEEK;
|
||||
}
|
||||
#line 13278 "ext/date/lib/parse_date.c"
|
||||
#line 13279 "ext/date/lib/parse_date.c"
|
||||
yy816:
|
||||
YYDEBUG(816, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -13284,7 +13285,7 @@ yy817:
|
||||
YYDEBUG(817, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(818, *YYCURSOR);
|
||||
#line 1491 "ext/date/lib/parse_date.re"
|
||||
#line 1492 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll w, d;
|
||||
DEBUG_OUTPUT("isoweekday");
|
||||
@@ -13302,7 +13303,7 @@ yy817:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_WEEK;
|
||||
}
|
||||
#line 13306 "ext/date/lib/parse_date.c"
|
||||
#line 13307 "ext/date/lib/parse_date.c"
|
||||
yy819:
|
||||
YYDEBUG(819, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -13366,7 +13367,7 @@ yy821:
|
||||
}
|
||||
yy822:
|
||||
YYDEBUG(822, *YYCURSOR);
|
||||
#line 1477 "ext/date/lib/parse_date.re"
|
||||
#line 1478 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("pgydotd");
|
||||
@@ -13379,7 +13380,7 @@ yy822:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_PG_YEARDAY;
|
||||
}
|
||||
#line 13383 "ext/date/lib/parse_date.c"
|
||||
#line 13384 "ext/date/lib/parse_date.c"
|
||||
yy823:
|
||||
YYDEBUG(823, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -13482,7 +13483,7 @@ yy842:
|
||||
++YYCURSOR;
|
||||
yy843:
|
||||
YYDEBUG(843, *YYCURSOR);
|
||||
#line 1451 "ext/date/lib/parse_date.re"
|
||||
#line 1452 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("xmlrpc | xmlrpcnocolon | soap | wddx | exif");
|
||||
@@ -13507,7 +13508,7 @@ yy843:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_XMLRPC_SOAP;
|
||||
}
|
||||
#line 13511 "ext/date/lib/parse_date.c"
|
||||
#line 13512 "ext/date/lib/parse_date.c"
|
||||
yy844:
|
||||
YYDEBUG(844, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -13769,7 +13770,7 @@ yy848:
|
||||
}
|
||||
yy849:
|
||||
YYDEBUG(849, *YYCURSOR);
|
||||
#line 1439 "ext/date/lib/parse_date.re"
|
||||
#line 1440 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("datenocolon");
|
||||
TIMELIB_INIT;
|
||||
@@ -13780,7 +13781,7 @@ yy849:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_NOCOLON;
|
||||
}
|
||||
#line 13784 "ext/date/lib/parse_date.c"
|
||||
#line 13785 "ext/date/lib/parse_date.c"
|
||||
yy850:
|
||||
YYDEBUG(850, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -14700,7 +14701,7 @@ yy973:
|
||||
if (yych <= '9') goto yy996;
|
||||
yy974:
|
||||
YYDEBUG(974, *YYCURSOR);
|
||||
#line 1316 "ext/date/lib/parse_date.re"
|
||||
#line 1317 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("gnudateshorter");
|
||||
@@ -14713,7 +14714,7 @@ yy974:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
#line 14717 "ext/date/lib/parse_date.c"
|
||||
#line 14718 "ext/date/lib/parse_date.c"
|
||||
yy975:
|
||||
YYDEBUG(975, *YYCURSOR);
|
||||
yyaccept = 22;
|
||||
@@ -15722,7 +15723,7 @@ yy1066:
|
||||
}
|
||||
yy1068:
|
||||
YYDEBUG(1068, *YYCURSOR);
|
||||
#line 1208 "ext/date/lib/parse_date.re"
|
||||
#line 1209 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("gnunocolon");
|
||||
TIMELIB_INIT;
|
||||
@@ -15744,7 +15745,7 @@ yy1068:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_GNU_NOCOLON;
|
||||
}
|
||||
#line 15748 "ext/date/lib/parse_date.c"
|
||||
#line 15749 "ext/date/lib/parse_date.c"
|
||||
yy1069:
|
||||
YYDEBUG(1069, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -15836,7 +15837,7 @@ yy1075:
|
||||
}
|
||||
yy1076:
|
||||
YYDEBUG(1076, *YYCURSOR);
|
||||
#line 1254 "ext/date/lib/parse_date.re"
|
||||
#line 1255 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
int tz_not_found;
|
||||
DEBUG_OUTPUT("iso8601nocolon");
|
||||
@@ -15855,7 +15856,7 @@ yy1076:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_NOCOLON;
|
||||
}
|
||||
#line 15859 "ext/date/lib/parse_date.c"
|
||||
#line 15860 "ext/date/lib/parse_date.c"
|
||||
yy1077:
|
||||
YYDEBUG(1077, *YYCURSOR);
|
||||
yyaccept = 25;
|
||||
@@ -16753,7 +16754,7 @@ yy1117:
|
||||
}
|
||||
yy1118:
|
||||
YYDEBUG(1118, *YYCURSOR);
|
||||
#line 1650 "ext/date/lib/parse_date.re"
|
||||
#line 1651 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll i;
|
||||
int behavior = 0;
|
||||
@@ -16769,7 +16770,7 @@ yy1118:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 16773 "ext/date/lib/parse_date.c"
|
||||
#line 16774 "ext/date/lib/parse_date.c"
|
||||
yy1119:
|
||||
YYDEBUG(1119, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -16820,7 +16821,7 @@ yy1126:
|
||||
YYDEBUG(1126, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(1127, *YYCURSOR);
|
||||
#line 1123 "ext/date/lib/parse_date.re"
|
||||
#line 1124 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll i;
|
||||
int behavior = 0;
|
||||
@@ -16841,7 +16842,7 @@ yy1126:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_WEEK_DAY_OF_MONTH;
|
||||
}
|
||||
#line 16845 "ext/date/lib/parse_date.c"
|
||||
#line 16846 "ext/date/lib/parse_date.c"
|
||||
yy1128:
|
||||
YYDEBUG(1128, *YYCURSOR);
|
||||
yyaccept = 26;
|
||||
@@ -16949,7 +16950,7 @@ yy1141:
|
||||
}
|
||||
yy1142:
|
||||
YYDEBUG(1142, *YYCURSOR);
|
||||
#line 1626 "ext/date/lib/parse_date.re"
|
||||
#line 1627 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_sll i;
|
||||
int behavior = 0;
|
||||
@@ -16972,7 +16973,7 @@ yy1142:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 16976 "ext/date/lib/parse_date.c"
|
||||
#line 16977 "ext/date/lib/parse_date.c"
|
||||
yy1143:
|
||||
YYDEBUG(1143, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -19649,7 +19650,7 @@ yy1294:
|
||||
goto yy1298;
|
||||
yy1295:
|
||||
YYDEBUG(1295, *YYCURSOR);
|
||||
#line 1100 "ext/date/lib/parse_date.re"
|
||||
#line 1101 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("backof | frontof");
|
||||
TIMELIB_INIT;
|
||||
@@ -19671,7 +19672,7 @@ yy1295:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_LF_DAY_OF_MONTH;
|
||||
}
|
||||
#line 19675 "ext/date/lib/parse_date.c"
|
||||
#line 19676 "ext/date/lib/parse_date.c"
|
||||
yy1296:
|
||||
YYDEBUG(1296, *YYCURSOR);
|
||||
yyaccept = 28;
|
||||
@@ -21362,7 +21363,7 @@ yy1385:
|
||||
if (yych <= '9') goto yy1385;
|
||||
yy1387:
|
||||
YYDEBUG(1387, *YYCURSOR);
|
||||
#line 1057 "ext/date/lib/parse_date.re"
|
||||
#line 1058 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
timelib_ull i;
|
||||
|
||||
@@ -21387,7 +21388,7 @@ yy1387:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 21391 "ext/date/lib/parse_date.c"
|
||||
#line 21392 "ext/date/lib/parse_date.c"
|
||||
yy1388:
|
||||
YYDEBUG(1388, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -21823,7 +21824,7 @@ yy1416:
|
||||
++YYCURSOR;
|
||||
yy1417:
|
||||
YYDEBUG(1417, *YYCURSOR);
|
||||
#line 1045 "ext/date/lib/parse_date.re"
|
||||
#line 1046 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("tomorrow");
|
||||
TIMELIB_INIT;
|
||||
@@ -21834,7 +21835,7 @@ yy1417:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 21838 "ext/date/lib/parse_date.c"
|
||||
#line 21839 "ext/date/lib/parse_date.c"
|
||||
yy1418:
|
||||
YYDEBUG(1418, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -21869,7 +21870,7 @@ yy1419:
|
||||
}
|
||||
yy1420:
|
||||
YYDEBUG(1420, *YYCURSOR);
|
||||
#line 1035 "ext/date/lib/parse_date.re"
|
||||
#line 1036 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("midnight | today");
|
||||
TIMELIB_INIT;
|
||||
@@ -21878,7 +21879,7 @@ yy1420:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 21882 "ext/date/lib/parse_date.c"
|
||||
#line 21883 "ext/date/lib/parse_date.c"
|
||||
yy1421:
|
||||
YYDEBUG(1421, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -23890,7 +23891,7 @@ yy1499:
|
||||
}
|
||||
yy1500:
|
||||
YYDEBUG(1500, *YYCURSOR);
|
||||
#line 1014 "ext/date/lib/parse_date.re"
|
||||
#line 1015 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("now");
|
||||
TIMELIB_INIT;
|
||||
@@ -23898,7 +23899,7 @@ yy1500:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 23902 "ext/date/lib/parse_date.c"
|
||||
#line 23903 "ext/date/lib/parse_date.c"
|
||||
yy1501:
|
||||
YYDEBUG(1501, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -24037,7 +24038,7 @@ yy1507:
|
||||
}
|
||||
yy1508:
|
||||
YYDEBUG(1508, *YYCURSOR);
|
||||
#line 1023 "ext/date/lib/parse_date.re"
|
||||
#line 1024 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("noon");
|
||||
TIMELIB_INIT;
|
||||
@@ -24048,7 +24049,7 @@ yy1508:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 24052 "ext/date/lib/parse_date.c"
|
||||
#line 24053 "ext/date/lib/parse_date.c"
|
||||
yy1509:
|
||||
YYDEBUG(1509, *YYCURSOR);
|
||||
yyaccept = 0;
|
||||
@@ -24581,7 +24582,7 @@ yy1530:
|
||||
++YYCURSOR;
|
||||
yy1531:
|
||||
YYDEBUG(1531, *YYCURSOR);
|
||||
#line 1002 "ext/date/lib/parse_date.re"
|
||||
#line 1003 "ext/date/lib/parse_date.re"
|
||||
{
|
||||
DEBUG_OUTPUT("yesterday");
|
||||
TIMELIB_INIT;
|
||||
@@ -24592,7 +24593,7 @@ yy1531:
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_RELATIVE;
|
||||
}
|
||||
#line 24596 "ext/date/lib/parse_date.c"
|
||||
#line 24597 "ext/date/lib/parse_date.c"
|
||||
yy1532:
|
||||
YYDEBUG(1532, *YYCURSOR);
|
||||
yyaccept = 0;
|
||||
@@ -24765,7 +24766,7 @@ yy1537:
|
||||
goto yy1531;
|
||||
}
|
||||
}
|
||||
#line 1776 "ext/date/lib/parse_date.re"
|
||||
#line 1777 "ext/date/lib/parse_date.re"
|
||||
|
||||
}
|
||||
|
||||
@@ -25035,7 +25036,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
|
||||
TIMELIB_CHECK_NUMBER;
|
||||
sec = timelib_get_nr_ex((char **) &ptr, 2, &length);
|
||||
if (sec == TIMELIB_UNSET || length != 2) {
|
||||
add_pbf_error(s, "A two second minute could not be found", string, begin);
|
||||
add_pbf_error(s, "A two digit second could not be found", string, begin);
|
||||
} else {
|
||||
s->time->s = sec;
|
||||
}
|
||||
@@ -25123,7 +25124,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
|
||||
break;
|
||||
|
||||
case '\\': /* escaped char */
|
||||
*fptr++;
|
||||
fptr++;
|
||||
if (*ptr == *fptr) {
|
||||
++ptr;
|
||||
} else {
|
||||
|
||||
@@ -649,7 +649,8 @@ static const timelib_relunit* timelib_lookup_relunit(char **ptr)
|
||||
char *begin = *ptr, *end;
|
||||
const timelib_relunit *tp, *value = NULL;
|
||||
|
||||
while (**ptr != '\0' && **ptr != ' ' && **ptr != ',' && **ptr != '\t') {
|
||||
while (**ptr != '\0' && **ptr != ' ' && **ptr != ',' && **ptr != '\t' && **ptr != ';' && **ptr != ':' &&
|
||||
**ptr != '/' && **ptr != '.' && **ptr != '-' && **ptr != '(' && **ptr != ')' ) {
|
||||
++*ptr;
|
||||
}
|
||||
end = *ptr;
|
||||
@@ -2042,7 +2043,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
|
||||
TIMELIB_CHECK_NUMBER;
|
||||
sec = timelib_get_nr_ex((char **) &ptr, 2, &length);
|
||||
if (sec == TIMELIB_UNSET || length != 2) {
|
||||
add_pbf_error(s, "A two second minute could not be found", string, begin);
|
||||
add_pbf_error(s, "A two digit second could not be found", string, begin);
|
||||
} else {
|
||||
s->time->s = sec;
|
||||
}
|
||||
@@ -2130,7 +2131,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
|
||||
break;
|
||||
|
||||
case '\\': /* escaped char */
|
||||
*fptr++;
|
||||
fptr++;
|
||||
if (*ptr == *fptr) {
|
||||
++ptr;
|
||||
} else {
|
||||
|
||||
+784
-794
File diff suppressed because it is too large.
Load diff
+10
-6
@@ -2113,13 +2113,13 @@ static HashTable *date_object_get_properties(zval *object TSRMLS_DC)
|
||||
/* first we add the date and time in ISO format */
|
||||
MAKE_STD_ZVAL(zv);
|
||||
ZVAL_STRING(zv, date_format("Y-m-d H:i:s", 12, dateobj->time, 1), 0);
|
||||
zend_hash_update(props, "date", 5, &zv, sizeof(zval), NULL);
|
||||
zend_hash_update(props, "date", 5, &zv, sizeof(zv), NULL);
|
||||
|
||||
/* then we add the timezone name (or similar) */
|
||||
if (dateobj->time->is_localtime) {
|
||||
MAKE_STD_ZVAL(zv);
|
||||
ZVAL_LONG(zv, dateobj->time->zone_type);
|
||||
zend_hash_update(props, "timezone_type", 14, &zv, sizeof(zval), NULL);
|
||||
zend_hash_update(props, "timezone_type", 14, &zv, sizeof(zv), NULL);
|
||||
|
||||
MAKE_STD_ZVAL(zv);
|
||||
switch (dateobj->time->zone_type) {
|
||||
@@ -2142,7 +2142,7 @@ static HashTable *date_object_get_properties(zval *object TSRMLS_DC)
|
||||
ZVAL_STRING(zv, dateobj->time->tz_abbr, 1);
|
||||
break;
|
||||
}
|
||||
zend_hash_update(props, "timezone", 9, &zv, sizeof(zval), NULL);
|
||||
zend_hash_update(props, "timezone", 9, &zv, sizeof(zv), NULL);
|
||||
}
|
||||
|
||||
return props;
|
||||
@@ -2265,7 +2265,7 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC)
|
||||
#define PHP_DATE_INTERVAL_ADD_PROPERTY(n,f) \
|
||||
MAKE_STD_ZVAL(zv); \
|
||||
ZVAL_LONG(zv, (long)intervalobj->diff->f); \
|
||||
zend_hash_update(props, n, strlen(n) + 1, &zv, sizeof(zval), NULL);
|
||||
zend_hash_update(props, n, strlen(n) + 1, &zv, sizeof(zv), NULL);
|
||||
|
||||
PHP_DATE_INTERVAL_ADD_PROPERTY("y", y);
|
||||
PHP_DATE_INTERVAL_ADD_PROPERTY("m", m);
|
||||
@@ -2282,7 +2282,7 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC)
|
||||
} else {
|
||||
MAKE_STD_ZVAL(zv);
|
||||
ZVAL_FALSE(zv);
|
||||
zend_hash_update(props, "days", 5, &zv, sizeof(zval), NULL);
|
||||
zend_hash_update(props, "days", 5, &zv, sizeof(zv), NULL);
|
||||
}
|
||||
PHP_DATE_INTERVAL_ADD_PROPERTY("special_type", special.type);
|
||||
PHP_DATE_INTERVAL_ADD_PROPERTY("special_amount", special.amount);
|
||||
@@ -3568,7 +3568,11 @@ zval *date_interval_read_property(zval *object, zval *member, int type, const ze
|
||||
ALLOC_INIT_ZVAL(retval);
|
||||
Z_SET_REFCOUNT_P(retval, 0);
|
||||
|
||||
ZVAL_LONG(retval, value);
|
||||
if (value != -99999) {
|
||||
ZVAL_LONG(retval, value);
|
||||
} else {
|
||||
ZVAL_FALSE(retval);
|
||||
}
|
||||
|
||||
if (member == &tmp_member) {
|
||||
zval_dtor(member);
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Wrong var_dump(DateInterval->days) value
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$interval = new DateInterval('P2Y4DT6H8M');
|
||||
|
||||
var_dump($interval->days);
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
@@ -0,0 +1,29 @@
|
||||
--TEST--
|
||||
Test fix for DateTime when date have textual day with dot or other special char at end
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
//Set the default time zone
|
||||
date_default_timezone_set('Europe/London');
|
||||
|
||||
echo "*** Testing clone on DateTime objects ***\n";
|
||||
|
||||
// Create a DateTime object..
|
||||
$orig = new DateTime('2012-11-29 17:00:00');
|
||||
|
||||
// String to parse
|
||||
$string = "Thu., Nov. 29, 2012 5:00PM";
|
||||
|
||||
// Create a DateTime object from format
|
||||
$fromFormat = DateTime::createFromFormat( "D., M# j, Y g:iA", $string );
|
||||
|
||||
echo "Format method: " . $orig->format("D., M. j, Y g:iA") . "\n";
|
||||
echo "createFromFormat method: " . $fromFormat->format("D., M. j, Y g:iA") . "\n";
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Testing clone on DateTime objects ***
|
||||
Format method: Thu., Nov. 29, 2012 5:00PM
|
||||
createFromFormat method: Thu., Nov. 29, 2012 5:00PM
|
||||
===DONE===
|
||||
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Test for bug #64157: DateTime::createFromFormat() reports confusing error message
|
||||
--CREDITS--
|
||||
Boro Sitnikovski <buritomath@yahoo.com>
|
||||
--INI--
|
||||
date.timezone = UTC
|
||||
--FILE--
|
||||
<?php
|
||||
DateTime::createFromFormat('s', '0');
|
||||
$lastErrors = DateTime::getLastErrors();
|
||||
print_r($lastErrors['errors'][0]);
|
||||
?>
|
||||
--EXPECT--
|
||||
A two digit second could not be found
|
||||
+19
-6
@@ -226,12 +226,17 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free TSRMLS
|
||||
*key_free = *key_str;
|
||||
return len;
|
||||
} else {
|
||||
*key_free = NULL;
|
||||
zval tmp = *key;
|
||||
int len;
|
||||
|
||||
convert_to_string(key);
|
||||
*key_str = Z_STRVAL_P(key);
|
||||
zval_copy_ctor(&tmp);
|
||||
convert_to_string(&tmp);
|
||||
|
||||
return Z_STRLEN_P(key);
|
||||
*key_free = *key_str = estrndup(Z_STRVAL(tmp), Z_STRLEN(tmp));
|
||||
len = Z_STRLEN(tmp);
|
||||
|
||||
zval_dtor(&tmp);
|
||||
return len;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
@@ -297,6 +302,14 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free TSRMLS
|
||||
RETURN_FALSE; \
|
||||
}
|
||||
|
||||
/* the same check, but with a call to DBA_ID_DONE before returning */
|
||||
#define DBA_WRITE_CHECK_WITH_ID \
|
||||
if(info->mode != DBA_WRITER && info->mode != DBA_TRUNC && info->mode != DBA_CREAT) { \
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "You cannot perform a modification to a database without proper access"); \
|
||||
DBA_ID_DONE; \
|
||||
RETURN_FALSE; \
|
||||
}
|
||||
|
||||
/* }}} */
|
||||
|
||||
/* {{{ globals */
|
||||
@@ -557,7 +570,7 @@ static void php_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode)
|
||||
|
||||
DBA_FETCH_RESOURCE(info, &id);
|
||||
|
||||
DBA_WRITE_CHECK;
|
||||
DBA_WRITE_CHECK_WITH_ID;
|
||||
|
||||
if (info->hnd->update(info, key_str, key_len, val, val_len, mode TSRMLS_CC) == SUCCESS) {
|
||||
DBA_ID_DONE;
|
||||
@@ -1110,7 +1123,7 @@ PHP_FUNCTION(dba_delete)
|
||||
{
|
||||
DBA_ID_GET2;
|
||||
|
||||
DBA_WRITE_CHECK;
|
||||
DBA_WRITE_CHECK_WITH_ID;
|
||||
|
||||
if(info->hnd->delete(info, key_str, key_len TSRMLS_CC) == SUCCESS)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
--TEST--
|
||||
Bug #65708 (dba functions cast $key param to string in-place, bypassing copy on write)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(dirname(__FILE__) .'/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
require_once(dirname(__FILE__) .'/test.inc');
|
||||
|
||||
$db = dba_popen($db_filename, 'c');
|
||||
|
||||
$key = 1;
|
||||
$copy = $key;
|
||||
|
||||
echo gettype($key)."\n";
|
||||
echo gettype($copy)."\n";
|
||||
|
||||
dba_exists($key, $db);
|
||||
|
||||
echo gettype($key)."\n";
|
||||
echo gettype($copy)."\n";
|
||||
|
||||
dba_close($db);
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require(dirname(__FILE__) .'/clean.inc');
|
||||
?>
|
||||
--EXPECT--
|
||||
integer
|
||||
integer
|
||||
integer
|
||||
integer
|
||||
@@ -1089,7 +1089,11 @@ void dom_xpath_objects_free_storage(void *object TSRMLS_DC)
|
||||
void dom_objects_free_storage(void *object TSRMLS_DC)
|
||||
{
|
||||
dom_object *intern = (dom_object *)object;
|
||||
#if defined(__GNUC__) && __GNUC__ >= 3
|
||||
int retcount __attribute__((unused)); /* keep compiler quiet */
|
||||
#else
|
||||
int retcount;
|
||||
#endif
|
||||
|
||||
zend_object_std_dtor(&intern->std TSRMLS_CC);
|
||||
|
||||
|
||||
@@ -484,10 +484,6 @@ void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
|
||||
}
|
||||
s++;
|
||||
}
|
||||
|
||||
if (*(e - 1) == '.') {
|
||||
goto bad_url;
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
@@ -718,6 +714,7 @@ void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
|
||||
if (flags & FILTER_FLAG_NO_RES_RANGE) {
|
||||
if (
|
||||
(ip[0] == 0) ||
|
||||
(ip[0] == 100 && (ip[1] >= 64 || ip[1] <= 127)) ||
|
||||
(ip[0] == 128 && ip[1] == 0) ||
|
||||
(ip[0] == 191 && ip[1] == 255) ||
|
||||
(ip[0] == 169 && ip[1] == 254) ||
|
||||
|
||||
@@ -15,6 +15,8 @@ var_dump(filter_var("192.168.0.1", FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE
|
||||
var_dump(filter_var("192.0.34.166", FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE));
|
||||
var_dump(filter_var("127.0.0.1", FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE));
|
||||
var_dump(filter_var("192.0.0.1", FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE));
|
||||
var_dump(filter_var("100.0.0.0", FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE));
|
||||
var_dump(filter_var("100.127.255.255", FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE));
|
||||
var_dump(filter_var("192.0.34.166", FILTER_VALIDATE_IP));
|
||||
var_dump(filter_var("256.1237.123.1", FILTER_VALIDATE_IP));
|
||||
var_dump(filter_var("255.255.255.255", FILTER_VALIDATE_IP));
|
||||
@@ -40,6 +42,8 @@ bool(false)
|
||||
string(12) "192.0.34.166"
|
||||
bool(false)
|
||||
string(9) "192.0.0.1"
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(12) "192.0.34.166"
|
||||
bool(false)
|
||||
string(15) "255.255.255.255"
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--TEST--
|
||||
bug 64441, FILTER_VALIDATE_URL will invalidate a hostname that ended by dot
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("filter")) die("skip"); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(filter_var('http://example.com./', FILTER_VALIDATE_URL));
|
||||
var_dump(filter_var('http://example.com/', FILTER_VALIDATE_URL));
|
||||
--EXPECT--
|
||||
string(20) "http://example.com./"
|
||||
string(19) "http://example.com/"
|
||||
+2
-2
@@ -198,9 +198,9 @@ if test "$PHP_IMAP" != "no"; then
|
||||
AC_MSG_ERROR(Cannot find rfc822.h. Please check your c-client installation.)
|
||||
fi
|
||||
|
||||
if test -r "$IMAP_DIR/c-client/c-client.a"; then
|
||||
if test ! -r "$IMAP_DIR/c-client/libc-client.a" && test -r "$IMAP_DIR/c-client/c-client.a" ; then
|
||||
ln -s "$IMAP_DIR/c-client/c-client.a" "$IMAP_DIR/c-client/libc-client.a" >/dev/null 2>&1
|
||||
elif test -r "$IMAP_DIR/$PHP_LIBDIR/c-client.a"; then
|
||||
elif test ! -r "$IMAP_DIR/$PHP_LIBDIR/libc-client.a" && test -r "$IMAP_DIR/$PHP_LIBDIR/c-client.a"; then
|
||||
ln -s "$IMAP_DIR/$PHP_LIBDIR/c-client.a" "$IMAP_DIR/$PHP_LIBDIR/libc-client.a" >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ void resourcebundle_extract_value( zval *return_value, ResourceBundle_object *so
|
||||
case URES_STRING:
|
||||
ufield = ures_getString( source->child, &ilen, &INTL_DATA_ERROR_CODE(source) );
|
||||
INTL_METHOD_CHECK_STATUS(source, "Failed to retrieve string value");
|
||||
INTL_METHOD_RETVAL_UTF8(source, ufield, ilen, 0);
|
||||
INTL_METHOD_RETVAL_UTF8(source, (UChar *)ufield, ilen, 0);
|
||||
break;
|
||||
|
||||
case URES_BINARY:
|
||||
|
||||
@@ -2107,6 +2107,7 @@ PHP_FUNCTION(ldap_set_rebind_proc)
|
||||
/* unregister rebind procedure */
|
||||
if (ld->rebindproc != NULL) {
|
||||
zval_dtor(ld->rebindproc);
|
||||
FREE_ZVAL(ld->rebindproc);
|
||||
ld->rebindproc = NULL;
|
||||
ldap_set_rebind_proc(ld->link, NULL, NULL);
|
||||
}
|
||||
|
||||
@@ -217,14 +217,26 @@ array(2) {
|
||||
[1]=>
|
||||
resource(%d) of type (ldap result)
|
||||
}
|
||||
NULL
|
||||
NULL
|
||||
array(1) {
|
||||
["count"]=>
|
||||
int(0)
|
||||
}
|
||||
array(1) {
|
||||
["count"]=>
|
||||
int(0)
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
resource(%d) of type (ldap result)
|
||||
[1]=>
|
||||
resource(%d) of type (ldap result)
|
||||
}
|
||||
NULL
|
||||
NULL
|
||||
array(1) {
|
||||
["count"]=>
|
||||
int(0)
|
||||
}
|
||||
array(1) {
|
||||
["count"]=>
|
||||
int(0)
|
||||
}
|
||||
===DONE===
|
||||
+26
-11
@@ -370,18 +370,33 @@ PHP_ARG_WITH(iodbc,,
|
||||
|
||||
if test "$PHP_IODBC" != "no"; then
|
||||
AC_MSG_CHECKING(for iODBC support)
|
||||
if test "$PHP_IODBC" = "yes"; then
|
||||
PHP_IODBC=/usr/local
|
||||
if test -z "$PKG_CONFIG"; then
|
||||
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
|
||||
fi
|
||||
if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists libiodbc ; then
|
||||
PHP_ADD_LIBRARY_WITH_PATH(iodbc, $PHP_IODBC/$PHP_LIBDIR)
|
||||
ODBC_TYPE=iodbc
|
||||
ODBC_INCLUDE=`$PKG_CONFIG --cflags-only-I libiodbc`
|
||||
ODBC_LFLAGS=`$PKG_CONFIG --libs-only-L libiodbc`
|
||||
ODBC_LIBS=`$PKG_CONFIG --libs-only-l libiodbc`
|
||||
PHP_EVAL_INCLINE($ODBC_INCLUDE)
|
||||
AC_DEFINE(HAVE_IODBC,1,[ ])
|
||||
AC_DEFINE(HAVE_ODBC2,1,[ ])
|
||||
AC_MSG_RESULT([$ext_output])
|
||||
else
|
||||
if test "$PHP_IODBC" = "yes"; then
|
||||
PHP_IODBC=/usr/local
|
||||
fi
|
||||
PHP_ADD_LIBRARY_WITH_PATH(iodbc, $PHP_IODBC/$PHP_LIBDIR)
|
||||
PHP_ADD_INCLUDE($PHP_IODBC/include, 1)
|
||||
ODBC_TYPE=iodbc
|
||||
ODBC_INCLUDE=-I$PHP_IODBC/include
|
||||
ODBC_LFLAGS=-L$PHP_IODBC/$PHP_LIBDIR
|
||||
ODBC_LIBS=-liodbc
|
||||
AC_DEFINE(HAVE_IODBC,1,[ ])
|
||||
AC_DEFINE(HAVE_ODBC2,1,[ ])
|
||||
AC_MSG_RESULT([$ext_output])
|
||||
fi
|
||||
PHP_ADD_LIBRARY_WITH_PATH(iodbc, $PHP_IODBC/$PHP_LIBDIR)
|
||||
PHP_ADD_INCLUDE($PHP_IODBC/include, 1)
|
||||
ODBC_TYPE=iodbc
|
||||
ODBC_INCLUDE=-I$PHP_IODBC/include
|
||||
ODBC_LFLAGS=-L$PHP_IODBC/$PHP_LIBDIR
|
||||
ODBC_LIBS=-liodbc
|
||||
AC_DEFINE(HAVE_IODBC,1,[ ])
|
||||
AC_DEFINE(HAVE_ODBC2,1,[ ])
|
||||
AC_MSG_RESULT([$ext_output])
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
+22
-32
@@ -561,6 +561,7 @@ static EVP_PKEY * php_openssl_generate_private_key(struct php_x509_request * req
|
||||
|
||||
static void add_assoc_name_entry(zval * val, char * key, X509_NAME * name, int shortname TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zval **data;
|
||||
zval *subitem, *subentries;
|
||||
int i, j = -1, last = -1, obj_cnt = 0;
|
||||
char *sname;
|
||||
@@ -592,39 +593,27 @@ static void add_assoc_name_entry(zval * val, char * key, X509_NAME * name, int s
|
||||
sname = (char *) OBJ_nid2ln(nid);
|
||||
}
|
||||
|
||||
MAKE_STD_ZVAL(subentries);
|
||||
array_init(subentries);
|
||||
|
||||
last = -1;
|
||||
for (;;) {
|
||||
j = X509_NAME_get_index_by_OBJ(name, obj, last);
|
||||
if (j < 0) {
|
||||
if (last != -1) break;
|
||||
} else {
|
||||
obj_cnt++;
|
||||
ne = X509_NAME_get_entry(name, j);
|
||||
str = X509_NAME_ENTRY_get_data(ne);
|
||||
if (ASN1_STRING_type(str) != V_ASN1_UTF8STRING) {
|
||||
to_add_len = ASN1_STRING_to_UTF8(&to_add, str);
|
||||
if (to_add_len != -1) {
|
||||
add_next_index_stringl(subentries, (char *)to_add, to_add_len, 1);
|
||||
}
|
||||
} else {
|
||||
to_add = ASN1_STRING_data(str);
|
||||
to_add_len = ASN1_STRING_length(str);
|
||||
add_next_index_stringl(subentries, (char *)to_add, to_add_len, 1);
|
||||
}
|
||||
}
|
||||
last = j;
|
||||
}
|
||||
i = last;
|
||||
|
||||
if (obj_cnt > 1) {
|
||||
add_assoc_zval_ex(subitem, sname, strlen(sname) + 1, subentries);
|
||||
str = X509_NAME_ENTRY_get_data(ne);
|
||||
if (ASN1_STRING_type(str) != V_ASN1_UTF8STRING) {
|
||||
to_add_len = ASN1_STRING_to_UTF8(&to_add, str);
|
||||
} else {
|
||||
zval_dtor(subentries);
|
||||
FREE_ZVAL(subentries);
|
||||
if (obj_cnt && str && to_add_len > -1) {
|
||||
to_add = ASN1_STRING_data(str);
|
||||
to_add_len = ASN1_STRING_length(str);
|
||||
}
|
||||
|
||||
if (to_add_len != -1) {
|
||||
if (zend_hash_find(Z_ARRVAL_P(subitem), sname, strlen(sname)+1, (void**)&data) == SUCCESS) {
|
||||
if (Z_TYPE_PP(data) == IS_ARRAY) {
|
||||
subentries = *data;
|
||||
add_next_index_stringl(subentries, (char *)to_add, to_add_len, 1);
|
||||
} else if (Z_TYPE_PP(data) == IS_STRING) {
|
||||
MAKE_STD_ZVAL(subentries);
|
||||
array_init(subentries);
|
||||
add_next_index_stringl(subentries, Z_STRVAL_PP(data), Z_STRLEN_PP(data), 1);
|
||||
add_next_index_stringl(subentries, (char *)to_add, to_add_len, 1);
|
||||
zend_hash_update(Z_ARRVAL_P(subitem), sname, strlen(sname)+1, &subentries, sizeof(zval*), NULL);
|
||||
}
|
||||
} else {
|
||||
add_assoc_stringl(subitem, sname, (char *)to_add, to_add_len, 1);
|
||||
}
|
||||
}
|
||||
@@ -1574,6 +1563,7 @@ PHP_FUNCTION(openssl_x509_parse)
|
||||
bio_out = BIO_new(BIO_s_mem());
|
||||
if (nid == NID_subject_alt_name) {
|
||||
if (openssl_x509v3_subjectAltName(bio_out, extension) == 0) {
|
||||
BIO_get_mem_ptr(bio_out, &bio_buf);
|
||||
add_assoc_stringl(subitem, extname, bio_buf->data, bio_buf->length, 1);
|
||||
} else {
|
||||
zval_dtor(return_value);
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIGfzCCBWegAwIBAgIQSVCinGH6MkvjJZjRyjK9nTANBgkqhkiG9w0BAQUFADCB
|
||||
jjELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G
|
||||
A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxNDAyBgNV
|
||||
BAMTK0NPTU9ETyBFeHRlbmRlZCBWYWxpZGF0aW9uIFNlY3VyZSBTZXJ2ZXIgQ0Ew
|
||||
HhcNMTIwMjI5MDAwMDAwWhcNMTQwMjI4MjM1OTU5WjCCAW8xEjAQBgNVBAMTCXd3
|
||||
dy5yZC5pbzERMA8GA1UEAxMIcmRpby5jb20xDjAMBgNVBAMTBXJkLmlvMRUwEwYD
|
||||
VQQDEwxhcGkucmRpby5jb20xEjAQBgNVBAMTCWFwaS5yZC5pbzEQMA4GA1UEBRMH
|
||||
NDU4NjAwNzETMBEGCysGAQQBgjc8AgEDEwJVUzEZMBcGCysGAQQBgjc8AgECEwhE
|
||||
ZWxhd2FyZTEdMBsGA1UEDxMUUHJpdmF0ZSBPcmdhbml6YXRpb24xCzAJBgNVBAYT
|
||||
AlVTMQ4wDAYDVQQREwU5NDEwMzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDVNhbiBG
|
||||
cmFuY2lzY28xFzAVBgNVBAkTDjE1NTAgQnJ5YW50IHN0MRMwEQYDVQQKEwpSZGlv
|
||||
LCBJbmMuMSMwIQYDVQQLExpDT01PRE8gRVYgTXVsdGktRG9tYWluIFNTTDEVMBMG
|
||||
A1UEAxMMd3d3LnJkaW8uY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC
|
||||
AQEAt0AgYOe8EBJNVBAuSJFLKHRKZn0/ObCLBFG4xVH/5fb1rfYHBT1XSjjOqR3t
|
||||
iGC/A3esF8YC7TuHQcTLVephx0DtJv1ASxRg3zPM8ebBRsuul18N0W+sY1aNXpkd
|
||||
36quxvjg5UdBrAweuekJ7OTSZcCe2Ry/SKBeZSWWtkWsI4krCLv7JaKUwxw2h+Hn
|
||||
TAZSBLVxz/mixF0WYdepYwnq2Hm7XvvVEIQ7wxOQ9bA7iCevLojZOnb39BT2QII7
|
||||
cy8AB47RZdfYg7UwaO3bST2rauA4MKar7/Ozqc0aemNFpLatJfgv07cydiuj9fsd
|
||||
5aE/c8is8C9M9+7MmSMkcNEgGwIDAQABo4IB8zCCAe8wHwYDVR0jBBgwFoAUiERR
|
||||
/1AqaV4tiPQhutkM8s7L6nwwHQYDVR0OBBYEFCrYw8bfrYJ61NS2yYx6/CnhjzT4
|
||||
MA4GA1UdDwEB/wQEAwIFoDAMBgNVHRMBAf8EAjAAMB0GA1UdJQQWMBQGCCsGAQUF
|
||||
BwMBBggrBgEFBQcDAjBGBgNVHSAEPzA9MDsGDCsGAQQBsjEBAgEFATArMCkGCCsG
|
||||
AQUFBwIBFh1odHRwczovL3NlY3VyZS5jb21vZG8uY29tL0NQUzBTBgNVHR8ETDBK
|
||||
MEigRqBEhkJodHRwOi8vY3JsLmNvbW9kb2NhLmNvbS9DT01PRE9FeHRlbmRlZFZh
|
||||
bGlkYXRpb25TZWN1cmVTZXJ2ZXJDQS5jcmwwgYQGCCsGAQUFBwEBBHgwdjBOBggr
|
||||
BgEFBQcwAoZCaHR0cDovL2NydC5jb21vZG9jYS5jb20vQ09NT0RPRXh0ZW5kZWRW
|
||||
YWxpZGF0aW9uU2VjdXJlU2VydmVyQ0EuY3J0MCQGCCsGAQUFBzABhhhodHRwOi8v
|
||||
b2NzcC5jb21vZG9jYS5jb20wTAYDVR0RBEUwQ4IMd3d3LnJkaW8uY29tgglhcGku
|
||||
cmQuaW+CDGFwaS5yZGlvLmNvbYIFcmQuaW+CCHJkaW8uY29tggl3d3cucmQuaW8w
|
||||
DQYJKoZIhvcNAQEFBQADggEBAKFd4bPVFRyrlqIKPtrtMuqGqid6685ohxf0cv52
|
||||
sjdRYwLVTjnZOrmkDdNaF3R2A1ZlVMRN+67rK+qfY5sTeijFcudV3/i0PDtOFRwP
|
||||
6yYVD2uZmYkxfPiW309HPmDF+EzhxpVjWlTQEOwkfFLTmJmwl3Qu2Kffp8F1ENXW
|
||||
OTVNvj5VtMghvzu68PpzKl1VjlOR4Ej9NCwh1dUjNKEoTPzvpehXsIZ7jHSpX/T1
|
||||
wSSt9ckiechDdpgZXTzHgbxHNibK0Uhh+QhkBgYMj5F8qj5BlBhWAWqQa/VnEdmr
|
||||
Pfo7U+QmadoqQd7qt06hE2hG1nfZ0vPJDbWV3oVSwG2Yt7I=
|
||||
-----END CERTIFICATE-----
|
||||
@@ -0,0 +1,56 @@
|
||||
--TEST--
|
||||
Bug #64802: openssl_x509_parse fails to parse subject properly in some cases
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("openssl")) die("skip");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$cert = file_get_contents(__DIR__.'/bug64802.pem');
|
||||
$r = openssl_x509_parse($cert,$use_short_names=true);
|
||||
sort($r['subject']);
|
||||
var_dump( $r['subject'] );
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(11) {
|
||||
[0]=>
|
||||
string(14) "1550 Bryant st"
|
||||
[1]=>
|
||||
string(5) "94103"
|
||||
[2]=>
|
||||
string(7) "4586007"
|
||||
[3]=>
|
||||
string(2) "CA"
|
||||
[4]=>
|
||||
string(26) "COMODO EV Multi-Domain SSL"
|
||||
[5]=>
|
||||
string(20) "Private Organization"
|
||||
[6]=>
|
||||
string(10) "Rdio, Inc."
|
||||
[7]=>
|
||||
string(13) "San Francisco"
|
||||
[8]=>
|
||||
string(2) "US"
|
||||
[9]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(2) "US"
|
||||
[1]=>
|
||||
string(8) "Delaware"
|
||||
}
|
||||
[10]=>
|
||||
array(6) {
|
||||
[0]=>
|
||||
string(9) "www.rd.io"
|
||||
[1]=>
|
||||
string(8) "rdio.com"
|
||||
[2]=>
|
||||
string(5) "rd.io"
|
||||
[3]=>
|
||||
string(12) "api.rdio.com"
|
||||
[4]=>
|
||||
string(9) "api.rd.io"
|
||||
[5]=>
|
||||
string(12) "www.rdio.com"
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -997,7 +997,7 @@ static PHP_METHOD(PDO, lastInsertId)
|
||||
pdo_raise_impl_error(dbh, NULL, "IM001", "driver does not support lastInsertId()" TSRMLS_CC);
|
||||
RETURN_FALSE;
|
||||
} else {
|
||||
Z_STRVAL_P(return_value) = dbh->methods->last_id(dbh, name, &Z_STRLEN_P(return_value) TSRMLS_CC);
|
||||
Z_STRVAL_P(return_value) = dbh->methods->last_id(dbh, name, (unsigned int *)&Z_STRLEN_P(return_value) TSRMLS_CC);
|
||||
if (!Z_STRVAL_P(return_value)) {
|
||||
PDO_HANDLE_DBH_ERR();
|
||||
RETURN_FALSE;
|
||||
|
||||
+39
-34
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.13.5 on Thu Apr 19 12:42:11 2012 */
|
||||
/* Generated by re2c 0.13.5 on Tue Aug 20 18:02:48 2013 */
|
||||
#line 1 "ext/pdo/pdo_sql_parser.re"
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
@@ -77,7 +77,7 @@ yy2:
|
||||
yy3:
|
||||
yyaccept = 0;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
if (yych >= 0x01) goto yy41;
|
||||
if (yych >= 0x01) goto yy43;
|
||||
yy4:
|
||||
#line 63 "ext/pdo/pdo_sql_parser.re"
|
||||
{ SKIP_ONE(PDO_PARSER_TEXT); }
|
||||
@@ -86,7 +86,7 @@ yy5:
|
||||
yyaccept = 0;
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
if (yych <= 0x00) goto yy4;
|
||||
goto yy36;
|
||||
goto yy38;
|
||||
yy6:
|
||||
yych = *++YYCURSOR;
|
||||
switch (yych) {
|
||||
@@ -153,21 +153,19 @@ yy6:
|
||||
case 'x':
|
||||
case 'y':
|
||||
case 'z': goto yy32;
|
||||
case ':':
|
||||
case '?': goto yy29;
|
||||
case ':': goto yy35;
|
||||
default: goto yy4;
|
||||
}
|
||||
yy7:
|
||||
++YYCURSOR;
|
||||
switch ((yych = *YYCURSOR)) {
|
||||
case ':':
|
||||
case '?': goto yy29;
|
||||
default: goto yy8;
|
||||
}
|
||||
yy8:
|
||||
#line 62 "ext/pdo/pdo_sql_parser.re"
|
||||
{ RET(PDO_PARSER_BIND_POS); }
|
||||
#line 171 "ext/pdo/pdo_sql_parser.c"
|
||||
#line 169 "ext/pdo/pdo_sql_parser.c"
|
||||
yy9:
|
||||
++YYCURSOR;
|
||||
switch ((yych = *YYCURSOR)) {
|
||||
@@ -177,7 +175,7 @@ yy9:
|
||||
yy10:
|
||||
#line 65 "ext/pdo/pdo_sql_parser.re"
|
||||
{ RET(PDO_PARSER_TEXT); }
|
||||
#line 181 "ext/pdo/pdo_sql_parser.c"
|
||||
#line 179 "ext/pdo/pdo_sql_parser.c"
|
||||
yy11:
|
||||
yych = *++YYCURSOR;
|
||||
switch (yych) {
|
||||
@@ -214,7 +212,7 @@ yy14:
|
||||
yy16:
|
||||
#line 64 "ext/pdo/pdo_sql_parser.re"
|
||||
{ RET(PDO_PARSER_TEXT); }
|
||||
#line 218 "ext/pdo/pdo_sql_parser.c"
|
||||
#line 216 "ext/pdo/pdo_sql_parser.c"
|
||||
yy17:
|
||||
++YYCURSOR;
|
||||
if (YYLIMIT <= YYCURSOR) YYFILL(1);
|
||||
@@ -288,14 +286,13 @@ yy29:
|
||||
if (YYLIMIT <= YYCURSOR) YYFILL(1);
|
||||
yych = *YYCURSOR;
|
||||
switch (yych) {
|
||||
case ':':
|
||||
case '?': goto yy29;
|
||||
default: goto yy31;
|
||||
}
|
||||
yy31:
|
||||
#line 60 "ext/pdo/pdo_sql_parser.re"
|
||||
{ RET(PDO_PARSER_TEXT); }
|
||||
#line 299 "ext/pdo/pdo_sql_parser.c"
|
||||
#line 296 "ext/pdo/pdo_sql_parser.c"
|
||||
yy32:
|
||||
++YYCURSOR;
|
||||
if (YYLIMIT <= YYCURSOR) YYFILL(1);
|
||||
@@ -369,51 +366,59 @@ yy32:
|
||||
yy34:
|
||||
#line 61 "ext/pdo/pdo_sql_parser.re"
|
||||
{ RET(PDO_PARSER_BIND); }
|
||||
#line 373 "ext/pdo/pdo_sql_parser.c"
|
||||
#line 370 "ext/pdo/pdo_sql_parser.c"
|
||||
yy35:
|
||||
++YYCURSOR;
|
||||
if (YYLIMIT <= YYCURSOR) YYFILL(1);
|
||||
yych = *YYCURSOR;
|
||||
yy36:
|
||||
switch (yych) {
|
||||
case 0x00: goto yy2;
|
||||
case '\'': goto yy38;
|
||||
case '\\': goto yy37;
|
||||
default: goto yy35;
|
||||
case ':': goto yy35;
|
||||
default: goto yy31;
|
||||
}
|
||||
yy37:
|
||||
++YYCURSOR;
|
||||
if (YYLIMIT <= YYCURSOR) YYFILL(1);
|
||||
yych = *YYCURSOR;
|
||||
if (yych <= 0x00) goto yy2;
|
||||
goto yy35;
|
||||
yy38:
|
||||
++YYCURSOR;
|
||||
#line 59 "ext/pdo/pdo_sql_parser.re"
|
||||
{ RET(PDO_PARSER_TEXT); }
|
||||
#line 395 "ext/pdo/pdo_sql_parser.c"
|
||||
yy40:
|
||||
switch (yych) {
|
||||
case 0x00: goto yy2;
|
||||
case '\'': goto yy40;
|
||||
case '\\': goto yy39;
|
||||
default: goto yy37;
|
||||
}
|
||||
yy39:
|
||||
++YYCURSOR;
|
||||
if (YYLIMIT <= YYCURSOR) YYFILL(1);
|
||||
yych = *YYCURSOR;
|
||||
yy41:
|
||||
switch (yych) {
|
||||
case 0x00: goto yy2;
|
||||
case '"': goto yy43;
|
||||
case '\\': goto yy42;
|
||||
default: goto yy40;
|
||||
}
|
||||
if (yych <= 0x00) goto yy2;
|
||||
goto yy37;
|
||||
yy40:
|
||||
++YYCURSOR;
|
||||
#line 59 "ext/pdo/pdo_sql_parser.re"
|
||||
{ RET(PDO_PARSER_TEXT); }
|
||||
#line 400 "ext/pdo/pdo_sql_parser.c"
|
||||
yy42:
|
||||
++YYCURSOR;
|
||||
if (YYLIMIT <= YYCURSOR) YYFILL(1);
|
||||
yych = *YYCURSOR;
|
||||
if (yych <= 0x00) goto yy2;
|
||||
goto yy40;
|
||||
yy43:
|
||||
switch (yych) {
|
||||
case 0x00: goto yy2;
|
||||
case '"': goto yy45;
|
||||
case '\\': goto yy44;
|
||||
default: goto yy42;
|
||||
}
|
||||
yy44:
|
||||
++YYCURSOR;
|
||||
if (YYLIMIT <= YYCURSOR) YYFILL(1);
|
||||
yych = *YYCURSOR;
|
||||
if (yych <= 0x00) goto yy2;
|
||||
goto yy42;
|
||||
yy45:
|
||||
++YYCURSOR;
|
||||
#line 58 "ext/pdo/pdo_sql_parser.re"
|
||||
{ RET(PDO_PARSER_TEXT); }
|
||||
#line 417 "ext/pdo/pdo_sql_parser.c"
|
||||
#line 422 "ext/pdo/pdo_sql_parser.c"
|
||||
}
|
||||
#line 66 "ext/pdo/pdo_sql_parser.re"
|
||||
|
||||
|
||||
@@ -50,14 +50,14 @@ static int scan(Scanner *s)
|
||||
QUESTION = [?];
|
||||
COMMENTS = ("/*"([^*]+|[*]+[^/*])*[*]*"*/"|"--"[^\r\n]*);
|
||||
SPECIALS = [:?"'];
|
||||
MULTICHAR = [:?];
|
||||
MULTICHAR = ([:]{2,}|[?]{2,});
|
||||
ANYNOEOF = [\001-\377];
|
||||
*/
|
||||
|
||||
/*!re2c
|
||||
(["](([\\]ANYNOEOF)|ANYNOEOF\["\\])*["]) { RET(PDO_PARSER_TEXT); }
|
||||
(['](([\\]ANYNOEOF)|ANYNOEOF\['\\])*[']) { RET(PDO_PARSER_TEXT); }
|
||||
MULTICHAR{2,} { RET(PDO_PARSER_TEXT); }
|
||||
MULTICHAR { RET(PDO_PARSER_TEXT); }
|
||||
BINDCHR { RET(PDO_PARSER_BIND); }
|
||||
QUESTION { RET(PDO_PARSER_BIND_POS); }
|
||||
SPECIALS { SKIP_ONE(PDO_PARSER_TEXT); }
|
||||
|
||||
+2
-2
@@ -1146,7 +1146,7 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value,
|
||||
zval_ptr_dtor(&val);
|
||||
pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "cannot unserialize class" TSRMLS_CC);
|
||||
return 0;
|
||||
} else if (ce->unserialize(&return_value, ce, Z_TYPE_P(val) == IS_STRING ? Z_STRVAL_P(val) : "", Z_TYPE_P(val) == IS_STRING ? Z_STRLEN_P(val) : 0, NULL TSRMLS_CC) == FAILURE) {
|
||||
} else if (ce->unserialize(&return_value, ce, (unsigned char *)(Z_TYPE_P(val) == IS_STRING ? Z_STRVAL_P(val) : ""), Z_TYPE_P(val) == IS_STRING ? Z_STRLEN_P(val) : 0, NULL TSRMLS_CC) == FAILURE) {
|
||||
zval_ptr_dtor(&val);
|
||||
pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "cannot unserialize class" TSRMLS_CC);
|
||||
zval_dtor(return_value);
|
||||
@@ -1876,7 +1876,7 @@ static PHP_METHOD(PDOStatement, getColumnMeta)
|
||||
int pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, int skip)
|
||||
{
|
||||
long mode = PDO_FETCH_BOTH;
|
||||
int flags, argc = ZEND_NUM_ARGS() - skip;
|
||||
int flags = 0, argc = ZEND_NUM_ARGS() - skip;
|
||||
zval ***args;
|
||||
zend_class_entry **cep;
|
||||
int retval;
|
||||
|
||||
@@ -72,11 +72,11 @@ enum pdo_param_type {
|
||||
/* get_col ptr should point to a zval*
|
||||
and the driver is responsible for adding correct type information to get_column_meta()
|
||||
*/
|
||||
PDO_PARAM_ZVAL
|
||||
};
|
||||
PDO_PARAM_ZVAL,
|
||||
|
||||
/* magic flag to denote a parameter as being input/output */
|
||||
#define PDO_PARAM_INPUT_OUTPUT 0x80000000
|
||||
/* magic flag to denote a parameter as being input/output */
|
||||
PDO_PARAM_INPUT_OUTPUT = 0x80000000
|
||||
};
|
||||
|
||||
#define PDO_PARAM_FLAGS 0xFFFF0000
|
||||
|
||||
|
||||
@@ -362,8 +362,10 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
#if PHP_DBLIB_IS_MSSQL
|
||||
/* dblib do not return more than this length from text/image */
|
||||
DBSETOPT(H->link, DBTEXTLIMIT, "2147483647");
|
||||
#endif
|
||||
|
||||
/* limit text/image from network */
|
||||
DBSETOPT(H->link, DBTEXTSIZE, "2147483647");
|
||||
|
||||
@@ -537,7 +537,9 @@ static int pdo_oci_check_liveness(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data;
|
||||
sb4 error_code = 0;
|
||||
#if (!((OCI_MAJOR_VERSION > 10) || ((OCI_MAJOR_VERSION == 10) && (OCI_MINOR_VERSION >= 2))))
|
||||
char version[256];
|
||||
#endif
|
||||
|
||||
/* TODO move attached check to PDO level */
|
||||
if (H->attached == 0) {
|
||||
|
||||
@@ -270,6 +270,12 @@ static int oci_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *pa
|
||||
P = (pdo_oci_bound_param*)param->driver_data;
|
||||
|
||||
switch (event_type) {
|
||||
case PDO_PARAM_EVT_FETCH_PRE:
|
||||
case PDO_PARAM_EVT_FETCH_POST:
|
||||
case PDO_PARAM_EVT_NORMALIZE:
|
||||
/* Do nothing */
|
||||
break;
|
||||
|
||||
case PDO_PARAM_EVT_FREE:
|
||||
P = param->driver_data;
|
||||
if (P) {
|
||||
|
||||
@@ -263,7 +263,7 @@ out:
|
||||
|
||||
static int odbc_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type param_type TSRMLS_DC)
|
||||
{
|
||||
pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data;
|
||||
/* pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data; */
|
||||
/* TODO: figure it out */
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -286,6 +286,12 @@ static int odbc_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *p
|
||||
if (param->is_param) {
|
||||
|
||||
switch (event_type) {
|
||||
case PDO_PARAM_EVT_FETCH_PRE:
|
||||
case PDO_PARAM_EVT_FETCH_POST:
|
||||
case PDO_PARAM_EVT_NORMALIZE:
|
||||
/* Do nothing */
|
||||
break;
|
||||
|
||||
case PDO_PARAM_EVT_FREE:
|
||||
P = param->driver_data;
|
||||
if (P) {
|
||||
@@ -543,7 +549,6 @@ static int odbc_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
|
||||
{
|
||||
pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data;
|
||||
struct pdo_column_data *col = &stmt->columns[colno];
|
||||
zend_bool dyn = FALSE;
|
||||
RETCODE rc;
|
||||
SWORD colnamelen;
|
||||
SDWORD colsize, displaysize;
|
||||
@@ -614,7 +619,6 @@ static int odbc_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned l
|
||||
|
||||
/* if it is a column containing "long" data, perform late binding now */
|
||||
if (C->is_long) {
|
||||
unsigned long alloced = 4096;
|
||||
unsigned long used = 0;
|
||||
char *buf;
|
||||
RETCODE rc;
|
||||
|
||||
@@ -315,9 +315,9 @@ static int pgsql_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquote
|
||||
case PDO_PARAM_LOB:
|
||||
/* escapedlen returned by PQescapeBytea() accounts for trailing 0 */
|
||||
#ifdef HAVE_PQESCAPE_BYTEA_CONN
|
||||
escaped = PQescapeByteaConn(H->server, unquoted, unquotedlen, &tmp_len);
|
||||
escaped = PQescapeByteaConn(H->server, (unsigned char *)unquoted, (size_t)unquotedlen, &tmp_len);
|
||||
#else
|
||||
escaped = PQescapeBytea(unquoted, unquotedlen, &tmp_len);
|
||||
escaped = PQescapeBytea((unsigned char *)unquoted, (size_t)unquotedlen, &tmp_len);
|
||||
#endif
|
||||
*quotedlen = (int)tmp_len + 1;
|
||||
*quoted = emalloc(*quotedlen + 1);
|
||||
@@ -331,9 +331,9 @@ static int pgsql_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquote
|
||||
*quoted = safe_emalloc(2, unquotedlen, 3);
|
||||
(*quoted)[0] = '\'';
|
||||
#ifndef HAVE_PQESCAPE_CONN
|
||||
*quotedlen = PQescapeString(*quoted + 1, unquoted, unquotedlen);
|
||||
*quotedlen = PQescapeString(*quoted + 1, unquoted, (size_t)unquotedlen);
|
||||
#else
|
||||
*quotedlen = PQescapeStringConn(H->server, *quoted + 1, unquoted, unquotedlen, NULL);
|
||||
*quotedlen = PQescapeStringConn(H->server, *quoted + 1, unquoted, (size_t)unquotedlen, NULL);
|
||||
#endif
|
||||
(*quoted)[*quotedlen + 1] = '\'';
|
||||
(*quoted)[*quotedlen + 2] = '\0';
|
||||
|
||||
@@ -536,7 +536,7 @@ static int pgsql_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned
|
||||
*len = 0;
|
||||
return 0;
|
||||
} else {
|
||||
char *tmp_ptr = PQunescapeBytea(*ptr, &tmp_len);
|
||||
char *tmp_ptr = (char *)PQunescapeBytea((unsigned char *)*ptr, &tmp_len);
|
||||
if (!tmp_ptr) {
|
||||
/* PQunescapeBytea returned an error */
|
||||
*len = 0;
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
--TEST--
|
||||
PDO PgSQL Bug #64953 (Postgres prepared statement positional parameter casting)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('pdo') || !extension_loaded('pdo_pgsql')) die('skip not loaded');
|
||||
require dirname(__FILE__) . '/config.inc';
|
||||
require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
|
||||
PDOTest::skip();
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo "Test\n";
|
||||
|
||||
require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
|
||||
$pdo = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
|
||||
$pdo->setAttribute (\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
|
||||
|
||||
echo "Taken from the bug report:\n";
|
||||
|
||||
$st = $pdo->prepare('SELECT ?::char as i');
|
||||
$st->bindValue(1, '1');
|
||||
$st->execute();
|
||||
var_dump($st->fetch()); // return false
|
||||
|
||||
|
||||
$st = $pdo->prepare('SELECT (?)::char as i');
|
||||
$st->bindValue(1, '1');
|
||||
$st->execute();
|
||||
var_dump($st->fetch()); // return array(1) { ["i"]=> string(1) "1" }
|
||||
|
||||
echo "Something more nasty:\n";
|
||||
|
||||
$st = $pdo->prepare("SELECT :int::int as i");
|
||||
$st->execute(array(":int" => 123));
|
||||
var_dump($st->fetch());
|
||||
|
||||
$st = $pdo->prepare("SELECT '''?'''::text as \":text\"");
|
||||
$st->execute();
|
||||
var_dump($st->fetch());
|
||||
|
||||
?>
|
||||
Done
|
||||
--EXPECT--
|
||||
Test
|
||||
Taken from the bug report:
|
||||
array(2) {
|
||||
["i"]=>
|
||||
string(1) "1"
|
||||
[0]=>
|
||||
string(1) "1"
|
||||
}
|
||||
array(2) {
|
||||
["i"]=>
|
||||
string(1) "1"
|
||||
[0]=>
|
||||
string(1) "1"
|
||||
}
|
||||
Something more nasty:
|
||||
array(2) {
|
||||
["i"]=>
|
||||
string(3) "123"
|
||||
[0]=>
|
||||
string(3) "123"
|
||||
}
|
||||
array(2) {
|
||||
[":text"]=>
|
||||
string(3) "'?'"
|
||||
[0]=>
|
||||
string(3) "'?'"
|
||||
}
|
||||
Done
|
||||
+29
-17
@@ -63,6 +63,7 @@
|
||||
#define PGSQL_MAX_LENGTH_OF_LONG 30
|
||||
#define PGSQL_MAX_LENGTH_OF_DOUBLE 60
|
||||
|
||||
#if LONG_MAX < UINT_MAX
|
||||
#define PGSQL_RETURN_OID(oid) do { \
|
||||
if (oid > LONG_MAX) { \
|
||||
smart_str s = {0}; \
|
||||
@@ -72,7 +73,9 @@
|
||||
} \
|
||||
RETURN_LONG((long)oid); \
|
||||
} while(0)
|
||||
|
||||
#else
|
||||
#define PGSQL_RETURN_OID(oid) (RETURN_LONG((long)oid))
|
||||
#endif
|
||||
|
||||
#if HAVE_PQSETNONBLOCKING
|
||||
#define PQ_SETNONBLOCKING(pg_link, flag) PQsetnonblocking(pg_link, flag)
|
||||
@@ -4152,7 +4155,7 @@ PHP_FUNCTION(pg_escape_bytea)
|
||||
#ifdef HAVE_PQESCAPE_BYTEA_CONN
|
||||
if (pgsql_link != NULL || id != -1) {
|
||||
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink);
|
||||
to = (char *)PQescapeByteaConn(pgsql, from, (size_t)from_len, &to_len);
|
||||
to = (char *)PQescapeByteaConn(pgsql, (unsigned char *)from, (size_t)from_len, &to_len);
|
||||
} else
|
||||
#endif
|
||||
to = (char *)PQescapeBytea((unsigned char*)from, from_len, &to_len);
|
||||
@@ -4346,7 +4349,7 @@ static char* php_pgsql_PQescapeInternal(PGconn *conn, const char *str, size_t le
|
||||
#endif
|
||||
|
||||
static void php_pgsql_escape_internal(INTERNAL_FUNCTION_PARAMETERS, int escape_literal) {
|
||||
char *from = NULL, *to = NULL, *tmp = NULL;
|
||||
char *from = NULL, *to = NULL;
|
||||
zval *pgsql_link = NULL;
|
||||
PGconn *pgsql;
|
||||
int from_len;
|
||||
@@ -4379,17 +4382,22 @@ static void php_pgsql_escape_internal(INTERNAL_FUNCTION_PARAMETERS, int escape_l
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#ifdef HAVE_PQESCAPELITERAL
|
||||
if (escape_literal) {
|
||||
tmp = PQescapeLiteral(pgsql, from, (size_t)from_len);
|
||||
} else {
|
||||
tmp = PQescapeIdentifier(pgsql, from, (size_t)from_len);
|
||||
/* Use a block with a local var to avoid unused variable warnings */
|
||||
{
|
||||
char *tmp;
|
||||
|
||||
if (escape_literal) {
|
||||
tmp = PQescapeLiteral(pgsql, from, (size_t)from_len);
|
||||
} else {
|
||||
tmp = PQescapeIdentifier(pgsql, from, (size_t)from_len);
|
||||
}
|
||||
if (!tmp) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING,"Failed to escape");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
to = estrdup(tmp);
|
||||
PQfreemem(tmp);
|
||||
}
|
||||
if (!tmp) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING,"Failed to escape");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
to = estrdup(tmp);
|
||||
PQfreemem(tmp);
|
||||
#else
|
||||
to = php_pgsql_PQescapeInternal(pgsql, from, (size_t)from_len, escape_literal);
|
||||
if (!to) {
|
||||
@@ -5120,7 +5128,9 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z
|
||||
#else
|
||||
new_len = PQescapeString(escaped, tmp_name2, strlen(tmp_name2));
|
||||
#endif
|
||||
smart_str_appends(&querystr, escaped);
|
||||
if (new_len) {
|
||||
smart_str_appends(&querystr, escaped);
|
||||
}
|
||||
efree(escaped);
|
||||
|
||||
smart_str_appends(&querystr, "' AND c.relnamespace = n.oid AND n.nspname = '");
|
||||
@@ -5130,7 +5140,9 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z
|
||||
#else
|
||||
new_len = PQescapeString(escaped, tmp_name, strlen(tmp_name));
|
||||
#endif
|
||||
smart_str_appends(&querystr, escaped);
|
||||
if (new_len) {
|
||||
smart_str_appends(&querystr, escaped);
|
||||
}
|
||||
efree(escaped);
|
||||
|
||||
smart_str_appends(&querystr, "' AND a.atttypid = t.oid ORDER BY a.attnum;");
|
||||
@@ -5923,9 +5935,9 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
|
||||
size_t to_len;
|
||||
smart_str s = {0};
|
||||
#ifdef HAVE_PQESCAPE_BYTEA_CONN
|
||||
tmp = PQescapeByteaConn(pg_link, Z_STRVAL_PP(val), Z_STRLEN_PP(val), &to_len);
|
||||
tmp = PQescapeByteaConn(pg_link, (unsigned char *)Z_STRVAL_PP(val), Z_STRLEN_PP(val), &to_len);
|
||||
#else
|
||||
tmp = PQescapeBytea(Z_STRVAL_PP(val), Z_STRLEN_PP(val), &to_len);
|
||||
tmp = PQescapeBytea(Z_STRVAL_PP(val), (unsigned char *)Z_STRLEN_PP(val), &to_len);
|
||||
#endif
|
||||
Z_TYPE_P(new_val) = IS_STRING;
|
||||
Z_STRLEN_P(new_val) = to_len-1; /* PQescapeBytea's to_len includes additional '\0' */
|
||||
|
||||
@@ -951,7 +951,9 @@ static php_conv_err_t php_conv_qprint_encode_convert(php_conv_qprint_encode *ins
|
||||
*(pd++) = qp_digits[(c & 0x0f)];
|
||||
ocnt -= 3;
|
||||
line_ccnt -= 3;
|
||||
trail_ws--;
|
||||
if (trail_ws > 0) {
|
||||
trail_ws--;
|
||||
}
|
||||
CONSUME_CHAR(ps, icnt, lb_ptr, lb_cnt);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,6 +84,30 @@
|
||||
#define HTTP_WRAPPER_HEADER_INIT 1
|
||||
#define HTTP_WRAPPER_REDIRECTED 2
|
||||
|
||||
static inline void strip_header(char *header_bag, char *lc_header_bag,
|
||||
const char *lc_header_name)
|
||||
{
|
||||
char *lc_header_start = strstr(lc_header_bag, lc_header_name);
|
||||
char *header_start = header_bag + (lc_header_start - lc_header_bag);
|
||||
|
||||
if (lc_header_start
|
||||
&& (lc_header_start == lc_header_bag || *(lc_header_start-1) == '\n')
|
||||
) {
|
||||
char *lc_eol = strchr(lc_header_start, '\n');
|
||||
char *eol = header_start + (lc_eol - lc_header_start);
|
||||
|
||||
if (lc_eol) {
|
||||
size_t eollen = strlen(lc_eol);
|
||||
|
||||
memmove(lc_header_start, lc_eol+1, eollen);
|
||||
memmove(header_start, eol+1, eollen);
|
||||
} else {
|
||||
*lc_header_start = '\0';
|
||||
*header_start = '\0';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context, int redirect_max, int flags STREAMS_DC TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
php_stream *stream = NULL;
|
||||
@@ -425,40 +449,17 @@ finish:
|
||||
if (tmp && strlen(tmp) > 0) {
|
||||
char *s;
|
||||
|
||||
if (!header_init) { /* Remove post headers for redirects */
|
||||
int l = strlen(tmp);
|
||||
char *s2, *tmp_c = estrdup(tmp);
|
||||
|
||||
php_strtolower(tmp_c, l);
|
||||
if ((s = strstr(tmp_c, "content-length:"))) {
|
||||
if ((s2 = memchr(s, '\n', tmp_c + l - s))) {
|
||||
int b = tmp_c + l - 1 - s2;
|
||||
memmove(tmp, tmp + (s2 + 1 - tmp_c), b);
|
||||
memmove(tmp_c, s2 + 1, b);
|
||||
|
||||
} else {
|
||||
tmp[s - tmp_c] = *s = '\0';
|
||||
}
|
||||
l = strlen(tmp_c);
|
||||
}
|
||||
if ((s = strstr(tmp_c, "content-type:"))) {
|
||||
if ((s2 = memchr(s, '\n', tmp_c + l - s))) {
|
||||
memmove(tmp, tmp + (s2 + 1 - tmp_c), tmp_c + l - 1 - s2);
|
||||
} else {
|
||||
tmp[s - tmp_c] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
efree(tmp_c);
|
||||
tmp_c = php_trim(tmp, strlen(tmp), NULL, 0, NULL, 3 TSRMLS_CC);
|
||||
efree(tmp);
|
||||
tmp = tmp_c;
|
||||
}
|
||||
|
||||
user_headers = estrdup(tmp);
|
||||
|
||||
/* Make lowercase for easy comparison against 'standard' headers */
|
||||
php_strtolower(tmp, strlen(tmp));
|
||||
|
||||
if (!header_init) {
|
||||
/* strip POST headers on redirect */
|
||||
strip_header(user_headers, tmp, "content-length:");
|
||||
strip_header(user_headers, tmp, "content-type:");
|
||||
}
|
||||
|
||||
if ((s = strstr(tmp, "user-agent:")) &&
|
||||
(s == tmp || *(s-1) == '\r' || *(s-1) == '\n' ||
|
||||
*(s-1) == '\t' || *(s-1) == ' ')) {
|
||||
|
||||
+1
-1
@@ -295,7 +295,7 @@ void php_info_print_style(TSRMLS_D)
|
||||
PHPAPI char *php_info_html_esc(char *string TSRMLS_DC)
|
||||
{
|
||||
size_t new_len;
|
||||
return php_escape_html_entities(string, strlen(string), &new_len, 0, ENT_QUOTES, NULL TSRMLS_CC);
|
||||
return php_escape_html_entities((unsigned char *) string, strlen(string), &new_len, 0, ENT_QUOTES, NULL TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
@@ -115,6 +115,7 @@ do { \
|
||||
|
||||
PHPAPI void var_replace(php_unserialize_data_t *var_hash, zval *ozval, zval **nzval);
|
||||
PHPAPI void var_push_dtor(php_unserialize_data_t *var_hash, zval **val);
|
||||
PHPAPI void var_push_dtor_no_addref(php_unserialize_data_t *var_hashx, zval **rval);
|
||||
PHPAPI void var_destroy(php_unserialize_data_t *var_hash);
|
||||
|
||||
#define PHP_VAR_UNSERIALIZE_ZVAL_CHANGED(var_hash, ozval, nzval) \
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Test glob() function: ensure no platform difference
|
||||
--FILE--
|
||||
<?php
|
||||
$path = dirname(__FILE__);
|
||||
|
||||
ini_set('open_basedir', NULL);
|
||||
var_dump(glob("$path/*.none"));
|
||||
|
||||
ini_set('open_basedir', $path);
|
||||
var_dump(glob("$path/*.none"));
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
array(0) {
|
||||
}
|
||||
bool(false)
|
||||
==DONE==
|
||||
@@ -0,0 +1,118 @@
|
||||
--TEST--
|
||||
Bug #61548 (content-type must appear at the end of headers)
|
||||
--INI--
|
||||
allow_url_fopen=1
|
||||
--SKIPIF--
|
||||
<?php require 'server.inc'; http_server_skipif('tcp://127.0.0.1:12342'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
require 'server.inc';
|
||||
|
||||
function do_test($header) {
|
||||
$options = [
|
||||
'http' => [
|
||||
'method' => 'POST',
|
||||
'header' => $header,
|
||||
'follow_location' => true,
|
||||
],
|
||||
];
|
||||
|
||||
$ctx = stream_context_create($options);
|
||||
|
||||
$responses = [
|
||||
"data://text/plain,HTTP/1.1 201\r\nLocation: /foo\r\n\r\n",
|
||||
"data://text/plain,HTTP/1.1 200\r\nConnection: close\r\n\r\n",
|
||||
];
|
||||
$pid = http_server('tcp://127.0.0.1:12342', $responses, $output);
|
||||
|
||||
$fd = fopen('http://127.0.0.1:12342/', 'rb', false, $ctx);
|
||||
fseek($output, 0, SEEK_SET);
|
||||
echo stream_get_contents($output);
|
||||
|
||||
http_server_kill($pid);
|
||||
}
|
||||
|
||||
do_test("First:1\nSecond:2\nContent-type: text/plain");
|
||||
do_test("First:1\nSecond:2\nContent-type: text/plain\n");
|
||||
do_test("First:1\nSecond:2\nContent-type: text/plain\nThird:");
|
||||
do_test("First:1\nContent-type:text/plain\nSecond:2");
|
||||
do_test("First:1\nContent-type:text/plain\nSecond:2\n");
|
||||
do_test("First:1\nContent-type:text/plain\nSecond:2\nThird:");
|
||||
|
||||
?>
|
||||
Done
|
||||
--EXPECT--
|
||||
POST / HTTP/1.0
|
||||
Host: 127.0.0.1:12342
|
||||
First:1
|
||||
Second:2
|
||||
Content-type: text/plain
|
||||
|
||||
GET /foo HTTP/1.0
|
||||
Host: 127.0.0.1:12342
|
||||
First:1
|
||||
Second:2
|
||||
|
||||
|
||||
POST / HTTP/1.0
|
||||
Host: 127.0.0.1:12342
|
||||
First:1
|
||||
Second:2
|
||||
Content-type: text/plain
|
||||
|
||||
GET /foo HTTP/1.0
|
||||
Host: 127.0.0.1:12342
|
||||
First:1
|
||||
Second:2
|
||||
|
||||
|
||||
POST / HTTP/1.0
|
||||
Host: 127.0.0.1:12342
|
||||
First:1
|
||||
Second:2
|
||||
Content-type: text/plain
|
||||
Third:
|
||||
|
||||
GET /foo HTTP/1.0
|
||||
Host: 127.0.0.1:12342
|
||||
First:1
|
||||
Second:2
|
||||
Third:
|
||||
|
||||
POST / HTTP/1.0
|
||||
Host: 127.0.0.1:12342
|
||||
First:1
|
||||
Content-type:text/plain
|
||||
Second:2
|
||||
|
||||
GET /foo HTTP/1.0
|
||||
Host: 127.0.0.1:12342
|
||||
First:1
|
||||
Second:2
|
||||
|
||||
POST / HTTP/1.0
|
||||
Host: 127.0.0.1:12342
|
||||
First:1
|
||||
Content-type:text/plain
|
||||
Second:2
|
||||
|
||||
GET /foo HTTP/1.0
|
||||
Host: 127.0.0.1:12342
|
||||
First:1
|
||||
Second:2
|
||||
|
||||
POST / HTTP/1.0
|
||||
Host: 127.0.0.1:12342
|
||||
First:1
|
||||
Content-type:text/plain
|
||||
Second:2
|
||||
Third:
|
||||
|
||||
GET /foo HTTP/1.0
|
||||
Host: 127.0.0.1:12342
|
||||
First:1
|
||||
Second:2
|
||||
Third:
|
||||
|
||||
Done
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
--TEST--
|
||||
Bug #65481 (shutdown segfault due to serialize)
|
||||
--FILE--
|
||||
<?php
|
||||
echo "Test\n";
|
||||
|
||||
class A {
|
||||
public $e = array();
|
||||
}
|
||||
|
||||
class Token implements \Serializable {
|
||||
public function serialize()
|
||||
{
|
||||
$c = new A;
|
||||
|
||||
for ($i = 0; $i < 4; $i++)
|
||||
{
|
||||
$e = new A;
|
||||
$c->e[] = $e;
|
||||
$e->e = $c->e;
|
||||
}
|
||||
|
||||
return serialize(array(serialize($c)));
|
||||
}
|
||||
|
||||
public function unserialize($str)
|
||||
{
|
||||
$r = unserialize($str);
|
||||
$r = unserialize($r[0]);
|
||||
}
|
||||
}
|
||||
|
||||
$token = new Token;
|
||||
$token = serialize($token);
|
||||
|
||||
?>
|
||||
Done
|
||||
--EXPECT--
|
||||
Test
|
||||
Done
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Bug #65483: quoted-printable encode stream filter incorrectly encoding spaces
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$data = 'a b=c d';
|
||||
|
||||
$fd = fopen('php://temp', 'w+');
|
||||
fwrite($fd, $data);
|
||||
rewind($fd);
|
||||
|
||||
$res = stream_filter_append($fd, 'convert.quoted-printable-encode', STREAM_FILTER_READ);
|
||||
var_dump(stream_get_contents($fd, -1, 0));
|
||||
|
||||
fclose($fd);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(9) "a b=3Dc d"
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.13.5 on Sat Mar 9 22:33:09 2013 */
|
||||
/* Generated by re2c 0.13.5 on Mon Jul 29 17:57:26 2013 */
|
||||
#line 1 "ext/standard/var_unserializer.re"
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
/* {{{ reference-handling for unserializer: var_* */
|
||||
#define VAR_ENTRIES_MAX 1024
|
||||
#define VAR_ENTRIES_DBG 0
|
||||
|
||||
typedef struct {
|
||||
zval *data[VAR_ENTRIES_MAX];
|
||||
@@ -36,7 +37,7 @@ typedef struct {
|
||||
static inline void var_push(php_unserialize_data_t *var_hashx, zval **rval)
|
||||
{
|
||||
var_entries *var_hash = (*var_hashx)->last;
|
||||
#if 0
|
||||
#if VAR_ENTRIES_DBG
|
||||
fprintf(stderr, "var_push(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(rval));
|
||||
#endif
|
||||
|
||||
@@ -60,7 +61,7 @@ static inline void var_push(php_unserialize_data_t *var_hashx, zval **rval)
|
||||
PHPAPI void var_push_dtor(php_unserialize_data_t *var_hashx, zval **rval)
|
||||
{
|
||||
var_entries *var_hash = (*var_hashx)->last_dtor;
|
||||
#if 0
|
||||
#if VAR_ENTRIES_DBG
|
||||
fprintf(stderr, "var_push_dtor(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(rval));
|
||||
#endif
|
||||
|
||||
@@ -82,11 +83,35 @@ PHPAPI void var_push_dtor(php_unserialize_data_t *var_hashx, zval **rval)
|
||||
var_hash->data[var_hash->used_slots++] = *rval;
|
||||
}
|
||||
|
||||
PHPAPI void var_push_dtor_no_addref(php_unserialize_data_t *var_hashx, zval **rval)
|
||||
{
|
||||
var_entries *var_hash = (*var_hashx)->last_dtor;
|
||||
#if VAR_ENTRIES_DBG
|
||||
fprintf(stderr, "var_push_dtor_no_addref(%ld): %d (%d)\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(rval), Z_REFCOUNT_PP(rval));
|
||||
#endif
|
||||
|
||||
if (!var_hash || var_hash->used_slots == VAR_ENTRIES_MAX) {
|
||||
var_hash = emalloc(sizeof(var_entries));
|
||||
var_hash->used_slots = 0;
|
||||
var_hash->next = 0;
|
||||
|
||||
if (!(*var_hashx)->first_dtor) {
|
||||
(*var_hashx)->first_dtor = var_hash;
|
||||
} else {
|
||||
((var_entries *) (*var_hashx)->last_dtor)->next = var_hash;
|
||||
}
|
||||
|
||||
(*var_hashx)->last_dtor = var_hash;
|
||||
}
|
||||
|
||||
var_hash->data[var_hash->used_slots++] = *rval;
|
||||
}
|
||||
|
||||
PHPAPI void var_replace(php_unserialize_data_t *var_hashx, zval *ozval, zval **nzval)
|
||||
{
|
||||
long i;
|
||||
var_entries *var_hash = (*var_hashx)->first;
|
||||
#if 0
|
||||
#if VAR_ENTRIES_DBG
|
||||
fprintf(stderr, "var_replace(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(nzval));
|
||||
#endif
|
||||
|
||||
@@ -104,7 +129,7 @@ PHPAPI void var_replace(php_unserialize_data_t *var_hashx, zval *ozval, zval **n
|
||||
static int var_access(php_unserialize_data_t *var_hashx, long id, zval ***store)
|
||||
{
|
||||
var_entries *var_hash = (*var_hashx)->first;
|
||||
#if 0
|
||||
#if VAR_ENTRIES_DBG
|
||||
fprintf(stderr, "var_access(%ld): %ld\n", var_hash?var_hash->used_slots:-1L, id);
|
||||
#endif
|
||||
|
||||
@@ -127,7 +152,7 @@ PHPAPI void var_destroy(php_unserialize_data_t *var_hashx)
|
||||
void *next;
|
||||
long i;
|
||||
var_entries *var_hash = (*var_hashx)->first;
|
||||
#if 0
|
||||
#if VAR_ENTRIES_DBG
|
||||
fprintf(stderr, "var_destroy(%ld)\n", var_hash?var_hash->used_slots:-1L);
|
||||
#endif
|
||||
|
||||
@@ -201,7 +226,7 @@ static char *unserialize_str(const unsigned char **p, size_t *len, size_t maxlen
|
||||
#define YYMARKER marker
|
||||
|
||||
|
||||
#line 209 "ext/standard/var_unserializer.re"
|
||||
#line 234 "ext/standard/var_unserializer.re"
|
||||
|
||||
|
||||
|
||||
@@ -432,7 +457,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
|
||||
|
||||
|
||||
|
||||
#line 436 "ext/standard/var_unserializer.c"
|
||||
#line 461 "ext/standard/var_unserializer.c"
|
||||
{
|
||||
YYCTYPE yych;
|
||||
static const unsigned char yybm[] = {
|
||||
@@ -492,9 +517,9 @@ yy2:
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
if (yych == ':') goto yy95;
|
||||
yy3:
|
||||
#line 785 "ext/standard/var_unserializer.re"
|
||||
#line 812 "ext/standard/var_unserializer.re"
|
||||
{ return 0; }
|
||||
#line 498 "ext/standard/var_unserializer.c"
|
||||
#line 523 "ext/standard/var_unserializer.c"
|
||||
yy4:
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
if (yych == ':') goto yy89;
|
||||
@@ -537,13 +562,13 @@ yy13:
|
||||
goto yy3;
|
||||
yy14:
|
||||
++YYCURSOR;
|
||||
#line 779 "ext/standard/var_unserializer.re"
|
||||
#line 806 "ext/standard/var_unserializer.re"
|
||||
{
|
||||
/* this is the case where we have less data than planned */
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unexpected end of serialized data");
|
||||
return 0; /* not sure if it should be 0 or 1 here? */
|
||||
}
|
||||
#line 547 "ext/standard/var_unserializer.c"
|
||||
#line 572 "ext/standard/var_unserializer.c"
|
||||
yy16:
|
||||
yych = *++YYCURSOR;
|
||||
goto yy3;
|
||||
@@ -573,7 +598,7 @@ yy20:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych != '"') goto yy18;
|
||||
++YYCURSOR;
|
||||
#line 635 "ext/standard/var_unserializer.re"
|
||||
#line 660 "ext/standard/var_unserializer.re"
|
||||
{
|
||||
size_t len, len2, len3, maxlen;
|
||||
long elements;
|
||||
@@ -625,9 +650,9 @@ yy20:
|
||||
|
||||
do {
|
||||
/* Try to find class directly */
|
||||
BG(serialize_lock) = 1;
|
||||
BG(serialize_lock)++;
|
||||
if (zend_lookup_class(class_name, len2, &pce TSRMLS_CC) == SUCCESS) {
|
||||
BG(serialize_lock) = 0;
|
||||
BG(serialize_lock)--;
|
||||
if (EG(exception)) {
|
||||
efree(class_name);
|
||||
return 0;
|
||||
@@ -635,7 +660,7 @@ yy20:
|
||||
ce = *pce;
|
||||
break;
|
||||
}
|
||||
BG(serialize_lock) = 0;
|
||||
BG(serialize_lock)--;
|
||||
|
||||
if (EG(exception)) {
|
||||
efree(class_name);
|
||||
@@ -655,9 +680,9 @@ yy20:
|
||||
args[0] = &arg_func_name;
|
||||
MAKE_STD_ZVAL(arg_func_name);
|
||||
ZVAL_STRING(arg_func_name, class_name, 1);
|
||||
BG(serialize_lock) = 1;
|
||||
BG(serialize_lock)++;
|
||||
if (call_user_function_ex(CG(function_table), NULL, user_func, &retval_ptr, 1, args, 0, NULL TSRMLS_CC) != SUCCESS) {
|
||||
BG(serialize_lock) = 0;
|
||||
BG(serialize_lock)--;
|
||||
if (EG(exception)) {
|
||||
efree(class_name);
|
||||
zval_ptr_dtor(&user_func);
|
||||
@@ -671,7 +696,7 @@ yy20:
|
||||
zval_ptr_dtor(&arg_func_name);
|
||||
break;
|
||||
}
|
||||
BG(serialize_lock) = 0;
|
||||
BG(serialize_lock)--;
|
||||
if (retval_ptr) {
|
||||
zval_ptr_dtor(&retval_ptr);
|
||||
}
|
||||
@@ -699,7 +724,9 @@ yy20:
|
||||
*p = YYCURSOR;
|
||||
|
||||
if (custom_object) {
|
||||
int ret = object_custom(UNSERIALIZE_PASSTHRU, ce);
|
||||
int ret;
|
||||
|
||||
ret = object_custom(UNSERIALIZE_PASSTHRU, ce);
|
||||
|
||||
if (ret && incomplete_class) {
|
||||
php_store_class_name(*rval, class_name, len2);
|
||||
@@ -717,7 +744,7 @@ yy20:
|
||||
|
||||
return object_common2(UNSERIALIZE_PASSTHRU, elements);
|
||||
}
|
||||
#line 721 "ext/standard/var_unserializer.c"
|
||||
#line 748 "ext/standard/var_unserializer.c"
|
||||
yy25:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= ',') {
|
||||
@@ -742,7 +769,7 @@ yy27:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych != '"') goto yy18;
|
||||
++YYCURSOR;
|
||||
#line 627 "ext/standard/var_unserializer.re"
|
||||
#line 652 "ext/standard/var_unserializer.re"
|
||||
{
|
||||
|
||||
INIT_PZVAL(*rval);
|
||||
@@ -750,7 +777,7 @@ yy27:
|
||||
return object_common2(UNSERIALIZE_PASSTHRU,
|
||||
object_common1(UNSERIALIZE_PASSTHRU, ZEND_STANDARD_CLASS_DEF_PTR));
|
||||
}
|
||||
#line 754 "ext/standard/var_unserializer.c"
|
||||
#line 781 "ext/standard/var_unserializer.c"
|
||||
yy32:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych == '+') goto yy33;
|
||||
@@ -771,7 +798,7 @@ yy34:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych != '{') goto yy18;
|
||||
++YYCURSOR;
|
||||
#line 607 "ext/standard/var_unserializer.re"
|
||||
#line 632 "ext/standard/var_unserializer.re"
|
||||
{
|
||||
long elements = parse_iv(start + 2);
|
||||
/* use iv() not uiv() in order to check data range */
|
||||
@@ -791,7 +818,7 @@ yy34:
|
||||
|
||||
return finish_nested_data(UNSERIALIZE_PASSTHRU);
|
||||
}
|
||||
#line 795 "ext/standard/var_unserializer.c"
|
||||
#line 822 "ext/standard/var_unserializer.c"
|
||||
yy39:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych == '+') goto yy40;
|
||||
@@ -812,7 +839,7 @@ yy41:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych != '"') goto yy18;
|
||||
++YYCURSOR;
|
||||
#line 578 "ext/standard/var_unserializer.re"
|
||||
#line 603 "ext/standard/var_unserializer.re"
|
||||
{
|
||||
size_t len, maxlen;
|
||||
char *str;
|
||||
@@ -841,7 +868,7 @@ yy41:
|
||||
ZVAL_STRINGL(*rval, str, len, 0);
|
||||
return 1;
|
||||
}
|
||||
#line 845 "ext/standard/var_unserializer.c"
|
||||
#line 872 "ext/standard/var_unserializer.c"
|
||||
yy46:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych == '+') goto yy47;
|
||||
@@ -862,7 +889,7 @@ yy48:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych != '"') goto yy18;
|
||||
++YYCURSOR;
|
||||
#line 550 "ext/standard/var_unserializer.re"
|
||||
#line 575 "ext/standard/var_unserializer.re"
|
||||
{
|
||||
size_t len, maxlen;
|
||||
char *str;
|
||||
@@ -890,7 +917,7 @@ yy48:
|
||||
ZVAL_STRINGL(*rval, str, len, 1);
|
||||
return 1;
|
||||
}
|
||||
#line 894 "ext/standard/var_unserializer.c"
|
||||
#line 921 "ext/standard/var_unserializer.c"
|
||||
yy53:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') {
|
||||
@@ -978,7 +1005,7 @@ yy61:
|
||||
}
|
||||
yy63:
|
||||
++YYCURSOR;
|
||||
#line 540 "ext/standard/var_unserializer.re"
|
||||
#line 565 "ext/standard/var_unserializer.re"
|
||||
{
|
||||
#if SIZEOF_LONG == 4
|
||||
use_double:
|
||||
@@ -988,7 +1015,7 @@ use_double:
|
||||
ZVAL_DOUBLE(*rval, zend_strtod((const char *)start + 2, NULL));
|
||||
return 1;
|
||||
}
|
||||
#line 992 "ext/standard/var_unserializer.c"
|
||||
#line 1019 "ext/standard/var_unserializer.c"
|
||||
yy65:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= ',') {
|
||||
@@ -1047,7 +1074,7 @@ yy73:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych != ';') goto yy18;
|
||||
++YYCURSOR;
|
||||
#line 525 "ext/standard/var_unserializer.re"
|
||||
#line 550 "ext/standard/var_unserializer.re"
|
||||
{
|
||||
*p = YYCURSOR;
|
||||
INIT_PZVAL(*rval);
|
||||
@@ -1062,7 +1089,7 @@ yy73:
|
||||
|
||||
return 1;
|
||||
}
|
||||
#line 1066 "ext/standard/var_unserializer.c"
|
||||
#line 1093 "ext/standard/var_unserializer.c"
|
||||
yy76:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych == 'N') goto yy73;
|
||||
@@ -1089,7 +1116,7 @@ yy79:
|
||||
if (yych <= '9') goto yy79;
|
||||
if (yych != ';') goto yy18;
|
||||
++YYCURSOR;
|
||||
#line 498 "ext/standard/var_unserializer.re"
|
||||
#line 523 "ext/standard/var_unserializer.re"
|
||||
{
|
||||
#if SIZEOF_LONG == 4
|
||||
int digits = YYCURSOR - start - 3;
|
||||
@@ -1116,7 +1143,7 @@ yy79:
|
||||
ZVAL_LONG(*rval, parse_iv(start + 2));
|
||||
return 1;
|
||||
}
|
||||
#line 1120 "ext/standard/var_unserializer.c"
|
||||
#line 1147 "ext/standard/var_unserializer.c"
|
||||
yy83:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= '/') goto yy18;
|
||||
@@ -1124,24 +1151,24 @@ yy83:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych != ';') goto yy18;
|
||||
++YYCURSOR;
|
||||
#line 491 "ext/standard/var_unserializer.re"
|
||||
#line 516 "ext/standard/var_unserializer.re"
|
||||
{
|
||||
*p = YYCURSOR;
|
||||
INIT_PZVAL(*rval);
|
||||
ZVAL_BOOL(*rval, parse_iv(start + 2));
|
||||
return 1;
|
||||
}
|
||||
#line 1135 "ext/standard/var_unserializer.c"
|
||||
#line 1162 "ext/standard/var_unserializer.c"
|
||||
yy87:
|
||||
++YYCURSOR;
|
||||
#line 484 "ext/standard/var_unserializer.re"
|
||||
#line 509 "ext/standard/var_unserializer.re"
|
||||
{
|
||||
*p = YYCURSOR;
|
||||
INIT_PZVAL(*rval);
|
||||
ZVAL_NULL(*rval);
|
||||
return 1;
|
||||
}
|
||||
#line 1145 "ext/standard/var_unserializer.c"
|
||||
#line 1172 "ext/standard/var_unserializer.c"
|
||||
yy89:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= ',') {
|
||||
@@ -1164,7 +1191,7 @@ yy91:
|
||||
if (yych <= '9') goto yy91;
|
||||
if (yych != ';') goto yy18;
|
||||
++YYCURSOR;
|
||||
#line 461 "ext/standard/var_unserializer.re"
|
||||
#line 486 "ext/standard/var_unserializer.re"
|
||||
{
|
||||
long id;
|
||||
|
||||
@@ -1179,7 +1206,7 @@ yy91:
|
||||
if (*rval == *rval_ref) return 0;
|
||||
|
||||
if (*rval != NULL) {
|
||||
zval_ptr_dtor(rval);
|
||||
var_push_dtor_no_addref(var_hash, rval);
|
||||
}
|
||||
*rval = *rval_ref;
|
||||
Z_ADDREF_PP(rval);
|
||||
@@ -1187,7 +1214,7 @@ yy91:
|
||||
|
||||
return 1;
|
||||
}
|
||||
#line 1191 "ext/standard/var_unserializer.c"
|
||||
#line 1218 "ext/standard/var_unserializer.c"
|
||||
yy95:
|
||||
yych = *++YYCURSOR;
|
||||
if (yych <= ',') {
|
||||
@@ -1210,7 +1237,7 @@ yy97:
|
||||
if (yych <= '9') goto yy97;
|
||||
if (yych != ';') goto yy18;
|
||||
++YYCURSOR;
|
||||
#line 440 "ext/standard/var_unserializer.re"
|
||||
#line 465 "ext/standard/var_unserializer.re"
|
||||
{
|
||||
long id;
|
||||
|
||||
@@ -1231,9 +1258,9 @@ yy97:
|
||||
|
||||
return 1;
|
||||
}
|
||||
#line 1235 "ext/standard/var_unserializer.c"
|
||||
#line 1262 "ext/standard/var_unserializer.c"
|
||||
}
|
||||
#line 787 "ext/standard/var_unserializer.re"
|
||||
#line 814 "ext/standard/var_unserializer.re"
|
||||
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
/* {{{ reference-handling for unserializer: var_* */
|
||||
#define VAR_ENTRIES_MAX 1024
|
||||
#define VAR_ENTRIES_DBG 0
|
||||
|
||||
typedef struct {
|
||||
zval *data[VAR_ENTRIES_MAX];
|
||||
@@ -34,7 +35,7 @@ typedef struct {
|
||||
static inline void var_push(php_unserialize_data_t *var_hashx, zval **rval)
|
||||
{
|
||||
var_entries *var_hash = (*var_hashx)->last;
|
||||
#if 0
|
||||
#if VAR_ENTRIES_DBG
|
||||
fprintf(stderr, "var_push(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(rval));
|
||||
#endif
|
||||
|
||||
@@ -58,7 +59,7 @@ static inline void var_push(php_unserialize_data_t *var_hashx, zval **rval)
|
||||
PHPAPI void var_push_dtor(php_unserialize_data_t *var_hashx, zval **rval)
|
||||
{
|
||||
var_entries *var_hash = (*var_hashx)->last_dtor;
|
||||
#if 0
|
||||
#if VAR_ENTRIES_DBG
|
||||
fprintf(stderr, "var_push_dtor(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(rval));
|
||||
#endif
|
||||
|
||||
@@ -80,11 +81,35 @@ PHPAPI void var_push_dtor(php_unserialize_data_t *var_hashx, zval **rval)
|
||||
var_hash->data[var_hash->used_slots++] = *rval;
|
||||
}
|
||||
|
||||
PHPAPI void var_push_dtor_no_addref(php_unserialize_data_t *var_hashx, zval **rval)
|
||||
{
|
||||
var_entries *var_hash = (*var_hashx)->last_dtor;
|
||||
#if VAR_ENTRIES_DBG
|
||||
fprintf(stderr, "var_push_dtor_no_addref(%ld): %d (%d)\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(rval), Z_REFCOUNT_PP(rval));
|
||||
#endif
|
||||
|
||||
if (!var_hash || var_hash->used_slots == VAR_ENTRIES_MAX) {
|
||||
var_hash = emalloc(sizeof(var_entries));
|
||||
var_hash->used_slots = 0;
|
||||
var_hash->next = 0;
|
||||
|
||||
if (!(*var_hashx)->first_dtor) {
|
||||
(*var_hashx)->first_dtor = var_hash;
|
||||
} else {
|
||||
((var_entries *) (*var_hashx)->last_dtor)->next = var_hash;
|
||||
}
|
||||
|
||||
(*var_hashx)->last_dtor = var_hash;
|
||||
}
|
||||
|
||||
var_hash->data[var_hash->used_slots++] = *rval;
|
||||
}
|
||||
|
||||
PHPAPI void var_replace(php_unserialize_data_t *var_hashx, zval *ozval, zval **nzval)
|
||||
{
|
||||
long i;
|
||||
var_entries *var_hash = (*var_hashx)->first;
|
||||
#if 0
|
||||
#if VAR_ENTRIES_DBG
|
||||
fprintf(stderr, "var_replace(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(nzval));
|
||||
#endif
|
||||
|
||||
@@ -102,7 +127,7 @@ PHPAPI void var_replace(php_unserialize_data_t *var_hashx, zval *ozval, zval **n
|
||||
static int var_access(php_unserialize_data_t *var_hashx, long id, zval ***store)
|
||||
{
|
||||
var_entries *var_hash = (*var_hashx)->first;
|
||||
#if 0
|
||||
#if VAR_ENTRIES_DBG
|
||||
fprintf(stderr, "var_access(%ld): %ld\n", var_hash?var_hash->used_slots:-1L, id);
|
||||
#endif
|
||||
|
||||
@@ -125,7 +150,7 @@ PHPAPI void var_destroy(php_unserialize_data_t *var_hashx)
|
||||
void *next;
|
||||
long i;
|
||||
var_entries *var_hash = (*var_hashx)->first;
|
||||
#if 0
|
||||
#if VAR_ENTRIES_DBG
|
||||
fprintf(stderr, "var_destroy(%ld)\n", var_hash?var_hash->used_slots:-1L);
|
||||
#endif
|
||||
|
||||
@@ -472,7 +497,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
|
||||
if (*rval == *rval_ref) return 0;
|
||||
|
||||
if (*rval != NULL) {
|
||||
zval_ptr_dtor(rval);
|
||||
var_push_dtor_no_addref(var_hash, rval);
|
||||
}
|
||||
*rval = *rval_ref;
|
||||
Z_ADDREF_PP(rval);
|
||||
@@ -683,9 +708,9 @@ object ":" uiv ":" ["] {
|
||||
|
||||
do {
|
||||
/* Try to find class directly */
|
||||
BG(serialize_lock) = 1;
|
||||
BG(serialize_lock)++;
|
||||
if (zend_lookup_class(class_name, len2, &pce TSRMLS_CC) == SUCCESS) {
|
||||
BG(serialize_lock) = 0;
|
||||
BG(serialize_lock)--;
|
||||
if (EG(exception)) {
|
||||
efree(class_name);
|
||||
return 0;
|
||||
@@ -693,7 +718,7 @@ object ":" uiv ":" ["] {
|
||||
ce = *pce;
|
||||
break;
|
||||
}
|
||||
BG(serialize_lock) = 0;
|
||||
BG(serialize_lock)--;
|
||||
|
||||
if (EG(exception)) {
|
||||
efree(class_name);
|
||||
@@ -713,9 +738,9 @@ object ":" uiv ":" ["] {
|
||||
args[0] = &arg_func_name;
|
||||
MAKE_STD_ZVAL(arg_func_name);
|
||||
ZVAL_STRING(arg_func_name, class_name, 1);
|
||||
BG(serialize_lock) = 1;
|
||||
BG(serialize_lock)++;
|
||||
if (call_user_function_ex(CG(function_table), NULL, user_func, &retval_ptr, 1, args, 0, NULL TSRMLS_CC) != SUCCESS) {
|
||||
BG(serialize_lock) = 0;
|
||||
BG(serialize_lock)--;
|
||||
if (EG(exception)) {
|
||||
efree(class_name);
|
||||
zval_ptr_dtor(&user_func);
|
||||
@@ -729,7 +754,7 @@ object ":" uiv ":" ["] {
|
||||
zval_ptr_dtor(&arg_func_name);
|
||||
break;
|
||||
}
|
||||
BG(serialize_lock) = 0;
|
||||
BG(serialize_lock)--;
|
||||
if (retval_ptr) {
|
||||
zval_ptr_dtor(&retval_ptr);
|
||||
}
|
||||
@@ -757,7 +782,9 @@ object ":" uiv ":" ["] {
|
||||
*p = YYCURSOR;
|
||||
|
||||
if (custom_object) {
|
||||
int ret = object_custom(UNSERIALIZE_PASSTHRU, ce);
|
||||
int ret;
|
||||
|
||||
ret = object_custom(UNSERIALIZE_PASSTHRU, ce);
|
||||
|
||||
if (ret && incomplete_class) {
|
||||
php_store_class_name(*rval, class_name, len2);
|
||||
|
||||
+103
-103
@@ -619,109 +619,109 @@ XML_GetErrorCode(XML_Parser parser)
|
||||
}
|
||||
|
||||
static const XML_Char *const error_mapping[] = {
|
||||
"No error",
|
||||
"No memory",
|
||||
"Invalid document start",
|
||||
"Empty document",
|
||||
"Not well-formed (invalid token)",
|
||||
"Invalid document end",
|
||||
"Invalid hexadecimal character reference",
|
||||
"Invalid decimal character reference",
|
||||
"Invalid character reference",
|
||||
"Invalid character",
|
||||
"XML_ERR_CHARREF_AT_EOF",
|
||||
"XML_ERR_CHARREF_IN_PROLOG",
|
||||
"XML_ERR_CHARREF_IN_EPILOG",
|
||||
"XML_ERR_CHARREF_IN_DTD",
|
||||
"XML_ERR_ENTITYREF_AT_EOF",
|
||||
"XML_ERR_ENTITYREF_IN_PROLOG",
|
||||
"XML_ERR_ENTITYREF_IN_EPILOG",
|
||||
"XML_ERR_ENTITYREF_IN_DTD",
|
||||
"PEReference at end of document",
|
||||
"PEReference in prolog",
|
||||
"PEReference in epilog",
|
||||
"PEReference: forbidden within markup decl in internal subset",
|
||||
"XML_ERR_ENTITYREF_NO_NAME",
|
||||
"EntityRef: expecting ';'",
|
||||
"PEReference: no name",
|
||||
"PEReference: expecting ';'",
|
||||
"Undeclared entity error",
|
||||
"Undeclared entity warning",
|
||||
"Unparsed Entity",
|
||||
"XML_ERR_ENTITY_IS_EXTERNAL",
|
||||
"XML_ERR_ENTITY_IS_PARAMETER",
|
||||
"Unknown encoding",
|
||||
"Unsupported encoding",
|
||||
"String not started expecting ' or \"",
|
||||
"String not closed expecting \" or '",
|
||||
"Namespace declaration error",
|
||||
"EntityValue: \" or ' expected",
|
||||
"EntityValue: \" or ' expected",
|
||||
"< in attribute",
|
||||
"Attribute not started",
|
||||
"Attribute not finished",
|
||||
"Attribute without value",
|
||||
"Attribute redefined",
|
||||
"SystemLiteral \" or ' expected",
|
||||
"SystemLiteral \" or ' expected",
|
||||
/* "XML_ERR_COMMENT_NOT_STARTED", <= eliminated on purpose */
|
||||
"Comment not finished",
|
||||
"Processing Instruction not started",
|
||||
"Processing Instruction not finished",
|
||||
"NOTATION: Name expected here",
|
||||
"'>' required to close NOTATION declaration",
|
||||
"'(' required to start ATTLIST enumeration",
|
||||
"'(' required to start ATTLIST enumeration",
|
||||
"MixedContentDecl : '|' or ')*' expected",
|
||||
"XML_ERR_MIXED_NOT_FINISHED",
|
||||
"ELEMENT in DTD not started",
|
||||
"ELEMENT in DTD not finished",
|
||||
"XML declaration not started",
|
||||
"XML declaration not finished",
|
||||
"XML_ERR_CONDSEC_NOT_STARTED",
|
||||
"XML conditional section not closed",
|
||||
"Content error in the external subset",
|
||||
"DOCTYPE not finished",
|
||||
"Sequence ']]>' not allowed in content",
|
||||
"CDATA not finished",
|
||||
"Reserved XML Name",
|
||||
"Space required",
|
||||
"XML_ERR_SEPARATOR_REQUIRED",
|
||||
"NmToken expected in ATTLIST enumeration",
|
||||
"XML_ERR_NAME_REQUIRED",
|
||||
"MixedContentDecl : '#PCDATA' expected",
|
||||
"SYSTEM or PUBLIC, the URI is missing",
|
||||
"PUBLIC, the Public Identifier is missing",
|
||||
"< required",
|
||||
"> required",
|
||||
"</ required",
|
||||
"= required",
|
||||
"Mismatched tag",
|
||||
"Tag not finished",
|
||||
"standalone accepts only 'yes' or 'no'",
|
||||
"Invalid XML encoding name",
|
||||
"Comment must not contain '--' (double-hyphen)",
|
||||
"Invalid encoding",
|
||||
"external parsed entities cannot be standalone",
|
||||
"XML conditional section '[' expected",
|
||||
"Entity value required",
|
||||
"chunk is not well balanced",
|
||||
"extra content at the end of well balanced chunk",
|
||||
"XML_ERR_ENTITY_CHAR_ERROR",
|
||||
"PEReferences forbidden in internal subset",
|
||||
"Detected an entity reference loop",
|
||||
"XML_ERR_ENTITY_BOUNDARY",
|
||||
"Invalid URI",
|
||||
"Fragment not allowed",
|
||||
"XML_WAR_CATALOG_PI",
|
||||
"XML_ERR_NO_DTD",
|
||||
"conditional section INCLUDE or IGNORE keyword expected", /* 95 */
|
||||
"Version in XML Declaration missing", /* 96 */
|
||||
"XML_WAR_UNKNOWN_VERSION", /* 97 */
|
||||
"XML_WAR_LANG_VALUE", /* 98 */
|
||||
"XML_WAR_NS_URI", /* 99 */
|
||||
"XML_WAR_NS_URI_RELATIVE", /* 100 */
|
||||
"Missing encoding in text declaration" /* 101 */
|
||||
(const XML_Char *)"No error",
|
||||
(const XML_Char *)"No memory",
|
||||
(const XML_Char *)"Invalid document start",
|
||||
(const XML_Char *)"Empty document",
|
||||
(const XML_Char *)"Not well-formed (invalid token)",
|
||||
(const XML_Char *)"Invalid document end",
|
||||
(const XML_Char *)"Invalid hexadecimal character reference",
|
||||
(const XML_Char *)"Invalid decimal character reference",
|
||||
(const XML_Char *)"Invalid character reference",
|
||||
(const XML_Char *)"Invalid character",
|
||||
(const XML_Char *)"XML_ERR_CHARREF_AT_EOF",
|
||||
(const XML_Char *)"XML_ERR_CHARREF_IN_PROLOG",
|
||||
(const XML_Char *)"XML_ERR_CHARREF_IN_EPILOG",
|
||||
(const XML_Char *)"XML_ERR_CHARREF_IN_DTD",
|
||||
(const XML_Char *)"XML_ERR_ENTITYREF_AT_EOF",
|
||||
(const XML_Char *)"XML_ERR_ENTITYREF_IN_PROLOG",
|
||||
(const XML_Char *)"XML_ERR_ENTITYREF_IN_EPILOG",
|
||||
(const XML_Char *)"XML_ERR_ENTITYREF_IN_DTD",
|
||||
(const XML_Char *)"PEReference at end of document",
|
||||
(const XML_Char *)"PEReference in prolog",
|
||||
(const XML_Char *)"PEReference in epilog",
|
||||
(const XML_Char *)"PEReference: forbidden within markup decl in internal subset",
|
||||
(const XML_Char *)"XML_ERR_ENTITYREF_NO_NAME",
|
||||
(const XML_Char *)"EntityRef: expecting ';'",
|
||||
(const XML_Char *)"PEReference: no name",
|
||||
(const XML_Char *)"PEReference: expecting ';'",
|
||||
(const XML_Char *)"Undeclared entity error",
|
||||
(const XML_Char *)"Undeclared entity warning",
|
||||
(const XML_Char *)"Unparsed Entity",
|
||||
(const XML_Char *)"XML_ERR_ENTITY_IS_EXTERNAL",
|
||||
(const XML_Char *)"XML_ERR_ENTITY_IS_PARAMETER",
|
||||
(const XML_Char *)"Unknown encoding",
|
||||
(const XML_Char *)"Unsupported encoding",
|
||||
(const XML_Char *)"String not started expecting ' or \"",
|
||||
(const XML_Char *)"String not closed expecting \" or '",
|
||||
(const XML_Char *)"Namespace declaration error",
|
||||
(const XML_Char *)"EntityValue: \" or ' expected",
|
||||
(const XML_Char *)"EntityValue: \" or ' expected",
|
||||
(const XML_Char *)"< in attribute",
|
||||
(const XML_Char *)"Attribute not started",
|
||||
(const XML_Char *)"Attribute not finished",
|
||||
(const XML_Char *)"Attribute without value",
|
||||
(const XML_Char *)"Attribute redefined",
|
||||
(const XML_Char *)"SystemLiteral \" or ' expected",
|
||||
(const XML_Char *)"SystemLiteral \" or ' expected",
|
||||
/* (const XML_Char *)"XML_ERR_COMMENT_NOT_STARTED", <= eliminated on purpose */
|
||||
(const XML_Char *)"Comment not finished",
|
||||
(const XML_Char *)"Processing Instruction not started",
|
||||
(const XML_Char *)"Processing Instruction not finished",
|
||||
(const XML_Char *)"NOTATION: Name expected here",
|
||||
(const XML_Char *)"'>' required to close NOTATION declaration",
|
||||
(const XML_Char *)"'(' required to start ATTLIST enumeration",
|
||||
(const XML_Char *)"'(' required to start ATTLIST enumeration",
|
||||
(const XML_Char *)"MixedContentDecl : '|' or ')*' expected",
|
||||
(const XML_Char *)"XML_ERR_MIXED_NOT_FINISHED",
|
||||
(const XML_Char *)"ELEMENT in DTD not started",
|
||||
(const XML_Char *)"ELEMENT in DTD not finished",
|
||||
(const XML_Char *)"XML declaration not started",
|
||||
(const XML_Char *)"XML declaration not finished",
|
||||
(const XML_Char *)"XML_ERR_CONDSEC_NOT_STARTED",
|
||||
(const XML_Char *)"XML conditional section not closed",
|
||||
(const XML_Char *)"Content error in the external subset",
|
||||
(const XML_Char *)"DOCTYPE not finished",
|
||||
(const XML_Char *)"Sequence ']]>' not allowed in content",
|
||||
(const XML_Char *)"CDATA not finished",
|
||||
(const XML_Char *)"Reserved XML Name",
|
||||
(const XML_Char *)"Space required",
|
||||
(const XML_Char *)"XML_ERR_SEPARATOR_REQUIRED",
|
||||
(const XML_Char *)"NmToken expected in ATTLIST enumeration",
|
||||
(const XML_Char *)"XML_ERR_NAME_REQUIRED",
|
||||
(const XML_Char *)"MixedContentDecl : '#PCDATA' expected",
|
||||
(const XML_Char *)"SYSTEM or PUBLIC, the URI is missing",
|
||||
(const XML_Char *)"PUBLIC, the Public Identifier is missing",
|
||||
(const XML_Char *)"< required",
|
||||
(const XML_Char *)"> required",
|
||||
(const XML_Char *)"</ required",
|
||||
(const XML_Char *)"= required",
|
||||
(const XML_Char *)"Mismatched tag",
|
||||
(const XML_Char *)"Tag not finished",
|
||||
(const XML_Char *)"standalone accepts only 'yes' or 'no'",
|
||||
(const XML_Char *)"Invalid XML encoding name",
|
||||
(const XML_Char *)"Comment must not contain '--' (double-hyphen)",
|
||||
(const XML_Char *)"Invalid encoding",
|
||||
(const XML_Char *)"external parsed entities cannot be standalone",
|
||||
(const XML_Char *)"XML conditional section '[' expected",
|
||||
(const XML_Char *)"Entity value required",
|
||||
(const XML_Char *)"chunk is not well balanced",
|
||||
(const XML_Char *)"extra content at the end of well balanced chunk",
|
||||
(const XML_Char *)"XML_ERR_ENTITY_CHAR_ERROR",
|
||||
(const XML_Char *)"PEReferences forbidden in internal subset",
|
||||
(const XML_Char *)"Detected an entity reference loop",
|
||||
(const XML_Char *)"XML_ERR_ENTITY_BOUNDARY",
|
||||
(const XML_Char *)"Invalid URI",
|
||||
(const XML_Char *)"Fragment not allowed",
|
||||
(const XML_Char *)"XML_WAR_CATALOG_PI",
|
||||
(const XML_Char *)"XML_ERR_NO_DTD",
|
||||
(const XML_Char *)"conditional section INCLUDE or IGNORE keyword expected", /* 95 */
|
||||
(const XML_Char *)"Version in XML Declaration missing", /* 96 */
|
||||
(const XML_Char *)"XML_WAR_UNKNOWN_VERSION", /* 97 */
|
||||
(const XML_Char *)"XML_WAR_LANG_VALUE", /* 98 */
|
||||
(const XML_Char *)"XML_WAR_NS_URI", /* 99 */
|
||||
(const XML_Char *)"XML_WAR_NS_URI_RELATIVE", /* 100 */
|
||||
(const XML_Char *)"Missing encoding in text declaration" /* 101 */
|
||||
};
|
||||
|
||||
PHPAPI const XML_Char *
|
||||
|
||||
+4
-4
@@ -274,10 +274,10 @@ zend_module_entry xml_module_entry = {
|
||||
* the encoding is currently done internally by expat/xmltok.
|
||||
*/
|
||||
xml_encoding xml_encodings[] = {
|
||||
{ "ISO-8859-1", xml_decode_iso_8859_1, xml_encode_iso_8859_1 },
|
||||
{ "US-ASCII", xml_decode_us_ascii, xml_encode_us_ascii },
|
||||
{ "UTF-8", NULL, NULL },
|
||||
{ NULL, NULL, NULL }
|
||||
{ (XML_Char *)"ISO-8859-1", xml_decode_iso_8859_1, xml_encode_iso_8859_1 },
|
||||
{ (XML_Char *)"US-ASCII", xml_decode_us_ascii, xml_encode_us_ascii },
|
||||
{ (XML_Char *)"UTF-8", NULL, NULL },
|
||||
{ (XML_Char *)NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
static XML_Memory_Handling_Suite php_xml_mem_hdlrs;
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
--TEST--
|
||||
xmlrpc_encode() Simple test encode array
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("xmlrpc")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$params = array(
|
||||
"one" => "red",
|
||||
"two" => "blue",
|
||||
"three" => "green"
|
||||
);
|
||||
|
||||
$response = xmlrpc_encode($params);
|
||||
echo $response;
|
||||
|
||||
$params = array(
|
||||
"red",
|
||||
"blue",
|
||||
"green"
|
||||
);
|
||||
|
||||
$response = xmlrpc_encode($params);
|
||||
echo $response;
|
||||
|
||||
$params = array(
|
||||
0 => "red",
|
||||
1 => "blue",
|
||||
3 => "green"
|
||||
);
|
||||
|
||||
$response = xmlrpc_encode($params);
|
||||
echo $response;
|
||||
|
||||
--EXPECT--
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<params>
|
||||
<param>
|
||||
<value>
|
||||
<struct>
|
||||
<member>
|
||||
<name>one</name>
|
||||
<value>
|
||||
<string>red</string>
|
||||
</value>
|
||||
</member>
|
||||
<member>
|
||||
<name>two</name>
|
||||
<value>
|
||||
<string>blue</string>
|
||||
</value>
|
||||
</member>
|
||||
<member>
|
||||
<name>three</name>
|
||||
<value>
|
||||
<string>green</string>
|
||||
</value>
|
||||
</member>
|
||||
</struct>
|
||||
</value>
|
||||
</param>
|
||||
</params>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<params>
|
||||
<param>
|
||||
<value>
|
||||
<array>
|
||||
<data>
|
||||
<value>
|
||||
<string>red</string>
|
||||
</value>
|
||||
<value>
|
||||
<string>blue</string>
|
||||
</value>
|
||||
<value>
|
||||
<string>green</string>
|
||||
</value>
|
||||
</data>
|
||||
</array>
|
||||
</value>
|
||||
</param>
|
||||
</params>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<params>
|
||||
<param>
|
||||
<value>
|
||||
<struct>
|
||||
<member>
|
||||
<name>0</name>
|
||||
<value>
|
||||
<string>red</string>
|
||||
</value>
|
||||
</member>
|
||||
<member>
|
||||
<name>1</name>
|
||||
<value>
|
||||
<string>blue</string>
|
||||
</value>
|
||||
</member>
|
||||
<member>
|
||||
<name>3</name>
|
||||
<value>
|
||||
<string>green</string>
|
||||
</value>
|
||||
</member>
|
||||
</struct>
|
||||
</value>
|
||||
</param>
|
||||
</params>
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
xmlrpc_encode() Simple test encode int
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("xmlrpc")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$response = xmlrpc_encode(1);
|
||||
echo $response;
|
||||
|
||||
--EXPECT--
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<params>
|
||||
<param>
|
||||
<value>
|
||||
<int>1</int>
|
||||
</value>
|
||||
</param>
|
||||
</params>
|
||||
@@ -0,0 +1,47 @@
|
||||
--TEST--
|
||||
xmlrpc_encode() Simple test encode type double and String
|
||||
|
||||
--CREDITS--
|
||||
Michel Araujo <araujo_michel@yahoo.com.br>
|
||||
#PHPSP 2013-08-22
|
||||
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("xmlrpc")) print "skip"; ?>
|
||||
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$response = xmlrpc_encode(3.24234);
|
||||
echo $response;
|
||||
|
||||
$response = xmlrpc_encode(-3.24234);
|
||||
echo $response;
|
||||
|
||||
$response = xmlrpc_encode('Is string');
|
||||
echo $response;
|
||||
|
||||
--EXPECT--
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<params>
|
||||
<param>
|
||||
<value>
|
||||
<double>3.24234</double>
|
||||
</value>
|
||||
</param>
|
||||
</params>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<params>
|
||||
<param>
|
||||
<value>
|
||||
<double>-3.24234</double>
|
||||
</value>
|
||||
</param>
|
||||
</params>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<params>
|
||||
<param>
|
||||
<value>
|
||||
<string>Is string</string>
|
||||
</value>
|
||||
</param>
|
||||
</params>
|
||||
@@ -0,0 +1,29 @@
|
||||
--TEST--
|
||||
xmlrpc_decode() Simple test decode type string
|
||||
|
||||
--CREDITS--
|
||||
Michel Araujo <araujo_michel@yahoo.com.br>
|
||||
#PHPSP 2013-08-22
|
||||
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("xmlrpc")) print "skip"; ?>
|
||||
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$xml = <<<XML
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<params>
|
||||
<param>
|
||||
<value>
|
||||
<string>Is string</string>
|
||||
</value>
|
||||
</param>
|
||||
</params>
|
||||
XML;
|
||||
|
||||
$response = xmlrpc_decode($xml);
|
||||
echo $response;
|
||||
|
||||
--EXPECT--
|
||||
Is string
|
||||
@@ -0,0 +1,29 @@
|
||||
--TEST--
|
||||
xmlrpc_decode() Simple test decode type int
|
||||
|
||||
--CREDITS--
|
||||
Michel Araujo <araujo_michel@yahoo.com.br>
|
||||
#PHPSP 2013-08-22
|
||||
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("xmlrpc")) print "skip"; ?>
|
||||
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$xml = <<<XML
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<params>
|
||||
<param>
|
||||
<value>
|
||||
<int>1</int>
|
||||
</value>
|
||||
</param>
|
||||
</params>
|
||||
XML;
|
||||
|
||||
$response = xmlrpc_decode($xml);
|
||||
echo $response;
|
||||
|
||||
--EXPECT--
|
||||
1
|
||||
@@ -775,7 +775,12 @@ PHPAPI char *expand_filepath_with_mode(const char *filepath, char *real_path, co
|
||||
* we cannot cannot getcwd() and the requested,
|
||||
* relatively referenced file is accessible */
|
||||
copy_len = strlen(filepath) > MAXPATHLEN - 1 ? MAXPATHLEN - 1 : strlen(filepath);
|
||||
real_path = estrndup(filepath, copy_len);
|
||||
if (real_path) {
|
||||
memcpy(real_path, filepath, copy_len);
|
||||
real_path[copy_len] = '\0';
|
||||
} else {
|
||||
real_path = estrndup(filepath, copy_len);
|
||||
}
|
||||
close(fdtest);
|
||||
return real_path;
|
||||
} else {
|
||||
|
||||
+6
-1
@@ -115,6 +115,10 @@
|
||||
#endif
|
||||
/* }}} */
|
||||
|
||||
#ifndef S_ISREG
|
||||
#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
|
||||
#endif
|
||||
|
||||
PHPAPI int (*php_register_internal_extensions_func)(TSRMLS_D) = php_register_internal_extensions;
|
||||
|
||||
#ifndef ZTS
|
||||
@@ -276,13 +280,14 @@ static void php_binary_init(TSRMLS_D)
|
||||
if ((envpath = getenv("PATH")) != NULL) {
|
||||
char *search_dir, search_path[MAXPATHLEN];
|
||||
char *last = NULL;
|
||||
struct stat s;
|
||||
|
||||
path = estrdup(envpath);
|
||||
search_dir = php_strtok_r(path, ":", &last);
|
||||
|
||||
while (search_dir) {
|
||||
snprintf(search_path, MAXPATHLEN, "%s/%s", search_dir, sapi_module.executable_location);
|
||||
if (VCWD_REALPATH(search_path, binary_location) && !VCWD_ACCESS(binary_location, X_OK)) {
|
||||
if (VCWD_REALPATH(search_path, binary_location) && !VCWD_ACCESS(binary_location, X_OK) && VCWD_STAT(binary_location, &s) == 0 && S_ISREG(s.st_mode)) {
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
+4
-4
@@ -2,7 +2,7 @@
|
||||
/* edit configure.in to change version number */
|
||||
#define PHP_MAJOR_VERSION 5
|
||||
#define PHP_MINOR_VERSION 4
|
||||
#define PHP_RELEASE_VERSION 19
|
||||
#define PHP_EXTRA_VERSION "-dev"
|
||||
#define PHP_VERSION "5.4.19-dev"
|
||||
#define PHP_VERSION_ID 50419
|
||||
#define PHP_RELEASE_VERSION 21
|
||||
#define PHP_EXTRA_VERSION ""
|
||||
#define PHP_VERSION "5.4.21"
|
||||
#define PHP_VERSION_ID 50421
|
||||
+8
-7
@@ -83,6 +83,8 @@
|
||||
; development version only in development environments as errors shown to
|
||||
; application users can inadvertently leak otherwise secure information.
|
||||
|
||||
; This is php.ini-development INI file.
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;
|
||||
; Quick Reference ;
|
||||
;;;;;;;;;;;;;;;;;;;
|
||||
@@ -197,13 +199,12 @@
|
||||
engine = On
|
||||
|
||||
; This directive determines whether or not PHP will recognize code between
|
||||
; <? and ?> tags as PHP source which should be processed as such. It's been
|
||||
; recommended for several years that you not use the short tag "short cut" and
|
||||
; instead to use the full <?php and ?> tag combination. With the wide spread use
|
||||
; of XML and use of these tags by other languages, the server can become easily
|
||||
; confused and end up parsing the wrong code in the wrong context. But because
|
||||
; this short cut has been a feature for such a long time, it's currently still
|
||||
; supported for backwards compatibility, but we recommend you don't use them.
|
||||
; <? and ?> tags as PHP source which should be processed as such. It is
|
||||
; generally recommended that <?php and ?> should be used and that this feature
|
||||
; should be disabled, as enabling it may result in issues when generating XML
|
||||
; documents, however this remains supported for backward compatibility reasons.
|
||||
; Note that this directive does not control the <?= shorthand tag, which can be
|
||||
; used regardless of this directive.
|
||||
; Default Value: On
|
||||
; Development Value: Off
|
||||
; Production Value: Off
|
||||
|
||||
+8
-7
@@ -83,6 +83,8 @@
|
||||
; development version only in development environments as errors shown to
|
||||
; application users can inadvertently leak otherwise secure information.
|
||||
|
||||
; This is php.ini-production INI file.
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;
|
||||
; Quick Reference ;
|
||||
;;;;;;;;;;;;;;;;;;;
|
||||
@@ -197,13 +199,12 @@
|
||||
engine = On
|
||||
|
||||
; This directive determines whether or not PHP will recognize code between
|
||||
; <? and ?> tags as PHP source which should be processed as such. It's been
|
||||
; recommended for several years that you not use the short tag "short cut" and
|
||||
; instead to use the full <?php and ?> tag combination. With the wide spread use
|
||||
; of XML and use of these tags by other languages, the server can become easily
|
||||
; confused and end up parsing the wrong code in the wrong context. But because
|
||||
; this short cut has been a feature for such a long time, it's currently still
|
||||
; supported for backwards compatibility, but we recommend you don't use them.
|
||||
; <? and ?> tags as PHP source which should be processed as such. It is
|
||||
; generally recommended that <?php and ?> should be used and that this feature
|
||||
; should be disabled, as enabling it may result in issues when generating XML
|
||||
; documents, however this remains supported for backward compatibility reasons.
|
||||
; Note that this directive does not control the <?= shorthand tag, which can be
|
||||
; used regardless of this directive.
|
||||
; Default Value: On
|
||||
; Development Value: Off
|
||||
; Production Value: Off
|
||||
|
||||
+22
-1
@@ -455,7 +455,7 @@ $pass_options = '';
|
||||
$compression = 0;
|
||||
$output_file = $CUR_DIR . '/php_test_results_' . date('Ymd_Hi') . '.txt';
|
||||
|
||||
if ($compression) {
|
||||
if ($compression && in_array("compress.zlib", stream_get_filters())) {
|
||||
$output_file = 'compress.zlib://' . $output_file . '.gz';
|
||||
}
|
||||
|
||||
@@ -597,6 +597,15 @@ if (isset($argc) && $argc > 1) {
|
||||
putenv("TEST_PHP_EXECUTABLE=$php");
|
||||
$environment['TEST_PHP_EXECUTABLE'] = $php;
|
||||
break;
|
||||
case 'P':
|
||||
if(constant('PHP_BINARY')) {
|
||||
$php = PHP_BINARY;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
putenv("TEST_PHP_EXECUTABLE=$php");
|
||||
$environment['TEST_PHP_EXECUTABLE'] = $php;
|
||||
break;
|
||||
case 'q':
|
||||
putenv('NO_INTERACTION=1');
|
||||
break;
|
||||
@@ -686,6 +695,8 @@ Options:
|
||||
|
||||
-p <php> Specify PHP executable to run.
|
||||
|
||||
-P Use PHP_BINARY as PHP executable to run.
|
||||
|
||||
-q Quiet, no user interaction (same as environment NO_INTERACTION).
|
||||
|
||||
-s <file> Write output to <file>.
|
||||
@@ -1534,6 +1545,16 @@ TEST $file
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!extension_loaded("zlib")
|
||||
&& ( array_key_exists("GZIP_POST", $section_text)
|
||||
|| array_key_exists("DEFLATE_POST", $section_text))
|
||||
) {
|
||||
$message = "ext/zlib required";
|
||||
show_result('SKIP', $tested, $tested_file, "reason: $message", $temp_filenames);
|
||||
junit_mark_test_as('SKIP', $shortname, $tested, null, "<![CDATA[\n$message\n]]>");
|
||||
return 'SKIPPED';
|
||||
}
|
||||
|
||||
if (@count($section_text['REDIRECTTEST']) == 1) {
|
||||
$test_files = array();
|
||||
|
||||
@@ -408,7 +408,7 @@ static void append_essential_headers(smart_str* buffer, php_cli_server_client *c
|
||||
{
|
||||
{
|
||||
char **val;
|
||||
if (SUCCESS == zend_hash_find(&client->request.headers, "Host", sizeof("Host"), (void**)&val)) {
|
||||
if (SUCCESS == zend_hash_find(&client->request.headers, "host", sizeof("host"), (void**)&val)) {
|
||||
smart_str_appendl_ex(buffer, "Host", sizeof("Host") - 1, persistent);
|
||||
smart_str_appendl_ex(buffer, ": ", sizeof(": ") - 1, persistent);
|
||||
smart_str_appends_ex(buffer, *val, persistent);
|
||||
@@ -558,7 +558,7 @@ static char *sapi_cli_server_read_cookies(TSRMLS_D) /* {{{ */
|
||||
{
|
||||
php_cli_server_client *client = SG(server_context);
|
||||
char **val;
|
||||
if (FAILURE == zend_hash_find(&client->request.headers, "Cookie", sizeof("Cookie"), (void**)&val)) {
|
||||
if (FAILURE == zend_hash_find(&client->request.headers, "cookie", sizeof("cookie"), (void**)&val)) {
|
||||
return NULL;
|
||||
}
|
||||
return *val;
|
||||
@@ -1556,12 +1556,9 @@ static int php_cli_server_client_read_request_on_header_value(php_http_parser *p
|
||||
return 1;
|
||||
}
|
||||
{
|
||||
char *header_name = client->current_header_name;
|
||||
size_t header_name_len = client->current_header_name_len;
|
||||
char c = header_name[header_name_len];
|
||||
header_name[header_name_len] = '\0';
|
||||
zend_hash_add(&client->request.headers, header_name, header_name_len + 1, &value, sizeof(char *), NULL);
|
||||
header_name[header_name_len] = c;
|
||||
char *header_name = zend_str_tolower_dup(client->current_header_name, client->current_header_name_len);
|
||||
zend_hash_add(&client->request.headers, header_name, client->current_header_name_len + 1, &value, sizeof(char *), NULL);
|
||||
efree(header_name);
|
||||
}
|
||||
|
||||
if (client->current_header_name_allocated) {
|
||||
@@ -1719,7 +1716,7 @@ static void php_cli_server_client_populate_request_info(const php_cli_server_cli
|
||||
request_info->post_data = client->request.content;
|
||||
request_info->content_length = request_info->post_data_length = client->request.content_len;
|
||||
request_info->auth_user = request_info->auth_password = request_info->auth_digest = NULL;
|
||||
if (SUCCESS == zend_hash_find(&client->request.headers, "Content-Type", sizeof("Content-Type"), (void**)&val)) {
|
||||
if (SUCCESS == zend_hash_find(&client->request.headers, "content-type", sizeof("content-type"), (void**)&val)) {
|
||||
request_info->content_type = *val;
|
||||
}
|
||||
} /* }}} */
|
||||
@@ -1957,7 +1954,7 @@ static int php_cli_server_begin_send_static(php_cli_server *server, php_cli_serv
|
||||
static int php_cli_server_request_startup(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) { /* {{{ */
|
||||
char **auth;
|
||||
php_cli_server_client_populate_request_info(client, &SG(request_info));
|
||||
if (SUCCESS == zend_hash_find(&client->request.headers, "Authorization", sizeof("Authorization"), (void**)&auth)) {
|
||||
if (SUCCESS == zend_hash_find(&client->request.headers, "authorization", sizeof("authorization"), (void**)&auth)) {
|
||||
php_handle_auth_data(*auth TSRMLS_CC);
|
||||
}
|
||||
SG(sapi_headers).http_response_code = 200;
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
--TEST--
|
||||
Bug #65633 (built-in server treat some http headers as case-sensitive)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
include "skipif.inc";
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
include "php_cli_server.inc";
|
||||
php_cli_server_start(<<<'PHP'
|
||||
var_dump($_COOKIE, $_SERVER['HTTP_FOO']);
|
||||
PHP
|
||||
);
|
||||
|
||||
list($host, $port) = explode(':', PHP_CLI_SERVER_ADDRESS);
|
||||
$port = intval($port)?:80;
|
||||
|
||||
$fp = fsockopen($host, $port, $errno, $errstr, 0.5);
|
||||
if (!$fp) {
|
||||
die("connect failed");
|
||||
}
|
||||
|
||||
if(fwrite($fp, <<<HEADER
|
||||
GET / HTTP/1.1
|
||||
cookie: foo=bar
|
||||
foo: bar
|
||||
|
||||
|
||||
HEADER
|
||||
)) {
|
||||
while (!feof($fp)) {
|
||||
echo fgets($fp);
|
||||
}
|
||||
}
|
||||
|
||||
fclose($fp);
|
||||
?>
|
||||
--EXPECTF--
|
||||
HTTP/1.1 200 OK
|
||||
Connection: close
|
||||
X-Powered-By: %s
|
||||
Content-type: text/html
|
||||
|
||||
array(1) {
|
||||
["foo"]=>
|
||||
string(3) "bar"
|
||||
}
|
||||
string(3) "bar"
|
||||
+1
-1
@@ -11,7 +11,7 @@ SED="@SED@"
|
||||
|
||||
FILES_BUILD="mkdep.awk scan_makefile_in.awk shtool libtool.m4"
|
||||
FILES="acinclude.m4 Makefile.global config.sub config.guess ltmain.sh run-tests*.php"
|
||||
CLEAN_FILES="$FILES *.o *.lo *.la .deps .libs/ build/ include/ modules/ install-sh \
|
||||
CLEAN_FILES="$FILES *.o *.lo *.la .deps .libs/ build/ modules/ install-sh \
|
||||
mkinstalldirs missing config.nice config.sub config.guess configure configure.in \
|
||||
aclocal.m4 config.h config.h.in conftest* ltmain.sh libtool config.cache autom4te.cache/ \
|
||||
config.log config.status Makefile Makefile.fragments Makefile.objects confdefs.h \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
bz2-1.0.6
|
||||
cclient-2007e
|
||||
freetype-2.4.3
|
||||
freetype-2.4.10
|
||||
icu-49.1.2
|
||||
jpeglib-8
|
||||
libcurl-7.30.0
|
||||
|
||||
Reference in new issue
Block a user