mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-11 11:10:49 +00:00
Compare commits
13
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
643a161a24 | ||
|
|
ba64d2cbdf | ||
|
|
f25ad94494 | ||
|
|
c725b782d9 | ||
|
|
d4b8081d5b | ||
|
|
e91b7cdde8 | ||
|
|
9bc3ca418f | ||
|
|
f94b81ce48 | ||
|
|
678429c028 | ||
|
|
ad2412c169 | ||
|
|
8240cf0fda | ||
|
|
66778cd2f4 | ||
|
|
8feb435bc2 |
No files matched your search
+1
-1
@@ -16,7 +16,7 @@ environment:
|
||||
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
|
||||
PHP_BUILD_OBJ_DIR: c:\obj
|
||||
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.2.0beta5
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.1.9beta1
|
||||
PHP_BUILD_CRT: vc15
|
||||
# ext and env setup for tests
|
||||
#MYSQL_TEST_PASSWD: Password12!
|
||||
|
||||
+5
-17
@@ -1,19 +1,17 @@
|
||||
# https://editorconfig.org/
|
||||
# http://editorconfig.org/
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
tab_width = 4
|
||||
|
||||
[*.{c,h,y,awk,w32,bat,mk,frag,cpp}]
|
||||
[*.{c,h,awk,w32,bat,mk,frag}]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
indent_style = tab
|
||||
tab_width = 4
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.{php,phpt,inc}]
|
||||
[*.{php,phpt}]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
@@ -33,15 +31,5 @@ insert_final_newline = true
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_style = space
|
||||
trim_trailing_whitespace = true
|
||||
trim_trailing_whitespace = false
|
||||
insert_final_newline = true
|
||||
max_line_length = 80
|
||||
|
||||
[COMMIT_EDITMSG]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
max_line_length = 80
|
||||
@@ -1,254 +1,5 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
16 May 2019, PHP 7.2.19RC1
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #77934 (php-fpm kill -USR2 not working). (Jakub Zelenka)
|
||||
. Fixed bug #77921 (static.php.net doesn't work anymore). (Peter Kokot)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #77943 (imageantialias($image, false); does not work). (cmb)
|
||||
|
||||
- JSON:
|
||||
. Fixed bug #77843 (Use after free with json serializer). (Nikita)
|
||||
|
||||
- Opcache:
|
||||
. Fixed possible crashes, because of inconsistent PCRE cache and opcache
|
||||
SHM reset. (Alexey Kalinin, Dmitry)
|
||||
|
||||
- PDO_MySQL:
|
||||
. Fixed bug #77944 (Wrong meta pdo_type for bigint on LLP64). (cmb)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #75186 (Inconsistent reflection of Closure:::__invoke()). (Nikita)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #77911 (Wrong warning for session.sid_bits_per_character). (cmb)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #77024 (SplFileObject::__toString() may return array). (Craig
|
||||
Duncan)
|
||||
|
||||
02 May 2019, PHP 7.2.18
|
||||
|
||||
- CLI:
|
||||
. Fixed bug #77794 (Incorrect Date header format in built-in server).
|
||||
(kelunik)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #77909 (DatePeriod::__construct() with invalid recurrence count
|
||||
value). (Ignace Nyamagana Butera)
|
||||
|
||||
- EXIF
|
||||
. Fixed bug #77950 (Heap-buffer-overflow in _estrndup via exif_process_IFD_TAG).
|
||||
(CVE-2019-11036) (Stas)
|
||||
|
||||
- Interbase:
|
||||
. Fixed bug #72175 (Impossibility of creating multiple connections to
|
||||
Interbase with php 7.x). (Nikita)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #77895 (IntlDateFormatter::create fails in strict mode if $locale
|
||||
= null). (Nikita)
|
||||
|
||||
- litespeed:
|
||||
. LiteSpeed SAPI 7.3.1, better process management, new API function
|
||||
litespeed_finish_request(). (George Wang)
|
||||
|
||||
- Mail
|
||||
. Fixed bug #77821 (Potential heap corruption in TSendMail()). (cmb)
|
||||
|
||||
- PCRE:
|
||||
. Fixed bug #77827 (preg_match does not ignore \r in regex flags). (requinix,
|
||||
cmb)
|
||||
|
||||
- PDO:
|
||||
. Fixed bug #77849 (Disable cloning of PDO handle/connection objects).
|
||||
(camporter)
|
||||
|
||||
- phpdbg:
|
||||
. Fixed bug #76801 (too many open files). (alekitto)
|
||||
. Fixed bug #77800 (phpdbg segfaults on listing some conditional breakpoints).
|
||||
(krakjoe)
|
||||
. Fixed bug #77805 (phpdbg build fails when readline is shared). (krakjoe)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #77772 (ReflectionClass::getMethods(null) doesn't work). (Nikita)
|
||||
. Fixed bug #77882 (Different behavior: always calls destructor). (Nikita)
|
||||
|
||||
- SOAP:
|
||||
. Fixed bug #77945 (Segmentation fault when constructing SoapClient with
|
||||
WSDL_CACHE_BOTH). (Nikita)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #77680 (recursive mkdir on ftp stream wrapper is incorrect).
|
||||
(Vlad Temian)
|
||||
. Fixed bug #77844 (Crash due to null pointer in parse_ini_string with
|
||||
INI_SCANNER_TYPED). (Nikita)
|
||||
. Fixed bug #77853 (Inconsistent substr_compare behaviour with empty
|
||||
haystack). (Nikita)
|
||||
|
||||
04 Apr 2019, PHP 7.2.17
|
||||
|
||||
- Core:
|
||||
. Fixed bug #77738 (Nullptr deref in zend_compile_expr). (Laruence)
|
||||
. Fixed bug #77660 (Segmentation fault on break 2147483648). (Laruence)
|
||||
. Fixed bug #77652 (Anonymous classes can lose their interface information).
|
||||
(Nikita)
|
||||
. Fixed bug #77676 (Unable to run tests when building shared extension on
|
||||
AIX). (Kevin Adler)
|
||||
|
||||
- Bcmath:
|
||||
. Fixed bug #77742 (bcpow() implementation related to gcc compiler
|
||||
optimization). (Nikita)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #77578 (Crash when php unload). (cmb)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #50020 (DateInterval:createDateFromString() silently fails).
|
||||
(Derick)
|
||||
. Fixed bug #75113 (Added DatePeriod::getRecurrences() method). (Ignace
|
||||
Nyamagana Butera)
|
||||
|
||||
- EXIF:
|
||||
. Fixed bug #77753 (Heap-buffer-overflow in php_ifd_get32s). (CVE-2019-11034)
|
||||
(Stas)
|
||||
. Fixed bug #77831 (Heap-buffer-overflow in exif_iif_add_value).
|
||||
(CVE-2019-11035) (Stas)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #77677 (FPM fails to build on AIX due to missing WCOREDUMP).
|
||||
(Kevin Adler)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #77700 (Writing truecolor images as GIF ignores interlace flag).
|
||||
(cmb)
|
||||
|
||||
- MySQLi:
|
||||
. Fixed bug #77597 (mysqli_fetch_field hangs scripts). (Nikita)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #77691 (Opcache passes wrong value for inline array push
|
||||
assignments). (Nikita)
|
||||
. Fixed bug #77743 (Incorrect pi node insertion for jmpznz with identical
|
||||
successors). (Nikita)
|
||||
|
||||
- phpdbg:
|
||||
. Fixed bug #77767 (phpdbg break cmd aliases listed in help do not match
|
||||
actual aliases). (Miriam Lauter)
|
||||
|
||||
- sodium:
|
||||
. Fixed bug #77646 (sign_detached() strings not terminated). (Frank)
|
||||
|
||||
- SQLite3:
|
||||
. Added sqlite3.defensive INI directive. (BohwaZ)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #77664 (Segmentation fault when using undefined constant in
|
||||
custom wrapper). (Laruence)
|
||||
. Fixed bug #77669 (Crash in extract() when overwriting extracted array).
|
||||
(Nikita)
|
||||
. Fixed bug #76717 (var_export() does not create a parsable value for
|
||||
PHP_INT_MIN). (Nikita)
|
||||
. Fixed bug #77765 (FTP stream wrapper should set the directory as
|
||||
executable). (Vlad Temian)
|
||||
|
||||
07 Mar 2019, PHP 7.2.16
|
||||
|
||||
- Core:
|
||||
. Fixed bug #77589 (Core dump using parse_ini_string with numeric sections).
|
||||
(Laruence)
|
||||
. Fixed bug #77630 (rename() across the device may allow unwanted access
|
||||
during processing). (Stas)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #77621 (Already defined constants are not properly reported).
|
||||
(cmb)
|
||||
|
||||
- EXIF:
|
||||
. Fixed bug #77509 (Uninitialized read in exif_process_IFD_in_TIFF). (Stas)
|
||||
. Fixed bug #77540 (Invalid Read on exif_process_SOFn). (Stas)
|
||||
. Fixed bug #77563 (Uninitialized read in exif_process_IFD_in_MAKERNOTE). (Stas)
|
||||
. Fixed bug #77659 (Uninitialized read in exif_process_IFD_in_MAKERNOTE). (Stas)
|
||||
|
||||
- PDO_OCI:
|
||||
. Support Oracle Database tracing attributes ACTION, MODULE,
|
||||
CLIENT_INFO, and CLIENT_IDENTIFIER. (Cameron Porter)
|
||||
|
||||
- PHAR:
|
||||
. Fixed bug #77396 (Null Pointer Dereference in phar_create_or_parse_filename).
|
||||
(bishop)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #51068 (DirectoryIterator glob:// don't support current path
|
||||
relative queries). (Ahmed Abdou)
|
||||
. Fixed bug #77431 (openFile() silently truncates after a null byte). (cmb)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #77552 (Unintialized php_stream_statbuf in stat functions).
|
||||
(John Stevenson)
|
||||
|
||||
- MySQL
|
||||
. Disabled LOCAL INFILE by default, can be enabled using php.ini directive
|
||||
mysqli.allow_local_infile for mysqli, or PDO::MYSQL_ATTR_LOCAL_INFILE
|
||||
attribute for pdo_mysql. (Darek Slusarczyk)
|
||||
|
||||
07 Feb 2019, PHP 7.2.15
|
||||
|
||||
- Core:
|
||||
. Fixed bug #77339 (__callStatic may get incorrect arguments). (Dmitry)
|
||||
. Fixed bug #77494 (Disabling class causes segfault on member access).
|
||||
(Dmitry)
|
||||
. Fixed bug #77530 (PHP crashes when parsing `(2)::class`). (Ekin)
|
||||
|
||||
- Curl:
|
||||
. Fixed bug #76675 (Segfault with H2 server push). (Pedro Magalhães)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #73281 (imagescale(…, IMG_BILINEAR_FIXED) can cause black border).
|
||||
(cmb)
|
||||
. Fixed bug #73614 (gdImageFilledArc() doesn't properly draw pies). (cmb)
|
||||
. Fixed bug #77272 (imagescale() may return image resource on failure). (cmb)
|
||||
. Fixed bug #77391 (1bpp BMPs may fail to be loaded). (Romain Déoux, cmb)
|
||||
. Fixed bug #77479 (imagewbmp() segfaults with very large images). (cmb)
|
||||
|
||||
- ldap:
|
||||
. Fixed bug #77440 (ldap_bind using ldaps or ldap_start_tls()=exception in
|
||||
libcrypto-1_1-x64.dll). (Anatol)
|
||||
|
||||
- Mbstring:
|
||||
. Fixed bug #77454 (mb_scrub() silently truncates after a null byte).
|
||||
(64796c6e69 at gmail dot com)
|
||||
|
||||
- MySQLnd:
|
||||
. Fixed bug #75684 (In mysqlnd_ext_plugin.h the plugin methods family has
|
||||
no external visibility). (Anatol)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #77361 (configure fails on 64-bit AIX when opcache enabled).
|
||||
(Kevin Adler)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #77390 (feof might hang on TLS streams in case of fragmented TLS
|
||||
records). (Abyl Valg, Jakub Zelenka)
|
||||
|
||||
- PDO:
|
||||
. Fixed bug #77273 (array_walk_recursive corrupts value types leading to PDO
|
||||
failure). (Nikita)
|
||||
|
||||
- phpdbg:
|
||||
. Fixed bug #76596 (phpdbg support for display_errors=stderr). (kabel)
|
||||
|
||||
- Sockets:
|
||||
. Fixed bug #76839 (socket_recvfrom may return an invalid 'from' address
|
||||
on MacOS). (Michael Meyer)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #77395 (segfault about array_multisort). (Laruence)
|
||||
. Fixed bug #77439 (parse_str segfaults when inserting item into existing
|
||||
array). (Nikita)
|
||||
|
||||
10 Jan 2019, PHP 7.2.14
|
||||
|
||||
- Core:
|
||||
|
||||
@@ -45,13 +45,6 @@ elseif (PHP_OS == 'FreeBSD') {
|
||||
if ($freeMemory < 2100*1024*1024) {
|
||||
die('skip Not enough memory.');
|
||||
}
|
||||
} elseif (PHP_OS == "WINNT") {
|
||||
$s = trim(shell_exec("wmic OS get FreeVirtualMemory /Value 2>nul"));
|
||||
$freeMemory = explode('=', $s)[1]*1;
|
||||
|
||||
if ($freeMemory < 2.1*1024*1024) {
|
||||
die('skip Not enough memory.');
|
||||
}
|
||||
}
|
||||
?>
|
||||
--INI--
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75426: "Cannot use empty array elements" reports wrong position
|
||||
--FILE--
|
||||
<?php
|
||||
$a = [
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
,
|
||||
5,
|
||||
6,
|
||||
];
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot use empty array elements in arrays in %s on line 5
|
||||
@@ -1,33 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77339 (__callStatic may get incorrect arguments)
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo
|
||||
{
|
||||
static function __callStatic($name, $arguments) {
|
||||
if ($name === 'get') {
|
||||
if (!isset($arguments[0])) {
|
||||
var_dump(['getSomeWhat']);
|
||||
var_dump($arguments);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
echo "OK\n";
|
||||
}
|
||||
|
||||
protected function get ($key) {
|
||||
echo "BUG!!!\n";
|
||||
}
|
||||
}
|
||||
|
||||
class Bar
|
||||
{
|
||||
static function __callStatic($name, $arguments) {
|
||||
echo Foo::get('getSomeWhat');
|
||||
}
|
||||
}
|
||||
|
||||
Bar::someUndefinedStaticFunction();
|
||||
?>
|
||||
--EXPECT--
|
||||
OK
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77494 (Disabling class causes segfault on member access)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl")) exit("skip curl extension not loaded"); ?>
|
||||
--INI--
|
||||
disable_classes=CURLFile
|
||||
--FILE--
|
||||
<?php
|
||||
$a = new CURLFile();
|
||||
var_dump($a->name);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: CURLFile() has been disabled for security reasons in %sbug77494.php on line 2
|
||||
|
||||
Notice: Undefined property: CURLFile::$name in %sbug77494.php on line 3
|
||||
NULL
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77530: PHP crashes when parsing '(2)::class'
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
echo (2)::class;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Illegal class name in %s on line %d
|
||||
@@ -1,40 +0,0 @@
|
||||
--TEST--
|
||||
BUG #77589 (Core dump using parse_ini_string with numeric sections)
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(
|
||||
parse_ini_string(<<<INI
|
||||
[0]
|
||||
a = 1
|
||||
b = on
|
||||
c = true
|
||||
|
||||
["true"]
|
||||
a = 100
|
||||
b = null
|
||||
c = yes
|
||||
INI
|
||||
, TRUE, INI_SCANNER_TYPED));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
["a"]=>
|
||||
int(1)
|
||||
["b"]=>
|
||||
bool(true)
|
||||
["c"]=>
|
||||
bool(true)
|
||||
}
|
||||
["true"]=>
|
||||
array(3) {
|
||||
["a"]=>
|
||||
int(100)
|
||||
["b"]=>
|
||||
NULL
|
||||
["c"]=>
|
||||
bool(true)
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
<?php
|
||||
return [
|
||||
'I' => function() {
|
||||
return new class implements I {};
|
||||
},
|
||||
];
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77652: Anonymous classes can lose their interface information
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
interface I {}
|
||||
require __DIR__ . '/bug77652.inc';
|
||||
$data = require __DIR__ . '/bug77652.inc';
|
||||
print_r(class_implements($data['I']()));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Array
|
||||
(
|
||||
[I] => I
|
||||
)
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77660 (Segmentation fault on break 2147483648)
|
||||
--SKIPIF--
|
||||
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
for(;;) break 2147483648;
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot 'break' 2147483648 levels in %sbug77660.php on line %d
|
||||
@@ -1,8 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77738 (Nullptr deref in zend_compile_expr)
|
||||
--FILE--
|
||||
<?php
|
||||
__COMPILER_HALT_OFFSET__;
|
||||
; // <- important
|
||||
--EXPECTF--
|
||||
Warning: Use of undefined constant __COMPILER_HALT_OFFSET__ - assumed '__COMPILER_HALT_OFFSET__' %sbug77738.php on line %d
|
||||
@@ -1,7 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77993 (Wrong parse error for invalid hex literal on Windows)
|
||||
--FILE--
|
||||
<?php
|
||||
0xg10;
|
||||
--EXPECTF--
|
||||
Parse error: syntax error, unexpected 'xg10' (T_STRING) in %s on line %d
|
||||
@@ -1,30 +0,0 @@
|
||||
--TEST--
|
||||
Calling exception getters when properties hold references
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class MyException extends Exception {
|
||||
public function __construct(&$refMsg, &$refCode, &$refFile, &$refLine) {
|
||||
$this->message =& $refMsg;
|
||||
$this->code =& $refCode;
|
||||
$this->file =& $refFile;
|
||||
$this->line =& $refLine;
|
||||
}
|
||||
}
|
||||
|
||||
$refMsg = "foo";
|
||||
$refCode = 0;
|
||||
$refFile = "foobar";
|
||||
$refLine = 42;
|
||||
$ex = new MyException($refMsg, $refCode, $refFile, $refLine);
|
||||
var_dump($ex->getMessage());
|
||||
var_dump($ex->getCode());
|
||||
var_dump($ex->getFile());
|
||||
var_dump($ex->getLine());
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "foo"
|
||||
int(0)
|
||||
string(6) "foobar"
|
||||
int(42)
|
||||
@@ -1,14 +0,0 @@
|
||||
--TEST--
|
||||
Bug object gc not working in shutdown
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set('memory_limit', '2M');
|
||||
register_shutdown_function(function () {
|
||||
for ($n = 1000 * 1000; $n--;) {
|
||||
new stdClass;
|
||||
}
|
||||
echo "OK\n";
|
||||
});
|
||||
?>
|
||||
--EXPECT--
|
||||
OK
|
||||
@@ -1,23 +0,0 @@
|
||||
--TEST--
|
||||
Use of self::class inside a constant in an unknown scope
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Test {
|
||||
public function foobar() {
|
||||
eval("
|
||||
const FOO = self::class;
|
||||
var_dump(FOO);
|
||||
");
|
||||
}
|
||||
}
|
||||
(new Test)->foobar();
|
||||
|
||||
// This should error, but doesn't
|
||||
const BAR = self::class;
|
||||
var_dump(BAR);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(4) "Test"
|
||||
string(0) ""
|
||||
@@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
The parent class is not necessarily the class of the prototype
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
function test(): B {}
|
||||
}
|
||||
class B extends A {}
|
||||
class C extends B {
|
||||
function test(): parent {}
|
||||
}
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -930,6 +930,10 @@ void zend_shutdown(void) /* {{{ */
|
||||
GLOBAL_CONSTANTS_TABLE = NULL;
|
||||
#endif
|
||||
zend_destroy_rsrc_list_dtors();
|
||||
|
||||
#ifndef ZTS
|
||||
zend_interned_strings_dtor();
|
||||
#endif
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
@@ -2855,17 +2855,6 @@ static zend_object *display_disabled_class(zend_class_entry *class_type) /* {{{
|
||||
zend_object *intern;
|
||||
|
||||
intern = zend_objects_new(class_type);
|
||||
|
||||
/* Initialize default properties */
|
||||
if (EXPECTED(class_type->default_properties_count != 0)) {
|
||||
zval *p = intern->properties_table;
|
||||
zval *end = p + class_type->default_properties_count;
|
||||
do {
|
||||
ZVAL_UNDEF(p);
|
||||
p++;
|
||||
} while (p != end);
|
||||
}
|
||||
|
||||
zend_error(E_WARNING, "%s() has been disabled for security reasons", ZSTR_VAL(class_type->name));
|
||||
return intern;
|
||||
}
|
||||
|
||||
+7
-8
@@ -193,7 +193,9 @@ typedef struct _zend_mm_free_slot zend_mm_free_slot;
|
||||
typedef struct _zend_mm_chunk zend_mm_chunk;
|
||||
typedef struct _zend_mm_huge_list zend_mm_huge_list;
|
||||
|
||||
#ifdef MAP_HUGETLB
|
||||
int zend_mm_use_huge_pages = 0;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Memory is retrived from OS by chunks of fixed size 2MB.
|
||||
@@ -710,9 +712,7 @@ static void *zend_mm_chunk_alloc_int(size_t size, size_t alignment)
|
||||
return NULL;
|
||||
} else if (ZEND_MM_ALIGNED_OFFSET(ptr, alignment) == 0) {
|
||||
#ifdef MADV_HUGEPAGE
|
||||
if (zend_mm_use_huge_pages) {
|
||||
madvise(ptr, size, MADV_HUGEPAGE);
|
||||
}
|
||||
madvise(ptr, size, MADV_HUGEPAGE);
|
||||
#endif
|
||||
return ptr;
|
||||
} else {
|
||||
@@ -743,9 +743,7 @@ static void *zend_mm_chunk_alloc_int(size_t size, size_t alignment)
|
||||
zend_mm_munmap((char*)ptr + size, alignment - REAL_PAGE_SIZE);
|
||||
}
|
||||
# ifdef MADV_HUGEPAGE
|
||||
if (zend_mm_use_huge_pages) {
|
||||
madvise(ptr, size, MADV_HUGEPAGE);
|
||||
}
|
||||
madvise(ptr, size, MADV_HUGEPAGE);
|
||||
# endif
|
||||
#endif
|
||||
return ptr;
|
||||
@@ -2602,9 +2600,8 @@ ZEND_API void shutdown_memory_manager(int silent, int full_shutdown)
|
||||
|
||||
static void alloc_globals_ctor(zend_alloc_globals *alloc_globals)
|
||||
{
|
||||
char *tmp;
|
||||
#if ZEND_MM_CUSTOM
|
||||
tmp = getenv("USE_ZEND_ALLOC");
|
||||
char *tmp = getenv("USE_ZEND_ALLOC");
|
||||
|
||||
if (tmp && !zend_atoi(tmp, 0)) {
|
||||
alloc_globals->mm_heap = malloc(sizeof(zend_mm_heap));
|
||||
@@ -2616,10 +2613,12 @@ static void alloc_globals_ctor(zend_alloc_globals *alloc_globals)
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifdef MAP_HUGETLB
|
||||
tmp = getenv("USE_ZEND_ALLOC_HUGE_PAGES");
|
||||
if (tmp && zend_atoi(tmp, 0)) {
|
||||
zend_mm_use_huge_pages = 1;
|
||||
}
|
||||
#endif
|
||||
ZEND_TSRMLS_CACHE_UPDATE();
|
||||
alloc_globals->mm_heap = zend_mm_init();
|
||||
}
|
||||
|
||||
+18
-66
@@ -1494,7 +1494,6 @@ static void zend_ensure_valid_class_fetch_type(uint32_t fetch_type) /* {{{ */
|
||||
static zend_bool zend_try_compile_const_expr_resolve_class_name(zval *zv, zend_ast *class_ast, zend_ast *name_ast, zend_bool constant) /* {{{ */
|
||||
{
|
||||
uint32_t fetch_type;
|
||||
zval *class_name;
|
||||
|
||||
if (name_ast->kind != ZEND_AST_ZVAL) {
|
||||
return 0;
|
||||
@@ -1509,18 +1508,12 @@ static zend_bool zend_try_compile_const_expr_resolve_class_name(zval *zv, zend_a
|
||||
"Dynamic class names are not allowed in compile-time ::class fetch");
|
||||
}
|
||||
|
||||
class_name = zend_ast_get_zval(class_ast);
|
||||
|
||||
if (Z_TYPE_P(class_name) != IS_STRING) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Illegal class name");
|
||||
}
|
||||
|
||||
fetch_type = zend_get_class_fetch_type(Z_STR_P(class_name));
|
||||
fetch_type = zend_get_class_fetch_type(zend_ast_get_str(class_ast));
|
||||
zend_ensure_valid_class_fetch_type(fetch_type);
|
||||
|
||||
switch (fetch_type) {
|
||||
case ZEND_FETCH_CLASS_SELF:
|
||||
if (CG(active_class_entry) && zend_is_scope_known()) {
|
||||
if (constant || (CG(active_class_entry) && zend_is_scope_known())) {
|
||||
ZVAL_STR_COPY(zv, CG(active_class_entry)->name);
|
||||
} else {
|
||||
ZVAL_NULL(zv);
|
||||
@@ -3630,7 +3623,7 @@ int zend_compile_func_cuf(znode *result, zend_ast_list *args, zend_string *lcnam
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static void zend_compile_assert(znode *result, zend_ast_list *args, zend_string *name, zend_function *fbc) /* {{{ */
|
||||
static int zend_compile_assert(znode *result, zend_ast_list *args, zend_string *name, zend_function *fbc) /* {{{ */
|
||||
{
|
||||
if (EG(assertions) >= 0) {
|
||||
znode name_node;
|
||||
@@ -3673,6 +3666,8 @@ static void zend_compile_assert(znode *result, zend_ast_list *args, zend_string
|
||||
result->op_type = IS_CONST;
|
||||
ZVAL_TRUE(&result->u.constant);
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -3880,6 +3875,10 @@ int zend_try_compile_special_func(znode *result, zend_string *lcname, zend_ast_l
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
if (zend_string_equals_literal(lcname, "assert")) {
|
||||
return zend_compile_assert(result, args, lcname, fbc);
|
||||
}
|
||||
|
||||
if (CG(compiler_options) & ZEND_COMPILE_NO_BUILTINS) {
|
||||
return FAILURE;
|
||||
}
|
||||
@@ -3982,16 +3981,8 @@ void zend_compile_call(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
|
||||
zend_op *opline;
|
||||
|
||||
lcname = zend_string_tolower(Z_STR_P(name));
|
||||
|
||||
fbc = zend_hash_find_ptr(CG(function_table), lcname);
|
||||
|
||||
/* Special assert() handling should apply independently of compiler flags. */
|
||||
if (fbc && zend_string_equals_literal(lcname, "assert")) {
|
||||
zend_compile_assert(result, zend_ast_get_list(args_ast), lcname, fbc);
|
||||
zend_string_release(lcname);
|
||||
zval_ptr_dtor(&name_node.u.constant);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!fbc
|
||||
|| (fbc->type == ZEND_INTERNAL_FUNCTION && (CG(compiler_options) & ZEND_COMPILE_IGNORE_INTERNAL_FUNCTIONS))
|
||||
|| (fbc->type == ZEND_USER_FUNCTION && (CG(compiler_options) & ZEND_COMPILE_IGNORE_USER_FUNCTIONS))
|
||||
@@ -4136,14 +4127,6 @@ void zend_compile_static_call(znode *result, zend_ast *ast, uint32_t type) /* {{
|
||||
if (ce) {
|
||||
zend_string *lcname = Z_STR_P(CT_CONSTANT(opline->op2) + 1);
|
||||
fbc = zend_hash_find_ptr(&ce->function_table, lcname);
|
||||
if (fbc && !(fbc->common.fn_flags & ZEND_ACC_PUBLIC)) {
|
||||
if (ce != CG(active_class_entry)
|
||||
&&((fbc->common.fn_flags & ZEND_ACC_PRIVATE)
|
||||
|| !zend_check_protected(zend_get_function_root_class(fbc), CG(active_class_entry)))) {
|
||||
/* incompatibe function */
|
||||
fbc = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4508,7 +4491,7 @@ void zend_compile_break_continue(zend_ast *ast) /* {{{ */
|
||||
zend_ast *depth_ast = ast->child[0];
|
||||
|
||||
zend_op *opline;
|
||||
zend_long depth;
|
||||
int depth;
|
||||
|
||||
ZEND_ASSERT(ast->kind == ZEND_AST_BREAK || ast->kind == ZEND_AST_CONTINUE);
|
||||
|
||||
@@ -4535,7 +4518,7 @@ void zend_compile_break_continue(zend_ast *ast) /* {{{ */
|
||||
ast->kind == ZEND_AST_BREAK ? "break" : "continue");
|
||||
} else {
|
||||
if (!zend_handle_loops_and_finally_ex(depth, NULL)) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Cannot '%s' " ZEND_LONG_FMT " level%s",
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Cannot '%s' %d level%s",
|
||||
ast->kind == ZEND_AST_BREAK ? "break" : "continue",
|
||||
depth, depth == 1 ? "" : "s");
|
||||
}
|
||||
@@ -4916,10 +4899,6 @@ static zend_uchar determine_switch_jumptable_type(zend_ast_list *cases) {
|
||||
}
|
||||
|
||||
static zend_bool should_use_jumptable(zend_ast_list *cases, zend_uchar jumptable_type) {
|
||||
if (CG(compiler_options) & ZEND_COMPILE_NO_JUMPTABLES) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Thresholds are chosen based on when the average switch time for equidistributed
|
||||
* input becomes smaller when using the jumptable optimization. */
|
||||
if (jumptable_type == IS_LONG) {
|
||||
@@ -6365,32 +6344,10 @@ void zend_compile_class_decl(zend_ast *ast) /* {{{ */
|
||||
if (!zend_hash_exists(CG(class_table), lcname)) {
|
||||
zend_hash_add_ptr(CG(class_table), lcname, ce);
|
||||
} else {
|
||||
/* This anonymous class has been included, reuse the existing definition.
|
||||
* NB: This behavior is buggy, and this should always result in a separate
|
||||
* class declaration. However, until the problem of RTD key collisions is
|
||||
* solved, this gives a behavior close to what is expected. */
|
||||
/* this anonymous class has been included */
|
||||
zval zv;
|
||||
ZVAL_PTR(&zv, ce);
|
||||
destroy_zend_class(&zv);
|
||||
ce = zend_hash_find_ptr(CG(class_table), lcname);
|
||||
|
||||
/* Manually replicate emission of necessary inheritance opcodes here. We cannot
|
||||
* reuse the general code, as we only want to emit the opcodes, without modifying
|
||||
* the reused class definition. */
|
||||
if (ce->ce_flags & ZEND_ACC_IMPLEMENT_TRAITS) {
|
||||
zend_emit_op(NULL, ZEND_BIND_TRAITS, &declare_node, NULL);
|
||||
}
|
||||
if (implements_ast) {
|
||||
zend_ast_list *iface_list = zend_ast_get_list(implements_ast);
|
||||
uint32_t i;
|
||||
for (i = 0; i < iface_list->children; i++) {
|
||||
opline = zend_emit_op(NULL, ZEND_ADD_INTERFACE, &declare_node, NULL);
|
||||
opline->op2_type = IS_CONST;
|
||||
opline->op2.constant = zend_add_class_name_literal(CG(active_op_array),
|
||||
zend_resolve_class_name_ast(iface_list->child[i]));
|
||||
}
|
||||
zend_emit_op(NULL, ZEND_VERIFY_ABSTRACT_CLASS, &declare_node, NULL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
@@ -6955,7 +6912,6 @@ static inline void zend_ct_eval_greater(zval *result, zend_ast_kind kind, zval *
|
||||
static zend_bool zend_try_ct_eval_array(zval *result, zend_ast *ast) /* {{{ */
|
||||
{
|
||||
zend_ast_list *list = zend_ast_get_list(ast);
|
||||
zend_ast *last_elem_ast = NULL;
|
||||
uint32_t i;
|
||||
zend_bool is_constant = 1;
|
||||
|
||||
@@ -6968,10 +6924,6 @@ static zend_bool zend_try_ct_eval_array(zval *result, zend_ast *ast) /* {{{ */
|
||||
zend_ast *elem_ast = list->child[i];
|
||||
|
||||
if (elem_ast == NULL) {
|
||||
/* Report error at line of last non-empty element */
|
||||
if (last_elem_ast) {
|
||||
CG(zend_lineno) = zend_ast_get_lineno(last_elem_ast);
|
||||
}
|
||||
zend_error(E_COMPILE_ERROR, "Cannot use empty array elements in arrays");
|
||||
}
|
||||
|
||||
@@ -6983,8 +6935,6 @@ static zend_bool zend_try_ct_eval_array(zval *result, zend_ast *ast) /* {{{ */
|
||||
) {
|
||||
is_constant = 0;
|
||||
}
|
||||
|
||||
last_elem_ast = elem_ast;
|
||||
}
|
||||
|
||||
if (!is_constant) {
|
||||
@@ -7673,11 +7623,11 @@ void zend_compile_const(znode *result, zend_ast *ast) /* {{{ */
|
||||
if (zend_string_equals_literal(resolved_name, "__COMPILER_HALT_OFFSET__") || (name_ast->attr != ZEND_NAME_RELATIVE && zend_string_equals_literal(orig_name, "__COMPILER_HALT_OFFSET__"))) {
|
||||
zend_ast *last = CG(ast);
|
||||
|
||||
while (last && last->kind == ZEND_AST_STMT_LIST) {
|
||||
while (last->kind == ZEND_AST_STMT_LIST) {
|
||||
zend_ast_list *list = zend_ast_get_list(last);
|
||||
last = list->child[list->children-1];
|
||||
}
|
||||
if (last && last->kind == ZEND_AST_HALT_COMPILER) {
|
||||
if (last->kind == ZEND_AST_HALT_COMPILER) {
|
||||
result->op_type = IS_CONST;
|
||||
ZVAL_LONG(&result->u.constant, Z_LVAL_P(zend_ast_get_zval(last->child[0])));
|
||||
zend_string_release(resolved_name);
|
||||
@@ -8044,7 +7994,9 @@ void zend_compile_const_expr_magic_const(zend_ast **ast_ptr) /* {{{ */
|
||||
zend_ast *ast = *ast_ptr;
|
||||
|
||||
/* Other cases already resolved by constant folding */
|
||||
ZEND_ASSERT(ast->attr == T_CLASS_C);
|
||||
ZEND_ASSERT(ast->attr == T_CLASS_C &&
|
||||
CG(active_class_entry) &&
|
||||
(CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT) != 0);
|
||||
|
||||
{
|
||||
zval const_zv;
|
||||
|
||||
@@ -1040,9 +1040,6 @@ END_EXTERN_C()
|
||||
/* disable builtin special case function calls */
|
||||
#define ZEND_COMPILE_NO_BUILTINS (1<<10)
|
||||
|
||||
/* disable jumptable optimization for switch statements */
|
||||
#define ZEND_COMPILE_NO_JUMPTABLES (1<<11)
|
||||
|
||||
/* The default value for CG(compiler_options) */
|
||||
#define ZEND_COMPILE_DEFAULT ZEND_COMPILE_HANDLE_OP_ARRAY
|
||||
|
||||
|
||||
@@ -341,9 +341,7 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
|
||||
ret_constant = NULL;
|
||||
} else {
|
||||
if (!zend_verify_const_access(c, scope)) {
|
||||
if ((flags & ZEND_FETCH_CLASS_SILENT) == 0) {
|
||||
zend_throw_error(NULL, "Cannot access %s const %s::%s", zend_visibility_string(Z_ACCESS_FLAGS(c->value)), ZSTR_VAL(class_name), ZSTR_VAL(constant_name));
|
||||
}
|
||||
zend_throw_error(NULL, "Cannot access %s const %s::%s", zend_visibility_string(Z_ACCESS_FLAGS(c->value)), ZSTR_VAL(class_name), ZSTR_VAL(constant_name));
|
||||
goto failure;
|
||||
}
|
||||
ret_constant = &c->value;
|
||||
|
||||
+12
-24
@@ -401,13 +401,11 @@ ZEND_METHOD(error_exception, __construct)
|
||||
Get the file in which the exception occurred */
|
||||
ZEND_METHOD(exception, getFile)
|
||||
{
|
||||
zval *prop, rv;
|
||||
zval rv;
|
||||
|
||||
DEFAULT_0_PARAMS;
|
||||
|
||||
prop = GET_PROPERTY(getThis(), ZEND_STR_FILE);
|
||||
ZVAL_DEREF(prop);
|
||||
ZVAL_COPY(return_value, prop);
|
||||
ZVAL_COPY(return_value, GET_PROPERTY(getThis(), ZEND_STR_FILE));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -415,13 +413,11 @@ ZEND_METHOD(exception, getFile)
|
||||
Get the line in which the exception occurred */
|
||||
ZEND_METHOD(exception, getLine)
|
||||
{
|
||||
zval *prop, rv;
|
||||
zval rv;
|
||||
|
||||
DEFAULT_0_PARAMS;
|
||||
|
||||
prop = GET_PROPERTY(getThis(), ZEND_STR_LINE);
|
||||
ZVAL_DEREF(prop);
|
||||
ZVAL_COPY(return_value, prop);
|
||||
ZVAL_COPY(return_value, GET_PROPERTY(getThis(), ZEND_STR_LINE));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -429,13 +425,11 @@ ZEND_METHOD(exception, getLine)
|
||||
Get the exception message */
|
||||
ZEND_METHOD(exception, getMessage)
|
||||
{
|
||||
zval *prop, rv;
|
||||
zval rv;
|
||||
|
||||
DEFAULT_0_PARAMS;
|
||||
|
||||
prop = GET_PROPERTY(getThis(), ZEND_STR_MESSAGE);
|
||||
ZVAL_DEREF(prop);
|
||||
ZVAL_COPY(return_value, prop);
|
||||
ZVAL_COPY(return_value, GET_PROPERTY(getThis(), ZEND_STR_MESSAGE));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -443,13 +437,11 @@ ZEND_METHOD(exception, getMessage)
|
||||
Get the exception code */
|
||||
ZEND_METHOD(exception, getCode)
|
||||
{
|
||||
zval *prop, rv;
|
||||
zval rv;
|
||||
|
||||
DEFAULT_0_PARAMS;
|
||||
|
||||
prop = GET_PROPERTY(getThis(), ZEND_STR_CODE);
|
||||
ZVAL_DEREF(prop);
|
||||
ZVAL_COPY(return_value, prop);
|
||||
ZVAL_COPY(return_value, GET_PROPERTY(getThis(), ZEND_STR_CODE));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -457,13 +449,11 @@ ZEND_METHOD(exception, getCode)
|
||||
Get the stack trace for the location in which the exception occurred */
|
||||
ZEND_METHOD(exception, getTrace)
|
||||
{
|
||||
zval *prop, rv;
|
||||
zval rv;
|
||||
|
||||
DEFAULT_0_PARAMS;
|
||||
|
||||
prop = GET_PROPERTY(getThis(), ZEND_STR_TRACE);
|
||||
ZVAL_DEREF(prop);
|
||||
ZVAL_COPY(return_value, prop);
|
||||
ZVAL_COPY(return_value, GET_PROPERTY(getThis(), ZEND_STR_TRACE));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -471,13 +461,11 @@ ZEND_METHOD(exception, getTrace)
|
||||
Get the exception severity */
|
||||
ZEND_METHOD(error_exception, getSeverity)
|
||||
{
|
||||
zval *prop, rv;
|
||||
zval rv;
|
||||
|
||||
DEFAULT_0_PARAMS;
|
||||
|
||||
prop = GET_PROPERTY(getThis(), ZEND_STR_SEVERITY);
|
||||
ZVAL_DEREF(prop);
|
||||
ZVAL_COPY(return_value, prop);
|
||||
ZVAL_COPY(return_value, GET_PROPERTY(getThis(), ZEND_STR_SEVERITY));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
+2
-3
@@ -230,9 +230,8 @@ struct _zend_executor_globals {
|
||||
void *reserved[ZEND_MAX_RESERVED_RESOURCES];
|
||||
};
|
||||
|
||||
#define EG_FLAGS_INITIAL (0)
|
||||
#define EG_FLAGS_IN_SHUTDOWN (1<<0)
|
||||
#define EG_FLAGS_OBJECT_STORE_NO_REUSE (1<<1)
|
||||
#define EG_FLAGS_INITIAL 0x00
|
||||
#define EG_FLAGS_IN_SHUTDOWN 0x01
|
||||
|
||||
struct _zend_ini_scanner_globals {
|
||||
zend_file_handle *yy_in;
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ static void _zend_is_inconsistent(const HashTable *ht, const char *file, int lin
|
||||
zend_output_debug_string(1, "%s(%d) : ht=%p is inconsistent", file, line, ht);
|
||||
break;
|
||||
}
|
||||
ZEND_ASSERT(0);
|
||||
zend_bailout();
|
||||
}
|
||||
#define IS_CONSISTENT(a) _zend_is_inconsistent(a, __FILE__, __LINE__);
|
||||
#define SET_INCONSISTENT(n) do { \
|
||||
|
||||
@@ -193,8 +193,8 @@ static int zend_do_perform_type_hint_check(const zend_function *fe, zend_arg_inf
|
||||
fe_class_name = ZEND_TYPE_NAME(fe_arg_info->type);
|
||||
class_name = ZSTR_VAL(fe_class_name);
|
||||
class_name_len = ZSTR_LEN(fe_class_name);
|
||||
if (class_name_len == sizeof("parent")-1 && !strcasecmp(class_name, "parent") && fe->common.scope && fe->common.scope->parent) {
|
||||
fe_class_name = zend_string_copy(fe->common.scope->parent->name);
|
||||
if (class_name_len == sizeof("parent")-1 && !strcasecmp(class_name, "parent") && proto->common.scope) {
|
||||
fe_class_name = zend_string_copy(proto->common.scope->name);
|
||||
} else if (class_name_len == sizeof("self")-1 && !strcasecmp(class_name, "self") && fe->common.scope) {
|
||||
fe_class_name = zend_string_copy(fe->common.scope->name);
|
||||
} else {
|
||||
|
||||
+16
-18
@@ -48,22 +48,6 @@ int ini_parse(void);
|
||||
|
||||
#define ZEND_SYSTEM_INI CG(ini_parser_unbuffered_errors)
|
||||
|
||||
static int get_int_val(zval *op) {
|
||||
switch (Z_TYPE_P(op)) {
|
||||
case IS_LONG:
|
||||
return Z_LVAL_P(op);
|
||||
case IS_DOUBLE:
|
||||
return (int)Z_DVAL_P(op);
|
||||
case IS_STRING:
|
||||
{
|
||||
int val = atoi(Z_STRVAL_P(op));
|
||||
zend_string_free(Z_STR_P(op));
|
||||
return val;
|
||||
}
|
||||
EMPTY_SWITCH_DEFAULT_CASE()
|
||||
}
|
||||
}
|
||||
|
||||
/* {{{ zend_ini_do_op()
|
||||
*/
|
||||
static void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2)
|
||||
@@ -73,8 +57,22 @@ static void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2)
|
||||
int str_len;
|
||||
char str_result[MAX_LENGTH_OF_LONG+1];
|
||||
|
||||
i_op1 = get_int_val(op1);
|
||||
i_op2 = op2 ? get_int_val(op2) : 0;
|
||||
if (IS_LONG == Z_TYPE_P(op1)) {
|
||||
i_op1 = Z_LVAL_P(op1);
|
||||
} else {
|
||||
i_op1 = atoi(Z_STRVAL_P(op1));
|
||||
zend_string_free(Z_STR_P(op1));
|
||||
}
|
||||
if (op2) {
|
||||
if (IS_LONG == Z_TYPE_P(op2)) {
|
||||
i_op2 = Z_LVAL_P(op2);
|
||||
} else {
|
||||
i_op2 = atoi(Z_STRVAL_P(op2));
|
||||
zend_string_free(Z_STR_P(op2));
|
||||
}
|
||||
} else {
|
||||
i_op2 = 0;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case '|':
|
||||
|
||||
+123
-124
@@ -144,14 +144,13 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
|
||||
ZVAL_NEW_STR(retval, zend_string_init(str, len, ZEND_SYSTEM_INI))
|
||||
|
||||
|
||||
#define RETURN_TOKEN(type, str, len) { \
|
||||
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_TYPED && \
|
||||
(YYSTATE == STATE(ST_VALUE) || YYSTATE == STATE(ST_RAW))) {\
|
||||
zend_ini_copy_typed_value(ini_lval, type, str, len); \
|
||||
} else { \
|
||||
zend_ini_copy_value(ini_lval, str, len); \
|
||||
} \
|
||||
return type; \
|
||||
#define RETURN_TOKEN(type, str, len) { \
|
||||
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_TYPED) { \
|
||||
zend_ini_copy_typed_value(ini_lval, type, str, len); \
|
||||
} else { \
|
||||
zend_ini_copy_value(ini_lval, str, len); \
|
||||
} \
|
||||
return type; \
|
||||
}
|
||||
|
||||
static inline int convert_to_number(zval *retval, const char *str, const int str_len)
|
||||
@@ -384,7 +383,7 @@ restart:
|
||||
}
|
||||
}
|
||||
|
||||
#line 388 "Zend/zend_ini_scanner.c"
|
||||
#line 387 "Zend/zend_ini_scanner.c"
|
||||
{
|
||||
YYCTYPE yych;
|
||||
unsigned int yyaccept = 0;
|
||||
@@ -506,7 +505,7 @@ yy4:
|
||||
yy5:
|
||||
YYDEBUG(5, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 484 "Zend/zend_ini_scanner.l"
|
||||
#line 483 "Zend/zend_ini_scanner.l"
|
||||
{ /* Get option name */
|
||||
/* Eat leading whitespace */
|
||||
EAT_LEADING_WHITESPACE();
|
||||
@@ -516,7 +515,7 @@ yy5:
|
||||
|
||||
RETURN_TOKEN(TC_LABEL, yytext, yyleng);
|
||||
}
|
||||
#line 520 "Zend/zend_ini_scanner.c"
|
||||
#line 519 "Zend/zend_ini_scanner.c"
|
||||
yy6:
|
||||
YYDEBUG(6, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -540,24 +539,24 @@ yy6:
|
||||
yy8:
|
||||
YYDEBUG(8, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 637 "Zend/zend_ini_scanner.l"
|
||||
#line 636 "Zend/zend_ini_scanner.l"
|
||||
{
|
||||
/* eat whitespace */
|
||||
goto restart;
|
||||
}
|
||||
#line 549 "Zend/zend_ini_scanner.c"
|
||||
#line 548 "Zend/zend_ini_scanner.c"
|
||||
yy9:
|
||||
YYDEBUG(9, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
yy10:
|
||||
YYDEBUG(10, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 642 "Zend/zend_ini_scanner.l"
|
||||
#line 641 "Zend/zend_ini_scanner.l"
|
||||
{
|
||||
SCNG(lineno)++;
|
||||
return END_OF_LINE;
|
||||
}
|
||||
#line 561 "Zend/zend_ini_scanner.c"
|
||||
#line 560 "Zend/zend_ini_scanner.c"
|
||||
yy11:
|
||||
YYDEBUG(11, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -618,11 +617,11 @@ yy14:
|
||||
++YYCURSOR;
|
||||
YYDEBUG(15, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 565 "Zend/zend_ini_scanner.l"
|
||||
#line 564 "Zend/zend_ini_scanner.l"
|
||||
{ /* Disallow these chars outside option values */
|
||||
return yytext[0];
|
||||
}
|
||||
#line 626 "Zend/zend_ini_scanner.c"
|
||||
#line 625 "Zend/zend_ini_scanner.c"
|
||||
yy16:
|
||||
YYDEBUG(16, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -630,11 +629,11 @@ yy16:
|
||||
goto yy32;
|
||||
YYDEBUG(17, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 658 "Zend/zend_ini_scanner.l"
|
||||
#line 657 "Zend/zend_ini_scanner.l"
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#line 638 "Zend/zend_ini_scanner.c"
|
||||
#line 637 "Zend/zend_ini_scanner.c"
|
||||
yy18:
|
||||
YYDEBUG(18, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -645,7 +644,7 @@ yy18:
|
||||
if (yych == ' ') goto yy18;
|
||||
YYDEBUG(20, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 494 "Zend/zend_ini_scanner.l"
|
||||
#line 493 "Zend/zend_ini_scanner.l"
|
||||
{ /* Start option value */
|
||||
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW) {
|
||||
BEGIN(ST_RAW);
|
||||
@@ -654,7 +653,7 @@ yy18:
|
||||
}
|
||||
return '=';
|
||||
}
|
||||
#line 658 "Zend/zend_ini_scanner.c"
|
||||
#line 657 "Zend/zend_ini_scanner.c"
|
||||
yy21:
|
||||
YYDEBUG(21, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -710,7 +709,7 @@ yy26:
|
||||
++YYCURSOR;
|
||||
YYDEBUG(27, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 409 "Zend/zend_ini_scanner.l"
|
||||
#line 408 "Zend/zend_ini_scanner.l"
|
||||
{ /* Section start */
|
||||
/* Enter section data lookup state */
|
||||
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW) {
|
||||
@@ -720,7 +719,7 @@ yy26:
|
||||
}
|
||||
return TC_SECTION;
|
||||
}
|
||||
#line 724 "Zend/zend_ini_scanner.c"
|
||||
#line 723 "Zend/zend_ini_scanner.c"
|
||||
yy28:
|
||||
YYDEBUG(28, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -731,7 +730,7 @@ yy28:
|
||||
if (yych == ' ') goto yy28;
|
||||
YYDEBUG(30, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 434 "Zend/zend_ini_scanner.l"
|
||||
#line 433 "Zend/zend_ini_scanner.l"
|
||||
{ /* Start of option with offset */
|
||||
/* Eat leading whitespace */
|
||||
EAT_LEADING_WHITESPACE();
|
||||
@@ -744,7 +743,7 @@ yy28:
|
||||
|
||||
RETURN_TOKEN(TC_OFFSET, yytext, yyleng);
|
||||
}
|
||||
#line 748 "Zend/zend_ini_scanner.c"
|
||||
#line 747 "Zend/zend_ini_scanner.c"
|
||||
yy31:
|
||||
YYDEBUG(31, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -762,13 +761,13 @@ yy33:
|
||||
yy34:
|
||||
YYDEBUG(34, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 647 "Zend/zend_ini_scanner.l"
|
||||
#line 646 "Zend/zend_ini_scanner.l"
|
||||
{ /* Comment */
|
||||
BEGIN(INITIAL);
|
||||
SCNG(lineno)++;
|
||||
return END_OF_LINE;
|
||||
}
|
||||
#line 772 "Zend/zend_ini_scanner.c"
|
||||
#line 771 "Zend/zend_ini_scanner.c"
|
||||
yy35:
|
||||
YYDEBUG(35, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -823,11 +822,11 @@ yy37:
|
||||
yy38:
|
||||
YYDEBUG(38, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 476 "Zend/zend_ini_scanner.l"
|
||||
#line 475 "Zend/zend_ini_scanner.l"
|
||||
{ /* FALSE value (when used outside option value/offset this causes parse error!)*/
|
||||
RETURN_TOKEN(BOOL_FALSE, "", 0);
|
||||
}
|
||||
#line 831 "Zend/zend_ini_scanner.c"
|
||||
#line 830 "Zend/zend_ini_scanner.c"
|
||||
yy39:
|
||||
YYDEBUG(39, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -884,11 +883,11 @@ yy41:
|
||||
yy43:
|
||||
YYDEBUG(43, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 472 "Zend/zend_ini_scanner.l"
|
||||
#line 471 "Zend/zend_ini_scanner.l"
|
||||
{ /* TRUE value (when used outside option value/offset this causes parse error!) */
|
||||
RETURN_TOKEN(BOOL_TRUE, "1", 1);
|
||||
}
|
||||
#line 892 "Zend/zend_ini_scanner.c"
|
||||
#line 891 "Zend/zend_ini_scanner.c"
|
||||
yy44:
|
||||
YYDEBUG(44, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -1035,11 +1034,11 @@ yy56:
|
||||
yy58:
|
||||
YYDEBUG(58, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 480 "Zend/zend_ini_scanner.l"
|
||||
#line 479 "Zend/zend_ini_scanner.l"
|
||||
{
|
||||
RETURN_TOKEN(NULL_NULL, "", 0);
|
||||
}
|
||||
#line 1043 "Zend/zend_ini_scanner.c"
|
||||
#line 1042 "Zend/zend_ini_scanner.c"
|
||||
yy59:
|
||||
YYDEBUG(59, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -1097,7 +1096,7 @@ yyc_ST_DOUBLE_QUOTES:
|
||||
yy64:
|
||||
YYDEBUG(64, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 597 "Zend/zend_ini_scanner.l"
|
||||
#line 596 "Zend/zend_ini_scanner.l"
|
||||
{ /* Escape double quoted string contents */
|
||||
if (YYCURSOR > YYLIMIT) {
|
||||
return 0;
|
||||
@@ -1133,7 +1132,7 @@ yy64:
|
||||
zend_ini_escape_string(ini_lval, yytext, yyleng, '"');
|
||||
return TC_QUOTED_STRING;
|
||||
}
|
||||
#line 1137 "Zend/zend_ini_scanner.c"
|
||||
#line 1136 "Zend/zend_ini_scanner.c"
|
||||
yy65:
|
||||
YYDEBUG(65, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -1145,12 +1144,12 @@ yy65:
|
||||
}
|
||||
YYDEBUG(67, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 592 "Zend/zend_ini_scanner.l"
|
||||
#line 591 "Zend/zend_ini_scanner.l"
|
||||
{ /* Double quoted '"' string ends */
|
||||
yy_pop_state();
|
||||
return '"';
|
||||
}
|
||||
#line 1154 "Zend/zend_ini_scanner.c"
|
||||
#line 1153 "Zend/zend_ini_scanner.c"
|
||||
yy68:
|
||||
YYDEBUG(68, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -1159,12 +1158,12 @@ yy68:
|
||||
++YYCURSOR;
|
||||
YYDEBUG(70, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 452 "Zend/zend_ini_scanner.l"
|
||||
#line 451 "Zend/zend_ini_scanner.l"
|
||||
{ /* Variable start */
|
||||
yy_push_state(ST_VARNAME);
|
||||
return TC_DOLLAR_CURLY;
|
||||
}
|
||||
#line 1168 "Zend/zend_ini_scanner.c"
|
||||
#line 1167 "Zend/zend_ini_scanner.c"
|
||||
}
|
||||
/* *********************************** */
|
||||
yyc_ST_OFFSET:
|
||||
@@ -1264,11 +1263,11 @@ yy74:
|
||||
yy75:
|
||||
YYDEBUG(75, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 583 "Zend/zend_ini_scanner.l"
|
||||
#line 582 "Zend/zend_ini_scanner.l"
|
||||
{ /* Get rest as section/offset value */
|
||||
RETURN_TOKEN(TC_STRING, yytext, yyleng);
|
||||
}
|
||||
#line 1272 "Zend/zend_ini_scanner.c"
|
||||
#line 1271 "Zend/zend_ini_scanner.c"
|
||||
yy76:
|
||||
YYDEBUG(76, *YYCURSOR);
|
||||
yyaccept = 0;
|
||||
@@ -1308,22 +1307,22 @@ yy78:
|
||||
yy79:
|
||||
YYDEBUG(79, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 658 "Zend/zend_ini_scanner.l"
|
||||
#line 657 "Zend/zend_ini_scanner.l"
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#line 1316 "Zend/zend_ini_scanner.c"
|
||||
#line 1315 "Zend/zend_ini_scanner.c"
|
||||
yy80:
|
||||
YYDEBUG(80, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(81, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 587 "Zend/zend_ini_scanner.l"
|
||||
#line 586 "Zend/zend_ini_scanner.l"
|
||||
{ /* Double quoted '"' string start */
|
||||
yy_push_state(ST_DOUBLE_QUOTES);
|
||||
return '"';
|
||||
}
|
||||
#line 1327 "Zend/zend_ini_scanner.c"
|
||||
#line 1326 "Zend/zend_ini_scanner.c"
|
||||
yy82:
|
||||
YYDEBUG(82, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -1389,11 +1388,11 @@ yy85:
|
||||
yy87:
|
||||
YYDEBUG(87, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 561 "Zend/zend_ini_scanner.l"
|
||||
#line 560 "Zend/zend_ini_scanner.l"
|
||||
{ /* Get number option value as string */
|
||||
RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
|
||||
}
|
||||
#line 1397 "Zend/zend_ini_scanner.c"
|
||||
#line 1396 "Zend/zend_ini_scanner.c"
|
||||
yy88:
|
||||
YYDEBUG(88, *YYCURSOR);
|
||||
yyaccept = 3;
|
||||
@@ -1426,11 +1425,11 @@ yy88:
|
||||
yy90:
|
||||
YYDEBUG(90, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 557 "Zend/zend_ini_scanner.l"
|
||||
#line 556 "Zend/zend_ini_scanner.l"
|
||||
{ /* Get constant option value */
|
||||
RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
|
||||
}
|
||||
#line 1434 "Zend/zend_ini_scanner.c"
|
||||
#line 1433 "Zend/zend_ini_scanner.c"
|
||||
yy91:
|
||||
YYDEBUG(91, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -1440,12 +1439,12 @@ yy92:
|
||||
++YYCURSOR;
|
||||
YYDEBUG(93, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 447 "Zend/zend_ini_scanner.l"
|
||||
#line 446 "Zend/zend_ini_scanner.l"
|
||||
{ /* End of section or an option offset */
|
||||
BEGIN(INITIAL);
|
||||
return ']';
|
||||
}
|
||||
#line 1449 "Zend/zend_ini_scanner.c"
|
||||
#line 1448 "Zend/zend_ini_scanner.c"
|
||||
yy94:
|
||||
YYDEBUG(94, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -1495,12 +1494,12 @@ yy99:
|
||||
++YYCURSOR;
|
||||
YYDEBUG(100, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 452 "Zend/zend_ini_scanner.l"
|
||||
#line 451 "Zend/zend_ini_scanner.l"
|
||||
{ /* Variable start */
|
||||
yy_push_state(ST_VARNAME);
|
||||
return TC_DOLLAR_CURLY;
|
||||
}
|
||||
#line 1504 "Zend/zend_ini_scanner.c"
|
||||
#line 1503 "Zend/zend_ini_scanner.c"
|
||||
yy101:
|
||||
YYDEBUG(101, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -1554,7 +1553,7 @@ yy105:
|
||||
++YYCURSOR;
|
||||
YYDEBUG(106, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 419 "Zend/zend_ini_scanner.l"
|
||||
#line 418 "Zend/zend_ini_scanner.l"
|
||||
{ /* Raw string */
|
||||
/* Eat leading and trailing single quotes */
|
||||
if (yytext[0] == '\'' && yytext[yyleng - 1] == '\'') {
|
||||
@@ -1563,7 +1562,7 @@ yy105:
|
||||
}
|
||||
RETURN_TOKEN(TC_RAW, yytext, yyleng);
|
||||
}
|
||||
#line 1567 "Zend/zend_ini_scanner.c"
|
||||
#line 1566 "Zend/zend_ini_scanner.c"
|
||||
}
|
||||
/* *********************************** */
|
||||
yyc_ST_RAW:
|
||||
@@ -1627,19 +1626,19 @@ yyc_ST_RAW:
|
||||
++YYCURSOR;
|
||||
YYDEBUG(110, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 653 "Zend/zend_ini_scanner.l"
|
||||
#line 652 "Zend/zend_ini_scanner.l"
|
||||
{ /* End of option value (if EOF is reached before EOL */
|
||||
BEGIN(INITIAL);
|
||||
return END_OF_LINE;
|
||||
}
|
||||
#line 1636 "Zend/zend_ini_scanner.c"
|
||||
#line 1635 "Zend/zend_ini_scanner.c"
|
||||
yy111:
|
||||
YYDEBUG(111, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
yy112:
|
||||
YYDEBUG(112, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 503 "Zend/zend_ini_scanner.l"
|
||||
#line 502 "Zend/zend_ini_scanner.l"
|
||||
{ /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
|
||||
unsigned char *sc = NULL;
|
||||
EAT_LEADING_WHITESPACE();
|
||||
@@ -1683,7 +1682,7 @@ end_raw_value_chars:
|
||||
|
||||
RETURN_TOKEN(TC_RAW, yytext, yyleng);
|
||||
}
|
||||
#line 1687 "Zend/zend_ini_scanner.c"
|
||||
#line 1686 "Zend/zend_ini_scanner.c"
|
||||
yy113:
|
||||
YYDEBUG(113, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -1707,13 +1706,13 @@ yy114:
|
||||
yy115:
|
||||
YYDEBUG(115, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 551 "Zend/zend_ini_scanner.l"
|
||||
#line 550 "Zend/zend_ini_scanner.l"
|
||||
{ /* End of option value */
|
||||
BEGIN(INITIAL);
|
||||
SCNG(lineno)++;
|
||||
return END_OF_LINE;
|
||||
}
|
||||
#line 1717 "Zend/zend_ini_scanner.c"
|
||||
#line 1716 "Zend/zend_ini_scanner.c"
|
||||
yy116:
|
||||
YYDEBUG(116, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -1743,12 +1742,12 @@ yy119:
|
||||
yy120:
|
||||
YYDEBUG(120, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 637 "Zend/zend_ini_scanner.l"
|
||||
#line 636 "Zend/zend_ini_scanner.l"
|
||||
{
|
||||
/* eat whitespace */
|
||||
goto restart;
|
||||
}
|
||||
#line 1752 "Zend/zend_ini_scanner.c"
|
||||
#line 1751 "Zend/zend_ini_scanner.c"
|
||||
yy121:
|
||||
YYDEBUG(121, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -1766,13 +1765,13 @@ yy123:
|
||||
yy124:
|
||||
YYDEBUG(124, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 647 "Zend/zend_ini_scanner.l"
|
||||
#line 646 "Zend/zend_ini_scanner.l"
|
||||
{ /* Comment */
|
||||
BEGIN(INITIAL);
|
||||
SCNG(lineno)++;
|
||||
return END_OF_LINE;
|
||||
}
|
||||
#line 1776 "Zend/zend_ini_scanner.c"
|
||||
#line 1775 "Zend/zend_ini_scanner.c"
|
||||
yy125:
|
||||
YYDEBUG(125, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -1835,21 +1834,21 @@ yy128:
|
||||
}
|
||||
YYDEBUG(130, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 547 "Zend/zend_ini_scanner.l"
|
||||
#line 546 "Zend/zend_ini_scanner.l"
|
||||
{ /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
|
||||
RETURN_TOKEN(TC_RAW, yytext, yyleng);
|
||||
}
|
||||
#line 1843 "Zend/zend_ini_scanner.c"
|
||||
#line 1842 "Zend/zend_ini_scanner.c"
|
||||
yy131:
|
||||
YYDEBUG(131, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(132, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 658 "Zend/zend_ini_scanner.l"
|
||||
#line 657 "Zend/zend_ini_scanner.l"
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#line 1853 "Zend/zend_ini_scanner.c"
|
||||
#line 1852 "Zend/zend_ini_scanner.c"
|
||||
yy133:
|
||||
YYDEBUG(133, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -1865,13 +1864,13 @@ yy133:
|
||||
yy135:
|
||||
YYDEBUG(135, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 428 "Zend/zend_ini_scanner.l"
|
||||
#line 427 "Zend/zend_ini_scanner.l"
|
||||
{ /* End of section */
|
||||
BEGIN(INITIAL);
|
||||
SCNG(lineno)++;
|
||||
return ']';
|
||||
}
|
||||
#line 1875 "Zend/zend_ini_scanner.c"
|
||||
#line 1874 "Zend/zend_ini_scanner.c"
|
||||
yy136:
|
||||
YYDEBUG(136, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -1980,11 +1979,11 @@ yy141:
|
||||
yy142:
|
||||
YYDEBUG(142, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 583 "Zend/zend_ini_scanner.l"
|
||||
#line 582 "Zend/zend_ini_scanner.l"
|
||||
{ /* Get rest as section/offset value */
|
||||
RETURN_TOKEN(TC_STRING, yytext, yyleng);
|
||||
}
|
||||
#line 1988 "Zend/zend_ini_scanner.c"
|
||||
#line 1987 "Zend/zend_ini_scanner.c"
|
||||
yy143:
|
||||
YYDEBUG(143, *YYCURSOR);
|
||||
yyaccept = 0;
|
||||
@@ -2024,22 +2023,22 @@ yy145:
|
||||
yy146:
|
||||
YYDEBUG(146, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 658 "Zend/zend_ini_scanner.l"
|
||||
#line 657 "Zend/zend_ini_scanner.l"
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#line 2032 "Zend/zend_ini_scanner.c"
|
||||
#line 2031 "Zend/zend_ini_scanner.c"
|
||||
yy147:
|
||||
YYDEBUG(147, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(148, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 587 "Zend/zend_ini_scanner.l"
|
||||
#line 586 "Zend/zend_ini_scanner.l"
|
||||
{ /* Double quoted '"' string start */
|
||||
yy_push_state(ST_DOUBLE_QUOTES);
|
||||
return '"';
|
||||
}
|
||||
#line 2043 "Zend/zend_ini_scanner.c"
|
||||
#line 2042 "Zend/zend_ini_scanner.c"
|
||||
yy149:
|
||||
YYDEBUG(149, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -2105,11 +2104,11 @@ yy152:
|
||||
yy154:
|
||||
YYDEBUG(154, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 561 "Zend/zend_ini_scanner.l"
|
||||
#line 560 "Zend/zend_ini_scanner.l"
|
||||
{ /* Get number option value as string */
|
||||
RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
|
||||
}
|
||||
#line 2113 "Zend/zend_ini_scanner.c"
|
||||
#line 2112 "Zend/zend_ini_scanner.c"
|
||||
yy155:
|
||||
YYDEBUG(155, *YYCURSOR);
|
||||
yyaccept = 3;
|
||||
@@ -2142,11 +2141,11 @@ yy155:
|
||||
yy157:
|
||||
YYDEBUG(157, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 557 "Zend/zend_ini_scanner.l"
|
||||
#line 556 "Zend/zend_ini_scanner.l"
|
||||
{ /* Get constant option value */
|
||||
RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
|
||||
}
|
||||
#line 2150 "Zend/zend_ini_scanner.c"
|
||||
#line 2149 "Zend/zend_ini_scanner.c"
|
||||
yy158:
|
||||
YYDEBUG(158, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -2168,13 +2167,13 @@ yy159:
|
||||
yy161:
|
||||
YYDEBUG(161, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 428 "Zend/zend_ini_scanner.l"
|
||||
#line 427 "Zend/zend_ini_scanner.l"
|
||||
{ /* End of section */
|
||||
BEGIN(INITIAL);
|
||||
SCNG(lineno)++;
|
||||
return ']';
|
||||
}
|
||||
#line 2178 "Zend/zend_ini_scanner.c"
|
||||
#line 2177 "Zend/zend_ini_scanner.c"
|
||||
yy162:
|
||||
YYDEBUG(162, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -2224,12 +2223,12 @@ yy167:
|
||||
++YYCURSOR;
|
||||
YYDEBUG(168, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 452 "Zend/zend_ini_scanner.l"
|
||||
#line 451 "Zend/zend_ini_scanner.l"
|
||||
{ /* Variable start */
|
||||
yy_push_state(ST_VARNAME);
|
||||
return TC_DOLLAR_CURLY;
|
||||
}
|
||||
#line 2233 "Zend/zend_ini_scanner.c"
|
||||
#line 2232 "Zend/zend_ini_scanner.c"
|
||||
yy169:
|
||||
YYDEBUG(169, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -2292,7 +2291,7 @@ yy175:
|
||||
++YYCURSOR;
|
||||
YYDEBUG(176, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 419 "Zend/zend_ini_scanner.l"
|
||||
#line 418 "Zend/zend_ini_scanner.l"
|
||||
{ /* Raw string */
|
||||
/* Eat leading and trailing single quotes */
|
||||
if (yytext[0] == '\'' && yytext[yyleng - 1] == '\'') {
|
||||
@@ -2301,7 +2300,7 @@ yy175:
|
||||
}
|
||||
RETURN_TOKEN(TC_RAW, yytext, yyleng);
|
||||
}
|
||||
#line 2305 "Zend/zend_ini_scanner.c"
|
||||
#line 2304 "Zend/zend_ini_scanner.c"
|
||||
}
|
||||
/* *********************************** */
|
||||
yyc_ST_VALUE:
|
||||
@@ -2437,12 +2436,12 @@ yy179:
|
||||
yy180:
|
||||
YYDEBUG(180, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 653 "Zend/zend_ini_scanner.l"
|
||||
#line 652 "Zend/zend_ini_scanner.l"
|
||||
{ /* End of option value (if EOF is reached before EOL */
|
||||
BEGIN(INITIAL);
|
||||
return END_OF_LINE;
|
||||
}
|
||||
#line 2446 "Zend/zend_ini_scanner.c"
|
||||
#line 2445 "Zend/zend_ini_scanner.c"
|
||||
yy181:
|
||||
YYDEBUG(181, *YYCURSOR);
|
||||
yyaccept = 0;
|
||||
@@ -2459,11 +2458,11 @@ yy182:
|
||||
yy183:
|
||||
YYDEBUG(183, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 579 "Zend/zend_ini_scanner.l"
|
||||
#line 578 "Zend/zend_ini_scanner.l"
|
||||
{ /* Get everything else as option/offset value */
|
||||
RETURN_TOKEN(TC_STRING, yytext, yyleng);
|
||||
}
|
||||
#line 2467 "Zend/zend_ini_scanner.c"
|
||||
#line 2466 "Zend/zend_ini_scanner.c"
|
||||
yy184:
|
||||
YYDEBUG(184, *YYCURSOR);
|
||||
yyaccept = 1;
|
||||
@@ -2488,24 +2487,24 @@ yy184:
|
||||
yy186:
|
||||
YYDEBUG(186, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 633 "Zend/zend_ini_scanner.l"
|
||||
#line 632 "Zend/zend_ini_scanner.l"
|
||||
{
|
||||
RETURN_TOKEN(TC_WHITESPACE, yytext, yyleng);
|
||||
}
|
||||
#line 2496 "Zend/zend_ini_scanner.c"
|
||||
#line 2495 "Zend/zend_ini_scanner.c"
|
||||
yy187:
|
||||
YYDEBUG(187, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
yy188:
|
||||
YYDEBUG(188, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 551 "Zend/zend_ini_scanner.l"
|
||||
#line 550 "Zend/zend_ini_scanner.l"
|
||||
{ /* End of option value */
|
||||
BEGIN(INITIAL);
|
||||
SCNG(lineno)++;
|
||||
return END_OF_LINE;
|
||||
}
|
||||
#line 2509 "Zend/zend_ini_scanner.c"
|
||||
#line 2508 "Zend/zend_ini_scanner.c"
|
||||
yy189:
|
||||
YYDEBUG(189, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -2521,22 +2520,22 @@ yy190:
|
||||
if (yych == ' ') goto yy190;
|
||||
YYDEBUG(192, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 569 "Zend/zend_ini_scanner.l"
|
||||
#line 568 "Zend/zend_ini_scanner.l"
|
||||
{ /* Boolean operators */
|
||||
return yytext[0];
|
||||
}
|
||||
#line 2529 "Zend/zend_ini_scanner.c"
|
||||
#line 2528 "Zend/zend_ini_scanner.c"
|
||||
yy193:
|
||||
YYDEBUG(193, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(194, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 587 "Zend/zend_ini_scanner.l"
|
||||
#line 586 "Zend/zend_ini_scanner.l"
|
||||
{ /* Double quoted '"' string start */
|
||||
yy_push_state(ST_DOUBLE_QUOTES);
|
||||
return '"';
|
||||
}
|
||||
#line 2540 "Zend/zend_ini_scanner.c"
|
||||
#line 2539 "Zend/zend_ini_scanner.c"
|
||||
yy195:
|
||||
YYDEBUG(195, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -2611,11 +2610,11 @@ yy198:
|
||||
yy200:
|
||||
YYDEBUG(200, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 561 "Zend/zend_ini_scanner.l"
|
||||
#line 560 "Zend/zend_ini_scanner.l"
|
||||
{ /* Get number option value as string */
|
||||
RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
|
||||
}
|
||||
#line 2619 "Zend/zend_ini_scanner.c"
|
||||
#line 2618 "Zend/zend_ini_scanner.c"
|
||||
yy201:
|
||||
YYDEBUG(201, *YYCURSOR);
|
||||
yyaccept = 2;
|
||||
@@ -2626,13 +2625,13 @@ yy202:
|
||||
++YYCURSOR;
|
||||
YYDEBUG(203, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 573 "Zend/zend_ini_scanner.l"
|
||||
#line 572 "Zend/zend_ini_scanner.l"
|
||||
{ /* Make = used in option value to trigger error */
|
||||
yyless(0);
|
||||
BEGIN(INITIAL);
|
||||
return END_OF_LINE;
|
||||
}
|
||||
#line 2636 "Zend/zend_ini_scanner.c"
|
||||
#line 2635 "Zend/zend_ini_scanner.c"
|
||||
yy204:
|
||||
YYDEBUG(204, *YYCURSOR);
|
||||
yyaccept = 4;
|
||||
@@ -2679,11 +2678,11 @@ yy204:
|
||||
yy206:
|
||||
YYDEBUG(206, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 557 "Zend/zend_ini_scanner.l"
|
||||
#line 556 "Zend/zend_ini_scanner.l"
|
||||
{ /* Get constant option value */
|
||||
RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
|
||||
}
|
||||
#line 2687 "Zend/zend_ini_scanner.c"
|
||||
#line 2686 "Zend/zend_ini_scanner.c"
|
||||
yy207:
|
||||
YYDEBUG(207, *YYCURSOR);
|
||||
yyaccept = 4;
|
||||
@@ -3037,12 +3036,12 @@ yy217:
|
||||
++YYCURSOR;
|
||||
YYDEBUG(218, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 452 "Zend/zend_ini_scanner.l"
|
||||
#line 451 "Zend/zend_ini_scanner.l"
|
||||
{ /* Variable start */
|
||||
yy_push_state(ST_VARNAME);
|
||||
return TC_DOLLAR_CURLY;
|
||||
}
|
||||
#line 3046 "Zend/zend_ini_scanner.c"
|
||||
#line 3045 "Zend/zend_ini_scanner.c"
|
||||
yy219:
|
||||
YYDEBUG(219, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -3108,13 +3107,13 @@ yy223:
|
||||
yy224:
|
||||
YYDEBUG(224, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 647 "Zend/zend_ini_scanner.l"
|
||||
#line 646 "Zend/zend_ini_scanner.l"
|
||||
{ /* Comment */
|
||||
BEGIN(INITIAL);
|
||||
SCNG(lineno)++;
|
||||
return END_OF_LINE;
|
||||
}
|
||||
#line 3118 "Zend/zend_ini_scanner.c"
|
||||
#line 3117 "Zend/zend_ini_scanner.c"
|
||||
yy225:
|
||||
YYDEBUG(225, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -3225,11 +3224,11 @@ yy227:
|
||||
yy228:
|
||||
YYDEBUG(228, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 476 "Zend/zend_ini_scanner.l"
|
||||
#line 475 "Zend/zend_ini_scanner.l"
|
||||
{ /* FALSE value (when used outside option value/offset this causes parse error!)*/
|
||||
RETURN_TOKEN(BOOL_FALSE, "", 0);
|
||||
}
|
||||
#line 3233 "Zend/zend_ini_scanner.c"
|
||||
#line 3232 "Zend/zend_ini_scanner.c"
|
||||
yy229:
|
||||
YYDEBUG(229, *YYCURSOR);
|
||||
yyaccept = 4;
|
||||
@@ -3376,11 +3375,11 @@ yy231:
|
||||
yy232:
|
||||
YYDEBUG(232, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 472 "Zend/zend_ini_scanner.l"
|
||||
#line 471 "Zend/zend_ini_scanner.l"
|
||||
{ /* TRUE value (when used outside option value/offset this causes parse error!) */
|
||||
RETURN_TOKEN(BOOL_TRUE, "1", 1);
|
||||
}
|
||||
#line 3384 "Zend/zend_ini_scanner.c"
|
||||
#line 3383 "Zend/zend_ini_scanner.c"
|
||||
yy233:
|
||||
YYDEBUG(233, *YYCURSOR);
|
||||
yyaccept = 4;
|
||||
@@ -3500,7 +3499,7 @@ yy237:
|
||||
++YYCURSOR;
|
||||
YYDEBUG(238, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 419 "Zend/zend_ini_scanner.l"
|
||||
#line 418 "Zend/zend_ini_scanner.l"
|
||||
{ /* Raw string */
|
||||
/* Eat leading and trailing single quotes */
|
||||
if (yytext[0] == '\'' && yytext[yyleng - 1] == '\'') {
|
||||
@@ -3509,7 +3508,7 @@ yy237:
|
||||
}
|
||||
RETURN_TOKEN(TC_RAW, yytext, yyleng);
|
||||
}
|
||||
#line 3513 "Zend/zend_ini_scanner.c"
|
||||
#line 3512 "Zend/zend_ini_scanner.c"
|
||||
yy239:
|
||||
YYDEBUG(239, *YYCURSOR);
|
||||
yyaccept = 4;
|
||||
@@ -3824,11 +3823,11 @@ yy248:
|
||||
yy249:
|
||||
YYDEBUG(249, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 480 "Zend/zend_ini_scanner.l"
|
||||
#line 479 "Zend/zend_ini_scanner.l"
|
||||
{
|
||||
RETURN_TOKEN(NULL_NULL, "", 0);
|
||||
}
|
||||
#line 3832 "Zend/zend_ini_scanner.c"
|
||||
#line 3831 "Zend/zend_ini_scanner.c"
|
||||
yy250:
|
||||
YYDEBUG(250, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -3895,7 +3894,7 @@ yy254:
|
||||
}
|
||||
YYDEBUG(256, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 457 "Zend/zend_ini_scanner.l"
|
||||
#line 456 "Zend/zend_ini_scanner.l"
|
||||
{ /* Variable name */
|
||||
/* Eat leading whitespace */
|
||||
EAT_LEADING_WHITESPACE();
|
||||
@@ -3905,30 +3904,30 @@ yy254:
|
||||
|
||||
RETURN_TOKEN(TC_VARNAME, yytext, yyleng);
|
||||
}
|
||||
#line 3909 "Zend/zend_ini_scanner.c"
|
||||
#line 3908 "Zend/zend_ini_scanner.c"
|
||||
yy257:
|
||||
YYDEBUG(257, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(258, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 658 "Zend/zend_ini_scanner.l"
|
||||
#line 657 "Zend/zend_ini_scanner.l"
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#line 3919 "Zend/zend_ini_scanner.c"
|
||||
#line 3918 "Zend/zend_ini_scanner.c"
|
||||
yy259:
|
||||
YYDEBUG(259, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(260, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 467 "Zend/zend_ini_scanner.l"
|
||||
#line 466 "Zend/zend_ini_scanner.l"
|
||||
{ /* Variable end */
|
||||
yy_pop_state();
|
||||
return '}';
|
||||
}
|
||||
#line 3930 "Zend/zend_ini_scanner.c"
|
||||
#line 3929 "Zend/zend_ini_scanner.c"
|
||||
}
|
||||
}
|
||||
#line 662 "Zend/zend_ini_scanner.l"
|
||||
#line 661 "Zend/zend_ini_scanner.l"
|
||||
|
||||
}
|
||||
@@ -142,14 +142,13 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
|
||||
ZVAL_NEW_STR(retval, zend_string_init(str, len, ZEND_SYSTEM_INI))
|
||||
|
||||
|
||||
#define RETURN_TOKEN(type, str, len) { \
|
||||
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_TYPED && \
|
||||
(YYSTATE == STATE(ST_VALUE) || YYSTATE == STATE(ST_RAW))) {\
|
||||
zend_ini_copy_typed_value(ini_lval, type, str, len); \
|
||||
} else { \
|
||||
zend_ini_copy_value(ini_lval, str, len); \
|
||||
} \
|
||||
return type; \
|
||||
#define RETURN_TOKEN(type, str, len) { \
|
||||
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_TYPED) { \
|
||||
zend_ini_copy_typed_value(ini_lval, type, str, len); \
|
||||
} else { \
|
||||
zend_ini_copy_value(ini_lval, str, len); \
|
||||
} \
|
||||
return type; \
|
||||
}
|
||||
|
||||
static inline int convert_to_number(zval *retval, const char *str, const int str_len)
|
||||
|
||||
+6008
-6005
File diff suppressed because it is too large.
Load diff
@@ -1648,8 +1648,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
|
||||
char *end;
|
||||
if (yyleng < MAX_LENGTH_OF_LONG - 1) { /* Won't overflow */
|
||||
errno = 0;
|
||||
/* base must be passed explicitly for correct parse error on Windows */
|
||||
ZVAL_LONG(zendlval, ZEND_STRTOL(yytext, &end, yytext[0] == '0' ? 8 : 10));
|
||||
ZVAL_LONG(zendlval, ZEND_STRTOL(yytext, &end, 0));
|
||||
/* This isn't an assert, we need to ensure 019 isn't valid octal
|
||||
* Because the lexing itself doesn't do that for us
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 1.0.1 */
|
||||
/* Generated by re2c 0.16 */
|
||||
#line 3 "Zend/zend_language_scanner_defs.h"
|
||||
|
||||
enum YYCONDTYPE {
|
||||
|
||||
@@ -43,7 +43,6 @@ ZEND_API void zend_objects_store_destroy(zend_objects_store *objects)
|
||||
|
||||
ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects)
|
||||
{
|
||||
EG(flags) |= EG_FLAGS_OBJECT_STORE_NO_REUSE;
|
||||
if (objects->top > 1) {
|
||||
uint32_t i;
|
||||
for (i = 1; i < objects->top; i++) {
|
||||
@@ -134,10 +133,10 @@ ZEND_API void zend_objects_store_put(zend_object *object)
|
||||
{
|
||||
int handle;
|
||||
|
||||
/* When in shutdown sequence - do not reuse previously freed handles, to make sure
|
||||
/* When in shutdown sequesnce - do not reuse previously freed handles, to make sure
|
||||
* the dtors for newly created objects are called in zend_objects_store_call_destructors() loop
|
||||
*/
|
||||
if (EG(objects_store).free_list_head != -1 && EXPECTED(!(EG(flags) & EG_FLAGS_OBJECT_STORE_NO_REUSE))) {
|
||||
if (!(EG(flags) & EG_FLAGS_IN_SHUTDOWN) && EG(objects_store).free_list_head != -1) {
|
||||
handle = EG(objects_store).free_list_head;
|
||||
EG(objects_store).free_list_head = GET_OBJ_BUCKET_NUMBER(EG(objects_store).object_buckets[handle]);
|
||||
} else {
|
||||
|
||||
@@ -903,7 +903,7 @@ function gen_code($f, $spec, $kind, $export, $code, $op1, $op2, $name, $extra_sp
|
||||
}
|
||||
|
||||
/* Remove unused free_op1 and free_op2 declarations */
|
||||
if ($spec && preg_match_all('/^\s*zend_free_op\s+[^;]+;\s*$/m', $code, $matches, PREG_SET_ORDER)) {
|
||||
if ($spec && preg_match_all('/^\s*zend_free_op\s+[^;]+;\s*$/me', $code, $matches, PREG_SET_ORDER)) {
|
||||
$n = 0;
|
||||
foreach ($matches as $match) {
|
||||
$code = preg_replace('/'.preg_quote($match[0],'/').'/', "\$D$n", $code);
|
||||
@@ -1805,7 +1805,7 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name)
|
||||
$prolog = $m[1];
|
||||
out($f,$prolog."if (UNEXPECTED(execute_data == NULL)) {\n");
|
||||
out($f,$prolog."\tstatic const void* labels[] = {\n");
|
||||
gen_labels($f, $spec, ($kind == ZEND_VM_KIND_HYBRID) ? ZEND_VM_KIND_GOTO : $kind, $prolog."\t\t", $specs);
|
||||
gen_labels($f, $spec, ZEND_VM_KIND_GOTO, $prolog."\t\t", $specs);
|
||||
out($f,$prolog."\t};\n");
|
||||
out($f,$prolog."\tzend_opcode_handlers = (const void **) labels;\n");
|
||||
out($f,$prolog."\tzend_handlers_count = sizeof(labels) / sizeof(void*);\n");
|
||||
@@ -1920,7 +1920,7 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name)
|
||||
out($f,$prolog.$executor_name."_ex(NULL);\n");
|
||||
} else {
|
||||
out($f,$prolog."static const void *labels[] = {\n");
|
||||
gen_labels($f, $spec, ($kind == ZEND_VM_KIND_HYBRID) ? ZEND_VM_KIND_CALL : $kind, $prolog."\t", $specs, $switch_labels);
|
||||
gen_labels($f, $spec, ZEND_VM_KIND_CALL, $prolog."\t", $specs, $switch_labels);
|
||||
out($f,$prolog."};\n");
|
||||
out($f,$prolog."static const uint32_t specs[] = {\n");
|
||||
gen_specs($f, $prolog."\t", $specs);
|
||||
@@ -2383,7 +2383,6 @@ function gen_vm($def, $skel) {
|
||||
|
||||
// Generate specialized executor
|
||||
gen_executor($f, $skl, ZEND_VM_SPEC, ZEND_VM_KIND, "execute", "zend_init_opcodes_handlers");
|
||||
out($f, "\n");
|
||||
|
||||
// Generate zend_vm_get_opcode_handler() function
|
||||
out($f, "static const void *zend_vm_get_opcode_handler_ex(uint32_t spec, const zend_op* op)\n");
|
||||
|
||||
+40
-70
@@ -836,11 +836,15 @@ dnl from object_var in build-dir.
|
||||
dnl
|
||||
AC_DEFUN([PHP_SHARED_MODULE],[
|
||||
install_modules="install-modules"
|
||||
suffix=la
|
||||
|
||||
case $host_alias in
|
||||
*aix*[)]
|
||||
additional_flags="-Wl,-G"
|
||||
suffix=so
|
||||
link_cmd='$(LIBTOOL) --mode=link ifelse($4,,[$(CC)],[$(CXX)]) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$3'/$1.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $($2) $(translit($1,a-z_-,A-Z__)_SHARED_LIBADD) && mv -f '$3'/.libs/$1.so '$3'/$1.so'
|
||||
;;
|
||||
*[)]
|
||||
suffix=la
|
||||
link_cmd='$(LIBTOOL) --mode=link ifelse($4,,[$(CC)],[$(CXX)]) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o [$]@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $($2) $(translit($1,a-z_-,A-Z__)_SHARED_LIBADD)'
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -855,7 +859,7 @@ AC_DEFUN([PHP_SHARED_MODULE],[
|
||||
\$(LIBTOOL) --mode=install cp $3/$1.$suffix \$(phplibdir)
|
||||
|
||||
$3/$1.$suffix: \$($2) \$(translit($1,a-z_-,A-Z__)_SHARED_DEPENDENCIES)
|
||||
\$(LIBTOOL) --mode=link ifelse($4,,[\$(CC)],[\$(CXX)]) \$(COMMON_FLAGS) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(LDFLAGS) $additional_flags -o [\$]@ -export-dynamic -avoid-version -prefer-pic -module -rpath \$(phplibdir) \$(EXTRA_LDFLAGS) \$($2) \$(translit($1,a-z_-,A-Z__)_SHARED_LIBADD)
|
||||
$link_cmd
|
||||
|
||||
EOF
|
||||
])
|
||||
@@ -971,7 +975,7 @@ dnl ---------------------------------------------- Shared module
|
||||
dnl ---------------------------------------------- CLI static module
|
||||
[PHP_]translit($1,a-z_-,A-Z__)[_SHARED]=no
|
||||
case "$PHP_SAPI" in
|
||||
cgi|embed|phpdbg[)]
|
||||
cgi|embed[)]
|
||||
PHP_ADD_SOURCES($ext_dir,$2,$ac_extra,)
|
||||
EXT_STATIC="$EXT_STATIC $1;$ext_dir"
|
||||
;;
|
||||
@@ -2197,79 +2201,45 @@ AC_DEFUN([PHP_SETUP_ICU],[
|
||||
PHP_ICU_DIR=DEFAULT
|
||||
fi
|
||||
|
||||
if test "$PHP_ICU_DIR" = "DEFAULT"; then
|
||||
dnl Try to find icu-config
|
||||
AC_PATH_PROG(ICU_CONFIG, icu-config, no, [$PATH:/usr/local/bin])
|
||||
else
|
||||
ICU_CONFIG="$PHP_ICU_DIR/bin/icu-config"
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([for location of ICU headers and libraries])
|
||||
found_icu=no
|
||||
|
||||
dnl First try to find pkg-config
|
||||
if test -z "$PKG_CONFIG"; then
|
||||
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
|
||||
fi
|
||||
dnl Trust icu-config to know better what the install prefix is..
|
||||
icu_install_prefix=`$ICU_CONFIG --prefix 2> /dev/null`
|
||||
if test "$?" != "0" || test -z "$icu_install_prefix"; then
|
||||
AC_MSG_RESULT([not found])
|
||||
AC_MSG_ERROR([Unable to detect ICU prefix or $ICU_CONFIG failed. Please verify ICU install prefix and make sure icu-config works.])
|
||||
else
|
||||
AC_MSG_RESULT([$icu_install_prefix])
|
||||
|
||||
dnl If pkg-config is found try using it
|
||||
if test "$PHP_ICU_DIR" = "DEFAULT" && test -x "$PKG_CONFIG" && $PKG_CONFIG --exists icu-uc icu-io icu-i18n; then
|
||||
if $PKG_CONFIG --atleast-version=40 icu-uc; then
|
||||
found_icu=yes
|
||||
icu_version_full=`$PKG_CONFIG --modversion icu-uc`
|
||||
ac_IFS=$IFS
|
||||
IFS="."
|
||||
set $icu_version_full
|
||||
IFS=$ac_IFS
|
||||
icu_version=`expr [$]1 \* 1000 + [$]2`
|
||||
AC_MSG_RESULT([found $icu_version_full])
|
||||
dnl Check ICU version
|
||||
AC_MSG_CHECKING([for ICU 4.0 or greater])
|
||||
icu_version_full=`$ICU_CONFIG --version`
|
||||
ac_IFS=$IFS
|
||||
IFS="."
|
||||
set $icu_version_full
|
||||
IFS=$ac_IFS
|
||||
icu_version=`expr [$]1 \* 1000 + [$]2`
|
||||
AC_MSG_RESULT([found $icu_version_full])
|
||||
|
||||
ICU_LIBS=`$PKG_CONFIG --libs icu-uc icu-io icu-i18n`
|
||||
ICU_INCS=`$PKG_CONFIG --cflags-only-I icu-uc icu-io icu-i18n`
|
||||
ICU_CXXFLAGS="-DU_USING_ICU_NAMESPACE=1"
|
||||
|
||||
AC_MSG_RESULT([found $ICU_VERSION])
|
||||
|
||||
PHP_EVAL_LIBLINE($ICU_LIBS, $1)
|
||||
PHP_EVAL_INCLINE($ICU_INCS)
|
||||
else
|
||||
AC_MSG_ERROR([ICU version 4.0 or later required.])
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl If pkg-config fails for some reason, revert to the old method
|
||||
if test "$found_icu" = "no"; then
|
||||
if test "$PHP_ICU_DIR" = "DEFAULT"; then
|
||||
dnl Try to find icu-config
|
||||
AC_PATH_PROG(ICU_CONFIG, icu-config, no, [$PATH:/usr/local/bin])
|
||||
else
|
||||
ICU_CONFIG="$PHP_ICU_DIR/bin/icu-config"
|
||||
if test "$icu_version" -lt "4000"; then
|
||||
AC_MSG_ERROR([ICU version 4.0 or later is required])
|
||||
fi
|
||||
|
||||
dnl Trust icu-config to know better what the install prefix is..
|
||||
icu_install_prefix=`$ICU_CONFIG --prefix 2> /dev/null`
|
||||
if test "$?" != "0" || test -z "$icu_install_prefix"; then
|
||||
AC_MSG_RESULT([not found])
|
||||
AC_MSG_ERROR([Unable to detect ICU prefix or $ICU_CONFIG failed. Please verify ICU install prefix and make sure icu-config works.])
|
||||
else
|
||||
AC_MSG_RESULT([$icu_install_prefix])
|
||||
ICU_VERSION=$icu_version
|
||||
ICU_INCS=`$ICU_CONFIG --cppflags-searchpath`
|
||||
ICU_LIBS=`$ICU_CONFIG --ldflags --ldflags-icuio`
|
||||
PHP_EVAL_INCLINE($ICU_INCS)
|
||||
PHP_EVAL_LIBLINE($ICU_LIBS, $1)
|
||||
|
||||
dnl Check ICU version
|
||||
AC_MSG_CHECKING([for ICU 4.0 or greater])
|
||||
icu_version_full=`$ICU_CONFIG --version`
|
||||
ac_IFS=$IFS
|
||||
IFS="."
|
||||
set $icu_version_full
|
||||
IFS=$ac_IFS
|
||||
icu_version=`expr [$]1 \* 1000 + [$]2`
|
||||
AC_MSG_RESULT([found $icu_version_full])
|
||||
|
||||
if test "$icu_version" -lt "4000"; then
|
||||
AC_MSG_ERROR([ICU version 4.0 or later is required])
|
||||
fi
|
||||
|
||||
ICU_VERSION=$icu_version
|
||||
ICU_INCS=`$ICU_CONFIG --cppflags-searchpath`
|
||||
ICU_LIBS=`$ICU_CONFIG --ldflags --ldflags-icuio`
|
||||
PHP_EVAL_INCLINE($ICU_INCS)
|
||||
PHP_EVAL_LIBLINE($ICU_LIBS, $1)
|
||||
|
||||
ICU_CXXFLAGS=`$ICU_CONFIG --cxxflags`
|
||||
ICU_CXXFLAGS="$ICU_CXXFLAGS -DU_USING_ICU_NAMESPACE=1"
|
||||
fi
|
||||
ICU_CXXFLAGS=`$ICU_CONFIG --cxxflags`
|
||||
ICU_CXXFLAGS="$ICU_CXXFLAGS -DU_USING_ICU_NAMESPACE=1"
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
@echo off
|
||||
|
||||
set SDK_REMOTE=https://github.com/Microsoft/php-sdk-binary-tools.git
|
||||
set SDK_REMOTE=https://github.com/OSTC/php-sdk-binary-tools.git
|
||||
set SDK_BRANCH=%PHP_BUILD_SDK_BRANCH%
|
||||
set SDK_RUNNER=%PHP_BUILD_CACHE_SDK_DIR%\phpsdk-%PHP_BUILD_CRT%-%PLATFORM%.bat
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ set PDO_MYSQL_TEST_USER=%MYSQL_TEST_USER%
|
||||
set PDO_MYSQL_TEST_PASS=%MYSQL_PWD%
|
||||
set PDO_MYSQL_TEST_HOST=%MYSQL_TEST_HOST%
|
||||
set PDO_MYSQL_TEST_PORT=%MYSQL_TEST_PORT%
|
||||
set PDO_MYSQL_TEST_DSN=mysql:host=%PDO_MYSQL_TEST_HOST%;port=%PDO_MYSQL_TEST_PORT%;dbname=test;user=%PDO_MYSQL_TEST_USER%;password=%MYSQL_PW%
|
||||
set PDO_MYSQL_TEST_DSN=mysql:host=%PDO_MYSQL_TEST_HOST% port=%PDO_MYSQL_TEST_PORT% dbname=test user=%PDO_MYSQL_TEST_USER% password=%MYSQL_PW%
|
||||
"C:\Program Files\MySql\MySQL Server 5.7\bin\mysql.exe" --user=%MYSQL_TEST_USER% -e "CREATE DATABASE IF NOT EXISTS test"
|
||||
if %errorlevel% neq 0 exit /b 3
|
||||
|
||||
@@ -52,7 +52,7 @@ rem set OPENSSL_CONF=
|
||||
rem set SSLEAY_CONF=
|
||||
|
||||
rem prepare for Opcache
|
||||
if "%OPCACHE%" equ "1" set OPCACHE_OPTS=-d opcache.enable=1 -d opcache.enable_cli=1
|
||||
if "%OPCACHE%" equ "1" set OPCACHE_OPTS=-d opcache.enabled=1 -d opcache.enable_cli=1
|
||||
|
||||
rem prepare for enchant
|
||||
mkdir c:\enchant_plugins
|
||||
|
||||
+2
-2
@@ -107,8 +107,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=7
|
||||
PHP_MINOR_VERSION=2
|
||||
PHP_RELEASE_VERSION=19
|
||||
PHP_EXTRA_VERSION="RC1"
|
||||
PHP_RELEASE_VERSION=14
|
||||
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`
|
||||
|
||||
|
||||
@@ -54,19 +54,12 @@ bc_num2long (num)
|
||||
/* Extract the int value, ignore the fraction. */
|
||||
val = 0;
|
||||
nptr = num->n_value;
|
||||
for (index = num->n_len; index > 0; index--) {
|
||||
char n = *nptr++;
|
||||
for (index=num->n_len; (index>0) && (val<=(LONG_MAX/BASE)); index--)
|
||||
val = val*BASE + *nptr++;
|
||||
|
||||
if (val > LONG_MAX/BASE) {
|
||||
return 0;
|
||||
}
|
||||
val *= BASE;
|
||||
|
||||
if (val > LONG_MAX - n) {
|
||||
return 0;
|
||||
}
|
||||
val += n;
|
||||
}
|
||||
/* Check for overflow. If overflow, return zero. */
|
||||
if (index>0) val = 0;
|
||||
if (val < 0) val = 0;
|
||||
|
||||
/* Return the value. */
|
||||
if (num->n_sign == PLUS)
|
||||
|
||||
@@ -197,10 +197,9 @@ PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode, int codepa
|
||||
SysFreeString(bstr_ids);
|
||||
|
||||
/* sanity check for the case where the constant is already defined */
|
||||
php_com_zval_from_variant(&value, pVarDesc->lpvarValue, codepage);
|
||||
if ((exists = zend_get_constant(c.name)) != NULL) {
|
||||
if (COMG(autoreg_verbose) && !compare_function(&results, &value, exists)) {
|
||||
php_error_docref(NULL, E_WARNING, "Type library constant %s is already defined", ZSTR_VAL(c.name));
|
||||
if (COMG(autoreg_verbose) && !compare_function(&results, &c.value, exists)) {
|
||||
php_error_docref(NULL, E_WARNING, "Type library constant %s is already defined", c.name);
|
||||
}
|
||||
zend_string_release(c.name);
|
||||
ITypeInfo_ReleaseVarDesc(TypeInfo, pVarDesc);
|
||||
@@ -208,6 +207,7 @@ PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode, int codepa
|
||||
}
|
||||
|
||||
/* register the constant */
|
||||
php_com_zval_from_variant(&value, pVarDesc->lpvarValue, codepage);
|
||||
if (Z_TYPE(value) == IS_LONG) {
|
||||
c.flags = mode;
|
||||
ZVAL_LONG(&c.value, Z_LVAL(value));
|
||||
@@ -225,8 +225,8 @@ PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode, int codepa
|
||||
/* Type-library stuff */
|
||||
void php_com_typelibrary_dtor(zval *pDest)
|
||||
{
|
||||
ITypeLib *Lib = (ITypeLib*)Z_PTR_P(pDest);
|
||||
ITypeLib_Release(Lib);
|
||||
ITypeLib **Lib = (ITypeLib**)Z_PTR_P(pDest);
|
||||
ITypeLib_Release(*Lib);
|
||||
}
|
||||
|
||||
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib_via_cache(char *search_string,
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77578 (Crash when php unload)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('com_dotnet')) die('skip com_dotnet extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
// To actually be able to verify the crash during shutdown on Windows, we have
|
||||
// to execute a PHP subprocess, and check its exit status.
|
||||
$php = PHP_BINARY;
|
||||
$ini = php_ini_loaded_file();
|
||||
$iniopt = $ini ? "-c $ini" : '';
|
||||
$command = "$php $iniopt -d com.autoregister_typelib=1 -r \"new COM('WbemScripting.SWbemLocator');\"";
|
||||
exec($command, $output, $status);
|
||||
var_dump($output, $status);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
array(0) {
|
||||
}
|
||||
int(0)
|
||||
===DONE===
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77621 (Already defined constants are not properly reported)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('com_dotnet')) die('skip com_dotnet extension not available');
|
||||
?>
|
||||
--INI--
|
||||
com.autoregister_verbose=1
|
||||
--FILE--
|
||||
<?php
|
||||
define('ADSTYPE_INVALID', 0);
|
||||
$root = dirname(array_change_key_case($_SERVER, CASE_UPPER)['COMSPEC']);
|
||||
com_load_typelib("$root\activeds.tlb");
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Warning: com_load_typelib(): Type library constant ADSTYPE_INVALID is already defined in %s on line %d
|
||||
===DONE===
|
||||
@@ -3310,12 +3310,8 @@ PHP_FUNCTION(curl_error)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (ch->err.no) {
|
||||
ch->err.str[CURL_ERROR_SIZE] = 0;
|
||||
RETURN_STRING(ch->err.str);
|
||||
} else {
|
||||
RETURN_EMPTY_STRING();
|
||||
}
|
||||
ch->err.str[CURL_ERROR_SIZE] = 0;
|
||||
RETURN_STRING(ch->err.str);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
+5
-2
@@ -425,7 +425,6 @@ void _php_curl_multi_close(zend_resource *rsrc) /* {{{ */
|
||||
curl_multi_cleanup(mh->multi);
|
||||
zend_llist_clean(&mh->easyh);
|
||||
if (mh->handlers->server_push) {
|
||||
zval_ptr_dtor(&mh->handlers->server_push->func_name);
|
||||
efree(mh->handlers->server_push);
|
||||
}
|
||||
if (mh->handlers) {
|
||||
@@ -510,7 +509,6 @@ static int _php_server_push_callback(CURL *parent_ch, CURL *easy, size_t num_hea
|
||||
Z_ADDREF_P(pz_parent_ch);
|
||||
|
||||
res = zend_register_resource(ch, le_curl);
|
||||
ch->res = res;
|
||||
ZVAL_RES(&pz_ch, res);
|
||||
|
||||
size_t i;
|
||||
@@ -588,6 +586,11 @@ static int _php_curl_multi_setopt(php_curlm *mh, zend_long option, zval *zvalue,
|
||||
|
||||
ZVAL_COPY(&mh->handlers->server_push->func_name, zvalue);
|
||||
mh->handlers->server_push->method = PHP_CURL_USER;
|
||||
if (!Z_ISUNDEF(mh->handlers->server_push->func_name)) {
|
||||
zval_ptr_dtor(&mh->handlers->server_push->func_name);
|
||||
mh->handlers->server_push->fci_cache = empty_fcall_info_cache;
|
||||
|
||||
}
|
||||
error = curl_multi_setopt(mh->multi, option, _php_server_push_callback);
|
||||
if (error != CURLM_OK) {
|
||||
return 0;
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
--TEST--
|
||||
Bug #76675 (Segfault with H2 server push write/writeheader handlers)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
include 'skipif.inc';
|
||||
if (getenv("SKIP_ONLINE_TESTS")) {
|
||||
die("skip online test");
|
||||
}
|
||||
$curl_version = curl_version();
|
||||
if ($curl_version['version_number'] < 0x073d00) {
|
||||
exit("skip: test may crash with curl < 7.61.0");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$transfers = 1;
|
||||
$callback = function($parent, $passed) use (&$transfers) {
|
||||
curl_setopt($passed, CURLOPT_WRITEFUNCTION, function ($ch, $data) {
|
||||
echo "Received ".strlen($data);
|
||||
return strlen($data);
|
||||
});
|
||||
$transfers++;
|
||||
return CURL_PUSH_OK;
|
||||
};
|
||||
$mh = curl_multi_init();
|
||||
curl_multi_setopt($mh, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX);
|
||||
curl_multi_setopt($mh, CURLMOPT_PUSHFUNCTION, $callback);
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, 'https://http2.golang.org/serverpush');
|
||||
curl_setopt($ch, CURLOPT_HTTP_VERSION, 3);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_multi_add_handle($mh, $ch);
|
||||
$active = null;
|
||||
do {
|
||||
$status = curl_multi_exec($mh, $active);
|
||||
do {
|
||||
$info = curl_multi_info_read($mh);
|
||||
if (false !== $info && $info['msg'] == CURLMSG_DONE) {
|
||||
$handle = $info['handle'];
|
||||
if ($handle !== null) {
|
||||
$transfers--;
|
||||
curl_multi_remove_handle($mh, $handle);
|
||||
curl_close($handle);
|
||||
}
|
||||
}
|
||||
} while ($info);
|
||||
} while ($transfers);
|
||||
curl_multi_close($mh);
|
||||
?>
|
||||
--EXPECTREGEX--
|
||||
(Received \d+)+
|
||||
@@ -1,77 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77535 (Invalid callback, h2 server push)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
include 'skipif.inc';
|
||||
if (getenv("SKIP_ONLINE_TESTS")) {
|
||||
die("skip online test");
|
||||
}
|
||||
$curl_version = curl_version();
|
||||
if ($curl_version['version_number'] < 0x073d00) {
|
||||
exit("skip: test may crash with curl < 7.61.0");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
class MyHttpClient
|
||||
{
|
||||
private $mh;
|
||||
private $curl;
|
||||
|
||||
public function sendRequest()
|
||||
{
|
||||
if (false === $this->mh = curl_multi_init()) {
|
||||
throw new \RuntimeException('Unable to create a new cURL multi handle');
|
||||
}
|
||||
|
||||
$this->addServerPushCallback();
|
||||
|
||||
$this->curl = curl_init();
|
||||
curl_setopt($this->curl, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);
|
||||
curl_setopt($this->curl, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);
|
||||
curl_setopt($this->curl, CURLOPT_HEADER, false);
|
||||
curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, false);
|
||||
curl_setopt($this->curl, CURLOPT_FAILONERROR, false);
|
||||
curl_setopt($this->curl, CURLOPT_URL, 'https://http2.golang.org/serverpush');
|
||||
curl_setopt($this->curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
|
||||
curl_setopt($this->curl, CURLOPT_HEADERFUNCTION, function ($ch, $data) {
|
||||
return \strlen($data);
|
||||
});
|
||||
curl_setopt($this->curl, CURLOPT_WRITEFUNCTION, function ($ch, $data) {
|
||||
return \strlen($data);
|
||||
});
|
||||
curl_multi_add_handle($this->mh, $this->curl);
|
||||
|
||||
$stillRunning = null;
|
||||
while (true) {
|
||||
do {
|
||||
$mrc = curl_multi_exec($this->mh, $stillRunning);
|
||||
} while (CURLM_CALL_MULTI_PERFORM === $mrc);
|
||||
|
||||
$info = curl_multi_info_read($this->mh);
|
||||
while (false !== $info && $info['msg'] == CURLMSG_DONE) {
|
||||
if (CURLMSG_DONE !== $info['msg']) {
|
||||
continue;
|
||||
}
|
||||
die("Start handle request.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function addServerPushCallback(): void
|
||||
{
|
||||
|
||||
$callback = static function () {
|
||||
return CURL_PUSH_OK;
|
||||
};
|
||||
|
||||
curl_multi_setopt($this->mh, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX);
|
||||
curl_multi_setopt($this->mh, CURLMOPT_PUSHFUNCTION, $callback);
|
||||
}
|
||||
}
|
||||
|
||||
$buzz = new MyHttpClient();
|
||||
$buzz->sendRequest();
|
||||
--EXPECT--
|
||||
Start handle request.
|
||||
|
||||
@@ -45,7 +45,7 @@ GSSAPI => No
|
||||
KERBEROS5 => Yes
|
||||
UNIX_SOCKETS => No
|
||||
PSL => No
|
||||
Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtsp, scp, sftp, smb, smbs, smtp, smtps, telnet, tftp
|
||||
Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, pop3, pop3s, rtsp, scp, sftp, smb, smbs, smtp, smtps, telnet, tftp
|
||||
Host => %s-pc-win32
|
||||
SSL Version => OpenSSL/%s
|
||||
ZLib Version => %s
|
||||
|
||||
@@ -18,6 +18,6 @@ curl_close($ch);
|
||||
|
||||
|
||||
?>
|
||||
--EXPECTREGEX--
|
||||
string\(\d+\) "([^\r\n]*rotocol[^\r\n]+|Could not resolve host: .+)"
|
||||
int\(\d\)
|
||||
--EXPECTF--
|
||||
string(%d) "%Srotocol%s"
|
||||
int(1)
|
||||
+2
-8
@@ -1,14 +1,8 @@
|
||||
dnl $Id$
|
||||
dnl config.m4 for date extension
|
||||
|
||||
dnl Check for headers needed by timelib
|
||||
AC_CHECK_HEADERS([ \
|
||||
strings.h \
|
||||
io.h
|
||||
])
|
||||
|
||||
dnl Check for strtoll, atoll
|
||||
AC_CHECK_FUNCS(strtoll atoll)
|
||||
sinclude(ext/date/lib/timelib.m4)
|
||||
sinclude(lib/timelib.m4)
|
||||
|
||||
PHP_DATE_CFLAGS="-I@ext_builddir@/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DHAVE_TIMELIB_CONFIG_H=1"
|
||||
timelib_sources="lib/astro.c lib/dow.c lib/parse_date.c lib/parse_tz.c
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
dnl
|
||||
dnl TL_DEF_HAVE(what [, why])
|
||||
dnl
|
||||
dnl Generates 'AC_DEFINE(HAVE_WHAT, 1, [WHY])'
|
||||
dnl
|
||||
AC_DEFUN([TL_DEF_HAVE],[AC_DEFINE([HAVE_]translit($1,a-z_.-,A-Z___),1,[ $2 ])])dnl
|
||||
|
||||
dnl
|
||||
dnl TL_CHECK_INT_TYPE(type)
|
||||
dnl
|
||||
AC_DEFUN([TL_CHECK_INT_TYPE],[
|
||||
AC_CACHE_CHECK([for $1], ac_cv_int_type_$1, [
|
||||
AC_TRY_COMPILE([
|
||||
#if HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
#if HAVE_INTTYPES_H
|
||||
# include <inttypes.h>
|
||||
#elif HAVE_STDINT_H
|
||||
# include <stdint.h>
|
||||
#endif],
|
||||
[if (($1 *) 0)
|
||||
return 0;
|
||||
if (sizeof ($1))
|
||||
return 0;
|
||||
], [ac_cv_int_type_$1=yes], [ac_cv_int_type_$1=no])
|
||||
])
|
||||
if test "$ac_cv_int_type_$1" = "yes"; then
|
||||
TL_DEF_HAVE($1, [Define if $1 type is present.])
|
||||
fi
|
||||
])dnl
|
||||
|
||||
dnl
|
||||
dnl AC_TIMELIB_C_BIGENDIAN
|
||||
dnl Replacement macro for AC_C_BIGENDIAN
|
||||
dnl
|
||||
AC_DEFUN([AC_TIMELIB_C_BIGENDIAN],
|
||||
[AC_CACHE_CHECK([whether byte ordering is bigendian], ac_cv_c_bigendian_php,
|
||||
[
|
||||
ac_cv_c_bigendian_php=unknown
|
||||
AC_TRY_RUN(
|
||||
[
|
||||
int main(void)
|
||||
{
|
||||
short one = 1;
|
||||
char *cp = (char *)&one;
|
||||
|
||||
if (*cp == 0) {
|
||||
return(0);
|
||||
} else {
|
||||
return(1);
|
||||
}
|
||||
}
|
||||
], [ac_cv_c_bigendian_php=yes], [ac_cv_c_bigendian_php=no], [ac_cv_c_bigendian_php=unknown])
|
||||
])
|
||||
if test $ac_cv_c_bigendian_php = yes; then
|
||||
AC_DEFINE(WORDS_BIGENDIAN, [], [Define if processor uses big-endian word])
|
||||
fi
|
||||
])dnl
|
||||
|
||||
dnl Check for types, sizes, etc. needed by timelib
|
||||
AC_CHECK_SIZEOF(long, 8)
|
||||
AC_CHECK_SIZEOF(int, 4)
|
||||
TL_CHECK_INT_TYPE(int32_t)
|
||||
TL_CHECK_INT_TYPE(uint32_t)
|
||||
|
||||
dnl Check for headers needed by timelib
|
||||
AC_CHECK_HEADERS([ \
|
||||
sys/time.h \
|
||||
sys/types.h \
|
||||
stdint.h \
|
||||
dirent.h \
|
||||
string.h \
|
||||
strings.h \
|
||||
unistd.h \
|
||||
io.h
|
||||
])
|
||||
|
||||
dnl Check for strtoll, atoll
|
||||
AC_CHECK_FUNCS(strtoll atoll strftime gettimeofday)
|
||||
+880
-1256
File diff suppressed because it is too large.
Load diff
+10
-38
@@ -543,7 +543,6 @@ const zend_function_entry date_funcs_period[] = {
|
||||
PHP_ME(DatePeriod, getStartDate, NULL, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(DatePeriod, getEndDate, NULL, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(DatePeriod, getDateInterval, NULL, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(DatePeriod, getRecurrences, NULL, ZEND_ACC_PUBLIC)
|
||||
PHP_FE_END
|
||||
};
|
||||
|
||||
@@ -4436,21 +4435,12 @@ PHP_FUNCTION(date_interval_create_from_date_string)
|
||||
Z_PARAM_STR(time_str)
|
||||
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
||||
|
||||
time = timelib_strtotime(ZSTR_VAL(time_str), ZSTR_LEN(time_str), &err, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper);
|
||||
|
||||
if (err->error_count > 0) {
|
||||
php_error_docref(NULL, E_WARNING, "Unknown or bad format (%s) at position %d (%c): %s", ZSTR_VAL(time_str),
|
||||
err->error_messages[0].position, err->error_messages[0].character ? err->error_messages[0].character : ' ', err->error_messages[0].message);
|
||||
RETVAL_FALSE;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
php_date_instantiate(date_ce_interval, return_value);
|
||||
|
||||
time = timelib_strtotime(ZSTR_VAL(time_str), ZSTR_LEN(time_str), &err, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper);
|
||||
diobj = Z_PHPINTERVAL_P(return_value);
|
||||
diobj->diff = timelib_rel_time_clone(&time->relative);
|
||||
diobj->initialized = 1;
|
||||
|
||||
cleanup:
|
||||
timelib_time_dtor(time);
|
||||
timelib_error_container_dtor(err);
|
||||
}
|
||||
@@ -4645,10 +4635,6 @@ PHP_METHOD(DatePeriod, __construct)
|
||||
dpobj->end = clone;
|
||||
}
|
||||
}
|
||||
|
||||
if (dpobj->end == NULL && recurrences < 1) {
|
||||
php_error_docref(NULL, E_WARNING, "The recurrence count '%d' is invalid. Needs to be > 0", (int) recurrences);
|
||||
}
|
||||
|
||||
/* options */
|
||||
dpobj->include_start_date = !(options & PHP_DATE_PERIOD_EXCLUDE_START_DATE);
|
||||
@@ -4741,27 +4727,6 @@ PHP_METHOD(DatePeriod, getDateInterval)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto int DatePeriod::getRecurrences()
|
||||
Get recurrences.
|
||||
*/
|
||||
PHP_METHOD(DatePeriod, getRecurrences)
|
||||
{
|
||||
php_period_obj *dpobj;
|
||||
|
||||
if (zend_parse_parameters_none() == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
dpobj = Z_PHPPERIOD_P(getThis());
|
||||
|
||||
if (0 == dpobj->recurrences - dpobj->include_start_date) {
|
||||
return;
|
||||
}
|
||||
|
||||
RETURN_LONG(dpobj->recurrences - dpobj->include_start_date);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int check_id_allowed(char *id, zend_long what) /* {{{ */
|
||||
{
|
||||
if (what & PHP_DATE_TIMEZONE_GROUP_AFRICA && strncasecmp(id, "Africa/", 7) == 0) return 1;
|
||||
@@ -5313,6 +5278,7 @@ PHP_METHOD(DatePeriod, __wakeup)
|
||||
/* {{{ date_period_read_property */
|
||||
static zval *date_period_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv)
|
||||
{
|
||||
zval *zv;
|
||||
if (type != BP_VAR_IS && type != BP_VAR_R) {
|
||||
zend_throw_error(NULL, "Retrieval of DatePeriod properties for modification is unsupported");
|
||||
return &EG(uninitialized_zval);
|
||||
@@ -5320,7 +5286,13 @@ static zval *date_period_read_property(zval *object, zval *member, int type, voi
|
||||
|
||||
Z_OBJPROP_P(object); /* build properties hash table */
|
||||
|
||||
return std_object_handlers.read_property(object, member, type, cache_slot, rv);
|
||||
zv = std_object_handlers.read_property(object, member, type, cache_slot, rv);
|
||||
if (Z_TYPE_P(zv) == IS_OBJECT && Z_OBJ_HANDLER_P(zv, clone_obj)) {
|
||||
/* defensive copy */
|
||||
ZVAL_OBJ(zv, Z_OBJ_HANDLER_P(zv, clone_obj)(zv));
|
||||
}
|
||||
|
||||
return zv;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
@@ -112,7 +112,6 @@ PHP_METHOD(DatePeriod, __set_state);
|
||||
PHP_METHOD(DatePeriod, getStartDate);
|
||||
PHP_METHOD(DatePeriod, getEndDate);
|
||||
PHP_METHOD(DatePeriod, getDateInterval);
|
||||
PHP_METHOD(DatePeriod, getRecurrences);
|
||||
|
||||
/* Options and Configuration */
|
||||
PHP_FUNCTION(date_default_timezone_set);
|
||||
|
||||
@@ -8,7 +8,6 @@ $start = new DateTime('2000-01-01 00:00:00', new DateTimeZone('Europe/Berlin'));
|
||||
$end = new DateTime('2000-01-31 00:00:00', new DateTimeZone('UTC'));
|
||||
$interval = new DateInterval('P1D');
|
||||
$period = new DatePeriod($start, $interval, $end);
|
||||
$recurrences = 4;
|
||||
|
||||
var_dump($period->getStartDate()->format('Y-m-d H:i:s'));
|
||||
var_dump($period->getStartDate()->getTimeZone()->getName());
|
||||
@@ -17,17 +16,6 @@ var_dump($period->getEndDate()->format('Y-m-d H:i:s'));
|
||||
var_dump($period->getEndDate()->getTimeZone()->getName());
|
||||
|
||||
var_dump($period->getDateInterval()->format('%R%y-%m-%d-%h-%i-%s'));
|
||||
var_dump($period->getRecurrences());
|
||||
|
||||
$periodWithRecurrences = new DatePeriod($start, $interval, $recurrences);
|
||||
|
||||
var_dump($periodWithRecurrences->getRecurrences());
|
||||
var_dump($periodWithRecurrences->getEndDate());
|
||||
|
||||
$periodWithRecurrencesWithoutStart = new DatePeriod($start, $interval, $recurrences, DatePeriod::EXCLUDE_START_DATE);
|
||||
|
||||
var_dump($periodWithRecurrences->getRecurrences());
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(19) "2000-01-01 00:00:00"
|
||||
@@ -35,7 +23,3 @@ string(13) "Europe/Berlin"
|
||||
string(19) "2000-01-31 00:00:00"
|
||||
string(3) "UTC"
|
||||
string(12) "+0-0-1-0-0-0"
|
||||
NULL
|
||||
int(4)
|
||||
NULL
|
||||
int(4)
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
DatePeriod: Test wrong recurrence parameter on __construct
|
||||
--FILE--
|
||||
<?php
|
||||
try {
|
||||
new DatePeriod(new DateTime('yesterday'), new DateInterval('P1D'), 0);
|
||||
} catch (Exception $exception) {
|
||||
echo $exception->getMessage(), "\n";
|
||||
}
|
||||
|
||||
try {
|
||||
new DatePeriod(new DateTime('yesterday'), new DateInterval('P1D'),-1);
|
||||
} catch (Exception $exception) {
|
||||
echo $exception->getMessage(), "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
DatePeriod::__construct(): The recurrence count '0' is invalid. Needs to be > 0
|
||||
DatePeriod::__construct(): The recurrence count '-1' is invalid. Needs to be > 0
|
||||
@@ -95,11 +95,11 @@ print "wanted=Friday 00:00:00\n\n";
|
||||
|
||||
print "TZ=Pacific/Kwajalein - wrong day.\n";
|
||||
date_default_timezone_set("Pacific/Kwajalein");
|
||||
$tStamp = mktime (17, 17, 17, 1, 8627, 1970);
|
||||
$tStamp = mktime (17, 17, 17, 1, 8626, 1970);
|
||||
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
|
||||
$strtotime_tstamp = strtotime("next Saturday", $tStamp);
|
||||
$strtotime_tstamp = strtotime("next Friday", $tStamp);
|
||||
print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
|
||||
print "wanted=Sunday 00:00:00\n\n";
|
||||
print "wanted=Friday 00:00:00\n\n";
|
||||
|
||||
print "TZ=Asia/Ulan_Bator - wrong day.\n";
|
||||
date_default_timezone_set("Asia/Ulan_Bator");
|
||||
@@ -256,9 +256,9 @@ result=Friday 2003-04-04 00:00:00 EEST 1
|
||||
wanted=Friday 00:00:00
|
||||
|
||||
TZ=Pacific/Kwajalein - wrong day.
|
||||
tStamp=Saturday 1993-08-14 17:17:17 -12 0
|
||||
result=Sunday 1993-08-22 00:00:00 +12 0
|
||||
wanted=Sunday 00:00:00
|
||||
tStamp=Friday 1993-08-13 17:17:17 -12 0
|
||||
result=Saturday 1993-08-21 00:00:00 +12 0
|
||||
wanted=Friday 00:00:00
|
||||
|
||||
TZ=Asia/Ulan_Bator - wrong day.
|
||||
tStamp=Saturday 2001-09-22 17:17:17 +09 1
|
||||
|
||||
@@ -132,11 +132,11 @@ print "wanted=Wednesday 00:15:00\n\n";
|
||||
|
||||
print "TZ=Pacific/Nauru - Is it OK for this to be 0:30? yes\n";
|
||||
date_default_timezone_set('Pacific/Nauru');
|
||||
$tStamp = mktime (17, 17, 17, 2, 3, 1979);
|
||||
$tStamp = mktime (17, 17, 17, 1, 3401, 1970);
|
||||
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
|
||||
$strtotime_tstamp = strtotime("next Saturday +2 hours", $tStamp);
|
||||
$strtotime_tstamp = strtotime("next Tuesday", $tStamp);
|
||||
print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
|
||||
print "wanted=Saturday 02:30:00\n\n";
|
||||
print "wanted=Tuesday 00:30:00\n\n";
|
||||
|
||||
print "TZ=Pacific/Niue - Is it OK for this to be 0:30 AM? yes\n";
|
||||
date_default_timezone_set('Pacific/Niue');
|
||||
@@ -292,9 +292,9 @@ result=Wednesday 1986-01-01 00:15:00 +0545 0
|
||||
wanted=Wednesday 00:15:00
|
||||
|
||||
TZ=Pacific/Nauru - Is it OK for this to be 0:30? yes
|
||||
tStamp=Saturday 1979-02-03 17:17:17 +1130 0
|
||||
result=Saturday 1979-02-10 02:30:00 +12 0
|
||||
wanted=Saturday 02:30:00
|
||||
tStamp=Tuesday 1979-04-24 17:17:17 +1130 0
|
||||
result=Tuesday 1979-05-01 00:30:00 +12 0
|
||||
wanted=Tuesday 00:30:00
|
||||
|
||||
TZ=Pacific/Niue - Is it OK for this to be 0:30 AM? yes
|
||||
tStamp=Sunday 1978-09-24 17:17:17 -1130 0
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
Test date_interval_create_from_date_string() function : nonsense data
|
||||
--FILE--
|
||||
<?php
|
||||
$i = date_interval_create_from_date_string("foobar");
|
||||
var_dump($i);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: date_interval_create_from_date_string(): Unknown or bad format (foobar) at position 0 (f): The timezone could not be found in the database in %sdate_interval_create_from_date_string_broken.php on line 2
|
||||
bool(false)
|
||||
@@ -4,9 +4,41 @@ Test date_interval_create_from_date_string() function : null parameter
|
||||
Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
|
||||
--FILE--
|
||||
<?php
|
||||
$i = date_interval_create_from_date_string(null);
|
||||
$i = date_interval_create_from_date_string(null); //returns a empty object
|
||||
var_dump($i);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: date_interval_create_from_date_string(): Unknown or bad format () at position 0 ( ): Empty string in %sdate_interval_create_from_date_string_nullparam.php on line 2
|
||||
bool(false)
|
||||
object(DateInterval)#%d (16) {
|
||||
["y"]=>
|
||||
int(0)
|
||||
["m"]=>
|
||||
int(0)
|
||||
["d"]=>
|
||||
int(0)
|
||||
["h"]=>
|
||||
int(0)
|
||||
["i"]=>
|
||||
int(0)
|
||||
["s"]=>
|
||||
int(0)
|
||||
["f"]=>
|
||||
float(0)
|
||||
["weekday"]=>
|
||||
int(0)
|
||||
["weekday_behavior"]=>
|
||||
int(0)
|
||||
["first_last_day_of"]=>
|
||||
int(0)
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
int(0)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(0)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
@@ -5,7 +5,7 @@ date_modify() function [1]
|
||||
--FILE--
|
||||
<?php
|
||||
date_default_timezone_set("Pacific/Kwajalein");
|
||||
$ts = date_create("Fri Aug 20 1993 23:59:59");
|
||||
$ts = date_create("Thu Aug 19 1993 23:59:59");
|
||||
echo date_format($ts, 'D, d M Y H:i:s T'), "\n";
|
||||
$ts->modify("+1 second");
|
||||
echo date_format($ts, 'D, d M Y H:i:s T'), "\n";
|
||||
@@ -22,8 +22,8 @@ $ts->modify("+ 1 hour 1 second");
|
||||
echo date_format($ts, 'D, d M Y H:i:s T'), "\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
Fri, 20 Aug 1993 23:59:59 -12
|
||||
Sun, 22 Aug 1993 00:00:00 +12
|
||||
Thu, 19 Aug 1993 23:59:59 -12
|
||||
Sat, 21 Aug 1993 00:00:00 +12
|
||||
Sun, 27 Mar 2005 01:59:59 CET
|
||||
Sun, 27 Mar 2005 03:00:00 CEST
|
||||
Sun, 30 Oct 2005 01:59:59 CEST
|
||||
|
||||
+26
-54
@@ -2062,10 +2062,10 @@ static int exif_file_sections_free(image_info_type *ImageInfo)
|
||||
/* {{{ exif_iif_add_value
|
||||
Add a value to image_info
|
||||
*/
|
||||
static void exif_iif_add_value(image_info_type *image_info, int section_index, char *name, int tag, int format, int length, void* value, size_t value_len, int motorola_intel)
|
||||
static void exif_iif_add_value(image_info_type *image_info, int section_index, char *name, int tag, int format, int length, void* value, int motorola_intel)
|
||||
{
|
||||
size_t idex;
|
||||
void *vptr, *vptr_end;
|
||||
void *vptr;
|
||||
image_info_value *info_value;
|
||||
image_info_data *info_data;
|
||||
image_info_data *list;
|
||||
@@ -2087,12 +2087,8 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
|
||||
|
||||
switch (format) {
|
||||
case TAG_FMT_STRING:
|
||||
if (length > value_len) {
|
||||
exif_error_docref("exif_iif_add_value" EXIFERR_CC, image_info, E_WARNING, "length > value_len: %d > %zu", length, value_len);
|
||||
value = NULL;
|
||||
}
|
||||
if (value) {
|
||||
length = (int)php_strnlen(value, length);
|
||||
length = php_strnlen(value, length);
|
||||
info_value->s = estrndup(value, length);
|
||||
info_data->length = length;
|
||||
} else {
|
||||
@@ -2114,10 +2110,6 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
|
||||
if (!length)
|
||||
break;
|
||||
case TAG_FMT_UNDEFINED:
|
||||
if (length > value_len) {
|
||||
exif_error_docref("exif_iif_add_value" EXIFERR_CC, image_info, E_WARNING, "length > value_len: %d > %zu", length, value_len);
|
||||
value = NULL;
|
||||
}
|
||||
if (value) {
|
||||
if (tag == TAG_MAKER_NOTE) {
|
||||
length = (int) php_strnlen(value, length);
|
||||
@@ -2148,12 +2140,7 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
|
||||
} else {
|
||||
info_value = &info_data->value;
|
||||
}
|
||||
vptr_end = (char *) value + value_len;
|
||||
for (idex=0,vptr=value; idex<(size_t)length; idex++,vptr=(char *) vptr + php_tiff_bytes_per_format[format]) {
|
||||
if ((char *) vptr_end - (char *) vptr < php_tiff_bytes_per_format[format]) {
|
||||
exif_error_docref("exif_iif_add_value" EXIFERR_CC, image_info, E_WARNING, "Value too short");
|
||||
break;
|
||||
}
|
||||
if (length>1) {
|
||||
info_value = &info_data->value.list[idex];
|
||||
}
|
||||
@@ -2189,7 +2176,7 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
|
||||
php_error_docref(NULL, E_WARNING, "Found value of type single");
|
||||
#endif
|
||||
info_value->f = *(float *)value;
|
||||
break;
|
||||
|
||||
case TAG_FMT_DOUBLE:
|
||||
#ifdef EXIF_DEBUG
|
||||
php_error_docref(NULL, E_WARNING, "Found value of type double");
|
||||
@@ -2207,9 +2194,9 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
|
||||
/* {{{ exif_iif_add_tag
|
||||
Add a tag from IFD to image_info
|
||||
*/
|
||||
static void exif_iif_add_tag(image_info_type *image_info, int section_index, char *name, int tag, int format, size_t length, void* value, size_t value_len)
|
||||
static void exif_iif_add_tag(image_info_type *image_info, int section_index, char *name, int tag, int format, size_t length, void* value)
|
||||
{
|
||||
exif_iif_add_value(image_info, section_index, name, tag, format, (int)length, value, value_len, image_info->motorola_intel);
|
||||
exif_iif_add_value(image_info, section_index, name, tag, format, (int)length, value, image_info->motorola_intel);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -2630,7 +2617,7 @@ static void add_assoc_image_info(zval *value, int sub_array, image_info_type *im
|
||||
*/
|
||||
static void exif_process_COM (image_info_type *image_info, char *value, size_t length)
|
||||
{
|
||||
exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_STRING, length-2, value+2, length-2);
|
||||
exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_STRING, length-2, value+2);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -2645,17 +2632,17 @@ static void exif_process_CME (image_info_type *image_info, char *value, size_t l
|
||||
if (length>3) {
|
||||
switch(value[2]) {
|
||||
case 0:
|
||||
exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_UNDEFINED, length, value, length);
|
||||
exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_UNDEFINED, length, value);
|
||||
break;
|
||||
case 1:
|
||||
exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_STRING, length, value, length);
|
||||
exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_STRING, length, value);
|
||||
break;
|
||||
default:
|
||||
php_error_docref(NULL, E_NOTICE, "Undefined JPEG2000 comment encoding");
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_UNDEFINED, 0, NULL, 0);
|
||||
exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_UNDEFINED, 0, NULL);
|
||||
php_error_docref(NULL, E_NOTICE, "JPEG2000 comment section too small");
|
||||
}
|
||||
}
|
||||
@@ -3165,7 +3152,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
||||
break;
|
||||
}
|
||||
|
||||
if (value_len < 2 || maker_note->offset >= value_len - 1) {
|
||||
if (maker_note->offset >= value_len) {
|
||||
/* Do not go past the value end */
|
||||
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "IFD data too short: 0x%04X offset 0x%04X", value_len, maker_note->offset);
|
||||
return FALSE;
|
||||
@@ -3220,7 +3207,6 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
||||
#endif
|
||||
default:
|
||||
case MN_OFFSET_NORMAL:
|
||||
data_len = value_len;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -3228,10 +3214,6 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
||||
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD size: 2 + 0x%04X*12 = 0x%04X > 0x%04X", NumDirEntries, 2+NumDirEntries*12, value_len);
|
||||
return FALSE;
|
||||
}
|
||||
if ((dir_start - value_ptr) > value_len - (2+NumDirEntries*12)) {
|
||||
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD size: 0x%04X > 0x%04X", (dir_start - value_ptr) + (2+NumDirEntries*12), value_len);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
for (de=0;de<NumDirEntries;de++) {
|
||||
if (!exif_process_IFD_TAG(ImageInfo, dir_start + 2 + 12 * de,
|
||||
@@ -3253,7 +3235,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
||||
static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, char *offset_base, size_t IFDlength, size_t displacement, int section_index, int ReadNextIFD, tag_table_type tag_table)
|
||||
{
|
||||
size_t length;
|
||||
unsigned int tag, format, components;
|
||||
int tag, format, components;
|
||||
char *value_ptr, tagname[64], cbuf[32], *outside=NULL;
|
||||
size_t byte_count, offset_val, fpos, fgot;
|
||||
int64_t byte_count_signed;
|
||||
@@ -3304,7 +3286,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
|
||||
offset_base is ImageInfo->file.list[sn].data-dir_offset
|
||||
dir_entry - offset_base is dir_offset+2+i*12
|
||||
*/
|
||||
if (byte_count > IFDlength || offset_val > IFDlength-byte_count || value_ptr < dir_entry || offset_val < (size_t)(dir_entry-offset_base) || dir_entry <= offset_base) {
|
||||
if (byte_count > IFDlength || offset_val > IFDlength-byte_count || value_ptr < dir_entry || offset_val < (size_t)(dir_entry-offset_base)) {
|
||||
/* It is important to check for IMAGE_FILETYPE_TIFF
|
||||
* JPEG does not use absolute pointers instead its pointers are
|
||||
* relative to the start of the TIFF header in APP1 section. */
|
||||
@@ -3423,10 +3405,6 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
|
||||
break;
|
||||
|
||||
case TAG_USERCOMMENT:
|
||||
EFREE_IF(ImageInfo->UserComment);
|
||||
ImageInfo->UserComment = NULL;
|
||||
EFREE_IF(ImageInfo->UserCommentEncoding);
|
||||
ImageInfo->UserCommentEncoding = NULL;
|
||||
ImageInfo->UserCommentLength = exif_process_user_comment(ImageInfo, &(ImageInfo->UserComment), &(ImageInfo->UserCommentEncoding), value_ptr, byte_count);
|
||||
break;
|
||||
|
||||
@@ -3568,7 +3546,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
|
||||
}
|
||||
}
|
||||
}
|
||||
exif_iif_add_tag(ImageInfo, section_index, exif_get_tagname(tag, tagname, sizeof(tagname), tag_table), tag, format, components, value_ptr, byte_count);
|
||||
exif_iif_add_tag(ImageInfo, section_index, exif_get_tagname(tag, tagname, sizeof(tagname), tag_table), tag, format, components, value_ptr);
|
||||
EFREE_IF(outside);
|
||||
return TRUE;
|
||||
}
|
||||
@@ -3730,10 +3708,10 @@ static void exif_process_APP12(image_info_type *ImageInfo, char *buffer, size_t
|
||||
size_t l1, l2=0;
|
||||
|
||||
if ((l1 = php_strnlen(buffer+2, length-2)) > 0) {
|
||||
exif_iif_add_tag(ImageInfo, SECTION_APP12, "Company", TAG_NONE, TAG_FMT_STRING, l1, buffer+2, l1);
|
||||
exif_iif_add_tag(ImageInfo, SECTION_APP12, "Company", TAG_NONE, TAG_FMT_STRING, l1, buffer+2);
|
||||
if (length > 2+l1+1) {
|
||||
l2 = php_strnlen(buffer+2+l1+1, length-2-l1-1);
|
||||
exif_iif_add_tag(ImageInfo, SECTION_APP12, "Info", TAG_NONE, TAG_FMT_STRING, l2, buffer+2+l1+1, l2);
|
||||
exif_iif_add_tag(ImageInfo, SECTION_APP12, "Info", TAG_NONE, TAG_FMT_STRING, l2, buffer+2+l1+1);
|
||||
}
|
||||
}
|
||||
#ifdef EXIF_DEBUG
|
||||
@@ -3948,7 +3926,7 @@ static int exif_scan_thumbnail(image_info_type *ImageInfo)
|
||||
return FALSE;
|
||||
marker = c;
|
||||
length = php_jpg_get16(data+pos);
|
||||
if (length > ImageInfo->Thumbnail.size || pos >= ImageInfo->Thumbnail.size - length) {
|
||||
if (pos+length>=ImageInfo->Thumbnail.size) {
|
||||
return FALSE;
|
||||
}
|
||||
#ifdef EXIF_DEBUG
|
||||
@@ -3969,10 +3947,6 @@ static int exif_scan_thumbnail(image_info_type *ImageInfo)
|
||||
case M_SOF14:
|
||||
case M_SOF15:
|
||||
/* handle SOFn block */
|
||||
if (length < 8 || ImageInfo->Thumbnail.size - 8 < pos) {
|
||||
/* exif_process_SOFn needs 8 bytes */
|
||||
return FALSE;
|
||||
}
|
||||
exif_process_SOFn(data+pos, marker, &sof_info);
|
||||
ImageInfo->Thumbnail.height = sof_info.height;
|
||||
ImageInfo->Thumbnail.width = sof_info.width;
|
||||
@@ -4010,10 +3984,10 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
|
||||
tag_table_type tag_table = exif_get_tag_table(section_index);
|
||||
|
||||
if (ImageInfo->ifd_nesting_level > MAX_IFD_NESTING_LEVEL) {
|
||||
return FALSE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (ImageInfo->FileSize >= 2 && ImageInfo->FileSize - 2 >= dir_offset) {
|
||||
if (ImageInfo->FileSize >= dir_offset+2) {
|
||||
sn = exif_file_sections_add(ImageInfo, M_PSEUDO, 2, NULL);
|
||||
#ifdef EXIF_DEBUG
|
||||
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read from TIFF: filesize(x%04X), IFD dir(x%04X + x%04X)", ImageInfo->FileSize, dir_offset, 2);
|
||||
@@ -4021,8 +3995,8 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
|
||||
php_stream_seek(ImageInfo->infile, dir_offset, SEEK_SET); /* we do not know the order of sections */
|
||||
php_stream_read(ImageInfo->infile, (char*)ImageInfo->file.list[sn].data, 2);
|
||||
num_entries = php_ifd_get16u(ImageInfo->file.list[sn].data, ImageInfo->motorola_intel);
|
||||
dir_size = 2/*num dir entries*/ +12/*length of entry*/*(size_t)num_entries +4/* offset to next ifd (points to thumbnail or NULL)*/;
|
||||
if (ImageInfo->FileSize >= dir_size && ImageInfo->FileSize - dir_size >= dir_offset) {
|
||||
dir_size = 2/*num dir entries*/ +12/*length of entry*/*num_entries +4/* offset to next ifd (points to thumbnail or NULL)*/;
|
||||
if (ImageInfo->FileSize >= dir_offset+dir_size) {
|
||||
#ifdef EXIF_DEBUG
|
||||
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read from TIFF: filesize(x%04X), IFD dir(x%04X + x%04X), IFD entries(%d)", ImageInfo->FileSize, dir_offset+2, dir_size-2, num_entries);
|
||||
#endif
|
||||
@@ -4105,9 +4079,9 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ImageInfo->FileSize >= ImageInfo->file.list[sn].size && ImageInfo->FileSize - ImageInfo->file.list[sn].size >= dir_offset) {
|
||||
if (ImageInfo->FileSize >= dir_offset + ImageInfo->file.list[sn].size) {
|
||||
if (ifd_size > dir_size) {
|
||||
if (ImageInfo->FileSize < ifd_size || dir_offset > ImageInfo->FileSize - ifd_size) {
|
||||
if (dir_offset + ifd_size > ImageInfo->FileSize) {
|
||||
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Error in TIFF: filesize(x%04X) less than size of IFD(x%04X + x%04X)", ImageInfo->FileSize, dir_offset, ifd_size);
|
||||
return FALSE;
|
||||
}
|
||||
@@ -4601,7 +4575,7 @@ PHP_FUNCTION(exif_read_data)
|
||||
if (ImageInfo.Thumbnail.size) {
|
||||
if (read_thumbnail) {
|
||||
/* not exif_iif_add_str : this is a buffer */
|
||||
exif_iif_add_tag(&ImageInfo, SECTION_THUMBNAIL, "THUMBNAIL", TAG_NONE, TAG_FMT_UNDEFINED, ImageInfo.Thumbnail.size, ImageInfo.Thumbnail.data, ImageInfo.Thumbnail.size);
|
||||
exif_iif_add_tag(&ImageInfo, SECTION_THUMBNAIL, "THUMBNAIL", TAG_NONE, TAG_FMT_UNDEFINED, ImageInfo.Thumbnail.size, ImageInfo.Thumbnail.data);
|
||||
}
|
||||
if (!ImageInfo.Thumbnail.width || !ImageInfo.Thumbnail.height) {
|
||||
/* try to evaluate if thumbnail data is present */
|
||||
@@ -4704,9 +4678,7 @@ PHP_FUNCTION(exif_thumbnail)
|
||||
ZVAL_STRINGL(return_value, ImageInfo.Thumbnail.data, ImageInfo.Thumbnail.size);
|
||||
if (arg_c >= 3) {
|
||||
if (!ImageInfo.Thumbnail.width || !ImageInfo.Thumbnail.height) {
|
||||
if (!exif_scan_thumbnail(&ImageInfo)) {
|
||||
ImageInfo.Thumbnail.width = ImageInfo.Thumbnail.height = 0;
|
||||
}
|
||||
exif_scan_thumbnail(&ImageInfo);
|
||||
}
|
||||
zval_dtor(z_width);
|
||||
zval_dtor(z_height);
|
||||
|
||||
Binary file not shown.
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug 77540 (Invalid Read on exif_process_SOFn)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
|
||||
--FILE--
|
||||
<?php
|
||||
$width = $height = 42;
|
||||
$s = exif_thumbnail(__DIR__."/bug77540.jpg", $width, $height);
|
||||
echo "Width ".$width."\n";
|
||||
echo "Height ".$height."\n";
|
||||
?>
|
||||
DONE
|
||||
--EXPECTF--
|
||||
Width 0
|
||||
Height 0
|
||||
DONE
|
||||
Binary file not shown.
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug 77563 (Uninitialized read in exif_process_IFD_in_MAKERNOTE)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
|
||||
--FILE--
|
||||
<?php
|
||||
$s = exif_thumbnail(__DIR__."/bug77563.jpg");
|
||||
?>
|
||||
DONE
|
||||
--EXPECTF--
|
||||
Warning: exif_thumbnail(bug77563.jpg): IFD data too short: 0x0009 offset 0x0008 in %s%ebug77563.php on line %d
|
||||
|
||||
Warning: exif_thumbnail(bug77563.jpg): File structure corrupted in %s%ebug77563.php on line %d
|
||||
|
||||
Warning: exif_thumbnail(bug77563.jpg): Invalid JPEG file in %s%ebug77563.php on line %d
|
||||
DONE
|
||||
Binary file not shown.
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Bug 77564 (Memory leak in exif_process_IFD_TAG)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(exif_read_data(dirname(__FILE__) . '/bug77564.jpg'));
|
||||
?>
|
||||
DONE
|
||||
--EXPECTF--
|
||||
|
||||
Warning: exif_read_data(bug77564.jpg): Illegal IFD offset in %sbug77564.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug77564.jpg): File structure corrupted in %sbug77564.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug77564.jpg): Invalid JPEG file in %sbug77564.php on line %d
|
||||
bool(false)
|
||||
DONE
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77753 (Heap-buffer-overflow in php_ifd_get32s)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(exif_read_data(__DIR__."/bug77753.tiff"));
|
||||
?>
|
||||
DONE
|
||||
--EXPECTF--
|
||||
%A
|
||||
Warning: exif_read_data(bug77753.tiff): Illegal IFD size: 0x006A > 0x0065 in %sbug77753.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug77753.tiff): Invalid TIFF file in %sbug77753.php on line %d
|
||||
bool(false)
|
||||
DONE
|
||||
Binary file not shown.
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77831 (Heap-buffer-overflow in exif_iif_add_value in EXIF)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(exif_read_data(__DIR__."/bug77831.tiff"));
|
||||
?>
|
||||
DONE
|
||||
--EXPECTF--
|
||||
%A
|
||||
bool(false)
|
||||
DONE
|
||||
Binary file not shown.
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77950 (Heap-buffer-overflow in _estrndup via exif_process_IFD_TAG)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
|
||||
--FILE--
|
||||
<?php
|
||||
exif_read_data(__DIR__."/bug77950.tiff");
|
||||
?>
|
||||
DONE
|
||||
--EXPECTF--
|
||||
%A
|
||||
DONE
|
||||
Binary file not shown.
+1
-1
@@ -1859,7 +1859,7 @@ data_accepted:
|
||||
php_pollfd p;
|
||||
int i;
|
||||
|
||||
p.fd = data->fd;
|
||||
p.fd = ftp->fd;
|
||||
p.events = (err == SSL_ERROR_WANT_READ) ? (POLLIN|POLLPRI) : POLLOUT;
|
||||
p.revents = 0;
|
||||
|
||||
|
||||
@@ -289,13 +289,8 @@ if ($pid) {
|
||||
}
|
||||
|
||||
}elseif (preg_match("~^CWD ([A-Za-z./]+)\r\n$~", $buf, $m)) {
|
||||
if (isset($bug77680)) {
|
||||
fputs($s, "550 Directory change to $m[1] failed: file does not exist\r\n");
|
||||
var_dump($buf);
|
||||
} else {
|
||||
change_dir($m[1]);
|
||||
fputs($s, "250 CWD command successful.\r\n");
|
||||
}
|
||||
change_dir($m[1]);
|
||||
fputs($s, "250 CWD command successful.\r\n");
|
||||
|
||||
} elseif (preg_match("~^NLST(?: ([A-Za-z./]+))?\r\n$~", $buf, $m)) {
|
||||
|
||||
@@ -337,9 +332,6 @@ if ($pid) {
|
||||
if (isset($bug7216)) {
|
||||
fputs($s, "257 OK.\r\n");
|
||||
} else {
|
||||
if (isset($bug77680)) {
|
||||
var_dump($buf);
|
||||
}
|
||||
fputs($s, "257 \"/path/to/ftproot$cwd$m[1]\" created.\r\n");
|
||||
}
|
||||
|
||||
|
||||
+1
-5
@@ -4699,11 +4699,7 @@ PHP_FUNCTION(imageantialias)
|
||||
if ((im = (gdImagePtr)zend_fetch_resource(Z_RES_P(IM), "Image", le_gd)) == NULL) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (im->trueColor) {
|
||||
im->AA = alias;
|
||||
}
|
||||
|
||||
gdImageSetAntiAliased(im, 0);
|
||||
RETURN_TRUE;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
+5
-23
@@ -1593,7 +1593,7 @@ void gdImageFilledArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e
|
||||
int i, pti;
|
||||
int lx = 0, ly = 0;
|
||||
int fx = 0, fy = 0;
|
||||
int startx, starty, endx, endy;
|
||||
|
||||
|
||||
if ((s % 360) == (e % 360)) {
|
||||
s = 0; e = 360;
|
||||
@@ -1620,8 +1620,8 @@ void gdImageFilledArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e
|
||||
|
||||
for (i = s, pti = 1; i <= e; i++, pti++) {
|
||||
int x, y;
|
||||
x = endx = ((long) gdCosT[i % 360] * (long) w / (2 * 1024)) + cx;
|
||||
y = endy = ((long) gdSinT[i % 360] * (long) h / (2 * 1024)) + cy;
|
||||
x = ((long) gdCosT[i % 360] * (long) w / (2 * 1024)) + cx;
|
||||
y = ((long) gdSinT[i % 360] * (long) h / (2 * 1024)) + cy;
|
||||
if (i != s) {
|
||||
if (!(style & gdChord)) {
|
||||
if (style & gdNoFill) {
|
||||
@@ -1646,8 +1646,8 @@ void gdImageFilledArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e
|
||||
if (!(style & (gdChord | gdNoFill))) {
|
||||
pts[0].x = cx;
|
||||
pts[0].y = cy;
|
||||
pts[pti].x = startx = x;
|
||||
pts[pti].y = starty = y;
|
||||
pts[pti].x = x;
|
||||
pts[pti].y = y;
|
||||
}
|
||||
}
|
||||
lx = x;
|
||||
@@ -1676,24 +1676,6 @@ void gdImageFilledArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e
|
||||
gdImageLine(im, cx, cy, fx, fy, color);
|
||||
}
|
||||
} else {
|
||||
if (e - s < 360) {
|
||||
if (pts[1].x != startx && pts[1].y == starty) {
|
||||
/* start point has been removed due to y-coord fix => insert it */
|
||||
for (i = pti; i > 1; i--) {
|
||||
pts[i].x = pts[i-1].x;
|
||||
pts[i].y = pts[i-1].y;
|
||||
}
|
||||
pts[1].x = startx;
|
||||
pts[1].y = starty;
|
||||
pti++;
|
||||
}
|
||||
if (pts[pti-1].x != endx && pts[pti-1].y == endy) {
|
||||
/* end point has been removed due to y-coord fix => insert it */
|
||||
pts[pti].x = endx;
|
||||
pts[pti].y = endy;
|
||||
pti++;
|
||||
}
|
||||
}
|
||||
pts[pti].x = cx;
|
||||
pts[pti].y = cy;
|
||||
gdImageFilledPolygon(im, pts, pti+1, color);
|
||||
|
||||
@@ -813,8 +813,8 @@ static int bmp_read_1bit(gdImagePtr im, gdIOCtxPtr infile, bmp_info_t *info, bmp
|
||||
}
|
||||
}
|
||||
|
||||
/* The line must be aligned on a 32 bits word, else it is padded with zeros */
|
||||
padding = (info->width + 7) / 8 % 4;
|
||||
/* The line must be divisible by 4, else its padded with NULLs */
|
||||
padding = ((int)ceil(0.1 * info->width)) % 4;
|
||||
if (padding) {
|
||||
padding = 4 - padding;
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ void gdImageGifCtx(gdImagePtr im, gdIOCtxPtr out)
|
||||
BitsPerPixel = colorstobpp(tim->colorsTotal);
|
||||
/* All set, let's do it. */
|
||||
GIFEncode(
|
||||
out, tim->sx, tim->sy, interlace, 0, tim->transparent, BitsPerPixel,
|
||||
out, tim->sx, tim->sy, tim->interlace, 0, tim->transparent, BitsPerPixel,
|
||||
tim->red, tim->green, tim->blue, tim);
|
||||
if (pim) {
|
||||
/* Destroy palette based temporary image. */
|
||||
|
||||
+108
-28
@@ -662,7 +662,43 @@ static inline int getPixelOverflowTC(gdImagePtr im, const int x, const int y, co
|
||||
}
|
||||
return c;
|
||||
} else {
|
||||
return bgColor;
|
||||
register int border = 0;
|
||||
|
||||
if (y < im->cy1) {
|
||||
border = im->tpixels[0][im->cx1];
|
||||
goto processborder;
|
||||
}
|
||||
|
||||
if (y < im->cy1) {
|
||||
border = im->tpixels[0][im->cx1];
|
||||
goto processborder;
|
||||
}
|
||||
|
||||
if (y > im->cy2) {
|
||||
if (x >= im->cx1 && x <= im->cx1) {
|
||||
border = im->tpixels[im->cy2][x];
|
||||
goto processborder;
|
||||
} else {
|
||||
return gdTrueColorAlpha(0, 0, 0, 127);
|
||||
}
|
||||
}
|
||||
|
||||
/* y is bound safe at this point */
|
||||
if (x < im->cx1) {
|
||||
border = im->tpixels[y][im->cx1];
|
||||
goto processborder;
|
||||
}
|
||||
|
||||
if (x > im->cx2) {
|
||||
border = im->tpixels[y][im->cx2];
|
||||
}
|
||||
|
||||
processborder:
|
||||
if (border == im->transparent) {
|
||||
return gdTrueColorAlpha(0, 0, 0, 127);
|
||||
} else{
|
||||
return gdTrueColorAlpha(gdTrueColorGetRed(border), gdTrueColorGetGreen(border), gdTrueColorGetBlue(border), 127);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -677,7 +713,42 @@ static inline int getPixelOverflowPalette(gdImagePtr im, const int x, const int
|
||||
}
|
||||
return colorIndex2RGBA(c);
|
||||
} else {
|
||||
return bgColor;
|
||||
register int border = 0;
|
||||
if (y < im->cy1) {
|
||||
border = gdImageGetPixel(im, im->cx1, 0);
|
||||
goto processborder;
|
||||
}
|
||||
|
||||
if (y < im->cy1) {
|
||||
border = gdImageGetPixel(im, im->cx1, 0);
|
||||
goto processborder;
|
||||
}
|
||||
|
||||
if (y > im->cy2) {
|
||||
if (x >= im->cx1 && x <= im->cx1) {
|
||||
border = gdImageGetPixel(im, x, im->cy2);
|
||||
goto processborder;
|
||||
} else {
|
||||
return gdTrueColorAlpha(0, 0, 0, 127);
|
||||
}
|
||||
}
|
||||
|
||||
/* y is bound safe at this point */
|
||||
if (x < im->cx1) {
|
||||
border = gdImageGetPixel(im, im->cx1, y);
|
||||
goto processborder;
|
||||
}
|
||||
|
||||
if (x > im->cx2) {
|
||||
border = gdImageGetPixel(im, im->cx2, y);
|
||||
}
|
||||
|
||||
processborder:
|
||||
if (border == im->transparent) {
|
||||
return gdTrueColorAlpha(0, 0, 0, 127);
|
||||
} else{
|
||||
return colorIndex2RGBcustomA(border, 127);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -950,7 +1021,7 @@ static inline void _gdScaleRow(gdImagePtr pSrc, unsigned int src_width, gdImage
|
||||
}
|
||||
}
|
||||
|
||||
static inline int _gdScaleHoriz(gdImagePtr pSrc, unsigned int src_width, unsigned int src_height, gdImagePtr pDst, unsigned int dst_width, unsigned int dst_height)
|
||||
static inline void _gdScaleHoriz(gdImagePtr pSrc, unsigned int src_width, unsigned int src_height, gdImagePtr pDst, unsigned int dst_width, unsigned int dst_height)
|
||||
{
|
||||
unsigned int u;
|
||||
LineContribType * contrib;
|
||||
@@ -965,14 +1036,13 @@ static inline int _gdScaleHoriz(gdImagePtr pSrc, unsigned int src_width, unsigne
|
||||
|
||||
contrib = _gdContributionsCalc(dst_width, src_width, (double)dst_width / (double)src_width, pSrc->interpolation);
|
||||
if (contrib == NULL) {
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
/* Scale each row */
|
||||
for (u = 0; u < dst_height - 1; u++) {
|
||||
_gdScaleRow(pSrc, src_width, pDst, dst_width, u, contrib);
|
||||
}
|
||||
_gdContributionsFree (contrib);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline void _gdScaleCol (gdImagePtr pSrc, unsigned int src_width, gdImagePtr pRes, unsigned int dst_width, unsigned int dst_height, unsigned int uCol, LineContribType *contrib)
|
||||
@@ -998,7 +1068,7 @@ static inline void _gdScaleCol (gdImagePtr pSrc, unsigned int src_width, gdImag
|
||||
}
|
||||
}
|
||||
|
||||
static inline int _gdScaleVert (const gdImagePtr pSrc, const unsigned int src_width, const unsigned int src_height, const gdImagePtr pDst, const unsigned int dst_width, const unsigned int dst_height)
|
||||
static inline void _gdScaleVert (const gdImagePtr pSrc, const unsigned int src_width, const unsigned int src_height, const gdImagePtr pDst, const unsigned int dst_width, const unsigned int dst_height)
|
||||
{
|
||||
unsigned int u;
|
||||
LineContribType * contrib;
|
||||
@@ -1013,21 +1083,19 @@ static inline int _gdScaleVert (const gdImagePtr pSrc, const unsigned int src_wi
|
||||
|
||||
contrib = _gdContributionsCalc(dst_height, src_height, (double)(dst_height) / (double)(src_height), pSrc->interpolation);
|
||||
if (contrib == NULL) {
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
/* scale each column */
|
||||
for (u = 0; u < dst_width - 1; u++) {
|
||||
_gdScaleCol(pSrc, src_width, pDst, dst_width, dst_height, u, contrib);
|
||||
}
|
||||
_gdContributionsFree(contrib);
|
||||
return 1;
|
||||
}
|
||||
|
||||
gdImagePtr gdImageScaleTwoPass(const gdImagePtr src, const unsigned int src_width, const unsigned int src_height, const unsigned int new_width, const unsigned int new_height)
|
||||
{
|
||||
gdImagePtr tmp_im;
|
||||
gdImagePtr dst;
|
||||
int scale_pass_res;
|
||||
|
||||
if (new_width == 0 || new_height == 0) {
|
||||
return NULL;
|
||||
@@ -1043,11 +1111,7 @@ gdImagePtr gdImageScaleTwoPass(const gdImagePtr src, const unsigned int src_widt
|
||||
return NULL;
|
||||
}
|
||||
gdImageSetInterpolationMethod(tmp_im, src->interpolation_id);
|
||||
scale_pass_res = _gdScaleHoriz(src, src_width, src_height, tmp_im, new_width, src_height);
|
||||
if (scale_pass_res != 1) {
|
||||
gdImageDestroy(tmp_im);
|
||||
return NULL;
|
||||
}
|
||||
_gdScaleHoriz(src, src_width, src_height, tmp_im, new_width, src_height);
|
||||
|
||||
dst = gdImageCreateTrueColor(new_width, new_height);
|
||||
if (dst == NULL) {
|
||||
@@ -1055,17 +1119,33 @@ gdImagePtr gdImageScaleTwoPass(const gdImagePtr src, const unsigned int src_widt
|
||||
return NULL;
|
||||
}
|
||||
gdImageSetInterpolationMethod(dst, src->interpolation_id);
|
||||
scale_pass_res = _gdScaleVert(tmp_im, new_width, src_height, dst, new_width, new_height);
|
||||
if (scale_pass_res != 1) {
|
||||
gdImageDestroy(dst);
|
||||
gdImageDestroy(tmp_im);
|
||||
return NULL;
|
||||
}
|
||||
_gdScaleVert(tmp_im, new_width, src_height, dst, new_width, new_height);
|
||||
gdImageDestroy(tmp_im);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
gdImagePtr Scale(const gdImagePtr src, const unsigned int src_width, const unsigned int src_height, const gdImagePtr dst, const unsigned int new_width, const unsigned int new_height)
|
||||
{
|
||||
gdImagePtr tmp_im;
|
||||
|
||||
if (new_width == 0 || new_height == 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
tmp_im = gdImageCreateTrueColor(new_width, src_height);
|
||||
if (tmp_im == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
gdImageSetInterpolationMethod(tmp_im, src->interpolation_id);
|
||||
|
||||
_gdScaleHoriz(src, src_width, src_height, tmp_im, new_width, src_height);
|
||||
_gdScaleVert(tmp_im, new_width, src_height, dst, new_width, new_height);
|
||||
|
||||
gdImageDestroy(tmp_im);
|
||||
return dst;
|
||||
}
|
||||
|
||||
/*
|
||||
BilinearFixed, BicubicFixed and nearest implementations are rewamped versions of the implementation in CBitmapEx
|
||||
http://www.codeproject.com/Articles/29121/CBitmapEx-Free-C-Bitmap-Manipulation-Class
|
||||
@@ -1237,11 +1317,11 @@ static gdImagePtr gdImageScaleBilinearPalette(gdImagePtr im, const unsigned int
|
||||
f_b1, f_b2, f_b3, f_b4,
|
||||
f_a1, f_a2, f_a3, f_a4;
|
||||
|
||||
/* 0 for bgColor; (n,m) is supposed to be valid anyway */
|
||||
/* zero for the background color, nothig gets outside anyway */
|
||||
pixel1 = getPixelOverflowPalette(im, n, m, 0);
|
||||
pixel2 = getPixelOverflowPalette(im, n + 1, m, pixel1);
|
||||
pixel3 = getPixelOverflowPalette(im, n, m + 1, pixel1);
|
||||
pixel4 = getPixelOverflowPalette(im, n + 1, m + 1, pixel1);
|
||||
pixel2 = getPixelOverflowPalette(im, n + 1, m, 0);
|
||||
pixel3 = getPixelOverflowPalette(im, n, m + 1, 0);
|
||||
pixel4 = getPixelOverflowPalette(im, n + 1, m + 1, 0);
|
||||
|
||||
f_r1 = gd_itofx(gdTrueColorGetRed(pixel1));
|
||||
f_r2 = gd_itofx(gdTrueColorGetRed(pixel2));
|
||||
@@ -1329,11 +1409,11 @@ static gdImagePtr gdImageScaleBilinearTC(gdImagePtr im, const unsigned int new_w
|
||||
f_b1, f_b2, f_b3, f_b4,
|
||||
f_a1, f_a2, f_a3, f_a4;
|
||||
dwSrcTotalOffset = m + n;
|
||||
/* 0 for bgColor; (n,m) is supposed to be valid anyway */
|
||||
/* 0 for bgColor, nothing gets outside anyway */
|
||||
pixel1 = getPixelOverflowTC(im, n, m, 0);
|
||||
pixel2 = getPixelOverflowTC(im, n + 1, m, pixel1);
|
||||
pixel3 = getPixelOverflowTC(im, n, m + 1, pixel1);
|
||||
pixel4 = getPixelOverflowTC(im, n + 1, m + 1, pixel1);
|
||||
pixel2 = getPixelOverflowTC(im, n + 1, m, 0);
|
||||
pixel3 = getPixelOverflowTC(im, n, m + 1, 0);
|
||||
pixel4 = getPixelOverflowTC(im, n + 1, m + 1, 0);
|
||||
|
||||
f_r1 = gd_itofx(gdTrueColorGetRed(pixel1));
|
||||
f_r2 = gd_itofx(gdTrueColorGetRed(pixel2));
|
||||
|
||||
@@ -100,7 +100,6 @@ void gdImageWBMPCtx (gdImagePtr image, int fg, gdIOCtx * out)
|
||||
/* create the WBMP */
|
||||
if ((wbmp = createwbmp (gdImageSX (image), gdImageSY (image), WBMP_WHITE)) == NULL) {
|
||||
gd_error("Could not create WBMP");
|
||||
return;
|
||||
}
|
||||
|
||||
/* fill up the WBMP structure */
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
--TEST--
|
||||
Bug #73281 (imagescale(…, IMG_BILINEAR_FIXED) can cause black border)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.3', '<=')) die('skip upstream fix not yet released');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$coordinates = [[0, 0], [0, 199], [199, 199], [199, 0]];
|
||||
|
||||
$src = imagecreatetruecolor(100, 100);
|
||||
$white = imagecolorallocate($src, 255, 255, 255);
|
||||
imagefilledrectangle($src, 0,0, 99,99, $white);
|
||||
$dst = imagescale($src, 200, 200, IMG_BILINEAR_FIXED);
|
||||
echo "truecolor source\n";
|
||||
foreach ($coordinates as $coordinate) {
|
||||
list($x, $y) = $coordinate;
|
||||
printf("%3d, %3d: %x\n", $x, $y, imagecolorat($dst, $x, $y));
|
||||
}
|
||||
|
||||
$src = imagecreate(100, 100);
|
||||
$white = imagecolorallocate($src, 255, 255, 255);
|
||||
imagefilledrectangle($src, 0,0, 99,99, $white);
|
||||
$dst = imagescale($src, 200, 200, IMG_BILINEAR_FIXED);
|
||||
echo "\npalette source\n";
|
||||
foreach ($coordinates as $coordinate) {
|
||||
list($x, $y) = $coordinate;
|
||||
printf("%3d, %3d: %x\n", $x, $y, imagecolorat($dst, $x, $y));
|
||||
}
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
truecolor source
|
||||
0, 0: ffffff
|
||||
0, 199: ffffff
|
||||
199, 199: ffffff
|
||||
199, 0: ffffff
|
||||
|
||||
palette source
|
||||
0, 0: ffffff
|
||||
0, 199: ffffff
|
||||
199, 199: ffffff
|
||||
199, 0: ffffff
|
||||
===DONE===
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Bug #73614 (gdImageFilledArc() doesn't properly draw pies)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.5', '<=')) die('skip upstream bugfix not yet released');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once __DIR__ . '/func.inc';
|
||||
|
||||
$image = imagecreatetruecolor(500, 500);
|
||||
|
||||
$white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);
|
||||
$navy = imagecolorallocate($image, 0x00, 0x00, 0x80);
|
||||
$red = imagecolorallocate($image, 0xFF, 0x00, 0x00);
|
||||
|
||||
imagefilledarc($image, 250, 250, 500, 250, 0, 88, $white, IMG_ARC_PIE);
|
||||
imagefilledarc($image, 250, 250, 500, 250, 88, 91 , $navy, IMG_ARC_PIE);
|
||||
imagefilledarc($image, 250, 250, 500, 250, 91, 360 , $red, IMG_ARC_PIE);
|
||||
|
||||
test_image_equals_file(__DIR__ . '/bug73614.png', $image);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
The images are equal.
|
||||
===DONE===
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.6 KiB |
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77272 (imagescale() may return image resource on failure)
|
||||
--INI--
|
||||
memory_limit=-1
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
if (!GD_BUNGLED && version_compare(GD_VERSION, '2.2.5', '<=')) die('skip upstream fix not yet released');
|
||||
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$img = imagecreate(2**28, 1);
|
||||
var_dump(imagescale($img, 1, 1, IMG_TRIANGLE));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Warning: imagescale():%S product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully
|
||||
in %s on line %d
|
||||
bool(false)
|
||||
===DONE===
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 102 B |
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77391 (1bpp BMPs may fail to be loaded)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.5', '<=')) die('skip upstream not yet fixed');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(imagecreatefrombmp(__DIR__ . '/bug77391.bmp'));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
resource(%d) of type (gd)
|
||||
===DONE===
|
||||
@@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77479 (imagewbmp() segfaults with very large image)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
|
||||
?>
|
||||
--INI--
|
||||
memory_limit=-1
|
||||
--FILE--
|
||||
<?php
|
||||
$im = imagecreate(40000, 20000);
|
||||
imagecolorallocate($im, 0, 0, 0);
|
||||
imagewbmp($im, __DIR__ . '/77479.wbmp');
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Warning: imagewbmp(): gd warning: product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully
|
||||
in %s on line %d
|
||||
|
||||
Warning: imagewbmp(): Could not create WBMP in %s on line %d
|
||||
===DONE===
|
||||
--CLEAN--
|
||||
<?php
|
||||
@unlink(__DIR__ . '/77479.wbmp');
|
||||
?>
|
||||
@@ -1,24 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77700 (Writing truecolor images as GIF ignores interlace flag)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$im = imagecreatetruecolor(10, 10);
|
||||
imagefilledrectangle($im, 0, 0, 9, 9, imagecolorallocate($im, 255, 255, 255));
|
||||
imageinterlace($im, 1);
|
||||
imagegif($im, __DIR__ . 'bug77700.gif');
|
||||
|
||||
$im = imagecreatefromgif(__DIR__ . 'bug77700.gif');
|
||||
var_dump(imageinterlace($im));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
int(1)
|
||||
===DONE===
|
||||
--CLEAN--
|
||||
<?php
|
||||
unlink(__DIR__ . 'bug77700.gif');
|
||||
?>
|
||||
@@ -1,29 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77943 (imageantialias($image, false); does not work)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once __DIR__ . '/func.inc';
|
||||
|
||||
$width = 400;
|
||||
$height = 300;
|
||||
$im = imagecreatetruecolor($width, $height);
|
||||
$white = imagecolorallocate($im, 255, 255, 255);
|
||||
$blue = imagecolorallocate($im, 0, 0, 255);
|
||||
|
||||
imageantialias($im, false);
|
||||
imagefilledrectangle($im, 0, 0, $width-1, $height-1, $white);
|
||||
|
||||
imageline($im, 0, 0, $width, $height, $blue);
|
||||
imagesetthickness($im, 3);
|
||||
imageline($im, 10, 0, $width, $height-10, $blue);
|
||||
|
||||
test_image_equals_file(__DIR__ . '/bug77943.png', $im);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
The images are equal.
|
||||
===DONE===
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.1 KiB |
@@ -194,7 +194,7 @@ static void PHP_SHA3_Final(unsigned char* digest,
|
||||
}
|
||||
|
||||
// Zero out context
|
||||
ZEND_SECURE_ZERO(ctx, sizeof(PHP_SHA3_CTX));
|
||||
memset(ctx, 0, sizeof(PHP_SHA3_CTX));
|
||||
}
|
||||
|
||||
// ==========================================================================
|
||||
|
||||
@@ -129,7 +129,7 @@ static inline void SnefruTransform(PHP_SNEFRU_CTX *context, const unsigned char
|
||||
((input[i+2] & 0xff) << 8) | (input[i+3] & 0xff);
|
||||
}
|
||||
Snefru(context->state);
|
||||
ZEND_SECURE_ZERO(&context->state[8], sizeof(uint32_t) * 8);
|
||||
memset(&context->state[8], 0, sizeof(uint32_t) * 8);
|
||||
}
|
||||
|
||||
PHP_HASH_API void PHP_SNEFRUInit(PHP_SNEFRU_CTX *context)
|
||||
|
||||
@@ -939,15 +939,13 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) /*
|
||||
|
||||
xlink = (zend_resource*) le->ptr;
|
||||
if ((!persistent && xlink->type == le_link) || xlink->type == le_plink) {
|
||||
if (IBG(default_link) != xlink) {
|
||||
GC_REFCOUNT(xlink)++;
|
||||
if (IBG(default_link)) {
|
||||
zend_list_delete(IBG(default_link));
|
||||
}
|
||||
IBG(default_link) = xlink;
|
||||
if (IBG(default_link)) {
|
||||
zend_list_close(IBG(default_link));
|
||||
}
|
||||
GC_REFCOUNT(xlink)++;
|
||||
RETURN_RES(xlink);
|
||||
xlink->gc.refcount++;
|
||||
xlink->gc.refcount++;
|
||||
IBG(default_link) = xlink;
|
||||
RETVAL_RES(xlink);
|
||||
} else {
|
||||
zend_hash_str_del(&EG(regular_list), hash, sizeof(hash)-1);
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ static int datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_constructor)
|
||||
intl_error_reset(NULL);
|
||||
object = return_value;
|
||||
/* Parse parameters. */
|
||||
if (zend_parse_parameters_ex(zpp_flags, ZEND_NUM_ARGS(), "s!ll|zzs",
|
||||
if (zend_parse_parameters_ex(zpp_flags, ZEND_NUM_ARGS(), "sll|zzs",
|
||||
&locale_str, &locale_len, &date_type, &time_type, &timezone_zv,
|
||||
&calendar_zv, &pattern_str, &pattern_str_len) == FAILURE) {
|
||||
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_create: "
|
||||
|
||||
@@ -169,7 +169,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
|
||||
goto cleanup;
|
||||
}
|
||||
cal = obj_cal->clone();
|
||||
} else if (instanceof_function(instance_ce, php_date_get_interface_ce())) {
|
||||
} else if (instanceof_function(instance_ce, php_date_get_date_ce())) {
|
||||
if (intl_datetime_decompose(object, &date, &timeZone, NULL,
|
||||
"datefmt_format_object") == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
|
||||
@@ -1 +1 @@
|
||||
- var_dump support
|
||||
- var_dump support
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77895: IntlDateFormatter::create fails in strict mode if $locale = null
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
var_dump(IntlDateFormatter::create(null, IntlDateFormatter::NONE, IntlDateFormatter::NONE));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
object(IntlDateFormatter)#1 (0) {
|
||||
}
|
||||
Loaded 100 of 371 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user