Compare commits

..
Author SHA1 Message Date
Stanislav Malyshev 6e49313d72 5.4.29 rc1 2014-05-13 21:44:00 -07:00
Stanislav Malyshev ffd74a0a29 update NEWS 2014-05-13 17:07:35 -07:00
Stanislav Malyshev dc92e81922 Merge branch 'bug67251' into PHP-5.4
* bug67251:
  Fix bug #67251 - date_parse_from_format out-of-bounds read

Conflicts:
	ext/date/lib/parse_date.c
2014-05-13 16:52:45 -07:00
Stanislav Malyshev 0094fd0969 Merge branch 'bug67252' into PHP-5.4
* bug67252:
  fix bug #67253: timelib_meridian_with_check out-of-bounds read
  Fix bug #67252: convert_uudecode out-of-bounds read
2014-05-13 16:47:27 -07:00
Stanislav Malyshev 9103c9eb4f Merge branch 'bug67250' into PHP-5.4
* bug67250:
  Fix bug #67250 (iptcparse out-of-bounds read)
2014-05-13 16:43:10 -07:00
Derick Rethans 3e276d6728 - Updated to version 2014.3 (2014c) 2014-05-13 16:36:58 +01:00
Stanislav Malyshev 6ef8e0f088 fix test - output can be chunked 2014-05-12 10:54:16 -07:00
Stanislav Malyshev 466b8aa444 fix bug #67253: timelib_meridian_with_check out-of-bounds read 2014-05-11 21:09:11 -07:00
Stanislav Malyshev 1e2818b143 Fix bug #67252: convert_uudecode out-of-bounds read 2014-05-11 20:29:27 -07:00
Stanislav Malyshev 0a80849250 Fix bug #67251 - date_parse_from_format out-of-bounds read 2014-05-11 19:34:21 -07:00
Stanislav Malyshev 3e9cb6a4a5 Fix bug #67250 (iptcparse out-of-bounds read) 2014-05-11 19:09:19 -07:00
Stanislav Malyshev 2b475eebbe Fix bug #67247 spl_fixedarray_resize integer overflow 2014-05-11 17:54:27 -07:00
Stanislav Malyshev 14dd6c2d54 fix news 2014-05-11 17:43:28 -07:00
Bob Weinand 62b2eb666d Updated NEWS 2014-05-11 15:13:40 +02:00
Bob Weinand 5bf6a093ad Fix Linux specific fail in error traces (cherry-picked and fix for bug #67245)
Linux apparently does not like memcpy in overlapping regions...
2014-05-11 15:11:03 +02:00
Felipe Pena fb3b8de98d - Fixed off-by-one in phar_build (patch by crrodriguez at opensuse dot org) 2014-05-11 09:45:17 -03:00
Felipe Pena c575ab0c88 - Move checking 2014-05-10 11:55:42 -03:00
Felipe Pena 345f6d90d5 - Fixed missing NULL check in SimpleXMLElement::xpath() 2014-05-10 11:53:40 -03:00
Felipe Pena 5bd443a452 - Fixed missing NULL check 2014-05-10 11:39:08 -03:00
Stanislav Malyshev 4392339c3e oops, 5.4 and 5.5 use malloc in TSRM 2014-05-08 01:59:39 -07:00
Stanislav Malyshev 0cc18fdfba Fix memory leak in TSRM 2014-05-08 01:00:34 -07:00
Dmitry Stogov 8517001b25 Fixed test (it requires ext/hash) 2014-05-07 00:52:49 +02:00
Dmitry Stogov f880013c4d Fixed tests (they might fail from time to time because of session GC) 2014-05-07 00:37:56 +02:00
Adam Harvey f7cb87f333 Fix author name on the #63228 patch. 2014-05-02 10:23:09 -07:00
Adam Harvey 941c39bd06 Use the right path for the suggested PHP invocation in ext_skel.
Fixes bug #67160 (ext_skel outputs incorrect information).
2014-05-01 11:22:20 -07:00
Ferenc Kovacs 1c13ad7c0e add missing NEWS entry to the correct release where it was added 2014-05-01 10:50:08 +02:00
Stanislav Malyshev 35ceea928b Fix bug #67060: use default mode of 660 2014-04-29 09:14:11 -07:00
Anatol Belski 2d625b5f81 Fixed bug #66431 Special Character via COM Interface (CP_UTF8) 2014-04-29 13:40:44 +02:00
Popa Adrian Marius bb422cb60e Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Cleanup ZEND_MODULE_API_NO => 20050922
2014-04-28 12:13:11 +03:00
Popa Adrian Marius dbcd6304bb Cleanup ZEND_MODULE_API_NO => 20050922 2014-04-28 12:12:52 +03:00
Anatol Belski d3dcd61623 fixed test 2014-04-25 17:39:53 +02:00
Anatol Belski c1aa9baf29 Fixed bug #67118 DateTime constructor crash with invalid data 2014-04-25 17:23:26 +02:00
Stanislav Malyshev 03c703b8bd add a test case previously broken by a bad fix 2014-04-24 23:58:38 -07:00
Stanislav Malyshev a328803803 Revert "Fixed bug #64604"
This reverts commit b05c088a3a.
Breaks parsing urls where query has : in it, like: /foo/bar?baz=goo:boo
2014-04-24 23:50:45 -07:00
Anatol Belski 03be983398 fix dll export 2014-04-24 10:51:42 +02:00
Jakub Zelenka 61499bf282 Fix accepting ill-formed UTF-8 characters
Conflicts:
	ext/phar/phar_path_check.c
2014-04-22 16:55:58 -07:00
Danack ea4cee93c8 Allow valid multi-byte utf-8 characters to be allowed as file names in phar archives. 2014-04-20 17:19:20 -07:00
Rouven Weßling 68283c9f4a Fix a compiler warning in php_rand.h 2014-04-20 16:35:36 -07:00
Julio Pintos 49341e992a Fix #66908: php-fpm reload leaks epoll_create() file descriptor
This patch fixes descriptor leak which could lead to DoS once Max open files is reached
2014-04-20 16:21:49 -07:00
Boro Sitnikovski a18cec1b86 Fix bug #65701: Do not use cache for file file copy 2014-04-20 15:22:44 -07:00
Anatol Belski 53c68811ba UPGRADING note about bug #67072 2014-04-18 15:43:05 +02:00
Anatol Belski c2acdbdd3d Improved the fix for bug #67072, thanks Nikita 2014-04-18 15:13:32 +02:00
Levi Morrison 6e1e98d7b8 These links to ~helly don't work anymore. 2014-04-17 17:20:24 +02:00
Anatol Belski 5328d42899 Fixed bug #67072 Echoing unserialized "SplFileObject" crash
The actual issue lays in the unserializer code which doesn't honor
the unserialize callback. By contrast, the serialize callback is
respected. This leads to the situation that even if a class has
disabled the serialization explicitly, user could still construct
a vulnerable string which would result bad things when trying
to unserialize.

This conserns also the classes implementing Serializable as well
as some core classes disabling serialize/unserialize callbacks
explicitly (PDO, SimpleXML, SplFileInfo and co). As of now, the
flow is first to call the unserialize callback (if available),
then call __wakeup. If the unserialize callback returns with no
success, no object is instantiated. This makes the scheme used
by internal classes effective, to disable unserialize just assign
zend_class_unserialize_deny as callback.
2014-04-17 10:48:14 +02:00
Anatol Belski 7a5f1663c6 correct the bug #67081 fix 2014-04-16 15:06:57 +02:00
Anatol Belski 5224614f23 Fixed bug #67081 DOMDocumentType->internalSubset returns entire DOCTYPE tag, not only the subset 2014-04-16 14:13:45 +02:00
Stanislav Malyshev 1d34d82231 5.4.29 is next 2014-04-15 16:51:38 -07:00
74 changed files with 1594 additions and 918 deletions

No files matched your search

+38 -4
View File
@@ -1,19 +1,50 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
17 Apr 2014, PHP 5.4.28 RC1
15 May 2014, PHP 5.4.29 RC1
- COM:
. Fixed bug #66431 (Special Character via COM Interface (CP_UTF8)). (Anatol)
- Core:
. Fixed bug #65701 (copy() doesn't work when destination filename is created
by tempnam()). (Boro Sitnikovski)
. Fixed bug #67072 (Echoing unserialized "SplFileObject" crash). (Anatol)
. Fixed bug #67245 (usage of memcpy() with overlapping src and dst in
zend_exceptions.c). (Bob)
. Fixed bug #67247 (spl_fixedarray_resize integer overflow). (Stas)
. Fixed bug #67250 (iptcparse out-of-bounds read). (Stas)
. Fixed bug #67252 (convert_uudecode out-of-bounds read). (Stas)
- Date:
. Fixed bug #67118 (DateTime constructor crash with invalid data). (Anatol)
. Fixed bug #67251 (date_parse_from_format out-of-bounds read). (Stas)
. Fixed bug #67253 (timelib_meridian_with_check out-of-bounds read). (Stas)
- DOM:
. Fixed bug #67081 (DOMDocumentType->internalSubset returns entire DOCTYPE tag,
not only the subset). (Anatol)
- FPM:
. Fixed bug #66908 (php-fpm reload leaks epoll_create() file descriptor).
(Julio Pintos)
- Phar:
. Fix bug #64498 ($phar->buildFromDirectory can't compress file with an accent
in its name). (PR #588)
01 May 2014, PHP 5.4.28
- Core:
. Fixed bug #61019 (Out of memory on command stream_get_contents). (Mike)
. Fixed bug #64330 (stream_socket_server() creates wrong Abstract Namespace
UNIX sockets). (Mike)
. Fixed bug #64604 (parse_url is inconsistent with specified port).
(Ingo Walz)
. Fixed bug #66171 (Symlinks and session handler allow open_basedir bypass).
(Jann Horn, Stas)
. Fixed bug #66182 (exit in stream filter produces segfault). (Mike)
. Fixed bug #66736 (fpassthru broken). (Mike)
. Fixed bug #67024 (getimagesize should recognize BMP files with negative
height). (Gabor Buella)
. Fixed bug #67033 (Remove reference to Windows 95). (Anatol)
- cURL:
. Fixed bug #66562 (curl_exec returns differently than curl_multi_getcontent).
@@ -32,6 +63,8 @@ PHP NEWS
- FPM:
. Fixed bug #66482 (unknown entry 'priority' in php-fpm.conf).
. Fixed bug #67060 (sapi/fpm: possible privilege escalation due to insecure
default configuration) (CVE-2014-0185). (Stas)
- JSON:
. Fixed bug #66021 (Blank line inside empty array/object when
@@ -694,7 +727,8 @@ PHP NEWS
. Fixed bug #63999 (php with fpm fails to build on Solaris 10 or 11). (Adam)
- Litespeed:
. Fixed bug #63228 (-Werror=format-security error in lsapi code). (George)
. Fixed bug #63228 (-Werror=format-security error in lsapi code).
(Elan Ruusamäe, George)
- ext/sqlite3:
. Fixed bug #63921 (sqlite3::bindvalue and relative PHP functions aren't
+3
View File
@@ -350,6 +350,9 @@ PHP 5.4 UPGRADE NOTES
- Since 5.4.7, ctor is always called when new user stream wrapper object is created.
Before, it was called only when stream_open was called.
- Manipulated serialization strings for objects implementing Serializable by
replacing "C:" with "O:" at the start will now produce an error.
==============================
5. Changes to existing classes
==============================
+15
View File
@@ -12,6 +12,7 @@ UPGRADE NOTES - PHP X.Y
g. leak_variable
h. API Signature changes
i. new TSRM function expand_filepath_with_mode
j. unserialization of manipulated object strings
2. Build system changes
a. Unix build system changes
@@ -189,6 +190,20 @@ it increments the refcounts of those objects instead.
PHPAPI char *expand_filepath_with_mode(const char *filepath, char *real_path, const char *relative_to, size_t relative_to_len, int realpath_mode TSRMLS_DC);
expand_filepath_with_mode lets define how realpath will behave, using one of the existing mode: CWD_EXPAND , CWD_FILEPATH or CWD_REALPATH.
j.
Strings requiring unserialization of objects are now explicitly checked
whether the object they contain implements the Serializable interface.
This solves the situation where manipulated strings could be passed for
objects using Serializable to disallow serialization. An object
implementing Serializable will always start with "C:" in the serialized
string, all other objects are represented with starting "O:". Objects
implementing Serializable to disable serialization using
zend_class_unserialize_deny and zend_class_serialize_deny, when
instantiated from the serializer with a manipulated "O:" string at the
start, will most likely be defectively initialized. This is now
fixed at the appropriate place by checking for the presence of the
serialize callback in the class entry.
========================
2. Build system changes
========================
+1 -1
View File
@@ -363,7 +363,7 @@ ZEND_METHOD(error_exception, getSeverity)
#define TRACE_ARG_APPEND(vallen) \
*str = (char*)erealloc(*str, *len + 1 + vallen); \
memcpy((*str) + *len - l_added + 1 + vallen, (*str) + *len - l_added + 1, l_added);
memmove((*str) + *len - l_added + 1 + vallen, (*str) + *len - l_added + 1, l_added);
/* }}} */
+1 -1
View File
@@ -119,7 +119,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=5
PHP_MINOR_VERSION=4
PHP_RELEASE_VERSION=28
PHP_RELEASE_VERSION=29
PHP_EXTRA_VERSION="RC1"
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`
+6
View File
@@ -229,6 +229,9 @@ PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper,
#endif
if (php_check_open_basedir(path_copy TSRMLS_CC)) {
#ifdef VIRTUAL_DIR
free(path_copy);
#endif
return NULL;
}
@@ -238,6 +241,9 @@ PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper,
if (opened_path && bz_file) {
*opened_path = estrdup(path_copy);
}
#ifdef VIRTUAL_DIR
free(path_copy);
#endif
path_copy = NULL;
if (bz_file == NULL) {
+6
View File
@@ -46,7 +46,13 @@ PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string, uint strin
if (string_len > 0) {
olestring = (OLECHAR*)safe_emalloc(string_len, sizeof(OLECHAR), 0);
/* XXX if that's a real multibyte string, olestring is obviously allocated excessively.
This should be fixed by reallocating the olestring, but as emalloc is used, that doesn't
matter much. */
ok = MultiByteToWideChar(codepage, flags, string, string_len, olestring, string_len);
if (ok > 0 && ok < string_len) {
olestring[ok] = '\0';
}
} else {
ok = FALSE;
olestring = (OLECHAR*)emalloc(sizeof(OLECHAR));
+5 -1
View File
@@ -154,7 +154,11 @@ PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codep
case IS_STRING:
V_VT(v) = VT_BSTR;
olestring = php_com_string_to_olestring(Z_STRVAL_P(z), Z_STRLEN_P(z), codepage TSRMLS_CC);
V_BSTR(v) = SysAllocStringByteLen((char*)olestring, Z_STRLEN_P(z) * sizeof(OLECHAR));
if (CP_UTF8 == codepage) {
V_BSTR(v) = SysAllocStringByteLen((char*)olestring, wcslen(olestring) * sizeof(OLECHAR));
} else {
V_BSTR(v) = SysAllocStringByteLen((char*)olestring, Z_STRLEN_P(z) * sizeof(OLECHAR));
}
efree(olestring);
break;
+42
View File
@@ -0,0 +1,42 @@
--TEST--
Bug #66431 Special Character via COM Interface (CP_UTF8), Scripting.FileSystemObject
--SKIPIF--
<?php
if (!extension_loaded("com_dotnet")){ echo "skip COM/.Net support not present"; }
?>
--FILE--
<?php
$text= "Xin chào cộng đồng PHP";
$fpath = str_replace("/", "\\", dirname(__FILE__) . "/bug66431.txt");
$fso = new COM("Scripting.FileSystemObject");
$fh = $fso->OpenTextFile($fpath, 2, true);
$fh->Write($text);
$fh->Close();
$check_text = file_get_contents($fpath);
$result = ($check_text == $text);
var_dump($result);
if (!$result) {
echo "Expected: '$check_text'\n";
echo "Have: '$text'\n";
}
?>
===DONE===
--CLEAN--
<?php
$fpath = str_replace("/", "\\", dirname(__FILE__) . "/bug66431.txt");
if (file_exists($fpath)) {
unlink($fpath);
}
?>
--EXPECT--
bool(true)
===DONE===
+60
View File
@@ -0,0 +1,60 @@
--TEST--
Bug #66431 Special Character via COM Interface (CP_UTF8), Application.Word
--SKIPIF--
<?php
if (!extension_loaded("com_dotnet")){ echo "skip COM/.Net support not present"; }
try {
new COM("word.application", NULL, CP_UTF8);
} catch (Exception $e) {
die('skip ' . $e->getMessage();
}
?>
--FILE--
<?php
$text= "Xin chào cộng đồng PHP";
$fpath = str_replace("/", "\\", dirname(__FILE__) . "/bug66431.docx");
com_load_typelib('Word.Application');
$Wrd = new COM("word.application", NULL, CP_UTF8);
$Wrd->Documents->Add();
$Wrd->Selection->TypeText($text);
$Wrd->ActiveDocument->SaveAs($fpath);
$Wrd->ActiveDocument->Close(false);
$Wrd->Application->Quit();
unset($Wrd);
$Wrd = new COM("word.application", NULL, CP_UTF8);
$Wrd->Documents->Open($fpath, NULL, false);
$check_text = $Wrd->ActiveDocument->Range($Wrd->ActiveDocument->Sentences(1)->Start, $Wrd->ActiveDocument->Sentences(1)->End)->Text;
$Wrd->ActiveDocument->Close(false);
$Wrd->Application->Quit();
unset($Wrd);
/* trim the returned text as we'll get windows eol from a word doc. */
$result = (trim($check_text) == $text);
var_dump($result);
if (!$result) {
echo "Expected: '$check_text'\n";
echo "Have: '$text'\n";
}
?>
===DONE===
--CLEAN--
<?php
$fpath = str_replace("/", "\\", dirname(__FILE__) . "/bug66431.docx");
if (file_exists($fpath)) {
unlink($fpath);
}
?>
--EXPECT--
bool(true)
===DONE===
+5 -3
View File
@@ -23,16 +23,18 @@ if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) exit("skip PHP_CURL_HTTP_R
$url = "{$host}/get.php?test=get";
$ch = curl_init();
$alldata = '';
ob_start(); // start output buffering
curl_setopt($ch, CURLOPT_URL, $url); //set the url we want to use
curl_setopt($ch, CURLOPT_WRITEFUNCTION, function ($ch, $data) {
echo 'Data: '.$data;
$GLOBALS['alldata'] .= $data;
return strlen ($data);
});
curl_exec($ch);
curl_close($ch);
ob_end_flush();
echo "Data: $alldata";
?>
===DONE===
--EXPECTF--
+106 -99
View File
@@ -1,4 +1,4 @@
/* Generated by re2c 0.13.5 on Sat Jan 25 15:48:30 2014 */
/* Generated by re2c 0.13.5 on Tue May 13 16:52:44 2014 */
#line 1 "ext/date/lib/parse_date.re"
/*
+----------------------------------------------------------------------+
@@ -403,9 +403,12 @@ static timelib_sll timelib_meridian_with_check(char **ptr, timelib_sll h)
{
timelib_sll retval = 0;
while (!strchr("AaPp", **ptr)) {
while (**ptr && !strchr("AaPp", **ptr)) {
++*ptr;
}
if(!**ptr) {
return TIMELIB_UNSET;
}
if (**ptr == 'a' || **ptr == 'A') {
if (h == 12) {
retval = -12;
@@ -872,11 +875,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper)
std:
s->tok = cursor;
s->len = 0;
#line 998 "ext/date/lib/parse_date.re"
#line 1001 "ext/date/lib/parse_date.re"
#line 880 "ext/date/lib/parse_date.c"
#line 883 "ext/date/lib/parse_date.c"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
@@ -996,7 +999,7 @@ std:
}
yy2:
YYDEBUG(2, *YYCURSOR);
#line 1084 "ext/date/lib/parse_date.re"
#line 1087 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("firstdayof | lastdayof");
TIMELIB_INIT;
@@ -1012,7 +1015,7 @@ yy2:
TIMELIB_DEINIT;
return TIMELIB_LF_DAY_OF_MONTH;
}
#line 1016 "ext/date/lib/parse_date.c"
#line 1019 "ext/date/lib/parse_date.c"
yy3:
YYDEBUG(3, *YYCURSOR);
++YYCURSOR;
@@ -1035,7 +1038,7 @@ yy3:
}
yy4:
YYDEBUG(4, *YYCURSOR);
#line 1678 "ext/date/lib/parse_date.re"
#line 1681 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("tzcorrection | tz");
@@ -1048,7 +1051,7 @@ yy4:
TIMELIB_DEINIT;
return TIMELIB_TIMEZONE;
}
#line 1052 "ext/date/lib/parse_date.c"
#line 1055 "ext/date/lib/parse_date.c"
yy5:
YYDEBUG(5, *YYCURSOR);
yych = *++YYCURSOR;
@@ -1359,12 +1362,12 @@ yy12:
if (yych <= '9') goto yy1385;
yy13:
YYDEBUG(13, *YYCURSOR);
#line 1773 "ext/date/lib/parse_date.re"
#line 1776 "ext/date/lib/parse_date.re"
{
add_error(s, "Unexpected character");
goto std;
}
#line 1368 "ext/date/lib/parse_date.c"
#line 1371 "ext/date/lib/parse_date.c"
yy14:
YYDEBUG(14, *YYCURSOR);
yych = *++YYCURSOR;
@@ -2421,11 +2424,11 @@ yy49:
if (yych <= '9') goto yy55;
yy50:
YYDEBUG(50, *YYCURSOR);
#line 1762 "ext/date/lib/parse_date.re"
#line 1765 "ext/date/lib/parse_date.re"
{
goto std;
}
#line 2429 "ext/date/lib/parse_date.c"
#line 2432 "ext/date/lib/parse_date.c"
yy51:
YYDEBUG(51, *YYCURSOR);
yych = *++YYCURSOR;
@@ -2434,12 +2437,12 @@ yy52:
YYDEBUG(52, *YYCURSOR);
++YYCURSOR;
YYDEBUG(53, *YYCURSOR);
#line 1767 "ext/date/lib/parse_date.re"
#line 1770 "ext/date/lib/parse_date.re"
{
s->pos = cursor; s->line++;
goto std;
}
#line 2443 "ext/date/lib/parse_date.c"
#line 2446 "ext/date/lib/parse_date.c"
yy54:
YYDEBUG(54, *YYCURSOR);
yych = *++YYCURSOR;
@@ -2826,7 +2829,7 @@ yy72:
if (yych == 's') goto yy74;
yy73:
YYDEBUG(73, *YYCURSOR);
#line 1746 "ext/date/lib/parse_date.re"
#line 1749 "ext/date/lib/parse_date.re"
{
timelib_ull i;
DEBUG_OUTPUT("relative");
@@ -2841,7 +2844,7 @@ yy73:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 2845 "ext/date/lib/parse_date.c"
#line 2848 "ext/date/lib/parse_date.c"
yy74:
YYDEBUG(74, *YYCURSOR);
yych = *++YYCURSOR;
@@ -3603,7 +3606,7 @@ yy166:
}
yy167:
YYDEBUG(167, *YYCURSOR);
#line 1609 "ext/date/lib/parse_date.re"
#line 1612 "ext/date/lib/parse_date.re"
{
const timelib_relunit* relunit;
DEBUG_OUTPUT("daytext");
@@ -3620,7 +3623,7 @@ yy167:
TIMELIB_DEINIT;
return TIMELIB_WEEKDAY;
}
#line 3624 "ext/date/lib/parse_date.c"
#line 3627 "ext/date/lib/parse_date.c"
yy168:
YYDEBUG(168, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4140,7 +4143,7 @@ yy193:
}
yy194:
YYDEBUG(194, *YYCURSOR);
#line 1668 "ext/date/lib/parse_date.re"
#line 1671 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("monthtext");
TIMELIB_INIT;
@@ -4149,7 +4152,7 @@ yy194:
TIMELIB_DEINIT;
return TIMELIB_DATE_TEXT;
}
#line 4153 "ext/date/lib/parse_date.c"
#line 4156 "ext/date/lib/parse_date.c"
yy195:
YYDEBUG(195, *YYCURSOR);
++YYCURSOR;
@@ -4200,7 +4203,7 @@ yy198:
}
yy199:
YYDEBUG(199, *YYCURSOR);
#line 1414 "ext/date/lib/parse_date.re"
#line 1417 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datetextual | datenoyear");
@@ -4213,7 +4216,7 @@ yy199:
TIMELIB_DEINIT;
return TIMELIB_DATE_TEXT;
}
#line 4217 "ext/date/lib/parse_date.c"
#line 4220 "ext/date/lib/parse_date.c"
yy200:
YYDEBUG(200, *YYCURSOR);
yyaccept = 6;
@@ -4482,7 +4485,7 @@ yy222:
}
yy223:
YYDEBUG(223, *YYCURSOR);
#line 1716 "ext/date/lib/parse_date.re"
#line 1719 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz");
@@ -4511,7 +4514,7 @@ yy223:
TIMELIB_DEINIT;
return TIMELIB_SHORTDATE_WITH_TIME;
}
#line 4515 "ext/date/lib/parse_date.c"
#line 4518 "ext/date/lib/parse_date.c"
yy224:
YYDEBUG(224, *YYCURSOR);
yyaccept = 7;
@@ -5209,7 +5212,7 @@ yy278:
YYDEBUG(278, *YYCURSOR);
++YYCURSOR;
YYDEBUG(279, *YYCURSOR);
#line 1692 "ext/date/lib/parse_date.re"
#line 1695 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("dateshortwithtimeshort12 | dateshortwithtimelong12");
TIMELIB_INIT;
@@ -5232,7 +5235,7 @@ yy278:
TIMELIB_DEINIT;
return TIMELIB_SHORTDATE_WITH_TIME;
}
#line 5236 "ext/date/lib/parse_date.c"
#line 5239 "ext/date/lib/parse_date.c"
yy280:
YYDEBUG(280, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5410,7 +5413,7 @@ yy294:
++YYCURSOR;
yy295:
YYDEBUG(295, *YYCURSOR);
#line 1386 "ext/date/lib/parse_date.re"
#line 1389 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datenoday");
@@ -5423,7 +5426,7 @@ yy295:
TIMELIB_DEINIT;
return TIMELIB_DATE_NO_DAY;
}
#line 5427 "ext/date/lib/parse_date.c"
#line 5430 "ext/date/lib/parse_date.c"
yy296:
YYDEBUG(296, *YYCURSOR);
yych = *++YYCURSOR;
@@ -6643,7 +6646,7 @@ yy362:
if (yych <= '9') goto yy365;
yy364:
YYDEBUG(364, *YYCURSOR);
#line 1530 "ext/date/lib/parse_date.re"
#line 1533 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pgtextshort");
@@ -6656,7 +6659,7 @@ yy364:
TIMELIB_DEINIT;
return TIMELIB_PG_TEXT;
}
#line 6660 "ext/date/lib/parse_date.c"
#line 6663 "ext/date/lib/parse_date.c"
yy365:
YYDEBUG(365, *YYCURSOR);
yych = *++YYCURSOR;
@@ -7294,7 +7297,7 @@ yy392:
}
yy393:
YYDEBUG(393, *YYCURSOR);
#line 1588 "ext/date/lib/parse_date.re"
#line 1591 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("ago");
TIMELIB_INIT;
@@ -7314,7 +7317,7 @@ yy393:
TIMELIB_DEINIT;
return TIMELIB_AGO;
}
#line 7318 "ext/date/lib/parse_date.c"
#line 7321 "ext/date/lib/parse_date.c"
yy394:
YYDEBUG(394, *YYCURSOR);
yyaccept = 5;
@@ -9064,7 +9067,7 @@ yy454:
++YYCURSOR;
yy455:
YYDEBUG(455, *YYCURSOR);
#line 1291 "ext/date/lib/parse_date.re"
#line 1294 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("iso8601date4 | iso8601date2 | iso8601dateslash | dateslash");
TIMELIB_INIT;
@@ -9075,7 +9078,7 @@ yy455:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 9079 "ext/date/lib/parse_date.c"
#line 9082 "ext/date/lib/parse_date.c"
yy456:
YYDEBUG(456, *YYCURSOR);
yyaccept = 0;
@@ -9635,7 +9638,7 @@ yy475:
}
yy476:
YYDEBUG(476, *YYCURSOR);
#line 1428 "ext/date/lib/parse_date.re"
#line 1431 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datenoyearrev");
TIMELIB_INIT;
@@ -9646,7 +9649,7 @@ yy476:
TIMELIB_DEINIT;
return TIMELIB_DATE_TEXT;
}
#line 9650 "ext/date/lib/parse_date.c"
#line 9653 "ext/date/lib/parse_date.c"
yy477:
YYDEBUG(477, *YYCURSOR);
yyaccept = 10;
@@ -9787,7 +9790,7 @@ yy488:
YYDEBUG(488, *YYCURSOR);
++YYCURSOR;
YYDEBUG(489, *YYCURSOR);
#line 1146 "ext/date/lib/parse_date.re"
#line 1149 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("timetiny12 | timeshort12 | timelong12");
TIMELIB_INIT;
@@ -9803,7 +9806,7 @@ yy488:
TIMELIB_DEINIT;
return TIMELIB_TIME12;
}
#line 9807 "ext/date/lib/parse_date.c"
#line 9810 "ext/date/lib/parse_date.c"
yy490:
YYDEBUG(490, *YYCURSOR);
yyaccept = 11;
@@ -9816,7 +9819,7 @@ yy490:
}
yy491:
YYDEBUG(491, *YYCURSOR);
#line 1183 "ext/date/lib/parse_date.re"
#line 1186 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("timeshort24 | timelong24 | iso8601long");
@@ -9841,7 +9844,7 @@ yy491:
TIMELIB_DEINIT;
return TIMELIB_TIME24_WITH_ZONE;
}
#line 9845 "ext/date/lib/parse_date.c"
#line 9848 "ext/date/lib/parse_date.c"
yy492:
YYDEBUG(492, *YYCURSOR);
yyaccept = 11;
@@ -10151,7 +10154,7 @@ yy523:
YYDEBUG(523, *YYCURSOR);
++YYCURSOR;
YYDEBUG(524, *YYCURSOR);
#line 1163 "ext/date/lib/parse_date.re"
#line 1166 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("mssqltime");
TIMELIB_INIT;
@@ -10170,7 +10173,7 @@ yy523:
TIMELIB_DEINIT;
return TIMELIB_TIME24_WITH_ZONE;
}
#line 10174 "ext/date/lib/parse_date.c"
#line 10177 "ext/date/lib/parse_date.c"
yy525:
YYDEBUG(525, *YYCURSOR);
yyaccept = 11;
@@ -10276,7 +10279,7 @@ yy534:
if (yych <= '9') goto yy541;
yy535:
YYDEBUG(535, *YYCURSOR);
#line 1345 "ext/date/lib/parse_date.re"
#line 1348 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datefull");
@@ -10290,7 +10293,7 @@ yy535:
TIMELIB_DEINIT;
return TIMELIB_DATE_FULL;
}
#line 10294 "ext/date/lib/parse_date.c"
#line 10297 "ext/date/lib/parse_date.c"
yy536:
YYDEBUG(536, *YYCURSOR);
yych = *++YYCURSOR;
@@ -11027,7 +11030,7 @@ yy605:
YYDEBUG(606, *YYCURSOR);
++YYCURSOR;
YYDEBUG(607, *YYCURSOR);
#line 1360 "ext/date/lib/parse_date.re"
#line 1363 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("pointed date YYYY");
TIMELIB_INIT;
@@ -11038,7 +11041,7 @@ yy605:
TIMELIB_DEINIT;
return TIMELIB_DATE_FULL_POINTED;
}
#line 11042 "ext/date/lib/parse_date.c"
#line 11045 "ext/date/lib/parse_date.c"
yy608:
YYDEBUG(608, *YYCURSOR);
yyaccept = 11;
@@ -11074,7 +11077,7 @@ yy611:
if (yych <= '9') goto yy605;
yy612:
YYDEBUG(612, *YYCURSOR);
#line 1372 "ext/date/lib/parse_date.re"
#line 1375 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pointed date YY");
@@ -11087,7 +11090,7 @@ yy612:
TIMELIB_DEINIT;
return TIMELIB_DATE_FULL_POINTED;
}
#line 11091 "ext/date/lib/parse_date.c"
#line 11094 "ext/date/lib/parse_date.c"
yy613:
YYDEBUG(613, *YYCURSOR);
yyaccept = 11;
@@ -11728,7 +11731,7 @@ yy656:
}
yy657:
YYDEBUG(657, *YYCURSOR);
#line 1331 "ext/date/lib/parse_date.re"
#line 1334 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("gnudateshort");
@@ -11741,7 +11744,7 @@ yy657:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 11745 "ext/date/lib/parse_date.c"
#line 11748 "ext/date/lib/parse_date.c"
yy658:
YYDEBUG(658, *YYCURSOR);
yyaccept = 13;
@@ -11847,7 +11850,7 @@ yy666:
}
yy667:
YYDEBUG(667, *YYCURSOR);
#line 1275 "ext/date/lib/parse_date.re"
#line 1278 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("americanshort | american");
@@ -11862,7 +11865,7 @@ yy667:
TIMELIB_DEINIT;
return TIMELIB_AMERICAN;
}
#line 11866 "ext/date/lib/parse_date.c"
#line 11869 "ext/date/lib/parse_date.c"
yy668:
YYDEBUG(668, *YYCURSOR);
yyaccept = 14;
@@ -12095,7 +12098,7 @@ yy700:
if (yych <= ':') goto yy704;
yy701:
YYDEBUG(701, *YYCURSOR);
#line 1558 "ext/date/lib/parse_date.re"
#line 1561 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("clf");
@@ -12115,7 +12118,7 @@ yy701:
TIMELIB_DEINIT;
return TIMELIB_CLF;
}
#line 12119 "ext/date/lib/parse_date.c"
#line 12122 "ext/date/lib/parse_date.c"
yy702:
YYDEBUG(702, *YYCURSOR);
yych = *++YYCURSOR;
@@ -12667,7 +12670,7 @@ yy763:
}
yy764:
YYDEBUG(764, *YYCURSOR);
#line 1303 "ext/date/lib/parse_date.re"
#line 1306 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("iso8601date2");
@@ -12680,7 +12683,7 @@ yy764:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 12684 "ext/date/lib/parse_date.c"
#line 12687 "ext/date/lib/parse_date.c"
yy765:
YYDEBUG(765, *YYCURSOR);
yych = *++YYCURSOR;
@@ -12719,7 +12722,7 @@ yy771:
YYDEBUG(771, *YYCURSOR);
++YYCURSOR;
YYDEBUG(772, *YYCURSOR);
#line 1544 "ext/date/lib/parse_date.re"
#line 1547 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pgtextreverse");
@@ -12732,7 +12735,7 @@ yy771:
TIMELIB_DEINIT;
return TIMELIB_PG_TEXT;
}
#line 12736 "ext/date/lib/parse_date.c"
#line 12739 "ext/date/lib/parse_date.c"
yy773:
YYDEBUG(773, *YYCURSOR);
yych = *++YYCURSOR;
@@ -12870,7 +12873,7 @@ yy783:
}
yy784:
YYDEBUG(784, *YYCURSOR);
#line 1579 "ext/date/lib/parse_date.re"
#line 1582 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("year4");
TIMELIB_INIT;
@@ -12878,7 +12881,7 @@ yy784:
TIMELIB_DEINIT;
return TIMELIB_CLF;
}
#line 12882 "ext/date/lib/parse_date.c"
#line 12885 "ext/date/lib/parse_date.c"
yy785:
YYDEBUG(785, *YYCURSOR);
yych = *++YYCURSOR;
@@ -13029,7 +13032,7 @@ yy793:
}
yy794:
YYDEBUG(794, *YYCURSOR);
#line 1400 "ext/date/lib/parse_date.re"
#line 1403 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datenodayrev");
@@ -13042,7 +13045,7 @@ yy794:
TIMELIB_DEINIT;
return TIMELIB_DATE_NO_DAY;
}
#line 13046 "ext/date/lib/parse_date.c"
#line 13049 "ext/date/lib/parse_date.c"
yy795:
YYDEBUG(795, *YYCURSOR);
yych = *++YYCURSOR;
@@ -13257,7 +13260,7 @@ yy814:
if (yych <= '7') goto yy817;
yy815:
YYDEBUG(815, *YYCURSOR);
#line 1511 "ext/date/lib/parse_date.re"
#line 1514 "ext/date/lib/parse_date.re"
{
timelib_sll w, d;
DEBUG_OUTPUT("isoweek");
@@ -13275,7 +13278,7 @@ yy815:
TIMELIB_DEINIT;
return TIMELIB_ISO_WEEK;
}
#line 13279 "ext/date/lib/parse_date.c"
#line 13282 "ext/date/lib/parse_date.c"
yy816:
YYDEBUG(816, *YYCURSOR);
yych = *++YYCURSOR;
@@ -13285,7 +13288,7 @@ yy817:
YYDEBUG(817, *YYCURSOR);
++YYCURSOR;
YYDEBUG(818, *YYCURSOR);
#line 1492 "ext/date/lib/parse_date.re"
#line 1495 "ext/date/lib/parse_date.re"
{
timelib_sll w, d;
DEBUG_OUTPUT("isoweekday");
@@ -13303,7 +13306,7 @@ yy817:
TIMELIB_DEINIT;
return TIMELIB_ISO_WEEK;
}
#line 13307 "ext/date/lib/parse_date.c"
#line 13310 "ext/date/lib/parse_date.c"
yy819:
YYDEBUG(819, *YYCURSOR);
yych = *++YYCURSOR;
@@ -13367,7 +13370,7 @@ yy821:
}
yy822:
YYDEBUG(822, *YYCURSOR);
#line 1478 "ext/date/lib/parse_date.re"
#line 1481 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pgydotd");
@@ -13380,7 +13383,7 @@ yy822:
TIMELIB_DEINIT;
return TIMELIB_PG_YEARDAY;
}
#line 13384 "ext/date/lib/parse_date.c"
#line 13387 "ext/date/lib/parse_date.c"
yy823:
YYDEBUG(823, *YYCURSOR);
yych = *++YYCURSOR;
@@ -13483,7 +13486,7 @@ yy842:
++YYCURSOR;
yy843:
YYDEBUG(843, *YYCURSOR);
#line 1452 "ext/date/lib/parse_date.re"
#line 1455 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("xmlrpc | xmlrpcnocolon | soap | wddx | exif");
@@ -13508,7 +13511,7 @@ yy843:
TIMELIB_DEINIT;
return TIMELIB_XMLRPC_SOAP;
}
#line 13512 "ext/date/lib/parse_date.c"
#line 13515 "ext/date/lib/parse_date.c"
yy844:
YYDEBUG(844, *YYCURSOR);
yych = *++YYCURSOR;
@@ -13770,7 +13773,7 @@ yy848:
}
yy849:
YYDEBUG(849, *YYCURSOR);
#line 1440 "ext/date/lib/parse_date.re"
#line 1443 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datenocolon");
TIMELIB_INIT;
@@ -13781,7 +13784,7 @@ yy849:
TIMELIB_DEINIT;
return TIMELIB_DATE_NOCOLON;
}
#line 13785 "ext/date/lib/parse_date.c"
#line 13788 "ext/date/lib/parse_date.c"
yy850:
YYDEBUG(850, *YYCURSOR);
yych = *++YYCURSOR;
@@ -14701,7 +14704,7 @@ yy973:
if (yych <= '9') goto yy996;
yy974:
YYDEBUG(974, *YYCURSOR);
#line 1317 "ext/date/lib/parse_date.re"
#line 1320 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("gnudateshorter");
@@ -14714,7 +14717,7 @@ yy974:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 14718 "ext/date/lib/parse_date.c"
#line 14721 "ext/date/lib/parse_date.c"
yy975:
YYDEBUG(975, *YYCURSOR);
yyaccept = 22;
@@ -15723,7 +15726,7 @@ yy1066:
}
yy1068:
YYDEBUG(1068, *YYCURSOR);
#line 1209 "ext/date/lib/parse_date.re"
#line 1212 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("gnunocolon");
TIMELIB_INIT;
@@ -15745,7 +15748,7 @@ yy1068:
TIMELIB_DEINIT;
return TIMELIB_GNU_NOCOLON;
}
#line 15749 "ext/date/lib/parse_date.c"
#line 15752 "ext/date/lib/parse_date.c"
yy1069:
YYDEBUG(1069, *YYCURSOR);
yych = *++YYCURSOR;
@@ -15837,7 +15840,7 @@ yy1075:
}
yy1076:
YYDEBUG(1076, *YYCURSOR);
#line 1255 "ext/date/lib/parse_date.re"
#line 1258 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("iso8601nocolon");
@@ -15856,7 +15859,7 @@ yy1076:
TIMELIB_DEINIT;
return TIMELIB_ISO_NOCOLON;
}
#line 15860 "ext/date/lib/parse_date.c"
#line 15863 "ext/date/lib/parse_date.c"
yy1077:
YYDEBUG(1077, *YYCURSOR);
yyaccept = 25;
@@ -16754,7 +16757,7 @@ yy1117:
}
yy1118:
YYDEBUG(1118, *YYCURSOR);
#line 1651 "ext/date/lib/parse_date.re"
#line 1654 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
@@ -16770,7 +16773,7 @@ yy1118:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 16774 "ext/date/lib/parse_date.c"
#line 16777 "ext/date/lib/parse_date.c"
yy1119:
YYDEBUG(1119, *YYCURSOR);
++YYCURSOR;
@@ -16821,7 +16824,7 @@ yy1126:
YYDEBUG(1126, *YYCURSOR);
++YYCURSOR;
YYDEBUG(1127, *YYCURSOR);
#line 1124 "ext/date/lib/parse_date.re"
#line 1127 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
@@ -16842,7 +16845,7 @@ yy1126:
TIMELIB_DEINIT;
return TIMELIB_WEEK_DAY_OF_MONTH;
}
#line 16846 "ext/date/lib/parse_date.c"
#line 16849 "ext/date/lib/parse_date.c"
yy1128:
YYDEBUG(1128, *YYCURSOR);
yyaccept = 26;
@@ -16950,7 +16953,7 @@ yy1141:
}
yy1142:
YYDEBUG(1142, *YYCURSOR);
#line 1627 "ext/date/lib/parse_date.re"
#line 1630 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
@@ -16973,7 +16976,7 @@ yy1142:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 16977 "ext/date/lib/parse_date.c"
#line 16980 "ext/date/lib/parse_date.c"
yy1143:
YYDEBUG(1143, *YYCURSOR);
yych = *++YYCURSOR;
@@ -19650,7 +19653,7 @@ yy1294:
goto yy1298;
yy1295:
YYDEBUG(1295, *YYCURSOR);
#line 1101 "ext/date/lib/parse_date.re"
#line 1104 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("backof | frontof");
TIMELIB_INIT;
@@ -19672,7 +19675,7 @@ yy1295:
TIMELIB_DEINIT;
return TIMELIB_LF_DAY_OF_MONTH;
}
#line 19676 "ext/date/lib/parse_date.c"
#line 19679 "ext/date/lib/parse_date.c"
yy1296:
YYDEBUG(1296, *YYCURSOR);
yyaccept = 28;
@@ -21363,7 +21366,7 @@ yy1385:
if (yych <= '9') goto yy1385;
yy1387:
YYDEBUG(1387, *YYCURSOR);
#line 1058 "ext/date/lib/parse_date.re"
#line 1061 "ext/date/lib/parse_date.re"
{
timelib_ull i;
@@ -21388,7 +21391,7 @@ yy1387:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 21392 "ext/date/lib/parse_date.c"
#line 21395 "ext/date/lib/parse_date.c"
yy1388:
YYDEBUG(1388, *YYCURSOR);
yych = *++YYCURSOR;
@@ -21824,7 +21827,7 @@ yy1416:
++YYCURSOR;
yy1417:
YYDEBUG(1417, *YYCURSOR);
#line 1046 "ext/date/lib/parse_date.re"
#line 1049 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("tomorrow");
TIMELIB_INIT;
@@ -21835,7 +21838,7 @@ yy1417:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 21839 "ext/date/lib/parse_date.c"
#line 21842 "ext/date/lib/parse_date.c"
yy1418:
YYDEBUG(1418, *YYCURSOR);
yych = *++YYCURSOR;
@@ -21870,7 +21873,7 @@ yy1419:
}
yy1420:
YYDEBUG(1420, *YYCURSOR);
#line 1036 "ext/date/lib/parse_date.re"
#line 1039 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("midnight | today");
TIMELIB_INIT;
@@ -21879,7 +21882,7 @@ yy1420:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 21883 "ext/date/lib/parse_date.c"
#line 21886 "ext/date/lib/parse_date.c"
yy1421:
YYDEBUG(1421, *YYCURSOR);
yych = *++YYCURSOR;
@@ -23891,7 +23894,7 @@ yy1499:
}
yy1500:
YYDEBUG(1500, *YYCURSOR);
#line 1015 "ext/date/lib/parse_date.re"
#line 1018 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("now");
TIMELIB_INIT;
@@ -23899,7 +23902,7 @@ yy1500:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 23903 "ext/date/lib/parse_date.c"
#line 23906 "ext/date/lib/parse_date.c"
yy1501:
YYDEBUG(1501, *YYCURSOR);
yych = *++YYCURSOR;
@@ -24038,7 +24041,7 @@ yy1507:
}
yy1508:
YYDEBUG(1508, *YYCURSOR);
#line 1024 "ext/date/lib/parse_date.re"
#line 1027 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("noon");
TIMELIB_INIT;
@@ -24049,7 +24052,7 @@ yy1508:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 24053 "ext/date/lib/parse_date.c"
#line 24056 "ext/date/lib/parse_date.c"
yy1509:
YYDEBUG(1509, *YYCURSOR);
yyaccept = 0;
@@ -24582,7 +24585,7 @@ yy1530:
++YYCURSOR;
yy1531:
YYDEBUG(1531, *YYCURSOR);
#line 1003 "ext/date/lib/parse_date.re"
#line 1006 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("yesterday");
TIMELIB_INIT;
@@ -24593,7 +24596,7 @@ yy1531:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 24597 "ext/date/lib/parse_date.c"
#line 24600 "ext/date/lib/parse_date.c"
yy1532:
YYDEBUG(1532, *YYCURSOR);
yyaccept = 0;
@@ -24766,7 +24769,7 @@ yy1537:
goto yy1531;
}
}
#line 1777 "ext/date/lib/parse_date.re"
#line 1780 "ext/date/lib/parse_date.re"
}
@@ -25124,6 +25127,10 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
break;
case '\\': /* escaped char */
if(!fptr[1]) {
add_pbf_error(s, "Escaped character expected", string, begin);
break;
}
fptr++;
if (*ptr == *fptr) {
++ptr;
+8 -1
View File
@@ -401,9 +401,12 @@ static timelib_sll timelib_meridian_with_check(char **ptr, timelib_sll h)
{
timelib_sll retval = 0;
while (!strchr("AaPp", **ptr)) {
while (**ptr && !strchr("AaPp", **ptr)) {
++*ptr;
}
if(!**ptr) {
return TIMELIB_UNSET;
}
if (**ptr == 'a' || **ptr == 'A') {
if (h == 12) {
retval = -12;
@@ -2131,6 +2134,10 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
break;
case '\\': /* escaped char */
if(!fptr[1]) {
add_pbf_error(s, "Escaped character expected", string, begin);
break;
}
fptr++;
if (*ptr == *fptr) {
++ptr;
+618 -582
View File
File diff suppressed because it is too large. Load diff
+3 -1
View File
@@ -2548,7 +2548,9 @@ PHP_METHOD(DateTime, __construct)
zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone)) {
php_date_initialize(zend_object_store_get_object(getThis() TSRMLS_CC), time_str, time_str_len, NULL, timezone_object, 1 TSRMLS_CC);
if (!php_date_initialize(zend_object_store_get_object(getThis() TSRMLS_CC), time_str, time_str_len, NULL, timezone_object, 1 TSRMLS_CC)) {
ZVAL_NULL(getThis());
}
}
zend_restore_error_handling(&error_handling TSRMLS_CC);
}
+27
View File
@@ -0,0 +1,27 @@
--TEST--
Bug #67118 php-cgi crashes regularly on IIS 7
--INI--
date.timezone=Europe/Berlin
--FILE--
<?php
class mydt extends datetime
{
public function __construct($time = 'now', $tz = NULL, $format = NULL)
{
if (!empty($tz) && !is_object($tz)) {
$tz = new DateTimeZone($tz);
}
@parent::__construct($time, $tz);
}
};
new mydt("Funktionsansvarig rådgivning och juridik", "UTC");
--EXPECTF--
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (Funktionsansvarig rådgivning och juridik) at position 0 (F): The timezone could not be found in the database' in %sbug67118.php:%d
Stack trace:
#0 %sbug67118.php(%d): DateTime->__construct('Funktionsansvar...', Object(DateTimeZone))
#1 %sbug67118.php(%d): mydt->__construct('Funktionsansvar...', 'UTC')
#2 {main}
thrown in %sbug67118.php on line %d
+38
View File
@@ -0,0 +1,38 @@
--TEST--
Bug #67251 (date_parse_from_format out-of-bounds read)
--INI--
date.timezone=Europe/Berlin
--FILE--
<?php
var_dump(date_parse_from_format("\\","AAAABBBB"));
--EXPECT--
array(12) {
["year"]=>
bool(false)
["month"]=>
bool(false)
["day"]=>
bool(false)
["hour"]=>
bool(false)
["minute"]=>
bool(false)
["second"]=>
bool(false)
["fraction"]=>
bool(false)
["warning_count"]=>
int(0)
["warnings"]=>
array(0) {
}
["error_count"]=>
int(2)
["errors"]=>
array(1) {
[0]=>
string(13) "Trailing data"
}
["is_localtime"]=>
bool(false)
}
+44
View File
@@ -0,0 +1,44 @@
--TEST--
Bug #67253 (timelib_meridian_with_check out-of-bounds read)
--INI--
date.timezone=Europe/Berlin
--FILE--
<?php
$z = '';
var_dump(date_parse_from_format("aHa0", "0=G{$z}9UCNnF"));
--EXPECT--
array(12) {
["year"]=>
bool(false)
["month"]=>
bool(false)
["day"]=>
bool(false)
["hour"]=>
int(0)
["minute"]=>
int(0)
["second"]=>
int(0)
["fraction"]=>
bool(false)
["warning_count"]=>
int(0)
["warnings"]=>
array(0) {
}
["error_count"]=>
int(3)
["errors"]=>
array(3) {
[0]=>
string(51) "Meridian can only come after an hour has been found"
[1]=>
string(29) "A meridian could not be found"
[9]=>
string(12) "Data missing"
}
["is_localtime"]=>
bool(false)
}
+25 -11
View File
@@ -188,8 +188,7 @@ int dom_documenttype_internal_subset_read(dom_object *obj, zval **retval TSRMLS_
{
xmlDtdPtr dtdptr;
xmlDtd *intsubset;
xmlOutputBuffer *buff = NULL;
xmlDtdPtr intsubset;
dtdptr = (xmlDtdPtr) dom_object_get_node(obj);
@@ -200,22 +199,37 @@ int dom_documenttype_internal_subset_read(dom_object *obj, zval **retval TSRMLS_
ALLOC_ZVAL(*retval);
if (dtdptr->doc != NULL && ((intsubset = dtdptr->doc->intSubset) != NULL)) {
buff = xmlAllocOutputBuffer(NULL);
if (buff != NULL) {
xmlNodeDumpOutput (buff, NULL, (xmlNodePtr) intsubset, 0, 0, NULL);
xmlOutputBufferFlush(buff);
if (dtdptr->doc != NULL && ((intsubset = xmlGetIntSubset(dtdptr->doc)) != NULL) && intsubset->children != NULL) {
smart_str ret_buf = {0};
xmlNodePtr cur = intsubset->children;
while (cur != NULL) {
xmlOutputBuffer *buff = xmlAllocOutputBuffer(NULL);
if (buff != NULL) {
xmlNodeDumpOutput (buff, NULL, cur, 0, 0, NULL);
xmlOutputBufferFlush(buff);
#ifdef LIBXML2_NEW_BUFFER
ZVAL_STRINGL(*retval, xmlOutputBufferGetContent(buff), xmlOutputBufferGetSize(buff), 1);
smart_str_appendl(&ret_buf, xmlOutputBufferGetContent(buff), xmlOutputBufferGetSize(buff));
#else
ZVAL_STRINGL(*retval, buff->buffer->content, buff->buffer->use, 1);
smart_str_appendl(&ret_buf, buff->buffer->content, buff->buffer->use);
#endif
(void)xmlOutputBufferClose(buff);
(void)xmlOutputBufferClose(buff);
}
cur = cur->next;
}
if (ret_buf.len) {
ZVAL_STRINGL(*retval, ret_buf.c, ret_buf.len, 1);
smart_str_free(&ret_buf);
return SUCCESS;
}
}
ZVAL_EMPTY_STRING(*retval);
ZVAL_NULL(*retval);
return SUCCESS;
+2 -2
View File
@@ -43,6 +43,6 @@ print 'notation: '.$notation->nodeName."\n";
publicId: -//OASIS//DTD DocBook XML//EN
systemId: docbookx.dtd
name: chapter
internalSubset: <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML//EN" "docbookx.dtd">
internalSubset:
entity: logo
notation: gif
notation: gif
+43
View File
@@ -0,0 +1,43 @@
--TEST--
Bug #67081 DOMDocumentType->internalSubset returns entire DOCTYPE tag, not only the subset
--SKIPIF--
<?php
require_once('skipif.inc');
?>
--FILE--
<?php
$domDocument = new DOMDocument();
$domDocument->load(dirname(__FILE__) . DIRECTORY_SEPARATOR . "bug67081_0.xml");
var_dump($domDocument->doctype->internalSubset);
$domDocument = new DOMDocument();
$domDocument->load(dirname(__FILE__) . DIRECTORY_SEPARATOR . "bug67081_1.xml");
var_dump($domDocument->doctype->internalSubset);
$domDocument = new DOMDocument();
$domDocument->load(dirname(__FILE__) . DIRECTORY_SEPARATOR . "bug67081_2.xml");
var_dump($domDocument->doctype->internalSubset);
$domDocument = new DOMDocument();
$domDocument->load(dirname(__FILE__) . DIRECTORY_SEPARATOR . "dom.xml");
var_dump($domDocument->doctype->internalSubset);
?>
===DONE===
--EXPECT--
string(19) "<!ELEMENT a EMPTY>
"
string(38) "<!ELEMENT a EMPTY>
<!ELEMENT b EMPTY>
"
NULL
string(277) "<!ENTITY % incent SYSTEM "dom.ent">
<!ENTITY amp "&#38;#38;">
<!ENTITY gt "&#62;">
<!ENTITY % coreattrs "title CDATA #IMPLIED">
<!ENTITY % attrs "%coreattrs;">
<!ATTLIST foo bar CDATA #IMPLIED>
<!ELEMENT foo (#PCDATA)>
<!ELEMENT root (foo)+>
<!ATTLIST th title CDATA #IMPLIED>
"
===DONE===
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0"?>
<!DOCTYPE a [
<!ELEMENT a EMPTY>
]>
<a></a>
+7
View File
@@ -0,0 +1,7 @@
<?xml version="1.0"?>
<!DOCTYPE a [
<!ELEMENT a EMPTY>
<!ELEMENT b EMPTY>
]>
<a></a>
+5
View File
@@ -0,0 +1,5 @@
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<a></a>
+1 -1
View File
@@ -288,7 +288,7 @@ To use your new extension, you will have to execute the following steps:
3. $ ./buildconf
4. $ ./configure --[with|enable]-$extname
5. $ make
6. $ ./php -f ext/$extname/$extname.php
6. $ ./sapi/cli/php -f ext/$extname/$extname.php
7. $ vi ext/$extname/$extname.c
8. $ make
+2 -4
View File
@@ -567,7 +567,7 @@ static int firebird_handle_get_attribute(pdo_dbh_t *dbh, long attr, zval *val TS
#else
HMODULE l = GetModuleHandle("fbclient");
if (!l && !(l = GetModuleHandle("gds32"))) {
if (!l) {
break;
}
info_func = (info_func_t)GetProcAddress(l, "isc_get_client_version");
@@ -575,9 +575,7 @@ static int firebird_handle_get_attribute(pdo_dbh_t *dbh, long attr, zval *val TS
if (info_func) {
info_func(tmp);
ZVAL_STRING(val,tmp,1);
} else {
ZVAL_STRING(val,"Firebird 1.0/Interbase 6",1);
}
}
#else
ZVAL_NULL(val);
#endif
-6
View File
@@ -35,21 +35,15 @@ const zend_function_entry pdo_firebird_functions[] = { /* {{{ */
/* {{{ pdo_firebird_deps
*/
#if ZEND_MODULE_API_NO >= 20050922
static const zend_module_dep pdo_firebird_deps[] = {
ZEND_MOD_REQUIRED("pdo")
ZEND_MOD_END
};
#endif
/* }}} */
zend_module_entry pdo_firebird_module_entry = { /* {{{ */
#if ZEND_MODULE_API_NO >= 20050922
STANDARD_MODULE_HEADER_EX, NULL,
pdo_firebird_deps,
#else
STANDARD_MODULE_HEADER,
#endif
"PDO_Firebird",
pdo_firebird_functions,
PHP_MINIT(pdo_firebird),
+1 -1
View File
@@ -1513,7 +1513,7 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{
}
close_fp = 0;
opened = (char *) estrndup(str, sizeof("[stream]") + 1);
opened = (char *) estrndup(str, sizeof("[stream]") - 1);
goto after_open_fp;
case IS_OBJECT:
if (instanceof_function(Z_OBJCE_PP(value), spl_ce_SplFileInfo TSRMLS_CC)) {
+184 -65
View File
@@ -1,4 +1,4 @@
/* Generated by re2c 0.13.5 on Fri Feb 25 04:35:39 2011 */
/* Generated by re2c 0.13.5 on Tue Apr 22 16:55:12 2014 */
#line 1 "ext/phar/phar_path_check.re"
/*
+----------------------------------------------------------------------+
@@ -46,60 +46,91 @@ loop:
#line 47 "ext/phar/phar_path_check.c"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
if ((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
yych = *YYCURSOR;
if (yych <= '.') {
if (yych <= '\n') {
if (yych <= 0x00) goto yy13;
if (yych <= '\t') goto yy10;
goto yy12;
if (yych <= '[') {
if (yych <= ')') {
if (yych <= '\t') {
if (yych <= 0x00) goto yy21;
goto yy23;
} else {
if (yych <= '\n') goto yy2;
if (yych <= 0x19) goto yy23;
goto yy11;
}
} else {
if (yych <= 0x19) goto yy10;
if (yych == '*') goto yy6;
goto yy15;
if (yych <= '/') {
if (yych <= '*') goto yy7;
if (yych <= '.') goto yy11;
goto yy3;
} else {
if (yych == '?') goto yy9;
goto yy11;
}
}
} else {
if (yych <= '?') {
if (yych <= '/') goto yy2;
if (yych <= '>') goto yy15;
goto yy8;
if (yych <= 0xEC) {
if (yych <= 0xC1) {
if (yych <= '\\') goto yy5;
if (yych <= 0x7F) goto yy11;
goto yy23;
} else {
if (yych <= 0xDF) goto yy12;
if (yych <= 0xE0) goto yy14;
goto yy15;
}
} else {
if (yych == '\\') goto yy4;
if (yych <= 0x7F) goto yy15;
goto yy10;
if (yych <= 0xF0) {
if (yych <= 0xED) goto yy16;
if (yych <= 0xEF) goto yy17;
goto yy18;
} else {
if (yych <= 0xF3) goto yy19;
if (yych <= 0xF4) goto yy20;
goto yy23;
}
}
}
yy2:
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '-') goto yy3;
if (yych <= '.') goto yy16;
if (yych <= '/') goto yy18;
YYCURSOR = YYMARKER;
if (yyaccept <= 0) {
goto yy4;
} else {
goto yy13;
}
yy3:
#line 93 "ext/phar/phar_path_check.re"
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= '-') goto yy4;
if (yych <= '.') goto yy35;
if (yych <= '/') goto yy36;
yy4:
#line 88 "ext/phar/phar_path_check.re"
{
goto loop;
}
#line 84 "ext/phar/phar_path_check.c"
yy4:
#line 115 "ext/phar/phar_path_check.c"
yy5:
++YYCURSOR;
#line 60 "ext/phar/phar_path_check.re"
#line 72 "ext/phar/phar_path_check.re"
{
*error = "back-slash";
return pcr_err_back_slash;
}
#line 92 "ext/phar/phar_path_check.c"
yy6:
#line 123 "ext/phar/phar_path_check.c"
yy7:
++YYCURSOR;
#line 64 "ext/phar/phar_path_check.re"
#line 76 "ext/phar/phar_path_check.re"
{
*error = "star";
return pcr_err_star;
}
#line 100 "ext/phar/phar_path_check.c"
yy8:
#line 131 "ext/phar/phar_path_check.c"
yy9:
++YYCURSOR;
#line 68 "ext/phar/phar_path_check.re"
#line 80 "ext/phar/phar_path_check.re"
{
if (**s == '/') {
(*s)++;
@@ -108,22 +139,66 @@ yy8:
*error = NULL;
return pcr_use_query;
}
#line 112 "ext/phar/phar_path_check.c"
yy10:
++YYCURSOR;
#line 143 "ext/phar/phar_path_check.c"
yy11:
#line 76 "ext/phar/phar_path_check.re"
yych = *++YYCURSOR;
goto yy4;
yy12:
++YYCURSOR;
if ((yych = *YYCURSOR) <= 0x7F) goto yy13;
if (yych <= 0xBF) goto yy26;
yy13:
#line 104 "ext/phar/phar_path_check.re"
{
*error ="illegal character";
return pcr_err_illegal_char;
}
#line 121 "ext/phar/phar_path_check.c"
yy12:
yych = *++YYCURSOR;
goto yy11;
yy13:
#line 157 "ext/phar/phar_path_check.c"
yy14:
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= 0x9F) goto yy13;
if (yych <= 0xBF) goto yy34;
goto yy13;
yy15:
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= 0x7F) goto yy13;
if (yych <= 0xBF) goto yy33;
goto yy13;
yy16:
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= 0x7F) goto yy13;
if (yych <= 0x9F) goto yy32;
goto yy13;
yy17:
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= 0x7F) goto yy13;
if (yych <= 0xBF) goto yy31;
goto yy13;
yy18:
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= 0x8F) goto yy13;
if (yych <= 0xBF) goto yy29;
goto yy13;
yy19:
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= 0x7F) goto yy13;
if (yych <= 0xBF) goto yy27;
goto yy13;
yy20:
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= 0x7F) goto yy13;
if (yych <= 0x8F) goto yy24;
goto yy13;
yy21:
++YYCURSOR;
#line 80 "ext/phar/phar_path_check.re"
#line 91 "ext/phar/phar_path_check.re"
{
if (**s == '/') {
(*s)++;
@@ -137,49 +212,93 @@ yy13:
*error = NULL;
return pcr_is_ok;
}
#line 141 "ext/phar/phar_path_check.c"
yy15:
#line 216 "ext/phar/phar_path_check.c"
yy23:
yych = *++YYCURSOR;
goto yy3;
yy16:
goto yy13;
yy24:
yych = *++YYCURSOR;
if (yych <= 0x00) goto yy21;
if (yych <= '-') goto yy17;
if (yych <= '.') goto yy20;
if (yych <= '/') goto yy21;
yy17:
YYCURSOR = YYMARKER;
goto yy3;
yy18:
if (yych <= 0x7F) goto yy2;
if (yych >= 0xC0) goto yy2;
yych = *++YYCURSOR;
if (yych <= 0x7F) goto yy2;
if (yych >= 0xC0) goto yy2;
yy26:
yych = *++YYCURSOR;
goto yy4;
yy27:
yych = *++YYCURSOR;
if (yych <= 0x7F) goto yy2;
if (yych >= 0xC0) goto yy2;
yych = *++YYCURSOR;
if (yych <= 0x7F) goto yy2;
if (yych <= 0xBF) goto yy26;
goto yy2;
yy29:
yych = *++YYCURSOR;
if (yych <= 0x7F) goto yy2;
if (yych >= 0xC0) goto yy2;
yych = *++YYCURSOR;
if (yych <= 0x7F) goto yy2;
if (yych <= 0xBF) goto yy26;
goto yy2;
yy31:
yych = *++YYCURSOR;
if (yych <= 0x7F) goto yy2;
if (yych <= 0xBF) goto yy26;
goto yy2;
yy32:
yych = *++YYCURSOR;
if (yych <= 0x7F) goto yy2;
if (yych <= 0xBF) goto yy26;
goto yy2;
yy33:
yych = *++YYCURSOR;
if (yych <= 0x7F) goto yy2;
if (yych <= 0xBF) goto yy26;
goto yy2;
yy34:
yych = *++YYCURSOR;
if (yych <= 0x7F) goto yy2;
if (yych <= 0xBF) goto yy26;
goto yy2;
yy35:
yych = *++YYCURSOR;
if (yych <= 0x00) goto yy39;
if (yych <= '-') goto yy2;
if (yych <= '.') goto yy38;
if (yych <= '/') goto yy39;
goto yy2;
yy36:
++YYCURSOR;
#line 48 "ext/phar/phar_path_check.re"
#line 60 "ext/phar/phar_path_check.re"
{
*error = "double slash";
return pcr_err_double_slash;
}
#line 161 "ext/phar/phar_path_check.c"
yy20:
#line 280 "ext/phar/phar_path_check.c"
yy38:
yych = *++YYCURSOR;
if (yych <= 0x00) goto yy23;
if (yych == '/') goto yy23;
goto yy17;
yy21:
if (yych <= 0x00) goto yy41;
if (yych == '/') goto yy41;
goto yy2;
yy39:
++YYCURSOR;
#line 56 "ext/phar/phar_path_check.re"
#line 68 "ext/phar/phar_path_check.re"
{
*error = "current directory reference";
return pcr_err_curr_dir;
}
#line 174 "ext/phar/phar_path_check.c"
yy23:
#line 293 "ext/phar/phar_path_check.c"
yy41:
++YYCURSOR;
#line 52 "ext/phar/phar_path_check.re"
#line 64 "ext/phar/phar_path_check.re"
{
*error = "upper directory reference";
return pcr_err_up_dir;
}
#line 182 "ext/phar/phar_path_check.c"
#line 301 "ext/phar/phar_path_check.c"
}
#line 96 "ext/phar/phar_path_check.re"
#line 108 "ext/phar/phar_path_check.re"
}
+18 -6
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| phar php single-file executable PHP extension |
+----------------------------------------------------------------------+
| Copyright (c) 2007-2013 The PHP Group |
| Copyright (c) 2007-2014 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -42,7 +42,19 @@ phar_path_check_result phar_path_check(char **s, int *len, const char **error)
loop:
/*!re2c
END = "\x00";
ILL = [\x01-\x19\x80-\xFF];
UTF8T = [\x80-\xBF] ;
UTF8_1 = [\x1A-\x7F] ;
UTF8_2 = [\xC2-\xDF] UTF8T ;
UTF8_3A = "\xE0" [\xA0-\xBF] UTF8T ;
UTF8_3B = [\xE1-\xEC] UTF8T{2} ;
UTF8_3C = "\xED" [\x80-\x9F] UTF8T ;
UTF8_3D = [\xEE-\xEF] UTF8T{2} ;
UTF8_3 = UTF8_3A | UTF8_3B | UTF8_3C | UTF8_3D ;
UTF8_4A = "\xF0"[\x90-\xBF] UTF8T{2} ;
UTF8_4B = [\xF1-\xF3] UTF8T{3} ;
UTF8_4C = "\xF4" [\x80-\x8F] UTF8T{2} ;
UTF8_4 = UTF8_4A | UTF8_4B | UTF8_4C ;
UTF8 = UTF8_1 | UTF8_2 | UTF8_3 | UTF8_4 ;
EOS = "/" | END;
ANY = .;
"//" {
@@ -73,9 +85,8 @@ ANY = .;
*error = NULL;
return pcr_use_query;
}
ILL {
*error ="illegal character";
return pcr_err_illegal_char;
UTF8 {
goto loop;
}
END {
if (**s == '/') {
@@ -91,7 +102,8 @@ END {
return pcr_is_ok;
}
ANY {
goto loop;
*error ="illegal character";
return pcr_err_illegal_char;
}
*/
}
+7 -1
View File
@@ -9,8 +9,13 @@ phar.require_hash=1
<?php
file_put_contents('phar://' . dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php/a.php',
'brand new!');
"brand new!\n");
include 'phar://' . dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php/a.php';
$fileName = "ChineseFile\xE5\x84\xB7\xE9\xBB\x91.php";
file_put_contents('phar://' . dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php/$fileName.php',
'Text in utf8 file.');
include 'phar://' . dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php/$fileName.php';
?>
===DONE===
@@ -18,4 +23,5 @@ include 'phar://' . dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.pha
<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
--EXPECT--
brand new!
Text in utf8 file.
===DONE===
+29 -6
View File
@@ -22,15 +22,28 @@ var_dump(file_get_contents($pname . '/b.php'));
function error_handler($errno, $errmsg)
{
echo "Error: $errmsg\n";
echo "Error: $errmsg";
}
set_error_handler('error_handler');
$checks = array('/', '.', '../', 'a/..', 'a/', 'b//a.php');
$count = 0;
$checks = array(
'/', '.', '../', 'a/..', 'a/', 'b//a.php',
"Font\xE5\x84\xB7\xE9\xBB\x91pro.ttf", //two valid multi-byte characters
"\xF0\x9F\x98\x8D.ttf", // valid 4 byte char - smiling face with heart-shaped eyes
"Font\xE9\xBBpro.ttf", //Invalid multi-byte character - missing last byte
"Font\xBB\x91pro.ttf", //Invalid multi-byte character - missing first byte
"Font\xC0\xAFpro.ttf", //Invalid multi-byte character - invalid first byte
"Font\xF0\x80\x90\x90pro.ttf", //Invalid multi-byte character - surrogate pair code point
"\xFC\x81\x81\x81\x81pro.ttf", //RFC 3629 limited char points to 0000-10FFFF aka 5 byte utf-8 not valid
);
foreach($checks as $check)
{
$count++;
echo "$count:";
file_put_contents($pname . '/' . $check, "error");
echo "\n";
}
$phar = new Phar($fname);
@@ -54,9 +67,19 @@ foreach($checks as $check)
--EXPECTF--
string(5) "query"
string(5) "query"
Error: file_put_contents(phar://%s//): failed to open stream: phar error: file "" in phar "%s" cannot be empty
Error: file_put_contents(phar://%s/.): failed to open stream: phar error: file "" in phar "%s" cannot be empty
Error: file_put_contents(phar://%s/../): failed to open stream: phar error: file "" in phar "%s" cannot be empty
Error: file_put_contents(phar://%s/a/..): failed to open stream: phar error: file "" in phar "%s" cannot be empty
1:Error: file_put_contents(phar://%s//): failed to open stream: phar error: file "" in phar "%s" cannot be empty
2:Error: file_put_contents(phar://%s/.): failed to open stream: phar error: file "" in phar "%s" cannot be empty
3:Error: file_put_contents(phar://%s/../): failed to open stream: phar error: file "" in phar "%s" cannot be empty
4:Error: file_put_contents(phar://%s/a/..): failed to open stream: phar error: file "" in phar "%s" cannot be empty
5:
6:
7:
8:
9:Error: file_put_contents(phar:///%s): failed to open stream: phar error: invalid path "%s" contains illegal character
10:Error: file_put_contents(phar:///%s): failed to open stream: phar error: invalid path "%s" contains illegal character
11:Error: file_put_contents(phar:///%s): failed to open stream: phar error: invalid path "%s" contains illegal character
12:Error: file_put_contents(phar:///%s): failed to open stream: phar error: invalid path "%s" contains illegal character
13:Error: file_put_contents(phar:///%s): failed to open stream: phar error: invalid path "%s" contains illegal character
Exception: Entry a does not exist and cannot be created: phar error: invalid path "a" contains illegal character
===DONE===
+1
View File
@@ -2,6 +2,7 @@
setting hash_function to sha512 and hash_bits_per_character > 4 should not crash
--SKIPIF--
<?php include('skipif.inc'); ?>
<?php if (!extension_loaded('hash')) die('skip hash extension not available'); ?>
--INI--
session.use_cookies=0
session.cache_limiter=
@@ -3,6 +3,7 @@ Test session_set_save_handler() : incomplete implementation
--INI--
session.save_handler=files
session.name=PHPSESSID
session.gc_probability=0
--SKIPIF--
<?php include('skipif.inc'); ?>
--FILE--
@@ -3,6 +3,7 @@ Test session_set_save_handler() : incorrect arguments for existing handler open
--INI--
session.save_handler=files
session.name=PHPSESSID
session.gc_probability=0
--SKIPIF--
<?php include('skipif.inc'); ?>
--FILE--
+9 -3
View File
@@ -1269,6 +1269,9 @@ SXE_METHOD(xpath)
}
if (!sxe->node) {
php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, xmlDocGetRootElement((xmlDocPtr) sxe->document->ptr), NULL TSRMLS_CC);
if (!sxe->node) {
RETURN_FALSE;
}
}
nodeptr = php_sxe_get_first_node(sxe, sxe->node->node TSRMLS_CC);
@@ -1533,15 +1536,18 @@ SXE_METHOD(getDocNamespaces)
return;
}
array_init(return_value);
sxe = php_sxe_fetch_object(getThis() TSRMLS_CC);
if(from_root){
node = xmlDocGetRootElement((xmlDocPtr)sxe->document->ptr);
}else{
GET_NODE(sxe, node);
}
if (node == NULL) {
RETURN_FALSE;
}
array_init(return_value);
sxe_add_registered_namespaces(sxe, node, recursive, return_value TSRMLS_CC);
}
/* }}} */
@@ -0,0 +1,9 @@
--TEST--
Testing getDocNamespaces() with invalid XML
--FILE--
<?php
$xml = @new SimpleXMLElement("X",1);
var_dump($xml->getDocNamespaces());
?>
--EXPECTF--
bool(false)
@@ -0,0 +1,8 @@
--TEST--
Testing xpath() with invalid XML
--FILE--
<?php
$xml = @simplexml_load_string("XXXXXXX^",$x,0x6000000000000001);
var_dump($xml->xpath("BBBB"));
--EXPECT--
bool(false)
+1 -1
View File
@@ -4,4 +4,4 @@ code in the file spl.php or in the corresponding .inc file in the examples
subdirectory. Based on the internal implementations or the files in the
examples subdirectory there are also some .php files to experiment with.
For more information look at: http://php.net/~helly/php/ext/spl
For more information look at: http://php.net/manual/en/book.spl.php
-3
View File
@@ -145,9 +145,6 @@
* - Debug session 2 <a href="http://talks.somabo.de/200509_toronto_iterator_debug_session_1.pps">[pps]</a>, <a href="http://talks.somabo.de/200509_toronto_iterator_debug_session_1.pdf">[pdf]</a>, <a href="http://taks.somabo.de/200411_php_conference_frankfrurt_iterator_debug_session.swf">[swf]</a>
* - Debug session 3 <a href="http://talks.somabo.de/200509_toronto_iterator_debug_session_2.pps">[pps]</a>, <a href="http://talks.somabo.de/200509_toronto_iterator_debug_session_2.pdf">[pdf]</a>
*
* You can download this documentation as a chm file
* <a href="http://php.net/~helly/php/ext/spl/spl.chm">here</a>.
*
* (c) Marcus Boerger, 2003 - 2007
*/
+1 -1
View File
@@ -116,7 +116,7 @@ static void spl_fixedarray_resize(spl_fixedarray *array, long size TSRMLS_DC) /*
array->elements = NULL;
}
} else if (size > array->size) {
array->elements = erealloc(array->elements, sizeof(zval *) * size);
array->elements = safe_erealloc(array->elements, size, sizeof(zval *), 0);
memset(array->elements + array->size, '\0', sizeof(zval *) * (size - array->size));
} else { /* size < array->size */
long i;
+13
View File
@@ -0,0 +1,13 @@
--TEST--
Bug #67247 (spl_fixedarray_resize integer overflow)
--FILE--
<?php
$ar = new SplFixedArray(1);
echo "size: ".$ar->getSize()."\n";
$ar->setSize((PHP_INT_SIZE==8)?0x2000000000000001:0x40000001);
echo "size: ".$ar->getSize()."\n";
?>
--EXPECTF--
size: 1
Fatal error: Possible integer overflow in memory allocation (%d * %d + 0) in %s on line %d
+1 -1
View File
@@ -1657,7 +1657,7 @@ PHPAPI int php_copy_file_ctx(char *src, char *dest, int src_flg, php_stream_cont
return FAILURE;
}
switch (php_stream_stat_path_ex(dest, PHP_STREAM_URL_STAT_QUIET, &dest_s, ctx)) {
switch (php_stream_stat_path_ex(dest, PHP_STREAM_URL_STAT_QUIET | PHP_STREAM_URL_STAT_NOCACHE, &dest_s, ctx)) {
case -1:
/* non-statable stream */
goto safe_to_copy;
+3
View File
@@ -329,6 +329,9 @@ PHP_FUNCTION(iptcparse)
recnum = buffer[ inx++ ];
if (buffer[ inx ] & (unsigned char) 0x80) { /* long tag */
if((inx+6) >= str_len) {
break;
}
len = (((long) buffer[ inx + 2 ]) << 24) + (((long) buffer[ inx + 3 ]) << 16) +
(((long) buffer[ inx + 4 ]) << 8) + (((long) buffer[ inx + 5 ]));
inx += 6;
+1
View File
@@ -27,6 +27,7 @@
#include <stdlib.h>
#include "basic_functions.h"
#include "php_lcg.h"
/* System Rand functions */
#ifndef RAND_MAX
-1
View File
@@ -30,7 +30,6 @@
#include "php.h"
#include "php_math.h"
#include "php_rand.h"
#include "php_lcg.h"
#include "basic_functions.h"
+30
View File
@@ -0,0 +1,30 @@
--TEST--
Test for bug #65701: copy() doesn't work when destination filename is created by tempnam()
--CREDITS--
Boro Sitnikovski <buritomath@yahoo.com>
--FILE--
<?php
$file_path = dirname(__FILE__) . "/bug65701/";
mkdir($file_path);
$src = $file_path . '/srcbug65701_file.txt';
$dst = tempnam($file_path, 'dstbug65701_file.txt');
file_put_contents($src, "Hello World");
copy($src, $dst);
var_dump(filesize($dst));
?>
--CLEAN--
<?php
$file_path = dirname(__FILE__) . "/bug65701/";
foreach (scandir($file_path) as $file) {
if (strpos($file, "bug65701") !== false) {
unlink($file_path . $file);
}
}
rmdir($file_path);
?>
--EXPECT--
int(11)
+8
View File
@@ -0,0 +1,8 @@
--TEST--
Bug #67250 (iptcparse out-of-bounds read)
--FILE--
<?php
var_dump(iptcparse("\x1C\x02_\x80___"));
?>
--EXPECT--
bool(false)
+5 -3
View File
@@ -156,9 +156,11 @@ object(TestNAOld)#%d (0) {
}
===NANew===
unserializer(TestNANew)
TestNew::__wakeup()
object(TestNANew)#%d (0) {
}
Warning: Erroneous data format for unserializing 'TestNANew' in %s005.php on line %d
Notice: unserialize(): Error at offset 19 of 20 bytes in %s005.php on line %d
bool(false)
===NANew2===
unserializer(TestNANew2)
TestNew::unserialize()
@@ -0,0 +1,12 @@
--TEST--
Bug #67072 Echoing unserialized "SplFileObject" crash
--FILE--
<?php
echo unserialize('O:13:"SplFileObject":1:{s:9:"*filename";s:15:"/home/flag/flag";}');
?>
===DONE==
--EXPECTF--
Warning: Erroneous data format for unserializing 'SplFileObject' in %sbug67072.php on line %d
Notice: unserialize(): Error at offset 24 of 64 bytes in %sbug67072.php on line %d
===DONE==
+13
View File
@@ -0,0 +1,13 @@
--TEST--
Bug #67252 (convert_uudecode out-of-bounds read)
--FILE--
<?php
$a = "M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A"."\n"."a.";
var_dump(convert_uudecode($a));
?>
--EXPECTF--
Warning: convert_uudecode(): The given parameter is not a valid uuencoded string in %s on line %d
bool(false)
-40
View File
@@ -1,40 +0,0 @@
--TEST--
Bug #64604 parse_url is inconsistent with specified port
--FILE--
<?php
var_dump(parse_url('//localhost/path'));
var_dump(parse_url('//localhost:80/path'));
var_dump(parse_url('//localhost:/path'));
var_dump(parse_url('http://localhost:80/path'));
?>
--EXPECT--
array(2) {
["host"]=>
string(9) "localhost"
["path"]=>
string(5) "/path"
}
array(3) {
["host"]=>
string(9) "localhost"
["port"]=>
int(80)
["path"]=>
string(5) "/path"
}
array(2) {
["host"]=>
string(9) "localhost"
["path"]=>
string(5) "/path"
}
array(4) {
["scheme"]=>
string(4) "http"
["host"]=>
string(9) "localhost"
["port"]=>
int(80)
["path"]=>
string(5) "/path"
}
@@ -845,6 +845,13 @@ echo "Done";
string(1) "/"
}
--> /rest/Users?filter={"id":"123"}: array(2) {
["path"]=>
string(11) "/rest/Users"
["query"]=>
string(19) "filter={"id":"123"}"
}
--> http:///blah.com: bool(false)
--> http://:80: bool(false)
@@ -110,6 +110,7 @@ echo "Done";
--> http://[x:80]/ : string(4) "http"
--> : NULL
--> / : NULL
--> /rest/Users?filter={"id":"123"} : NULL
--> http:///blah.com : bool(false)
--> http://:80 : bool(false)
--> http://user@:80 : bool(false)
@@ -109,6 +109,7 @@ echo "Done";
--> http://[x:80]/ : string(6) "[x:80]"
--> : NULL
--> / : NULL
--> /rest/Users?filter={"id":"123"} : NULL
--> http:///blah.com : bool(false)
--> http://:80 : bool(false)
--> http://user@:80 : bool(false)
@@ -109,6 +109,7 @@ echo "Done";
--> http://[x:80]/ : NULL
--> : NULL
--> / : NULL
--> /rest/Users?filter={"id":"123"} : NULL
--> http:///blah.com : bool(false)
--> http://:80 : bool(false)
--> http://user@:80 : bool(false)
@@ -109,6 +109,7 @@ echo "Done";
--> http://[x:80]/ : NULL
--> : NULL
--> / : NULL
--> /rest/Users?filter={"id":"123"} : NULL
--> http:///blah.com : bool(false)
--> http://:80 : bool(false)
--> http://user@:80 : bool(false)
@@ -109,6 +109,7 @@ echo "Done";
--> http://[x:80]/ : NULL
--> : NULL
--> / : NULL
--> /rest/Users?filter={"id":"123"} : NULL
--> http:///blah.com : bool(false)
--> http://:80 : bool(false)
--> http://user@:80 : bool(false)
@@ -109,6 +109,7 @@ echo "Done";
--> http://[x:80]/ : string(1) "/"
--> : string(0) ""
--> / : string(1) "/"
--> /rest/Users?filter={"id":"123"} : string(11) "/rest/Users"
--> http:///blah.com : bool(false)
--> http://:80 : bool(false)
--> http://user@:80 : bool(false)
@@ -109,6 +109,7 @@ echo "Done";
--> http://[x:80]/ : NULL
--> : NULL
--> / : NULL
--> /rest/Users?filter={"id":"123"} : string(19) "filter={"id":"123"}"
--> http:///blah.com : bool(false)
--> http://:80 : bool(false)
--> http://user@:80 : bool(false)
@@ -109,6 +109,7 @@ echo "Done";
--> http://[x:80]/ : NULL
--> : NULL
--> / : NULL
--> /rest/Users?filter={"id":"123"} : NULL
--> http:///blah.com : bool(false)
--> http://:80 : bool(false)
--> http://user@:80 : bool(false)
+1
View File
@@ -89,6 +89,7 @@ $urls = array(
'http://[x:80]/',
'',
'/',
'/rest/Users?filter={"id":"123"}',
// Severely malformed URLs that do not parse:
'http:///blah.com',
+4 -4
View File
@@ -181,10 +181,6 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length)
p = e + 1;
pp = p;
if (*s == '/' && *(s+1) == '/') { /* relative-scheme URL */
s += 2;
}
while (pp-p < 6 && isdigit(*pp)) {
pp++;
}
@@ -205,6 +201,10 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length)
STR_FREE(ret->scheme);
efree(ret);
return NULL;
} else if (*s == '/' && *(s+1) == '/') { /* relative-scheme URL */
s += 2;
} else {
goto just_path;
}
} else if (*s == '/' && *(s+1) == '/') { /* relative-scheme URL */
s += 2;
+3
View File
@@ -151,6 +151,9 @@ PHPAPI int php_uudecode(char *src, int src_len, char **dest) /* {{{ */
}
while (s < ee) {
if(s+4 > e) {
goto err;
}
*p++ = PHP_UU_DEC(*s) << 2 | PHP_UU_DEC(*(s + 1)) >> 4;
*p++ = PHP_UU_DEC(*(s + 1)) << 4 | PHP_UU_DEC(*(s + 2)) >> 2;
*p++ = PHP_UU_DEC(*(s + 2)) << 6 | PHP_UU_DEC(*(s + 3));
+45 -33
View File
@@ -1,10 +1,10 @@
/* Generated by re2c 0.13.5 on Mon Jul 29 17:57:26 2013 */
/* Generated by re2c 0.13.5 on Fri Apr 18 15:07:27 2014 */
#line 1 "ext/standard/var_unserializer.re"
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
| Copyright (c) 1997-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -396,7 +396,15 @@ static inline long object_common1(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
(*p) += 2;
object_init_ex(*rval, ce);
if (ce->serialize == NULL) {
object_init_ex(*rval, ce);
} else {
/* If this class implements Serializable, it should not land here but in object_custom(). The passed string
obviously doesn't descend from the regular serializer. */
zend_error(E_WARNING, "Erroneous data format for unserializing '%s'", ce->name);
return 0;
}
return elements;
}
@@ -408,6 +416,10 @@ static inline int object_common2(UNSERIALIZE_PARAMETER, long elements)
zval *retval_ptr = NULL;
zval fname;
if (Z_TYPE_PP(rval) != IS_OBJECT) {
return 0;
}
if (!process_nested_data(UNSERIALIZE_PASSTHRU, Z_OBJPROP_PP(rval), elements, 1)) {
return 0;
}
@@ -457,7 +469,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
#line 461 "ext/standard/var_unserializer.c"
#line 473 "ext/standard/var_unserializer.c"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
@@ -517,9 +529,9 @@ yy2:
yych = *(YYMARKER = ++YYCURSOR);
if (yych == ':') goto yy95;
yy3:
#line 812 "ext/standard/var_unserializer.re"
#line 824 "ext/standard/var_unserializer.re"
{ return 0; }
#line 523 "ext/standard/var_unserializer.c"
#line 535 "ext/standard/var_unserializer.c"
yy4:
yych = *(YYMARKER = ++YYCURSOR);
if (yych == ':') goto yy89;
@@ -562,13 +574,13 @@ yy13:
goto yy3;
yy14:
++YYCURSOR;
#line 806 "ext/standard/var_unserializer.re"
#line 818 "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 572 "ext/standard/var_unserializer.c"
#line 584 "ext/standard/var_unserializer.c"
yy16:
yych = *++YYCURSOR;
goto yy3;
@@ -598,7 +610,7 @@ yy20:
yych = *++YYCURSOR;
if (yych != '"') goto yy18;
++YYCURSOR;
#line 660 "ext/standard/var_unserializer.re"
#line 672 "ext/standard/var_unserializer.re"
{
size_t len, len2, len3, maxlen;
long elements;
@@ -744,7 +756,7 @@ yy20:
return object_common2(UNSERIALIZE_PASSTHRU, elements);
}
#line 748 "ext/standard/var_unserializer.c"
#line 760 "ext/standard/var_unserializer.c"
yy25:
yych = *++YYCURSOR;
if (yych <= ',') {
@@ -769,7 +781,7 @@ yy27:
yych = *++YYCURSOR;
if (yych != '"') goto yy18;
++YYCURSOR;
#line 652 "ext/standard/var_unserializer.re"
#line 664 "ext/standard/var_unserializer.re"
{
INIT_PZVAL(*rval);
@@ -777,7 +789,7 @@ yy27:
return object_common2(UNSERIALIZE_PASSTHRU,
object_common1(UNSERIALIZE_PASSTHRU, ZEND_STANDARD_CLASS_DEF_PTR));
}
#line 781 "ext/standard/var_unserializer.c"
#line 793 "ext/standard/var_unserializer.c"
yy32:
yych = *++YYCURSOR;
if (yych == '+') goto yy33;
@@ -798,7 +810,7 @@ yy34:
yych = *++YYCURSOR;
if (yych != '{') goto yy18;
++YYCURSOR;
#line 632 "ext/standard/var_unserializer.re"
#line 644 "ext/standard/var_unserializer.re"
{
long elements = parse_iv(start + 2);
/* use iv() not uiv() in order to check data range */
@@ -818,7 +830,7 @@ yy34:
return finish_nested_data(UNSERIALIZE_PASSTHRU);
}
#line 822 "ext/standard/var_unserializer.c"
#line 834 "ext/standard/var_unserializer.c"
yy39:
yych = *++YYCURSOR;
if (yych == '+') goto yy40;
@@ -839,7 +851,7 @@ yy41:
yych = *++YYCURSOR;
if (yych != '"') goto yy18;
++YYCURSOR;
#line 603 "ext/standard/var_unserializer.re"
#line 615 "ext/standard/var_unserializer.re"
{
size_t len, maxlen;
char *str;
@@ -868,7 +880,7 @@ yy41:
ZVAL_STRINGL(*rval, str, len, 0);
return 1;
}
#line 872 "ext/standard/var_unserializer.c"
#line 884 "ext/standard/var_unserializer.c"
yy46:
yych = *++YYCURSOR;
if (yych == '+') goto yy47;
@@ -889,7 +901,7 @@ yy48:
yych = *++YYCURSOR;
if (yych != '"') goto yy18;
++YYCURSOR;
#line 575 "ext/standard/var_unserializer.re"
#line 587 "ext/standard/var_unserializer.re"
{
size_t len, maxlen;
char *str;
@@ -917,7 +929,7 @@ yy48:
ZVAL_STRINGL(*rval, str, len, 1);
return 1;
}
#line 921 "ext/standard/var_unserializer.c"
#line 933 "ext/standard/var_unserializer.c"
yy53:
yych = *++YYCURSOR;
if (yych <= '/') {
@@ -1005,7 +1017,7 @@ yy61:
}
yy63:
++YYCURSOR;
#line 565 "ext/standard/var_unserializer.re"
#line 577 "ext/standard/var_unserializer.re"
{
#if SIZEOF_LONG == 4
use_double:
@@ -1015,7 +1027,7 @@ use_double:
ZVAL_DOUBLE(*rval, zend_strtod((const char *)start + 2, NULL));
return 1;
}
#line 1019 "ext/standard/var_unserializer.c"
#line 1031 "ext/standard/var_unserializer.c"
yy65:
yych = *++YYCURSOR;
if (yych <= ',') {
@@ -1074,7 +1086,7 @@ yy73:
yych = *++YYCURSOR;
if (yych != ';') goto yy18;
++YYCURSOR;
#line 550 "ext/standard/var_unserializer.re"
#line 562 "ext/standard/var_unserializer.re"
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -1089,7 +1101,7 @@ yy73:
return 1;
}
#line 1093 "ext/standard/var_unserializer.c"
#line 1105 "ext/standard/var_unserializer.c"
yy76:
yych = *++YYCURSOR;
if (yych == 'N') goto yy73;
@@ -1116,7 +1128,7 @@ yy79:
if (yych <= '9') goto yy79;
if (yych != ';') goto yy18;
++YYCURSOR;
#line 523 "ext/standard/var_unserializer.re"
#line 535 "ext/standard/var_unserializer.re"
{
#if SIZEOF_LONG == 4
int digits = YYCURSOR - start - 3;
@@ -1143,7 +1155,7 @@ yy79:
ZVAL_LONG(*rval, parse_iv(start + 2));
return 1;
}
#line 1147 "ext/standard/var_unserializer.c"
#line 1159 "ext/standard/var_unserializer.c"
yy83:
yych = *++YYCURSOR;
if (yych <= '/') goto yy18;
@@ -1151,24 +1163,24 @@ yy83:
yych = *++YYCURSOR;
if (yych != ';') goto yy18;
++YYCURSOR;
#line 516 "ext/standard/var_unserializer.re"
#line 528 "ext/standard/var_unserializer.re"
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
ZVAL_BOOL(*rval, parse_iv(start + 2));
return 1;
}
#line 1162 "ext/standard/var_unserializer.c"
#line 1174 "ext/standard/var_unserializer.c"
yy87:
++YYCURSOR;
#line 509 "ext/standard/var_unserializer.re"
#line 521 "ext/standard/var_unserializer.re"
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
ZVAL_NULL(*rval);
return 1;
}
#line 1172 "ext/standard/var_unserializer.c"
#line 1184 "ext/standard/var_unserializer.c"
yy89:
yych = *++YYCURSOR;
if (yych <= ',') {
@@ -1191,7 +1203,7 @@ yy91:
if (yych <= '9') goto yy91;
if (yych != ';') goto yy18;
++YYCURSOR;
#line 486 "ext/standard/var_unserializer.re"
#line 498 "ext/standard/var_unserializer.re"
{
long id;
@@ -1214,7 +1226,7 @@ yy91:
return 1;
}
#line 1218 "ext/standard/var_unserializer.c"
#line 1230 "ext/standard/var_unserializer.c"
yy95:
yych = *++YYCURSOR;
if (yych <= ',') {
@@ -1237,7 +1249,7 @@ yy97:
if (yych <= '9') goto yy97;
if (yych != ';') goto yy18;
++YYCURSOR;
#line 465 "ext/standard/var_unserializer.re"
#line 477 "ext/standard/var_unserializer.re"
{
long id;
@@ -1258,9 +1270,9 @@ yy97:
return 1;
}
#line 1262 "ext/standard/var_unserializer.c"
#line 1274 "ext/standard/var_unserializer.c"
}
#line 814 "ext/standard/var_unserializer.re"
#line 826 "ext/standard/var_unserializer.re"
return 0;
+13 -1
View File
@@ -400,7 +400,15 @@ static inline long object_common1(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
(*p) += 2;
object_init_ex(*rval, ce);
if (ce->serialize == NULL) {
object_init_ex(*rval, ce);
} else {
/* If this class implements Serializable, it should not land here but in object_custom(). The passed string
obviously doesn't descend from the regular serializer. */
zend_error(E_WARNING, "Erroneous data format for unserializing '%s'", ce->name);
return 0;
}
return elements;
}
@@ -412,6 +420,10 @@ static inline int object_common2(UNSERIALIZE_PARAMETER, long elements)
zval *retval_ptr = NULL;
zval fname;
if (Z_TYPE_PP(rval) != IS_OBJECT) {
return 0;
}
if (!process_nested_data(UNSERIALIZE_PASSTHRU, Z_OBJPROP_PP(rval), elements, 1)) {
return 0;
}
+1
View File
@@ -377,6 +377,7 @@ END_EXTERN_C()
/* Flags for url_stat method in wrapper ops */
#define PHP_STREAM_URL_STAT_LINK 1
#define PHP_STREAM_URL_STAT_QUIET 2
#define PHP_STREAM_URL_STAT_NOCACHE 4
/* change the blocking mode of stream: value == 1 => blocking, value == 0 => non-blocking. */
#define PHP_STREAM_OPTION_BLOCKING 1
+1 -1
View File
@@ -636,7 +636,7 @@ static zend_bool php_auto_globals_create_request(const char *name, uint name_len
/* {{{ php_hash_environment
*/
int php_hash_environment(TSRMLS_D)
PHPAPI int php_hash_environment(TSRMLS_D)
{
memset(PG(http_globals), 0, sizeof(PG(http_globals)));
zend_activate_auto_globals(TSRMLS_C);
+1 -1
View File
@@ -41,7 +41,7 @@ PHPAPI void php_register_variable(char *var, char *val, zval *track_vars_array T
PHPAPI void php_register_variable_safe(char *var, char *val, int val_len, zval *track_vars_array TSRMLS_DC);
PHPAPI void php_register_variable_ex(char *var, zval *val, zval *track_vars_array TSRMLS_DC);
int php_hash_environment(TSRMLS_D);
PHPAPI int php_hash_environment(TSRMLS_D);
END_EXTERN_C()
#define NUM_TRACK_VARS 6
+3 -3
View File
@@ -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 28
#define PHP_RELEASE_VERSION 29
#define PHP_EXTRA_VERSION "RC1"
#define PHP_VERSION "5.4.28RC1"
#define PHP_VERSION_ID 50428
#define PHP_VERSION "5.4.29RC1"
#define PHP_VERSION_ID 50429
+26 -22
View File
@@ -1929,16 +1929,18 @@ PHPAPI int _php_stream_stat_path(char *path, int flags, php_stream_statbuf *ssb,
char *path_to_open = path;
int ret;
/* Try to hit the cache first */
if (flags & PHP_STREAM_URL_STAT_LINK) {
if (BG(CurrentLStatFile) && strcmp(path, BG(CurrentLStatFile)) == 0) {
memcpy(ssb, &BG(lssb), sizeof(php_stream_statbuf));
return 0;
}
} else {
if (BG(CurrentStatFile) && strcmp(path, BG(CurrentStatFile)) == 0) {
memcpy(ssb, &BG(ssb), sizeof(php_stream_statbuf));
return 0;
if (!(flags & PHP_STREAM_URL_STAT_NOCACHE)) {
/* Try to hit the cache first */
if (flags & PHP_STREAM_URL_STAT_LINK) {
if (BG(CurrentLStatFile) && strcmp(path, BG(CurrentLStatFile)) == 0) {
memcpy(ssb, &BG(lssb), sizeof(php_stream_statbuf));
return 0;
}
} else {
if (BG(CurrentStatFile) && strcmp(path, BG(CurrentStatFile)) == 0) {
memcpy(ssb, &BG(ssb), sizeof(php_stream_statbuf));
return 0;
}
}
}
@@ -1946,19 +1948,21 @@ PHPAPI int _php_stream_stat_path(char *path, int flags, php_stream_statbuf *ssb,
if (wrapper && wrapper->wops->url_stat) {
ret = wrapper->wops->url_stat(wrapper, path_to_open, flags, ssb, context TSRMLS_CC);
if (ret == 0) {
/* Drop into cache */
if (flags & PHP_STREAM_URL_STAT_LINK) {
if (BG(CurrentLStatFile)) {
efree(BG(CurrentLStatFile));
if (!(flags & PHP_STREAM_URL_STAT_NOCACHE)) {
/* Drop into cache */
if (flags & PHP_STREAM_URL_STAT_LINK) {
if (BG(CurrentLStatFile)) {
efree(BG(CurrentLStatFile));
}
BG(CurrentLStatFile) = estrdup(path);
memcpy(&BG(lssb), ssb, sizeof(php_stream_statbuf));
} else {
if (BG(CurrentStatFile)) {
efree(BG(CurrentStatFile));
}
BG(CurrentStatFile) = estrdup(path);
memcpy(&BG(ssb), ssb, sizeof(php_stream_statbuf));
}
BG(CurrentLStatFile) = estrdup(path);
memcpy(&BG(lssb), ssb, sizeof(php_stream_statbuf));
} else {
if (BG(CurrentStatFile)) {
efree(BG(CurrentStatFile));
}
BG(CurrentStatFile) = estrdup(path);
memcpy(&BG(ssb), ssb, sizeof(php_stream_statbuf));
}
}
return ret;
+5 -1
View File
@@ -46,7 +46,7 @@ static struct fpm_event_module_s epoll_module = {
static struct epoll_event *epollfds = NULL;
static int nepollfds = 0;
static int epollfd = 0;
static int epollfd = -1;
#endif /* HAVE_EPOLL */
@@ -103,6 +103,10 @@ static int fpm_event_epoll_clean() /* {{{ */
free(epollfds);
epollfds = NULL;
}
if (epollfd != -1) {
close(epollfd);
epollfd = -1;
}
nepollfds = 0;
+1 -1
View File
@@ -35,7 +35,7 @@ int fpm_unix_resolve_socket_premissions(struct fpm_worker_pool_s *wp) /* {{{ */
/* uninitialized */
wp->socket_uid = -1;
wp->socket_gid = -1;
wp->socket_mode = 0666;
wp->socket_mode = 0660;
if (!c) {
return 0;
+2 -2
View File
@@ -166,10 +166,10 @@ listen = 127.0.0.1:9000
; permissions must be set in order to allow connections from a web server. Many
; BSD-derived systems allow connections regardless of permissions.
; Default Values: user and group are set as the running user
; mode is set to 0666
; mode is set to 0660
;listen.owner = @php_fpm_user@
;listen.group = @php_fpm_group@
;listen.mode = 0666
;listen.mode = 0660
; List of ipv4 addresses of FastCGI clients which are allowed to connect.
; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original