mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-12 03:30:50 +00:00
Compare commits
225
Commits
php-7.3.10
...
php-7.3.13
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a1457cf8b8 | ||
|
|
b88bd529e7 | ||
|
|
3371c84ff1 | ||
|
|
df5ec733ff | ||
|
|
63d0fa4a92 | ||
|
|
11893c8e66 | ||
|
|
36ac1671d5 | ||
|
|
303528803a | ||
|
|
65bbc67063 | ||
|
|
3444b90746 | ||
|
|
d2cfb63f02 | ||
|
|
861fa60814 | ||
|
|
600f1f898f | ||
|
|
bb735c9e9e | ||
|
|
3d81c54879 | ||
|
|
db420cb6a1 | ||
|
|
1979c5d16f | ||
|
|
8c4b0ddde5 | ||
|
|
ff2140c49d | ||
|
|
c55d09c2f5 | ||
|
|
fee38633d2 | ||
|
|
23c65a8173 | ||
|
|
bb30fe9e2b | ||
|
|
e1da72bdf1 | ||
|
|
e981f5af51 | ||
|
|
c7141412ce | ||
|
|
b4f501d5a4 | ||
|
|
9b92c1d154 | ||
|
|
3b46fbfc36 | ||
|
|
f6eac76b65 | ||
|
|
e72e3370c6 | ||
|
|
a2c41c0ea6 | ||
|
|
39d04f15f8 | ||
|
|
9083e178f6 | ||
|
|
ea2a125789 | ||
|
|
2c9926f156 | ||
|
|
4a55794b98 | ||
|
|
b9dfa12853 | ||
|
|
6dcc0b859f | ||
|
|
29f4939923 | ||
|
|
ee243bc471 | ||
|
|
8d2a9d8859 | ||
|
|
5fa6dcd972 | ||
|
|
6d4965febd | ||
|
|
4c9ba3e042 | ||
|
|
e85cae8ef4 | ||
|
|
d317e16e89 | ||
|
|
747cb46244 | ||
|
|
4f984a2fdb | ||
|
|
85874af404 | ||
|
|
e175a0a1c8 | ||
|
|
e29922f054 | ||
|
|
d3237b5504 | ||
|
|
5f6eaf355c | ||
|
|
33dd25d21c | ||
|
|
f9895b4bf5 | ||
|
|
8c2b3b0568 | ||
|
|
2bdb13a1f7 | ||
|
|
736cd93ef5 | ||
|
|
89c327f884 | ||
|
|
b61b60d15b | ||
|
|
16c4910876 | ||
|
|
469820048d | ||
|
|
74699533e5 | ||
|
|
5249993814 | ||
|
|
813305b67f | ||
|
|
8daf96cef3 | ||
|
|
832b5c7b9d | ||
|
|
fa89c41f37 | ||
|
|
52f049879a | ||
|
|
326cd05dae | ||
|
|
36943dfff1 | ||
|
|
c00fd843d7 | ||
|
|
2213bd36fd | ||
|
|
57b4dcbe77 | ||
|
|
4b5cdda0c7 | ||
|
|
1c9b62fbd4 | ||
|
|
bea2ff88c9 | ||
|
|
ab061f95ca | ||
|
|
4f50d58cab | ||
|
|
ce035dc4a0 | ||
|
|
45a7723267 | ||
|
|
c7c7ab53ac | ||
|
|
d2cde0bfd3 | ||
|
|
3725a446ba | ||
|
|
22ac57b064 | ||
|
|
e2a6bf482f | ||
|
|
7439d48bea | ||
|
|
900bdcbd03 | ||
|
|
74ac3dd6e2 | ||
|
|
46561dab6a | ||
|
|
4ba8d78100 | ||
|
|
96c84b7bc1 | ||
|
|
a0163417ef | ||
|
|
daf1fc6e31 | ||
|
|
bbd481c11d | ||
|
|
3164186d53 | ||
|
|
6fd6ad8f53 | ||
|
|
cbf589b17c | ||
|
|
d6ca174d5b | ||
|
|
736af5f660 | ||
|
|
a8f60ac9dd | ||
|
|
9fd555f99e | ||
|
|
46894580b0 | ||
|
|
2fdd142f99 | ||
|
|
d6fdc17f7f | ||
|
|
195c2008e8 | ||
|
|
26f45cb4bb | ||
|
|
4b15f7ca09 | ||
|
|
05d6878b3b | ||
|
|
11654fdfa6 | ||
|
|
fd3118ffb0 | ||
|
|
8a03fd6a5e | ||
|
|
19e6abebc7 | ||
|
|
2624c9a505 | ||
|
|
7d19668f60 | ||
|
|
ab61d5caf9 | ||
|
|
3322c78a88 | ||
|
|
114c03b9a6 | ||
|
|
239e2dda64 | ||
|
|
1d6e9da743 | ||
|
|
1ce8c805e2 | ||
|
|
545412a6cd | ||
|
|
cf183a5e2c | ||
|
|
abaf9a76dc | ||
|
|
f45eb353d1 | ||
|
|
a6d219630c | ||
|
|
f4d078b1c7 | ||
|
|
9a2b42a5c1 | ||
|
|
5b1bb23edf | ||
|
|
05560b67bc | ||
|
|
0505fbf2e5 | ||
|
|
d295e1dce2 | ||
|
|
f2fb37a772 | ||
|
|
752a34fb2c | ||
|
|
8ce04df7e0 | ||
|
|
3c42471ef8 | ||
|
|
a5d3620d93 | ||
|
|
f7596d1b5b | ||
|
|
3124129ca8 | ||
|
|
848bc776ea | ||
|
|
2fcb5eadbb | ||
|
|
2fc5d00afa | ||
|
|
209e37db7d | ||
|
|
0805e132b0 | ||
|
|
6fcde56b03 | ||
|
|
2046b3ce4f | ||
|
|
e546d721e8 | ||
|
|
45db6fa567 | ||
|
|
466f91bb3b | ||
|
|
f6bfbe9553 | ||
|
|
7df50ef147 | ||
|
|
66c48e8694 | ||
|
|
37d27e666a | ||
|
|
878704ff6f | ||
|
|
115f6effec | ||
|
|
91c4abcfcc | ||
|
|
ab938d7bbc | ||
|
|
99c67804d5 | ||
|
|
8a9df88597 | ||
|
|
915fe2fdc6 | ||
|
|
d2331cc3f2 | ||
|
|
7530938670 | ||
|
|
8f949eba80 | ||
|
|
8c9c58436b | ||
|
|
ed099ab186 | ||
|
|
954d073833 | ||
|
|
3ddb63dce1 | ||
|
|
d0f4966b05 | ||
|
|
bc4c4c658c | ||
|
|
087051c9a5 | ||
|
|
1a184f030a | ||
|
|
f53af9ac23 | ||
|
|
8509970e6a | ||
|
|
e65adc9c19 | ||
|
|
9c89f43d55 | ||
|
|
697945aa89 | ||
|
|
9cd365e571 | ||
|
|
f989a4cd44 | ||
|
|
623d897998 | ||
|
|
0701835c01 | ||
|
|
33e556fab4 | ||
|
|
0d6c2448a7 | ||
|
|
698088ca7c | ||
|
|
398b308316 | ||
|
|
e76dea4283 | ||
|
|
0fa13028cb | ||
|
|
85e7668129 | ||
|
|
003c13d7bc | ||
|
|
6bf5c8508a | ||
|
|
3e139a4653 | ||
|
|
f53b8268d6 | ||
|
|
e3255a4f49 | ||
|
|
85b001974a | ||
|
|
e11ed02870 | ||
|
|
03efeda538 | ||
|
|
409e9ea51d | ||
|
|
175f4f24ae | ||
|
|
c5d4c45e7d | ||
|
|
e691a98c1f | ||
|
|
3a2fa489dd | ||
|
|
252ebce0d7 | ||
|
|
f98684b06c | ||
|
|
29bced9521 | ||
|
|
8a11f1284e | ||
|
|
2f6efd835d | ||
|
|
74876f09c4 | ||
|
|
8873df8e86 | ||
|
|
da8aa4a798 | ||
|
|
81cefab7b0 | ||
|
|
00ad365125 | ||
|
|
fdcca93056 | ||
|
|
df982da587 | ||
|
|
31f617d9bc | ||
|
|
f6f981c13c | ||
|
|
716518373f | ||
|
|
6f0e5a45ff | ||
|
|
2823e938d4 | ||
|
|
e2bdd7b4ab | ||
|
|
a270eb1911 | ||
|
|
664b1a3f57 | ||
|
|
c43fc204b1 | ||
|
|
cf31210f29 | ||
|
|
fadd7f0f1e | ||
|
|
481520d381 |
No files matched your search
@@ -1,6 +1,147 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? ????, PHP 7.3.10
|
||||
19 Dec 2019, PHP 7.3.13
|
||||
|
||||
- Bcmath:
|
||||
. Fixed bug #78878 (Buffer underflow in bc_shift_addsub). (CVE-2019-11046).
|
||||
(cmb)
|
||||
|
||||
- Core:
|
||||
. Fixed bug #78862 (link() silently truncates after a null byte on Windows).
|
||||
(CVE-2019-11044). (cmb)
|
||||
. Fixed bug #78863 (DirectoryIterator class silently truncates after a null
|
||||
byte). (CVE-2019-11045). (cmb)
|
||||
. Fixed bug #78943 (mail() may release string with refcount==1 twice).
|
||||
(CVE-2019-11049). (cmb)
|
||||
. Fixed bug #78787 (Segfault with trait overriding inherited private shadow
|
||||
property). (Nikita)
|
||||
. Fixed bug #78868 (Calling __autoload() with incorrect EG(fake_scope) value).
|
||||
(Antony Dovgal, Dmitry)
|
||||
. Fixed bug #78296 (is_file fails to detect file). (cmb)
|
||||
|
||||
- EXIF:
|
||||
. Fixed bug #78793 (Use-after-free in exif parsing under memory sanitizer).
|
||||
(CVE-2019-11050). (Nikita)
|
||||
. Fixed bug #78910 (Heap-buffer-overflow READ in exif). (CVE-2019-11047).
|
||||
(Nikita)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #78849 (GD build broken with -D SIGNED_COMPARE_SLOW). (cmb)
|
||||
|
||||
- MBString:
|
||||
. Upgraded bundled Oniguruma to 6.9.4. (cmb)
|
||||
|
||||
- OPcache:
|
||||
. Fixed potential ASLR related invalid opline handler issues. (cmb)
|
||||
. Fixed $x = (bool)$x; with opcache (should emit undeclared variable notice).
|
||||
(Tyson Andre)
|
||||
|
||||
- PCRE:
|
||||
. Fixed bug #78853 (preg_match() may return integer > 1). (cmb)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #78759 (array_search in $GLOBALS). (Nikita)
|
||||
. Fixed bug #77638 (var_export'ing certain class instances segfaults). (cmb)
|
||||
. Fixed bug #78840 (imploding $GLOBALS crashes). (cmb)
|
||||
. Fixed bug #78833 (Integer overflow in pack causes out-of-bound access).
|
||||
(cmb)
|
||||
. Fixed bug #78814 (strip_tags allows / in tag name => whitelist bypass).
|
||||
(cmb)
|
||||
|
||||
21 Nov 2019, PHP 7.3.12
|
||||
|
||||
- Core:
|
||||
. Fixed bug #78658 (Memory corruption using Closure::bindTo). (Nikita)
|
||||
. Fixed bug #78656 (Parse errors classified as highest log-level). (Erik
|
||||
Lundin)
|
||||
. Fixed bug #78752 (Segfault if GC triggered while generator stack frame is
|
||||
being destroyed). (Nikita)
|
||||
. Fixed bug #78689 (Closure::fromCallable() doesn't handle
|
||||
[Closure, '__invoke']). (Nikita)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #78694 (Appending to a variant array causes segfault). (cmb)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #70153 (\DateInterval incorrectly unserialized). (Maksim Iakunin)
|
||||
. Fixed bug #78751 (Serialising DatePeriod converts DateTimeImmutable). (cmb)
|
||||
|
||||
- Iconv:
|
||||
. Fixed bug #78642 (Wrong libiconv version displayed). (gedas at martynas,
|
||||
cmb).
|
||||
|
||||
- OpCache:
|
||||
. Fixed bug #78654 (Incorrectly computed opcache checksum on files with
|
||||
non-ascii characters). (mhagstrand)
|
||||
. Fixed bug #78747 (OpCache corrupts custom extension result). (Nikita)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #78775 (TLS issues from HTTP request affecting other encrypted
|
||||
connections). (Nikita)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #78697 (ReflectionClass::ImplementsInterface - inaccurate error
|
||||
message with traits). (villfa)
|
||||
|
||||
- Sockets:
|
||||
. Fixed bug #78665 (Multicasting may leak memory). (cmb)
|
||||
|
||||
24 Oct 2019, PHP 7.3.11
|
||||
|
||||
- Core:
|
||||
. Fixed bug #78535 (auto_detect_line_endings value not parsed as bool).
|
||||
(bugreportuser)
|
||||
. Fixed bug #78620 (Out of memory error). (cmb, Nikita)
|
||||
|
||||
- Exif :
|
||||
. Fixed bug #78442 ('Illegal component' on exif_read_data since PHP7)
|
||||
(Kalle)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #78599 (env_path_info underflow in fpm_main.c can lead to RCE).
|
||||
(CVE-2019-11043) (Jakub Zelenka)
|
||||
. Fixed bug #78413 (request_terminate_timeout does not take effect after
|
||||
fastcgi_finish_request). (Sergei Turchanov)
|
||||
|
||||
- MBString:
|
||||
. Fixed bug #78633 (Heap buffer overflow (read) in mb_eregi). (cmb)
|
||||
. Fixed bug #78579 (mb_decode_numericentity: args number inconsistency).
|
||||
(cmb)
|
||||
. Fixed bug #78609 (mb_check_encoding() no longer supports stringable
|
||||
objects). (cmb)
|
||||
|
||||
- MySQLi:
|
||||
. Fixed bug #76809 (SSL settings aren't respected when persistent connections
|
||||
are used). (fabiomsouto)
|
||||
|
||||
- Mysqlnd:
|
||||
. Fixed bug #78525 (Memory leak in pdo when reusing native prepared
|
||||
statements). (Nikita)
|
||||
|
||||
- PCRE:
|
||||
. Fixed bug #78272 (calling preg_match() before pcntl_fork() will freeze
|
||||
child process). (Nikita)
|
||||
|
||||
- PDO_MySQL:
|
||||
. Fixed bug #78623 (Regression caused by "SP call yields additional empty
|
||||
result set"). (cmb)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #78624 (session_gc return value for user defined session
|
||||
handlers). (bshaffer)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #76342 (file_get_contents waits twice specified timeout).
|
||||
(Thomas Calvet)
|
||||
. Fixed bug #78612 (strtr leaks memory when integer keys are used and the
|
||||
subject string shorter). (Nikita)
|
||||
. Fixed bug #76859 (stream_get_line skips data if used with data-generating
|
||||
filter). (kkopachev)
|
||||
|
||||
- Zip:
|
||||
. Fixed bug #78641 (addGlob can modify given remove_path value). (cmb)
|
||||
|
||||
26 Sep 2019, PHP 7.3.10
|
||||
|
||||
- Core:
|
||||
. Fixed bug #78220 (Can't access OneDrive folder). (cmb, ab)
|
||||
@@ -23,6 +164,9 @@ PHP NEWS
|
||||
. Ensure IDNA2003 rules are used with idn_to_ascii() and idn_to_utf8()
|
||||
when requested. (Sara)
|
||||
|
||||
- MBString:
|
||||
. Fixed bug #78559 (Heap buffer overflow in mb_eregi). (cmb)
|
||||
|
||||
- MySQLnd:
|
||||
. Fixed connect_attr issues and added the _server_host connection attribute.
|
||||
(Qianqian Bu)
|
||||
@@ -203,6 +347,10 @@ PHP NEWS
|
||||
. Implemented FR #72189 (Add missing CURL_VERSION_* constants). (Javier
|
||||
Spagnoletti)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #77909 (DatePeriod::__construct() with invalid recurrence count
|
||||
value). (Ignace Nyamagana Butera)
|
||||
|
||||
- EXIF:
|
||||
. Fixed bug #77988 (heap-buffer-overflow on php_jpg_get16).
|
||||
(CVE-2019-11040) (Stas)
|
||||
|
||||
@@ -273,6 +273,10 @@ FPM:
|
||||
disabling output decoration for workers output when catch_workers_output
|
||||
enabled.
|
||||
. The getallheaders() function is now also available.
|
||||
. In PHP 7.3.11 a new pool option
|
||||
request_terminate_timeout_track_finished has been added. When enabled,
|
||||
request_terminate_timeout will also apply after fastcgi_finish_request()
|
||||
has been called, as well as during execution of shutdown functions.
|
||||
|
||||
========================================
|
||||
4. Deprecated Functionality
|
||||
|
||||
@@ -140,6 +140,7 @@ assert(0 && ($a = function () {
|
||||
if ($a) {
|
||||
} elseif ($b) {
|
||||
}
|
||||
if ($a); else;
|
||||
}));
|
||||
|
||||
?>
|
||||
@@ -292,4 +293,7 @@ Warning: assert(): assert(0 && ($a = function () {
|
||||
if ($a) {
|
||||
} elseif ($b) {
|
||||
}
|
||||
if ($a) {
|
||||
} else {
|
||||
}
|
||||
})) failed in %sexpect_015.php on line %d
|
||||
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Bug #78658: Memory corruption using Closure::bindTo()
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$c = function(){};
|
||||
|
||||
$scope = "AAAA";
|
||||
$scope = "{$scope}BBBB";
|
||||
$c->bindTo(new stdClass, $scope);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Class 'AAAABBBB' not found in %s on line %d
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Bug #78689: Closure::fromCallable() doesn't handle [Closure, '__invoke']
|
||||
--FILE--
|
||||
<?php
|
||||
$a = [function () { echo "123\n"; }, '__invoke'];
|
||||
$a();
|
||||
|
||||
$b = Closure::fromCallable($a);
|
||||
$b();
|
||||
?>
|
||||
--EXPECT--
|
||||
123
|
||||
123
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Bug #78752: Segfault if GC triggered while generator stack frame is being destroyed
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen(&$gen) {
|
||||
$a = new stdClass;
|
||||
$a->a = $a;
|
||||
$b = new stdClass;
|
||||
$b->b = $b;
|
||||
yield 1;
|
||||
}
|
||||
|
||||
$gen = gen($gen);
|
||||
var_dump($gen->current());
|
||||
for ($i = 0; $i < 9999; $i++) {
|
||||
$a = new stdClass;
|
||||
$a->a = $a;
|
||||
}
|
||||
$gen->next();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #78787: Segfault with trait overriding inherited private shadow property
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
trait T {
|
||||
private $prop;
|
||||
}
|
||||
class C1 {
|
||||
/** Doc comment */
|
||||
private $prop;
|
||||
}
|
||||
class C2 extends C1 {
|
||||
}
|
||||
class C3 extends C2 {
|
||||
use T;
|
||||
}
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -0,0 +1,33 @@
|
||||
--TEST--
|
||||
Bug #78868: Calling __autoload() with incorrect EG(fake_scope) value
|
||||
--FILE--
|
||||
<?php
|
||||
class C {
|
||||
private $private = 1;
|
||||
|
||||
function foo() {
|
||||
$this->private++; //fails with EG(fake_scope) != NULL && EG(fake_scope) != "C"
|
||||
}
|
||||
}
|
||||
|
||||
class A {
|
||||
static $foo = B::foo; //not resolved on include()
|
||||
}
|
||||
|
||||
function main_autoload($class_name) {
|
||||
$c = new C;
|
||||
$c->foo();
|
||||
//doesn't affect the error
|
||||
eval("class B {const foo = 1;}");
|
||||
}
|
||||
|
||||
spl_autoload_register('main_autoload', false);
|
||||
|
||||
$classA = new ReflectionClass("A");
|
||||
$props = $classA->getProperties();
|
||||
$props[0]->setValue(2); //causes constant resolving, which runs autoload, all with EG(fake_scope) == "A"
|
||||
|
||||
echo "OK\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
OK
|
||||
@@ -0,0 +1,8 @@
|
||||
--TEST--
|
||||
Using __COMPILER_HALF_OFFSET__ with trailing {} (OSS-Fuzz #17895)
|
||||
--FILE--
|
||||
<?php
|
||||
__COMPILER_HALT_OFFSET__;
|
||||
{}
|
||||
--EXPECTF--
|
||||
Warning: Use of undefined constant __COMPILER_HALT_OFFSET__ - assumed '__COMPILER_HALT_OFFSET__' (this will throw an Error in a future version of PHP) in %s on line %d
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Memory leak on ** with result==op1 array
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$x = [0];
|
||||
$x **= 1;
|
||||
var_dump($x);
|
||||
|
||||
$x = [0];
|
||||
$x **= $x;
|
||||
var_dump($x);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(0)
|
||||
int(0)
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Calling a static method on a non-existing class
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$str = "foo";
|
||||
try {
|
||||
Test::{$str . "bar"}();
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Class 'Test' not found
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
No warnings should be thrown during heredoc scan-ahead
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
<<<TEST
|
||||
${x}
|
||||
\400
|
||||
${/*}
|
||||
TEST;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Unexpected character in input: '' (ASCII=1) state=0 in %s on line %d
|
||||
|
||||
Warning: Octal escape sequence overflow \400 is greater than \377 in %s on line %d
|
||||
|
||||
Warning: Unterminated comment starting line %d in %s on line %d
|
||||
|
||||
Parse error: syntax error, unexpected end of file in %s on line %d
|
||||
+1
-1
@@ -20,7 +20,7 @@
|
||||
#ifndef ZEND_H
|
||||
#define ZEND_H
|
||||
|
||||
#define ZEND_VERSION "3.3.10-dev"
|
||||
#define ZEND_VERSION "3.3.13"
|
||||
|
||||
#define ZEND_ENGINE_3
|
||||
|
||||
|
||||
@@ -4082,6 +4082,12 @@ ZEND_API int zend_update_static_property_ex(zend_class_entry *scope, zend_string
|
||||
zval *property;
|
||||
zend_class_entry *old_scope = EG(fake_scope);
|
||||
|
||||
if (UNEXPECTED(!(scope->ce_flags & ZEND_ACC_CONSTANTS_UPDATED))) {
|
||||
if (UNEXPECTED(zend_update_class_constants(scope)) != SUCCESS) {
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
EG(fake_scope) = scope;
|
||||
property = zend_std_get_static_property(scope, name, 0);
|
||||
EG(fake_scope) = old_scope;
|
||||
|
||||
+7
-2
@@ -1792,12 +1792,17 @@ static void *zend_mm_alloc_huge(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_D
|
||||
* We allocate them with 2MB size granularity, to avoid many
|
||||
* reallocations when they are extended by small pieces
|
||||
*/
|
||||
size_t new_size = ZEND_MM_ALIGNED_SIZE_EX(size, MAX(REAL_PAGE_SIZE, ZEND_MM_CHUNK_SIZE));
|
||||
size_t alignment = MAX(REAL_PAGE_SIZE, ZEND_MM_CHUNK_SIZE);
|
||||
#else
|
||||
size_t new_size = ZEND_MM_ALIGNED_SIZE_EX(size, REAL_PAGE_SIZE);
|
||||
size_t alignment = REAL_PAGE_SIZE;
|
||||
#endif
|
||||
size_t new_size = ZEND_MM_ALIGNED_SIZE_EX(size, alignment);
|
||||
void *ptr;
|
||||
|
||||
if (UNEXPECTED(new_size < size)) {
|
||||
zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu + %zu)", size, alignment);
|
||||
}
|
||||
|
||||
#if ZEND_MM_LIMIT
|
||||
if (UNEXPECTED(new_size > heap->limit - heap->real_size)) {
|
||||
if (zend_mm_gc(heap) && new_size <= heap->limit - heap->real_size) {
|
||||
|
||||
+1
-1
@@ -1158,7 +1158,7 @@ tail_call:
|
||||
} else {
|
||||
zend_ast_export_indent(str, indent);
|
||||
smart_str_appends(str, "} else ");
|
||||
if (ast->child[1]->kind == ZEND_AST_IF) {
|
||||
if (ast->child[1] && ast->child[1]->kind == ZEND_AST_IF) {
|
||||
list = (zend_ast_list*)ast->child[1];
|
||||
goto tail_call;
|
||||
} else {
|
||||
|
||||
+10
-2
@@ -200,7 +200,7 @@ ZEND_METHOD(Closure, bind)
|
||||
ce = closure->func.common.scope;
|
||||
} else if ((ce = zend_lookup_class_ex(class_name, NULL, 1)) == NULL) {
|
||||
zend_error(E_WARNING, "Class '%s' not found", ZSTR_VAL(class_name));
|
||||
zend_string_release_ex(class_name, 0);
|
||||
zend_tmp_string_release(tmp_class_name);
|
||||
RETURN_NULL();
|
||||
}
|
||||
zend_tmp_string_release(tmp_class_name);
|
||||
@@ -268,8 +268,16 @@ static int zend_create_closure_from_callable(zval *return_value, zval *callable,
|
||||
|
||||
mptr = fcc.function_handler;
|
||||
if (mptr->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) {
|
||||
memset(&call, 0, sizeof(zend_internal_function));
|
||||
/* For Closure::fromCallable([$closure, "__invoke"]) return $closure. */
|
||||
if (fcc.object && fcc.object->ce == zend_ce_closure
|
||||
&& zend_string_equals_literal(mptr->common.function_name, "__invoke")) {
|
||||
ZVAL_OBJ(return_value, fcc.object);
|
||||
GC_ADDREF(fcc.object);
|
||||
zend_free_trampoline(mptr);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
memset(&call, 0, sizeof(zend_internal_function));
|
||||
call.type = ZEND_INTERNAL_FUNCTION;
|
||||
call.fn_flags = mptr->common.fn_flags & ZEND_ACC_STATIC;
|
||||
call.handler = zend_closure_call_magic;
|
||||
|
||||
+8
-1
@@ -1693,13 +1693,17 @@ ZEND_API void zend_activate_auto_globals(void) /* {{{ */
|
||||
int ZEND_FASTCALL zendlex(zend_parser_stack_elem *elem) /* {{{ */
|
||||
{
|
||||
zval zv;
|
||||
int ret;
|
||||
|
||||
if (CG(increment_lineno)) {
|
||||
CG(zend_lineno)++;
|
||||
CG(increment_lineno) = 0;
|
||||
}
|
||||
|
||||
return lex_scan(&zv, elem);
|
||||
ret = lex_scan(&zv, elem);
|
||||
ZEND_ASSERT(!EG(exception) || ret == T_ERROR);
|
||||
return ret;
|
||||
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -7764,6 +7768,9 @@ void zend_compile_const(znode *result, zend_ast *ast) /* {{{ */
|
||||
|
||||
while (last && last->kind == ZEND_AST_STMT_LIST) {
|
||||
zend_ast_list *list = zend_ast_get_list(last);
|
||||
if (list->children == 0) {
|
||||
break;
|
||||
}
|
||||
last = list->child[list->children-1];
|
||||
}
|
||||
if (last && last->kind == ZEND_AST_HALT_COMPILER) {
|
||||
|
||||
+12
-8
@@ -96,16 +96,18 @@ ZEND_API zend_execute_data* zend_generator_freeze_call_stack(zend_execute_data *
|
||||
/* }}} */
|
||||
|
||||
static void zend_generator_cleanup_unfinished_execution(
|
||||
zend_generator *generator, uint32_t catch_op_num) /* {{{ */
|
||||
zend_generator *generator, zend_execute_data *execute_data, uint32_t catch_op_num) /* {{{ */
|
||||
{
|
||||
zend_execute_data *execute_data = generator->execute_data;
|
||||
|
||||
if (execute_data->opline != execute_data->func->op_array.opcodes) {
|
||||
/* -1 required because we want the last run opcode, not the next to-be-run one. */
|
||||
uint32_t op_num = execute_data->opline - execute_data->func->op_array.opcodes - 1;
|
||||
|
||||
if (UNEXPECTED(generator->frozen_call_stack)) {
|
||||
/* Temporarily restore generator->execute_data if it has been NULLed out already. */
|
||||
zend_execute_data *save_ex = generator->execute_data;
|
||||
generator->execute_data = execute_data;
|
||||
zend_generator_restore_call_stack(generator);
|
||||
generator->execute_data = save_ex;
|
||||
}
|
||||
zend_cleanup_unfinished_execution(execute_data, op_num, catch_op_num);
|
||||
}
|
||||
@@ -116,6 +118,9 @@ ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished
|
||||
{
|
||||
if (EXPECTED(generator->execute_data)) {
|
||||
zend_execute_data *execute_data = generator->execute_data;
|
||||
/* Null out execute_data early, to prevent double frees if GC runs while we're
|
||||
* already cleaning up execute_data. */
|
||||
generator->execute_data = NULL;
|
||||
|
||||
if (EX_CALL_INFO() & ZEND_CALL_HAS_SYMBOL_TABLE) {
|
||||
zend_clean_and_cache_symbol_table(execute_data->symbol_table);
|
||||
@@ -134,12 +139,12 @@ ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished
|
||||
return;
|
||||
}
|
||||
|
||||
zend_vm_stack_free_extra_args(generator->execute_data);
|
||||
zend_vm_stack_free_extra_args(execute_data);
|
||||
|
||||
/* Some cleanups are only necessary if the generator was closed
|
||||
* before it could finish execution (reach a return statement). */
|
||||
if (UNEXPECTED(!finished_execution)) {
|
||||
zend_generator_cleanup_unfinished_execution(generator, 0);
|
||||
zend_generator_cleanup_unfinished_execution(generator, execute_data, 0);
|
||||
}
|
||||
|
||||
/* Free closure object */
|
||||
@@ -153,8 +158,7 @@ ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished
|
||||
generator->gc_buffer = NULL;
|
||||
}
|
||||
|
||||
efree(generator->execute_data);
|
||||
generator->execute_data = NULL;
|
||||
efree(execute_data);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
@@ -215,7 +219,7 @@ static void zend_generator_dtor_storage(zend_object *object) /* {{{ */
|
||||
if (finally_op_num) {
|
||||
zval *fast_call;
|
||||
|
||||
zend_generator_cleanup_unfinished_execution(generator, finally_op_num);
|
||||
zend_generator_cleanup_unfinished_execution(generator, ex, finally_op_num);
|
||||
|
||||
fast_call = ZEND_CALL_VAR(ex, ex->func->op_array.opcodes[finally_op_end].op1.var);
|
||||
Z_OBJ_P(fast_call) = EG(exception);
|
||||
|
||||
@@ -1595,10 +1595,14 @@ static void zend_do_traits_property_binding(zend_class_entry *ce) /* {{{ */
|
||||
/* next: check for conflicts with current class */
|
||||
if ((coliding_prop = zend_hash_find_ptr(&ce->properties_info, prop_name)) != NULL) {
|
||||
if (coliding_prop->flags & ZEND_ACC_SHADOW) {
|
||||
zend_string_release_ex(coliding_prop->name, 0);
|
||||
if (coliding_prop->doc_comment) {
|
||||
zend_string_release_ex(coliding_prop->doc_comment, 0);
|
||||
}
|
||||
/* Only free if shadow is coming from direct parent,
|
||||
* otherwise these weren't copied in the first place. */
|
||||
if (coliding_prop->ce == ce->parent) {
|
||||
zend_string_release_ex(coliding_prop->name, 0);
|
||||
if (coliding_prop->doc_comment) {
|
||||
zend_string_release_ex(coliding_prop->doc_comment, 0);
|
||||
}
|
||||
}
|
||||
zend_hash_del(&ce->properties_info, prop_name);
|
||||
flags |= ZEND_ACC_CHANGED;
|
||||
} else {
|
||||
|
||||
+210
-191
File diff suppressed because it is too large.
Load diff
@@ -2098,7 +2098,7 @@ inline_char_handler:
|
||||
|
||||
if (YYCURSOR < YYLIMIT) {
|
||||
YYCURSOR++;
|
||||
} else {
|
||||
} else if (!SCNG(heredoc_scan_ahead)) {
|
||||
zend_error(E_COMPILE_WARNING, "Unterminated comment starting line %d", CG(zend_lineno));
|
||||
}
|
||||
|
||||
@@ -2323,6 +2323,9 @@ skip_escape_conversion:
|
||||
if (!IS_LABEL_SUCCESSOR(YYCURSOR[heredoc_label->length])) {
|
||||
if (spacing == (HEREDOC_USING_SPACES | HEREDOC_USING_TABS)) {
|
||||
zend_throw_exception(zend_ce_parse_error, "Invalid indentation - tabs and spaces cannot be mixed", 0);
|
||||
if (PARSER_MODE()) {
|
||||
RETURN_TOKEN(T_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
YYCURSOR = saved_cursor;
|
||||
@@ -2339,6 +2342,7 @@ skip_escape_conversion:
|
||||
zend_lex_state current_state;
|
||||
int heredoc_nesting_level = 1;
|
||||
int first_token = 0;
|
||||
int error = 0;
|
||||
|
||||
zend_save_lexical_state(¤t_state);
|
||||
|
||||
@@ -2386,6 +2390,7 @@ skip_escape_conversion:
|
||||
|| first_token == T_CURLY_OPEN
|
||||
) && SCNG(heredoc_indentation)) {
|
||||
zend_throw_exception_ex(zend_ce_parse_error, 0, "Invalid body indentation level (expecting an indentation level of at least %d)", SCNG(heredoc_indentation));
|
||||
error = 1;
|
||||
}
|
||||
|
||||
heredoc_label->indentation = SCNG(heredoc_indentation);
|
||||
@@ -2394,6 +2399,10 @@ skip_escape_conversion:
|
||||
zend_restore_lexical_state(¤t_state);
|
||||
SCNG(heredoc_scan_ahead) = 0;
|
||||
CG(increment_lineno) = 0;
|
||||
|
||||
if (PARSER_MODE() && error) {
|
||||
RETURN_TOKEN(T_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TOKEN(T_START_HEREDOC);
|
||||
@@ -2583,6 +2592,9 @@ double_quotes_scan_done:
|
||||
|
||||
if (spacing == (HEREDOC_USING_SPACES | HEREDOC_USING_TABS)) {
|
||||
zend_throw_exception(zend_ce_parse_error, "Invalid indentation - tabs and spaces cannot be mixed", 0);
|
||||
if (PARSER_MODE()) {
|
||||
RETURN_TOKEN(T_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
/* newline before label will be subtracted from returned text, but
|
||||
@@ -2704,6 +2716,9 @@ heredoc_scan_done:
|
||||
|
||||
if (spacing == (HEREDOC_USING_SPACES | HEREDOC_USING_TABS)) {
|
||||
zend_throw_exception(zend_ce_parse_error, "Invalid indentation - tabs and spaces cannot be mixed", 0);
|
||||
if (PARSER_MODE()) {
|
||||
RETURN_TOKEN(T_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
/* newline before label will be subtracted from returned text, but
|
||||
@@ -2752,7 +2767,9 @@ nowdoc_scan_done:
|
||||
RETURN_TOKEN(END);
|
||||
}
|
||||
|
||||
zend_error(E_COMPILE_WARNING,"Unexpected character in input: '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE);
|
||||
if (!SCNG(heredoc_scan_ahead)) {
|
||||
zend_error(E_COMPILE_WARNING, "Unexpected character in input: '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE);
|
||||
}
|
||||
goto restart;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 1.1.1 */
|
||||
/* Generated by re2c 1.0.1 */
|
||||
#line 3 "Zend/zend_language_scanner_defs.h"
|
||||
|
||||
enum YYCONDTYPE {
|
||||
|
||||
@@ -1193,12 +1193,18 @@ ZEND_API int ZEND_FASTCALL pow_function(zval *result, zval *op1, zval *op2) /* {
|
||||
|
||||
if (EXPECTED(op1 != op2)) {
|
||||
if (Z_TYPE_P(op1) == IS_ARRAY) {
|
||||
if (op1 == result) {
|
||||
zval_ptr_dtor(result);
|
||||
}
|
||||
ZVAL_LONG(result, 0);
|
||||
return SUCCESS;
|
||||
} else {
|
||||
op1 = zendi_convert_scalar_to_number(op1, &op1_copy, result, 0);
|
||||
}
|
||||
if (Z_TYPE_P(op2) == IS_ARRAY) {
|
||||
if (op1 == result) {
|
||||
zval_ptr_dtor(result);
|
||||
}
|
||||
ZVAL_LONG(result, 1L);
|
||||
return SUCCESS;
|
||||
} else {
|
||||
@@ -1206,6 +1212,9 @@ ZEND_API int ZEND_FASTCALL pow_function(zval *result, zval *op1, zval *op2) /* {
|
||||
}
|
||||
} else {
|
||||
if (Z_TYPE_P(op1) == IS_ARRAY) {
|
||||
if (op1 == result) {
|
||||
zval_ptr_dtor(result);
|
||||
}
|
||||
ZVAL_LONG(result, 0);
|
||||
return SUCCESS;
|
||||
} else {
|
||||
|
||||
@@ -90,10 +90,10 @@ ZEND_API const char* ZEND_FASTCALL zend_memnstr_ex(const char *haystack, const c
|
||||
ZEND_API const char* ZEND_FASTCALL zend_memnrstr_ex(const char *haystack, const char *needle, size_t needle_len, const char *end);
|
||||
|
||||
#if SIZEOF_ZEND_LONG == 4
|
||||
# define ZEND_DOUBLE_FITS_LONG(d) (!((d) > ZEND_LONG_MAX || (d) < ZEND_LONG_MIN))
|
||||
# define ZEND_DOUBLE_FITS_LONG(d) (!((d) > (double)ZEND_LONG_MAX || (d) < (double)ZEND_LONG_MIN))
|
||||
#else
|
||||
/* >= as (double)ZEND_LONG_MAX is outside signed range */
|
||||
# define ZEND_DOUBLE_FITS_LONG(d) (!((d) >= ZEND_LONG_MAX || (d) < ZEND_LONG_MIN))
|
||||
# define ZEND_DOUBLE_FITS_LONG(d) (!((d) >= (double)ZEND_LONG_MAX || (d) < (double)ZEND_LONG_MIN))
|
||||
#endif
|
||||
|
||||
#if ZEND_DVAL_TO_LVAL_CAST_OK
|
||||
|
||||
+7
-2
@@ -741,8 +741,10 @@ ZEND_VM_COLD_CONST_HANDLER(13, ZEND_BOOL_NOT, CONST|TMPVAR|CV, ANY)
|
||||
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
|
||||
ZVAL_FALSE(EX_VAR(opline->result.var));
|
||||
} else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
|
||||
/* The result and op1 can be the same cv zval */
|
||||
const uint32_t orig_val_type = Z_TYPE_INFO_P(val);
|
||||
ZVAL_TRUE(EX_VAR(opline->result.var));
|
||||
if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
|
||||
if (OP1_TYPE == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) {
|
||||
SAVE_OPLINE();
|
||||
GET_OP1_UNDEF_CV(val, BP_VAR_R);
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
@@ -3161,6 +3163,7 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, UNUSED|CLASS_FETCH|CONST|VAR,
|
||||
ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
ZEND_ASSERT(EG(exception));
|
||||
FREE_UNFETCHED_OP2();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (OP2_TYPE != IS_CONST) {
|
||||
@@ -4845,8 +4848,10 @@ ZEND_VM_COLD_CONST_HANDLER(52, ZEND_BOOL, CONST|TMPVAR|CV, ANY)
|
||||
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
|
||||
ZVAL_TRUE(EX_VAR(opline->result.var));
|
||||
} else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
|
||||
/* The result and op1 can be the same cv zval */
|
||||
const uint32_t orig_val_type = Z_TYPE_INFO_P(val);
|
||||
ZVAL_FALSE(EX_VAR(opline->result.var));
|
||||
if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
|
||||
if (OP1_TYPE == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) {
|
||||
SAVE_OPLINE();
|
||||
GET_OP1_UNDEF_CV(val, BP_VAR_R);
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
|
||||
+30
-6
@@ -2485,8 +2485,10 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_CON
|
||||
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
|
||||
ZVAL_FALSE(EX_VAR(opline->result.var));
|
||||
} else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
|
||||
/* The result and op1 can be the same cv zval */
|
||||
const uint32_t orig_val_type = Z_TYPE_INFO_P(val);
|
||||
ZVAL_TRUE(EX_VAR(opline->result.var));
|
||||
if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
|
||||
if (IS_CONST == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) {
|
||||
SAVE_OPLINE();
|
||||
GET_OP1_UNDEF_CV(val, BP_VAR_R);
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
@@ -3056,8 +3058,10 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_SPEC_CONST_H
|
||||
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
|
||||
ZVAL_TRUE(EX_VAR(opline->result.var));
|
||||
} else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
|
||||
/* The result and op1 can be the same cv zval */
|
||||
const uint32_t orig_val_type = Z_TYPE_INFO_P(val);
|
||||
ZVAL_FALSE(EX_VAR(opline->result.var));
|
||||
if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
|
||||
if (IS_CONST == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) {
|
||||
SAVE_OPLINE();
|
||||
GET_OP1_UNDEF_CV(val, BP_VAR_R);
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
@@ -5209,6 +5213,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
|
||||
ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
ZEND_ASSERT(EG(exception));
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (IS_CONST != IS_CONST) {
|
||||
@@ -7390,6 +7395,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
|
||||
ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
ZEND_ASSERT(EG(exception));
|
||||
zval_ptr_dtor_nogc(EX_VAR(opline->op2.var));
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
|
||||
@@ -8623,6 +8629,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
|
||||
ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
ZEND_ASSERT(EG(exception));
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (IS_UNUSED != IS_CONST) {
|
||||
@@ -10490,6 +10497,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
|
||||
ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
ZEND_ASSERT(EG(exception));
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (IS_CV != IS_CONST) {
|
||||
@@ -12097,8 +12105,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_TMPVAR_HANDLER(Z
|
||||
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
|
||||
ZVAL_FALSE(EX_VAR(opline->result.var));
|
||||
} else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
|
||||
/* The result and op1 can be the same cv zval */
|
||||
const uint32_t orig_val_type = Z_TYPE_INFO_P(val);
|
||||
ZVAL_TRUE(EX_VAR(opline->result.var));
|
||||
if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
|
||||
if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) {
|
||||
SAVE_OPLINE();
|
||||
GET_OP1_UNDEF_CV(val, BP_VAR_R);
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
@@ -12359,8 +12369,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_SPEC_TMPVAR_HANDLER(ZEND_
|
||||
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
|
||||
ZVAL_TRUE(EX_VAR(opline->result.var));
|
||||
} else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
|
||||
/* The result and op1 can be the same cv zval */
|
||||
const uint32_t orig_val_type = Z_TYPE_INFO_P(val);
|
||||
ZVAL_FALSE(EX_VAR(opline->result.var));
|
||||
if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
|
||||
if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) {
|
||||
SAVE_OPLINE();
|
||||
GET_OP1_UNDEF_CV(val, BP_VAR_R);
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
@@ -23505,6 +23517,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
|
||||
ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
ZEND_ASSERT(EG(exception));
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (IS_CONST != IS_CONST) {
|
||||
@@ -25819,6 +25832,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
|
||||
ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
ZEND_ASSERT(EG(exception));
|
||||
zval_ptr_dtor_nogc(EX_VAR(opline->op2.var));
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
|
||||
@@ -27378,6 +27392,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
|
||||
ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
ZEND_ASSERT(EG(exception));
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (IS_UNUSED != IS_CONST) {
|
||||
@@ -29816,6 +29831,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
|
||||
ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
ZEND_ASSERT(EG(exception));
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (IS_CV != IS_CONST) {
|
||||
@@ -31918,6 +31934,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_U
|
||||
ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
ZEND_ASSERT(EG(exception));
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (IS_CONST != IS_CONST) {
|
||||
@@ -33653,6 +33670,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_U
|
||||
ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
ZEND_ASSERT(EG(exception));
|
||||
zval_ptr_dtor_nogc(EX_VAR(opline->op2.var));
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
|
||||
@@ -34191,6 +34209,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_U
|
||||
ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
ZEND_ASSERT(EG(exception));
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (IS_UNUSED != IS_CONST) {
|
||||
@@ -36032,6 +36051,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_U
|
||||
ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
|
||||
if (UNEXPECTED(ce == NULL)) {
|
||||
ZEND_ASSERT(EG(exception));
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (IS_CV != IS_CONST) {
|
||||
@@ -36399,8 +36419,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_CV_HANDLER(ZEND_
|
||||
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
|
||||
ZVAL_FALSE(EX_VAR(opline->result.var));
|
||||
} else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
|
||||
/* The result and op1 can be the same cv zval */
|
||||
const uint32_t orig_val_type = Z_TYPE_INFO_P(val);
|
||||
ZVAL_TRUE(EX_VAR(opline->result.var));
|
||||
if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
|
||||
if (IS_CV == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) {
|
||||
SAVE_OPLINE();
|
||||
GET_OP1_UNDEF_CV(val, BP_VAR_R);
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
@@ -37222,8 +37244,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_SPEC_CV_HANDLER(ZEND_OPCO
|
||||
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
|
||||
ZVAL_TRUE(EX_VAR(opline->result.var));
|
||||
} else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
|
||||
/* The result and op1 can be the same cv zval */
|
||||
const uint32_t orig_val_type = Z_TYPE_INFO_P(val);
|
||||
ZVAL_FALSE(EX_VAR(opline->result.var));
|
||||
if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
|
||||
if (IS_CV == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) {
|
||||
SAVE_OPLINE();
|
||||
GET_OP1_UNDEF_CV(val, BP_VAR_R);
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
|
||||
+4
-1
@@ -395,6 +395,8 @@ AC_DEFUN([PHP_EVAL_LIBLINE],[
|
||||
$2="[$]$2 -pthread"
|
||||
else
|
||||
PHP_RUN_ONCE(EXTRA_LDFLAGS, [$ac_i], [EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i"])
|
||||
PHP_RUN_ONCE(EXTRA_LDFLAGS_PROGRAM, [$ac_i],
|
||||
[EXTRA_LDFLAGS_PROGRAM="$EXTRA_LDFLAGS_PROGRAM $ac_i"])
|
||||
fi
|
||||
;;
|
||||
-l*[)]
|
||||
@@ -2191,7 +2193,8 @@ AC_DEFUN([PHP_SETUP_ICU],[
|
||||
|
||||
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"
|
||||
ICU_CXXFLAGS=`$PKG_CONFIG --variable=CXXFLAGS icu-uc`
|
||||
ICU_CXXFLAGS="$ICU_CXXFLAGS -DU_USING_ICU_NAMESPACE=1"
|
||||
|
||||
AC_MSG_RESULT([found $ICU_VERSION])
|
||||
|
||||
|
||||
+2
-2
@@ -107,8 +107,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=7
|
||||
PHP_MINOR_VERSION=3
|
||||
PHP_RELEASE_VERSION=10
|
||||
PHP_EXTRA_VERSION="-dev"
|
||||
PHP_RELEASE_VERSION=13
|
||||
PHP_EXTRA_VERSION=""
|
||||
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
|
||||
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
|
||||
|
||||
|
||||
@@ -57,9 +57,9 @@ bc_str2num (bc_num *num, char *str, int scale)
|
||||
zero_int = FALSE;
|
||||
if ( (*ptr == '+') || (*ptr == '-')) ptr++; /* Sign */
|
||||
while (*ptr == '0') ptr++; /* Skip leading zeros. */
|
||||
while (isdigit((int)*ptr)) ptr++, digits++; /* digits */
|
||||
while (*ptr >= '0' && *ptr <= '9') ptr++, digits++; /* digits */
|
||||
if (*ptr == '.') ptr++; /* decimal point */
|
||||
while (isdigit((int)*ptr)) ptr++, strscale++; /* digits */
|
||||
while (*ptr >= '0' && *ptr <= '9') ptr++, strscale++; /* digits */
|
||||
if ((*ptr != '\0') || (digits+strscale == 0))
|
||||
{
|
||||
*num = bc_copy_num (BCG(_zero_));
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
Bug #78878 (Buffer underflow in bc_shift_addsub)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('bcmath')) die('skip bcmath extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
print @bcmul("\xB26483605105519922841849335928742092", bcpowmod(2, 65535, -4e-4));
|
||||
?>
|
||||
--EXPECT--
|
||||
0
|
||||
@@ -123,6 +123,11 @@ static void com_write_dimension(zval *object, zval *offset, zval *value)
|
||||
|
||||
obj = CDNO_FETCH(object);
|
||||
|
||||
if (offset == NULL) {
|
||||
php_com_throw_exception(DISP_E_BADINDEX, "appending to variants is not supported");
|
||||
return;
|
||||
}
|
||||
|
||||
if (V_VT(&obj->v) == VT_DISPATCH) {
|
||||
ZVAL_COPY_VALUE(&args[0], offset);
|
||||
ZVAL_COPY_VALUE(&args[1], value);
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Bug #78694 (Appending to a variant array causes segfault)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('com_dotnet')) die('skip com_dotnet extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
foreach ([new com('WScript.Shell'), new variant([])] as $var) {
|
||||
try {
|
||||
$var[] = 42;
|
||||
} catch (com_exception $ex) {
|
||||
var_dump($ex->getMessage());
|
||||
}
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
string(38) "appending to variants is not supported"
|
||||
string(38) "appending to variants is not supported"
|
||||
@@ -0,0 +1,34 @@
|
||||
--TEST--
|
||||
Bug #78775: TLS issues from HTTP request affecting other encrypted connections
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('curl')) die('skip Requires curl');
|
||||
if (getenv('SKIP_ONLINE_TESTS')) die('skip Online test');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$sock = fsockopen("tls://google.com", 443);
|
||||
|
||||
var_dump($sock);
|
||||
|
||||
$handle = curl_init('https://self-signed.badssl.com/');
|
||||
curl_setopt_array(
|
||||
$handle,
|
||||
[
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_SSL_VERIFYPEER => true,
|
||||
]
|
||||
);
|
||||
|
||||
var_dump(curl_exec($handle));
|
||||
curl_close($handle);
|
||||
|
||||
fwrite($sock, "GET / HTTP/1.0\n\n");
|
||||
var_dump(fread($sock, 8));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
resource(%d) of type (stream)
|
||||
bool(false)
|
||||
string(8) "HTTP/1.0"
|
||||
+25
-38
@@ -144,7 +144,7 @@ void timelib_isodate_from_date(timelib_sll y, timelib_sll m, timelib_sll d, time
|
||||
*id = timelib_day_of_week_ex(y, m, d, 1);
|
||||
}
|
||||
|
||||
static timelib_sll timelib_daynr_from_weeknr_ex(timelib_sll iy, timelib_sll iw, timelib_sll id, timelib_sll *y)
|
||||
timelib_sll timelib_daynr_from_weeknr(timelib_sll iy, timelib_sll iw, timelib_sll id)
|
||||
{
|
||||
timelib_sll dow, day;
|
||||
|
||||
@@ -152,54 +152,41 @@ static timelib_sll timelib_daynr_from_weeknr_ex(timelib_sll iy, timelib_sll iw,
|
||||
dow = timelib_day_of_week(iy, 1, 1);
|
||||
/* then use that to figure out the offset for day 1 of week 1 */
|
||||
day = 0 - (dow > 4 ? dow - 7 : dow);
|
||||
/* and adjust the year to the natural year if we need to */
|
||||
*y = (iw == 1 && day < 0 && id < dow) ? iy - 1 : iy;
|
||||
|
||||
/* Add weeks and days */
|
||||
return day + ((iw - 1) * 7) + id;
|
||||
}
|
||||
|
||||
timelib_sll timelib_daynr_from_weeknr(timelib_sll iy, timelib_sll iw, timelib_sll id)
|
||||
{
|
||||
timelib_sll dummy_iso_year;
|
||||
|
||||
return timelib_daynr_from_weeknr_ex(iy, iw, id, &dummy_iso_year);
|
||||
}
|
||||
|
||||
void timelib_date_from_isodate(timelib_sll iy, timelib_sll iw, timelib_sll id, timelib_sll *y, timelib_sll *m, timelib_sll *d)
|
||||
{
|
||||
timelib_sll daynr = timelib_daynr_from_weeknr_ex(iy, iw, id, y) + 1;
|
||||
timelib_sll daynr = timelib_daynr_from_weeknr(iy, iw, id) + 1;
|
||||
int *table;
|
||||
bool is_leap_year;
|
||||
|
||||
*m = 0;
|
||||
// Invariant: is_leap_year == timelib_is_leap(*y)
|
||||
*y = iy;
|
||||
is_leap_year = timelib_is_leap(*y);
|
||||
|
||||
if (daynr <= 0) {
|
||||
*y += 1;
|
||||
}
|
||||
|
||||
if (timelib_is_leap(*y)) {
|
||||
table = ml_table_leap;
|
||||
if (daynr > 366) {
|
||||
*y += 1;
|
||||
daynr -= 366;
|
||||
}
|
||||
} else {
|
||||
table = ml_table_common;
|
||||
if (daynr > 365) {
|
||||
*y += 1;
|
||||
daynr -= 365;
|
||||
}
|
||||
}
|
||||
|
||||
do {
|
||||
daynr -= table[*m];
|
||||
(*m)++;
|
||||
} while (daynr > table[*m]);
|
||||
|
||||
if (daynr <= 0) {
|
||||
daynr += 31;
|
||||
// Establish invariant that daynr >= 0
|
||||
while (daynr <= 0) {
|
||||
*y -= 1;
|
||||
*m = 12;
|
||||
daynr += (is_leap_year = timelib_is_leap(*y)) ? 366 : 365;
|
||||
}
|
||||
|
||||
// Establish invariant that daynr <= number of days in *yr
|
||||
while (daynr > (is_leap_year ? 366 : 365)) {
|
||||
daynr -= is_leap_year ? 366 : 365;
|
||||
*y += 1;
|
||||
is_leap_year = timelib_is_leap(*y);
|
||||
}
|
||||
|
||||
table = is_leap_year ? ml_table_leap : ml_table_common;
|
||||
|
||||
// Establish invariant that daynr <= number of days in *m
|
||||
*m = 1;
|
||||
while (daynr > table[*m]) {
|
||||
daynr -= table[*m];
|
||||
*m += 1;
|
||||
}
|
||||
|
||||
*d = daynr;
|
||||
|
||||
@@ -322,9 +322,9 @@ typedef struct _timelib_tzdb {
|
||||
# define timelib_free free
|
||||
#endif
|
||||
|
||||
#define TIMELIB_VERSION 201802
|
||||
#define TIMELIB_EXTENDED_VERSION 20180201
|
||||
#define TIMELIB_ASCII_VERSION "2018.02"
|
||||
#define TIMELIB_VERSION 201803
|
||||
#define TIMELIB_EXTENDED_VERSION 20180301
|
||||
#define TIMELIB_ASCII_VERSION "2018.03"
|
||||
|
||||
#define TIMELIB_NONE 0x00
|
||||
#define TIMELIB_OVERRIDE_TIME 0x01
|
||||
|
||||
+1066
-1051
File diff suppressed because it is too large.
Load diff
@@ -33,18 +33,6 @@ static int month_tab[12] = { 0, 31, 59, 90, 120, 151, 181, 212, 24
|
||||
static int days_in_month_leap[13] = { 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
|
||||
static int days_in_month[13] = { 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
|
||||
|
||||
static void do_range_limit_fraction(timelib_sll *fraction, timelib_sll *seconds)
|
||||
{
|
||||
if (*fraction < 0) {
|
||||
*fraction += 1000000;
|
||||
*seconds -= 1;
|
||||
}
|
||||
if (*fraction >= 1000000) {
|
||||
*fraction -= 1000000;
|
||||
*seconds += 1;
|
||||
}
|
||||
}
|
||||
|
||||
static void do_range_limit(timelib_sll start, timelib_sll end, timelib_sll adj, timelib_sll *a, timelib_sll *b)
|
||||
{
|
||||
if (*a < start) {
|
||||
@@ -194,7 +182,7 @@ static void do_adjust_for_weekday(timelib_time* time)
|
||||
|
||||
void timelib_do_rel_normalize(timelib_time *base, timelib_rel_time *rt)
|
||||
{
|
||||
do_range_limit_fraction(&rt->us, &rt->s);
|
||||
do_range_limit(0, 1000000, 1000000, &rt->us, &rt->s);
|
||||
do_range_limit(0, 60, 60, &rt->s, &rt->i);
|
||||
do_range_limit(0, 60, 60, &rt->i, &rt->h);
|
||||
do_range_limit(0, 24, 24, &rt->h, &rt->d);
|
||||
@@ -234,7 +222,7 @@ static void magic_date_calc(timelib_time *time)
|
||||
|
||||
void timelib_do_normalize(timelib_time* time)
|
||||
{
|
||||
if (time->us != TIMELIB_UNSET) do_range_limit_fraction(&time->us, &time->s);
|
||||
if (time->us != TIMELIB_UNSET) do_range_limit(0, 1000000, 1000000, &time->us, &time->s);
|
||||
if (time->s != TIMELIB_UNSET) do_range_limit(0, 60, 60, &time->s, &time->i);
|
||||
if (time->s != TIMELIB_UNSET) do_range_limit(0, 60, 60, &time->i, &time->h);
|
||||
if (time->s != TIMELIB_UNSET) do_range_limit(0, 24, 24, &time->h, &time->d);
|
||||
|
||||
+22
-8
@@ -2923,7 +2923,7 @@ static int php_date_initialize_from_hash(php_date_obj **dateobj, HashTable *myht
|
||||
zval tmp_obj;
|
||||
timelib_tzinfo *tzi;
|
||||
|
||||
z_date = zend_hash_str_find(myht, "date", sizeof("data")-1);
|
||||
z_date = zend_hash_str_find(myht, "date", sizeof("date")-1);
|
||||
if (z_date && Z_TYPE_P(z_date) == IS_STRING) {
|
||||
zval *z_timezone_type = zend_hash_str_find(myht, "timezone_type", sizeof("timezone_type")-1);
|
||||
if (z_timezone_type && Z_TYPE_P(z_timezone_type) == IS_LONG) {
|
||||
@@ -4359,6 +4359,20 @@ static int php_date_interval_initialize_from_hash(zval **return_value, php_inter
|
||||
} \
|
||||
} while (0);
|
||||
|
||||
#define PHP_DATE_INTERVAL_READ_PROPERTY_DAYS(member) \
|
||||
do { \
|
||||
zval *z_arg = zend_hash_str_find(myht, "days", sizeof("days") - 1); \
|
||||
if (z_arg && Z_TYPE_P(z_arg) == IS_FALSE) { \
|
||||
(*intobj)->diff->member = -99999; \
|
||||
} else if (z_arg && Z_TYPE_P(z_arg) <= IS_STRING) { \
|
||||
zend_string *str = zval_get_string(z_arg); \
|
||||
DATE_A64I((*intobj)->diff->member, ZSTR_VAL(str)); \
|
||||
zend_string_release(str); \
|
||||
} else { \
|
||||
(*intobj)->diff->member = -1LL; \
|
||||
} \
|
||||
} while (0);
|
||||
|
||||
#define PHP_DATE_INTERVAL_READ_PROPERTY_DOUBLE(element, member, def) \
|
||||
do { \
|
||||
zval *z_arg = zend_hash_str_find(myht, element, sizeof(element) - 1); \
|
||||
@@ -4387,7 +4401,7 @@ static int php_date_interval_initialize_from_hash(zval **return_value, php_inter
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("weekday_behavior", weekday_behavior, int, -1)
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("first_last_day_of", first_last_day_of, int, -1)
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("invert", invert, int, 0);
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY_I64("days", days);
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY_DAYS(days);
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("special_type", special.type, unsigned int, 0);
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY_I64("special_amount", special.amount);
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("have_weekday_relative", have_weekday_relative, unsigned int, 0);
|
||||
@@ -5154,7 +5168,7 @@ static HashTable *date_object_get_properties_period(zval *object) /* {{{ */
|
||||
|
||||
if (period_obj->start) {
|
||||
php_date_obj *date_obj;
|
||||
object_init_ex(&zv, date_ce_date);
|
||||
object_init_ex(&zv, period_obj->start_ce);
|
||||
date_obj = Z_PHPDATE_P(&zv);
|
||||
date_obj->time = timelib_time_clone(period_obj->start);
|
||||
} else {
|
||||
@@ -5164,7 +5178,7 @@ static HashTable *date_object_get_properties_period(zval *object) /* {{{ */
|
||||
|
||||
if (period_obj->current) {
|
||||
php_date_obj *date_obj;
|
||||
object_init_ex(&zv, date_ce_date);
|
||||
object_init_ex(&zv, period_obj->start_ce);
|
||||
date_obj = Z_PHPDATE_P(&zv);
|
||||
date_obj->time = timelib_time_clone(period_obj->current);
|
||||
} else {
|
||||
@@ -5174,7 +5188,7 @@ static HashTable *date_object_get_properties_period(zval *object) /* {{{ */
|
||||
|
||||
if (period_obj->end) {
|
||||
php_date_obj *date_obj;
|
||||
object_init_ex(&zv, date_ce_date);
|
||||
object_init_ex(&zv, period_obj->start_ce);
|
||||
date_obj = Z_PHPDATE_P(&zv);
|
||||
date_obj->time = timelib_time_clone(period_obj->end);
|
||||
} else {
|
||||
@@ -5211,7 +5225,7 @@ static int php_date_period_initialize_from_hash(php_period_obj *period_obj, Hash
|
||||
|
||||
ht_entry = zend_hash_str_find(myht, "start", sizeof("start")-1);
|
||||
if (ht_entry) {
|
||||
if (Z_TYPE_P(ht_entry) == IS_OBJECT && Z_OBJCE_P(ht_entry) == date_ce_date) {
|
||||
if (Z_TYPE_P(ht_entry) == IS_OBJECT && instanceof_function(Z_OBJCE_P(ht_entry), date_ce_interface)) {
|
||||
php_date_obj *date_obj;
|
||||
date_obj = Z_PHPDATE_P(ht_entry);
|
||||
period_obj->start = timelib_time_clone(date_obj->time);
|
||||
@@ -5225,7 +5239,7 @@ static int php_date_period_initialize_from_hash(php_period_obj *period_obj, Hash
|
||||
|
||||
ht_entry = zend_hash_str_find(myht, "end", sizeof("end")-1);
|
||||
if (ht_entry) {
|
||||
if (Z_TYPE_P(ht_entry) == IS_OBJECT && Z_OBJCE_P(ht_entry) == date_ce_date) {
|
||||
if (Z_TYPE_P(ht_entry) == IS_OBJECT && instanceof_function(Z_OBJCE_P(ht_entry), date_ce_interface)) {
|
||||
php_date_obj *date_obj;
|
||||
date_obj = Z_PHPDATE_P(ht_entry);
|
||||
period_obj->end = timelib_time_clone(date_obj->time);
|
||||
@@ -5238,7 +5252,7 @@ static int php_date_period_initialize_from_hash(php_period_obj *period_obj, Hash
|
||||
|
||||
ht_entry = zend_hash_str_find(myht, "current", sizeof("current")-1);
|
||||
if (ht_entry) {
|
||||
if (Z_TYPE_P(ht_entry) == IS_OBJECT && Z_OBJCE_P(ht_entry) == date_ce_date) {
|
||||
if (Z_TYPE_P(ht_entry) == IS_OBJECT && instanceof_function(Z_OBJCE_P(ht_entry), date_ce_interface)) {
|
||||
php_date_obj *date_obj;
|
||||
date_obj = Z_PHPDATE_P(ht_entry);
|
||||
period_obj->current = timelib_time_clone(date_obj->time);
|
||||
|
||||
@@ -39,7 +39,7 @@ DateInterval Object
|
||||
[weekday_behavior] => 0
|
||||
[first_last_day_of] => 0
|
||||
[invert] => 0
|
||||
[days] => 0
|
||||
[days] =>
|
||||
[special_type] => 0
|
||||
[special_amount] => 0
|
||||
[have_weekday_relative] => 0
|
||||
|
||||
@@ -136,7 +136,7 @@ object(DatePeriod)#%d (6) {
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
int(0)
|
||||
bool(false)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
|
||||
@@ -71,7 +71,7 @@ object(DateInterval)#2 (16) {
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
int(0)
|
||||
bool(false)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Bug #70153 (\DateInterval incorrectly unserialized)
|
||||
--FILE--
|
||||
<?php
|
||||
$i1 = \DateInterval::createFromDateString('+1 month');
|
||||
$i2 = unserialize(serialize($i1));
|
||||
var_dump($i1->days, $i2->days);
|
||||
var_dump($i2->special_amount, $i2->special_amount);
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
int(0)
|
||||
int(0)
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #78751 (Serialising DatePeriod converts DateTimeImmutable)
|
||||
--FILE--
|
||||
<?php
|
||||
$oDay = new DateTimeImmutable('2019-10-25');
|
||||
$oDateInterval = DateInterval::createFromDateString('1 day');
|
||||
$oDays = new DatePeriod($oDay, $oDateInterval, $oDay->modify('+1 day'));
|
||||
$oDays = unserialize(serialize($oDays));
|
||||
var_dump(
|
||||
$oDays->start instanceof DateTimeImmutable,
|
||||
$oDays->end instanceof DateTimeImmutable
|
||||
);
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(true)
|
||||
@@ -21,6 +21,6 @@ domdocumentloadxml_test_method.php
|
||||
--EXPECTF--
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): Opening and ending tag mismatch: title line 5 and book %s
|
||||
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): expected '>' %s
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): %rexpected '>'|Opening and ending tag mismatch: book line 5 and books%r %s
|
||||
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): Premature end of data in tag books %s
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): %rPremature end of data in tag books|EndTag: '<\/' not found in Entity, line: 13%r %s
|
||||
@@ -21,6 +21,6 @@ domdocumentload_test_method.php
|
||||
--EXPECTF--
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): Opening and ending tag mismatch: title line 5 and book %s
|
||||
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): expected '>' %s
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): %rexpected '>'|Opening and ending tag mismatch: book line 5 and books%r %s
|
||||
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): Premature end of data in tag books %s
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): %rPremature end of data in tag books|EndTag: '<\/' not found%r %s
|
||||
+67
-50
@@ -978,7 +978,6 @@ static tag_info_array tag_table_VND_PANASONIC = {
|
||||
{ 0x0001, "Quality"},
|
||||
{ 0x0002, "FirmwareVersion"},
|
||||
{ 0x0003, "WhiteBalance"},
|
||||
{ 0x0004, "0x0004"},
|
||||
{ 0x0007, "FocusMode"},
|
||||
{ 0x000f, "AFMode"},
|
||||
{ 0x001a, "ImageStabilization"},
|
||||
@@ -986,12 +985,10 @@ static tag_info_array tag_table_VND_PANASONIC = {
|
||||
{ 0x001f, "ShootingMode"},
|
||||
{ 0x0020, "Audio"},
|
||||
{ 0x0021, "DataDump"},
|
||||
{ 0x0022, "0x0022"},
|
||||
{ 0x0023, "WhiteBalanceBias"},
|
||||
{ 0x0024, "FlashBias"},
|
||||
{ 0x0025, "InternalSerialNumber"},
|
||||
{ 0x0026, "ExifVersion"},
|
||||
{ 0x0027, "0x0027"},
|
||||
{ 0x0028, "ColorEffect"},
|
||||
{ 0x0029, "TimeSincePowerOn"},
|
||||
{ 0x002a, "BurstMode"},
|
||||
@@ -999,7 +996,6 @@ static tag_info_array tag_table_VND_PANASONIC = {
|
||||
{ 0x002c, "Contrast"},
|
||||
{ 0x002d, "NoiseReduction"},
|
||||
{ 0x002e, "SelfTimer"},
|
||||
{ 0x002f, "0x002f"},
|
||||
{ 0x0030, "Rotation"},
|
||||
{ 0x0031, "AFAssistLamp"},
|
||||
{ 0x0032, "ColorMode"},
|
||||
@@ -1066,7 +1062,6 @@ static tag_info_array tag_table_VND_PANASONIC = {
|
||||
{ 0x00a3, "ClearRetouchValue"},
|
||||
{ 0x00ab, "TouchAE"},
|
||||
{ 0x0e00, "PrintIM"},
|
||||
{ 0x4449, "0x4449"},
|
||||
{ 0x8000, "MakerNoteVersion"},
|
||||
{ 0x8001, "SceneMode"},
|
||||
{ 0x8004, "WBRedLevel"},
|
||||
@@ -1101,22 +1096,20 @@ static tag_info_array tag_table_VND_SONY = {
|
||||
{ 0x0112, "WhiteBalanceFineTune"},
|
||||
{ 0x0114, "CameraSettings"},
|
||||
{ 0x0115, "WhiteBalance"},
|
||||
{ 0x0116, "0x0116"},
|
||||
{ 0x0116, "ExtraInfo"},
|
||||
{ 0x0e00, "PrintIM"},
|
||||
{ 0x1000, "MultiBurstMode"},
|
||||
{ 0x1001, "MultiBurstImageWidth"},
|
||||
{ 0x1002, "MultiBurstImageHeight"},
|
||||
{ 0x1003, "Panorama"},
|
||||
{ 0x2000, "0x2000"},
|
||||
{ 0x2001, "PreviewImage"},
|
||||
{ 0x2002, "0x2002"},
|
||||
{ 0x2003, "0x2003"},
|
||||
{ 0x2002, "Rating"},
|
||||
{ 0x2004, "Contrast"},
|
||||
{ 0x2005, "Saturation"},
|
||||
{ 0x2006, "0x2006"},
|
||||
{ 0x2007, "0x2007"},
|
||||
{ 0x2008, "0x2008"},
|
||||
{ 0x2009, "0x2009"},
|
||||
{ 0x2006, "Sharpness"},
|
||||
{ 0x2007, "Brightness"},
|
||||
{ 0x2008, "LongExposureNoiseReduction"},
|
||||
{ 0x2009, "HighISONoiseReduction"},
|
||||
{ 0x200a, "AutoHDR"},
|
||||
{ 0x3000, "ShotInfo"},
|
||||
{ 0xb000, "FileFormat"},
|
||||
@@ -1143,8 +1136,9 @@ static tag_info_array tag_table_VND_SONY = {
|
||||
{ 0xb049, "ReleaseMode"},
|
||||
{ 0xb04a, "SequenceNumber"},
|
||||
{ 0xb04b, "AntiBlur"},
|
||||
{ 0xb04e, "LongExposureNoiseReduction"},
|
||||
{ 0xb04e, "FocusMode"},
|
||||
{ 0xb04f, "DynamicRangeOptimizer"},
|
||||
{ 0xb050, "HighISONoiseReduction2"},
|
||||
{ 0xb052, "IntelligentAuto"},
|
||||
{ 0xb054, "WhiteBalance2"},
|
||||
TAG_TABLE_END
|
||||
@@ -1249,7 +1243,6 @@ static tag_info_array tag_table_VND_MINOLTA = {
|
||||
{ 0x0100, "SceneMode"},
|
||||
{ 0x0101, "ColorMode"},
|
||||
{ 0x0102, "Quality"},
|
||||
{ 0x0103, "0x0103"},
|
||||
{ 0x0104, "FlashExposureComp"},
|
||||
{ 0x0105, "Teleconverter"},
|
||||
{ 0x0107, "ImageStabilization"},
|
||||
@@ -1334,27 +1327,28 @@ typedef struct {
|
||||
|
||||
/* Remember to update PHP_MINFO if updated */
|
||||
static const maker_note_type maker_note_array[] = {
|
||||
{ tag_table_VND_CANON, "Canon", NULL, 0, 0, MN_ORDER_INTEL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_CASIO, "CASIO", NULL, 0, 0, MN_ORDER_MOTOROLA, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_FUJI, "FUJIFILM", "FUJIFILM\x0C\x00\x00\x00", 12, 12, MN_ORDER_INTEL, MN_OFFSET_MAKER},
|
||||
{ tag_table_VND_NIKON, "NIKON", "Nikon\x00\x01\x00", 8, 8, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_NIKON_990, "NIKON", NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_OLYMPUS, "OLYMPUS OPTICAL CO.,LTD", "OLYMP\x00\x01\x00", 8, 8, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_SAMSUNG, "SAMSUNG", NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_PANASONIC, "Panasonic", "Panasonic\x00\x00\x00", 12, 12, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_DJI, "DJI", NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_SONY, "SONY", "SONY DSC \x00\x00\x00", 12, 12, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_PENTAX, "PENTAX", "AOC\x00", 6, 6, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_MINOLTA, "Minolta, KONICA MINOLTA", NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_SIGMA, "SIGMA, FOVEON", "SIGMA\x00\x00\x00", 10, 10, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_SIGMA, "SIGMA, FOVEON", "FOVEON\x00\x00\x00", 10, 10, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_KYOCERA, "KYOCERA, CONTAX", "KYOCERA \x00\x00\x00", 22, 22, MN_ORDER_NORMAL, MN_OFFSET_MAKER},
|
||||
{ tag_table_VND_RICOH, "RICOH", "Ricoh", 5, 5, MN_ORDER_MOTOROLA, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_RICOH, "RICOH", "RICOH", 5, 5, MN_ORDER_MOTOROLA, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_CANON, "Canon", NULL, 0, 0, MN_ORDER_INTEL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_CASIO, "CASIO", NULL, 0, 0, MN_ORDER_MOTOROLA, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_FUJI, "FUJIFILM", "FUJIFILM\x0C\x00\x00\x00", 12, 12, MN_ORDER_INTEL, MN_OFFSET_MAKER},
|
||||
{ tag_table_VND_NIKON, "NIKON", "Nikon\x00\x01\x00", 8, 8, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_NIKON_990, "NIKON", NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_OLYMPUS, "OLYMPUS OPTICAL CO.,LTD", "OLYMP\x00\x01\x00", 8, 8, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_SAMSUNG, "SAMSUNG", NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_PANASONIC, "Panasonic", "Panasonic\x00\x00\x00", 12, 12, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_DJI, "DJI", NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_SONY, "SONY", "SONY DSC \x00\x00\x00", 12, 12, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_SONY, "SONY", NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_PENTAX, "PENTAX", "AOC\x00", 6, 6, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_MINOLTA, "Minolta, KONICA MINOLTA", NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_SIGMA, "SIGMA, FOVEON", "SIGMA\x00\x00\x00", 10, 10, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_SIGMA, "SIGMA, FOVEON", "FOVEON\x00\x00\x00", 10, 10, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_KYOCERA, "KYOCERA, CONTAX", "KYOCERA \x00\x00\x00", 22, 22, MN_ORDER_NORMAL, MN_OFFSET_MAKER},
|
||||
{ tag_table_VND_RICOH, "RICOH", "Ricoh", 5, 5, MN_ORDER_MOTOROLA, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_RICOH, "RICOH", "RICOH", 5, 5, MN_ORDER_MOTOROLA, MN_OFFSET_NORMAL},
|
||||
|
||||
/* These re-uses existing formats */
|
||||
{ tag_table_VND_OLYMPUS, "AGFA", "AGFA \x00\x01", 8, 8, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_OLYMPUS, "EPSON", "EPSON\x00\x01\x00", 8, 8, MN_ORDER_NORMAL, MN_OFFSET_NORMAL}
|
||||
{ tag_table_VND_OLYMPUS, "AGFA", "AGFA \x00\x01", 8, 8, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_OLYMPUS, "EPSON", "EPSON\x00\x01\x00", 8, 8, MN_ORDER_NORMAL, MN_OFFSET_NORMAL}
|
||||
};
|
||||
/* }}} */
|
||||
|
||||
@@ -2303,14 +2297,11 @@ static void exif_iif_free(image_info_type *image_info, int section_index) {
|
||||
efree(f);
|
||||
}
|
||||
switch(image_info->info_list[section_index].list[i].format) {
|
||||
case TAG_FMT_SBYTE:
|
||||
case TAG_FMT_BYTE:
|
||||
/* in contrast to strings bytes do not need to allocate buffer for NULL if length==0 */
|
||||
if (image_info->info_list[section_index].list[i].length<1)
|
||||
break;
|
||||
default:
|
||||
case TAG_FMT_UNDEFINED:
|
||||
case TAG_FMT_STRING:
|
||||
case TAG_FMT_SBYTE:
|
||||
case TAG_FMT_BYTE:
|
||||
default:
|
||||
if ((f=image_info->info_list[section_index].list[i].value.s) != NULL) {
|
||||
efree(f);
|
||||
}
|
||||
@@ -3147,7 +3138,8 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
||||
/*exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "check (%s)", maker_note->make?maker_note->make:"");*/
|
||||
if (maker_note->make && (!ImageInfo->make || strcmp(maker_note->make, ImageInfo->make)))
|
||||
continue;
|
||||
if (maker_note->id_string && strncmp(maker_note->id_string, value_ptr, maker_note->id_string_len))
|
||||
if (maker_note->id_string && value_len >= maker_note->id_string_len
|
||||
&& strncmp(maker_note->id_string, value_ptr, maker_note->id_string_len))
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
@@ -3221,8 +3213,9 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
||||
}
|
||||
|
||||
for (de=0;de<NumDirEntries;de++) {
|
||||
if (!exif_process_IFD_TAG(ImageInfo, dir_start + 2 + 12 * de,
|
||||
offset_base, data_len, displacement, section_index, 0, maker_note->tag_table)) {
|
||||
size_t offset = 2 + 12 * de;
|
||||
if (!exif_process_IFD_TAG(ImageInfo, dir_start + offset,
|
||||
offset_base, data_len - offset, displacement, section_index, 0, maker_note->tag_table)) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@@ -3235,6 +3228,14 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#define REQUIRE_NON_EMPTY() do { \
|
||||
if (byte_count == 0) { \
|
||||
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Cannot be empty", tag, exif_get_tagname(tag, tagname, -12, tag_table)); \
|
||||
return FALSE; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
||||
/* {{{ exif_process_IFD_TAG
|
||||
* Process one of the nested IFDs directories. */
|
||||
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)
|
||||
@@ -3268,11 +3269,6 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
|
||||
/*return TRUE;*/
|
||||
}
|
||||
|
||||
if (components <= 0) {
|
||||
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal components(%d)", tag, exif_get_tagname(tag, tagname, -12, tag_table), components);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
byte_count_signed = (int64_t)components * php_tiff_bytes_per_format[format];
|
||||
|
||||
if (byte_count_signed < 0 || (byte_count_signed > INT32_MAX)) {
|
||||
@@ -3352,8 +3348,12 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
|
||||
}
|
||||
#endif
|
||||
|
||||
/* NB: The following code may not assume that there is at least one component!
|
||||
* byte_count may be zero! */
|
||||
|
||||
if (section_index==SECTION_THUMBNAIL) {
|
||||
if (!ImageInfo->Thumbnail.data) {
|
||||
REQUIRE_NON_EMPTY();
|
||||
switch(tag) {
|
||||
case TAG_IMAGEWIDTH:
|
||||
case TAG_COMP_IMAGE_WIDTH:
|
||||
@@ -3397,6 +3397,9 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
|
||||
if (byte_count>1 && (length=php_strnlen(value_ptr, byte_count)) > 0) {
|
||||
if (length<byte_count-1) {
|
||||
/* When there are any characters after the first NUL */
|
||||
EFREE_IF(ImageInfo->CopyrightPhotographer);
|
||||
EFREE_IF(ImageInfo->CopyrightEditor);
|
||||
EFREE_IF(ImageInfo->Copyright);
|
||||
ImageInfo->CopyrightPhotographer = estrdup(value_ptr);
|
||||
ImageInfo->CopyrightEditor = estrndup(value_ptr+length+1, byte_count-length-1);
|
||||
spprintf(&ImageInfo->Copyright, 0, "%s, %s", ImageInfo->CopyrightPhotographer, ImageInfo->CopyrightEditor);
|
||||
@@ -3404,6 +3407,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
|
||||
/* but we are not supposed to change this */
|
||||
/* keep in mind that image_info does not store editor value */
|
||||
} else {
|
||||
EFREE_IF(ImageInfo->Copyright);
|
||||
ImageInfo->Copyright = estrndup(value_ptr, byte_count);
|
||||
}
|
||||
}
|
||||
@@ -3432,6 +3436,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
|
||||
case TAG_FNUMBER:
|
||||
/* Simplest way of expressing aperture, so I trust it the most.
|
||||
(overwrite previously computed value if there is one) */
|
||||
REQUIRE_NON_EMPTY();
|
||||
ImageInfo->ApertureFNumber = (float)exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel);
|
||||
break;
|
||||
|
||||
@@ -3440,6 +3445,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
|
||||
/* More relevant info always comes earlier, so only use this field if we don't
|
||||
have appropriate aperture information yet. */
|
||||
if (ImageInfo->ApertureFNumber == 0) {
|
||||
REQUIRE_NON_EMPTY();
|
||||
ImageInfo->ApertureFNumber
|
||||
= (float)exp(exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel)*log(2)*0.5);
|
||||
}
|
||||
@@ -3451,6 +3457,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
|
||||
SHUTTERSPEED comes after EXPOSURE TIME
|
||||
*/
|
||||
if (ImageInfo->ExposureTime == 0) {
|
||||
REQUIRE_NON_EMPTY();
|
||||
ImageInfo->ExposureTime
|
||||
= (float)(1/exp(exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel)*log(2)));
|
||||
}
|
||||
@@ -3460,20 +3467,24 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
|
||||
break;
|
||||
|
||||
case TAG_COMP_IMAGE_WIDTH:
|
||||
REQUIRE_NON_EMPTY();
|
||||
ImageInfo->ExifImageWidth = exif_convert_any_to_int(value_ptr, exif_rewrite_tag_format_to_unsigned(format), ImageInfo->motorola_intel);
|
||||
break;
|
||||
|
||||
case TAG_FOCALPLANE_X_RES:
|
||||
REQUIRE_NON_EMPTY();
|
||||
ImageInfo->FocalplaneXRes = exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel);
|
||||
break;
|
||||
|
||||
case TAG_SUBJECT_DISTANCE:
|
||||
/* Inidcates the distacne the autofocus camera is focused to.
|
||||
Tends to be less accurate as distance increases. */
|
||||
REQUIRE_NON_EMPTY();
|
||||
ImageInfo->Distance = (float)exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel);
|
||||
break;
|
||||
|
||||
case TAG_FOCALPLANE_RESOLUTION_UNIT:
|
||||
REQUIRE_NON_EMPTY();
|
||||
switch((int)exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel)) {
|
||||
case 1: ImageInfo->FocalplaneUnits = 25.4; break; /* inch */
|
||||
case 2:
|
||||
@@ -3499,9 +3510,11 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
|
||||
break;
|
||||
|
||||
case TAG_MAKE:
|
||||
EFREE_IF(ImageInfo->make);
|
||||
ImageInfo->make = estrndup(value_ptr, byte_count);
|
||||
break;
|
||||
case TAG_MODEL:
|
||||
EFREE_IF(ImageInfo->model);
|
||||
ImageInfo->model = estrndup(value_ptr, byte_count);
|
||||
break;
|
||||
|
||||
@@ -3516,6 +3529,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
|
||||
case TAG_GPS_IFD_POINTER:
|
||||
case TAG_INTEROP_IFD_POINTER:
|
||||
if (ReadNextIFD) {
|
||||
REQUIRE_NON_EMPTY();
|
||||
char *Subdir_start;
|
||||
int sub_section_index = 0;
|
||||
switch(tag) {
|
||||
@@ -3544,9 +3558,11 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
|
||||
Subdir_start = offset_base + php_ifd_get32u(value_ptr, ImageInfo->motorola_intel);
|
||||
if (Subdir_start < offset_base || Subdir_start > offset_base+IFDlength) {
|
||||
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD Pointer");
|
||||
EFREE_IF(outside);
|
||||
return FALSE;
|
||||
}
|
||||
if (!exif_process_IFD_in_JPEG(ImageInfo, Subdir_start, offset_base, IFDlength, displacement, sub_section_index, tag)) {
|
||||
EFREE_IF(outside);
|
||||
return FALSE;
|
||||
}
|
||||
#ifdef EXIF_DEBUG
|
||||
@@ -4557,8 +4573,9 @@ PHP_FUNCTION(exif_read_data)
|
||||
exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "CCDWidth", "%dmm", (int)ImageInfo.CCDWidth);
|
||||
}
|
||||
if(ImageInfo.ExposureTime>0) {
|
||||
if(ImageInfo.ExposureTime <= 0.5) {
|
||||
exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime", "%0.3F s (1/%d)", ImageInfo.ExposureTime, (int)(0.5 + 1/ImageInfo.ExposureTime));
|
||||
float recip_exposure_time = 0.5f + 1.0f/ImageInfo.ExposureTime;
|
||||
if (ImageInfo.ExposureTime <= 0.5 && recip_exposure_time < INT_MAX) {
|
||||
exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime", "%0.3F s (1/%d)", ImageInfo.ExposureTime, (int) recip_exposure_time);
|
||||
} else {
|
||||
exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime", "%0.3F s", ImageInfo.ExposureTime);
|
||||
}
|
||||
|
||||
@@ -4,9 +4,48 @@ Bug #68547 (Exif Header component value check error)
|
||||
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
|
||||
--FILE--
|
||||
<?php
|
||||
exif_read_data(__DIR__ . DIRECTORY_SEPARATOR . 'bug68547.jpg');
|
||||
var_dump(exif_read_data(__DIR__ . DIRECTORY_SEPARATOR . 'bug68547.jpg'));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Warning: exif_read_data(bug68547.jpg): Process tag(x9C9E=Keywords ): Illegal components(%d) in %sbug68547.php on line %d
|
||||
array(12) {
|
||||
["FileName"]=>
|
||||
string(12) "bug68547.jpg"
|
||||
["FileDateTime"]=>
|
||||
int(%d)
|
||||
["FileSize"]=>
|
||||
int(713)
|
||||
["FileType"]=>
|
||||
int(2)
|
||||
["MimeType"]=>
|
||||
string(10) "image/jpeg"
|
||||
["SectionsFound"]=>
|
||||
string(20) "ANY_TAG, IFD0, WINXP"
|
||||
["COMPUTED"]=>
|
||||
array(5) {
|
||||
["html"]=>
|
||||
string(20) "width="1" height="1""
|
||||
["Height"]=>
|
||||
int(1)
|
||||
["Width"]=>
|
||||
int(1)
|
||||
["IsColor"]=>
|
||||
int(1)
|
||||
["ByteOrderMotorola"]=>
|
||||
int(0)
|
||||
}
|
||||
["Subject"]=>
|
||||
string(10) "Subjec??.."
|
||||
["Keywords"]=>
|
||||
string(0) ""
|
||||
["Author"]=>
|
||||
string(9) "Rui Carmo"
|
||||
["Comments"]=>
|
||||
string(29) "Comments
|
||||
Line2
|
||||
Line3
|
||||
Line4"
|
||||
["Title"]=>
|
||||
string(8) "Title..."
|
||||
}
|
||||
===DONE===
|
||||
@@ -39,7 +39,6 @@ print_r(exif_read_data(__DIR__.'/bug68799.jpg'));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: exif_read_data(bug68799.jpg): Process tag(x9C9D=Author ): Illegal components(%d) in %s on line %d
|
||||
Array
|
||||
(
|
||||
[FileName] => bug68799.jpg
|
||||
@@ -47,7 +46,7 @@ Array
|
||||
[FileSize] => 735
|
||||
[FileType] => 2
|
||||
[MimeType] => image/jpeg
|
||||
[SectionsFound] => ANY_TAG, IFD0
|
||||
[SectionsFound] => ANY_TAG, IFD0, WINXP
|
||||
[COMPUTED] => Array
|
||||
(
|
||||
[html] => width="1" height="1"
|
||||
@@ -60,4 +59,5 @@ Array
|
||||
[XResolution] => 96/1
|
||||
[YResolution] => 96/1
|
||||
[ResolutionUnit] => 2
|
||||
[Author] =>
|
||||
)
|
||||
@@ -47,7 +47,7 @@ Warning: exif_read_data(bug72094_3.jpg): Process tag(x3030=UndefinedTa): Illegal
|
||||
|
||||
Warning: exif_read_data(bug72094_3.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %s%ebug72094.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug72094_3.jpg): Process tag(x3030=UndefinedTa): Illegal components(%d) in %s%ebug72094.php on line %d
|
||||
Warning: exif_read_data(bug72094_3.jpg): Illegal IFD size in %s%ebug72094.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug72094_3.jpg): File structure corrupted in %s%ebug72094.php on line %d
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ Bug #73737 (Crash when parsing a tag format)
|
||||
var_dump($exif);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: exif_thumbnail(bug73737.tiff): Process tag(x0100=ImageWidth ): Illegal components(0) in %s on line %d
|
||||
Warning: exif_thumbnail(bug73737.tiff): Process tag(x0100=ImageWidth ): Cannot be empty in %s on line %d
|
||||
|
||||
Warning: exif_thumbnail(bug73737.tiff): Error in TIFF: filesize(x0030) less than start of IFD dir(x10102) in %s line %d
|
||||
bool(false)
|
||||
@@ -70,7 +70,7 @@ Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal f
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal pointer offset(x30303030 + x30303030 = x60606060 > x00EE) in %sbug76557.php on line %d
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal pointer offset(x30303030 + x30303030 = x60606060 > %s) in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): File structure corrupted in %sbug76557.php on line %d
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
Bug #78793: Use-after-free in exif parsing under memory sanitizer
|
||||
--FILE--
|
||||
<?php
|
||||
$f = "ext/exif/tests/bug77950.tiff";
|
||||
for ($i = 0; $i < 10; $i++) {
|
||||
@exif_read_data($f);
|
||||
}
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #78910: Heap-buffer-overflow READ in exif (OSS-Fuzz #19044)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(exif_read_data('data:image/jpg;base64,TU0AKgAAAAwgICAgAAIBDwAEAAAAAgAAACKSfCAgAAAAAEZVSklGSUxN'));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: exif_read_data(): Read from TIFF: tag(0x927C, MakerNote ): Illegal format code 0x2020, switching to BYTE in %s on line %d
|
||||
|
||||
Warning: exif_read_data(): Process tag(x927C=MakerNote ): Illegal format code 0x2020, suppose BYTE in %s on line %d
|
||||
|
||||
Warning: exif_read_data(): IFD data too short: 0x0000 offset 0x000C in %s on line %d
|
||||
|
||||
Warning: exif_read_data(): Invalid TIFF file in %s on line %d
|
||||
bool(false)
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
OSS-Fuzz #17474: Memory leak on duplicate Copyright tags
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('exif')) {
|
||||
die('skip exif extension not available');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
// Only checking for an absence of leaks here.
|
||||
@exif_read_data(__DIR__ . '/duplicate_copyright_tag_leak.tiff');
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
===DONE===
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
OSS-Fuzz #17163: Out-of-bounds read due to tag with zero components
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('exif')) {
|
||||
die('skip exif extension not available');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(exif_read_data(__DIR__ . '/tag_with_illegal_zero_components.jpeg'));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: exif_read_data(tag_with_illegal_zero_components.jpeg): Process tag(x0202=JPEGInterch): Cannot be empty in %s on line %d
|
||||
|
||||
Warning: exif_read_data(tag_with_illegal_zero_components.jpeg): File structure corrupted in %s on line %d
|
||||
|
||||
Warning: exif_read_data(tag_with_illegal_zero_components.jpeg): Invalid JPEG file in %s on line %d
|
||||
bool(false)
|
||||
Binary file not shown.
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
OSS-Fuzz: Temporary buffer leak in tag reading
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('exif')) {
|
||||
die('skip exif extension not available');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(@exif_read_data(__DIR__ . '/temporary_buffer_leak.jpg'));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
OSS-Fuzz: Memory leak for zero-length MAKERNOTE
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('exif')) {
|
||||
die('skip exif extension not available');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@exif_read_data(__DIR__ . '/zero_length_makernote_leak.tiff');
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
Binary file not shown.
@@ -989,8 +989,9 @@ cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h,
|
||||
goto out;
|
||||
}
|
||||
nelements = CDF_GETUINT32(q, 1);
|
||||
if (nelements == 0) {
|
||||
DPRINTF(("CDF_VECTOR with nelements == 0\n"));
|
||||
if (nelements > CDF_ELEMENT_LIMIT || nelements == 0) {
|
||||
DPRINTF(("CDF_VECTOR with nelements == %"
|
||||
SIZE_T_FORMAT "u\n", nelements));
|
||||
goto out;
|
||||
}
|
||||
slen = 2;
|
||||
@@ -1032,8 +1033,6 @@ cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h,
|
||||
goto out;
|
||||
inp += nelem;
|
||||
}
|
||||
DPRINTF(("nelements = %" SIZE_T_FORMAT "u\n",
|
||||
nelements));
|
||||
for (j = 0; j < nelements && i < sh.sh_properties;
|
||||
j++, i++)
|
||||
{
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
typedef int32_t cdf_secid_t;
|
||||
|
||||
#define CDF_LOOP_LIMIT 10000
|
||||
#define CDF_ELEMENT_LIMIT 100000
|
||||
|
||||
#define CDF_SECID_NULL 0
|
||||
#define CDF_SECID_FREE -1
|
||||
|
||||
@@ -534,7 +534,7 @@ compress(int init_bits, gdIOCtxPtr outfile, gdImagePtr im, GifCtx *ctx)
|
||||
output( (code_int)ctx->ClearCode, ctx );
|
||||
|
||||
#ifdef SIGNED_COMPARE_SLOW
|
||||
while ( (c = GIFNextPixel( im )) != (unsigned) EOF ) {
|
||||
while ( (c = GIFNextPixel( im, ctx )) != (unsigned) EOF ) {
|
||||
#else /*SIGNED_COMPARE_SLOW*/
|
||||
while ( (c = GIFNextPixel( im, ctx )) != EOF ) { /* } */
|
||||
#endif /*SIGNED_COMPARE_SLOW*/
|
||||
|
||||
@@ -3,7 +3,7 @@ Bug #77198 (auto cropping has insufficient precision)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
if (!GD_BUNDLED) die('upstream bugfix has not been released');
|
||||
if (!GD_BUNDLED) die('skip upstream bugfix has not been released');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -3,7 +3,7 @@ Bug #77198 (threshold cropping has insufficient precision)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
if (!GD_BUNDLED) die('upstream bugfix has not been released');
|
||||
if (!GD_BUNDLED) die('skip upstream bugfix has not been released');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -3,7 +3,7 @@ Bug #77200 (imagecropauto(…, GD_CROP_SIDES) crops left but not right)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
if (!GD_BUNDLED) die('upstream bugfix has not been released');
|
||||
if (!GD_BUNDLED) die('skip upstream bugfix has not been released');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
+1
-1
@@ -284,7 +284,7 @@ PHP_MINIT_FUNCTION(miconv)
|
||||
{
|
||||
static char buf[16];
|
||||
snprintf(buf, sizeof(buf), "%d.%d",
|
||||
((_libiconv_version >> 8) & 0x0f), (_libiconv_version & 0x0f));
|
||||
_libiconv_version >> 8, _libiconv_version & 0xff);
|
||||
version = buf;
|
||||
}
|
||||
#elif HAVE_GLIBC_ICONV
|
||||
|
||||
+2
-2
@@ -232,7 +232,7 @@ static void php_intl_idn_to(INTERNAL_FUNCTION_PARAMETERS,
|
||||
#if defined(__clang__)
|
||||
# pragma clang diagnostic push
|
||||
# pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#elif ZEND_GCC_VERSION >= 4002
|
||||
#elif ZEND_GCC_VERSION >= 4008
|
||||
# pragma GCC diagnostic push
|
||||
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
@@ -243,7 +243,7 @@ static void php_intl_idn_to(INTERNAL_FUNCTION_PARAMETERS,
|
||||
}
|
||||
#if defined(__clang__)
|
||||
# pragma clang diagnostic pop
|
||||
#elif ZEND_GCC_VERSION >= 4002
|
||||
#elif ZEND_GCC_VERSION >= 4008
|
||||
# pragma GCC diagnostic pop
|
||||
#endif
|
||||
efree(ustring);
|
||||
|
||||
@@ -1285,7 +1285,7 @@ PHP_FUNCTION(locale_filter_matches)
|
||||
if( boolCanonical ){
|
||||
/* canonicalize loc_range */
|
||||
can_loc_range=get_icu_value_internal( loc_range , LOC_CANONICALIZE_TAG , &result , 0);
|
||||
if( result ==0) {
|
||||
if( result <=0) {
|
||||
intl_error_set( NULL, status,
|
||||
"locale_filter_matches : unable to canonicalize loc_range" , 0 );
|
||||
RETURN_FALSE;
|
||||
@@ -1293,7 +1293,7 @@ PHP_FUNCTION(locale_filter_matches)
|
||||
|
||||
/* canonicalize lang_tag */
|
||||
can_lang_tag = get_icu_value_internal( lang_tag , LOC_CANONICALIZE_TAG , &result , 0);
|
||||
if( result ==0) {
|
||||
if( result <=0) {
|
||||
intl_error_set( NULL, status,
|
||||
"locale_filter_matches : unable to canonicalize lang_tag" , 0 );
|
||||
RETURN_FALSE;
|
||||
|
||||
@@ -191,10 +191,10 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
|
||||
|
||||
if (name_part.getType() == UMSGPAT_PART_TYPE_ARG_NAME) {
|
||||
UnicodeString argName = mp.getSubstring(name_part);
|
||||
if ((storedType = (Formattable::Type*)zend_hash_str_find_ptr(ret, (char*)argName.getBuffer(), argName.length())) == NULL) {
|
||||
if ((storedType = (Formattable::Type*)zend_hash_str_find_ptr(ret, (char*)argName.getBuffer(), argName.length() * sizeof(UChar))) == NULL) {
|
||||
/* not found already; create new entry in HT */
|
||||
Formattable::Type bogusType = Formattable::kObject;
|
||||
storedType = (Formattable::Type*)zend_hash_str_update_mem(ret, (char*)argName.getBuffer(), argName.length(),
|
||||
storedType = (Formattable::Type*)zend_hash_str_update_mem(ret, (char*)argName.getBuffer(), argName.length() * sizeof(UChar),
|
||||
(void*)&bogusType, sizeof(bogusType));
|
||||
}
|
||||
} else if (name_part.getType() == UMSGPAT_PART_TYPE_ARG_NUMBER) {
|
||||
@@ -450,7 +450,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
|
||||
continue;
|
||||
}
|
||||
|
||||
storedArgType = (Formattable::Type*)zend_hash_str_find_ptr(types, (char*)key.getBuffer(), key.length());
|
||||
storedArgType = (Formattable::Type*)zend_hash_str_find_ptr(types, (char*)key.getBuffer(), key.length() * sizeof(UChar));
|
||||
}
|
||||
|
||||
if (storedArgType != NULL) {
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Bug #78804: Segmentation fault in Locale::filterMatches
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
if (Locale::filterMatches('en-US', 'und', true)) {
|
||||
echo 'Matches';
|
||||
} else {
|
||||
echo 'Not matches';
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
Not matches
|
||||
@@ -2,6 +2,7 @@
|
||||
grapheme()
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '65.0') >= 0) die('skip for ICU < 65.0'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -3,6 +3,7 @@ locale_get_display_name() icu >= 64.0
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '64.0') < 0) die('skip for ICU >= 64.0'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '65.0') >= 0) die('skip for ICU < 65.0'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -0,0 +1,342 @@
|
||||
--TEST--
|
||||
locale_get_display_name() icu >= 64.0
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '65.0') < 0) die('skip for ICU >= 65.0'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Try getting the display_name for different locales
|
||||
* with Procedural and Object methods.
|
||||
*/
|
||||
|
||||
function ut_main()
|
||||
{
|
||||
$res_str='';
|
||||
|
||||
$disp_locales=array('en','fr','de');
|
||||
|
||||
$locales = array(
|
||||
'sl_IT_nedis_KIRTI',
|
||||
'sl_IT_nedis-a-kirti-x-xyz',
|
||||
'sl_IT_rozaj',
|
||||
'sl_IT_NEDIS_ROJAZ_1901',
|
||||
'i-enochian',
|
||||
'zh-hakka',
|
||||
'zh-wuu',
|
||||
'i-tay',
|
||||
'sgn-BE-nl',
|
||||
'sgn-CH-de',
|
||||
'sl_IT_rozaj@currency=EUR',
|
||||
'uk-ua_CALIFORNIA@currency=;currency=GRN',
|
||||
'root',
|
||||
'uk@currency=EURO',
|
||||
'Hindi',
|
||||
//Simple language subtag
|
||||
'de',
|
||||
'fr',
|
||||
'ja',
|
||||
'i-enochian', //(example of a grandfathered tag)
|
||||
//Language subtag plus Script subtag:
|
||||
'zh-Hant',
|
||||
'zh-Hans',
|
||||
'sr-Cyrl',
|
||||
'sr-Latn',
|
||||
//Language-Script-Region
|
||||
'zh-Hans-CN',
|
||||
'sr-Latn-CS',
|
||||
//Language-Variant
|
||||
'sl-rozaj',
|
||||
'sl-nedis',
|
||||
//Language-Region-Variant
|
||||
'de-CH-1901',
|
||||
'sl-IT-nedis',
|
||||
//Language-Script-Region-Variant
|
||||
'sl-Latn-IT-nedis',
|
||||
//Language-Region:
|
||||
'de-DE',
|
||||
'en-US',
|
||||
'es-419',
|
||||
//Private use subtags:
|
||||
'de-CH-x-phonebk',
|
||||
'az-Arab-x-AZE-derbend',
|
||||
//Extended language subtags
|
||||
'zh-min',
|
||||
'zh-min-nan-Hant-CN',
|
||||
//Private use registry values
|
||||
'x-whatever',
|
||||
'qaa-Qaaa-QM-x-southern',
|
||||
'sr-Latn-QM',
|
||||
'sr-Qaaa-CS',
|
||||
/*Tags that use extensions (examples ONLY: extensions MUST be defined
|
||||
by revision or update to this document or by RFC): */
|
||||
'en-US-u-islamCal',
|
||||
'zh-CN-a-myExt-x-private',
|
||||
'en-a-myExt-b-another',
|
||||
//Some Invalid Tags:
|
||||
'de-419-DE',
|
||||
'a-DE',
|
||||
'ar-a-aaa-b-bbb-a-ccc'
|
||||
);
|
||||
|
||||
|
||||
$res_str = '';
|
||||
|
||||
foreach( $locales as $locale )
|
||||
{
|
||||
$res_str .= "locale='$locale'\n";
|
||||
foreach( $disp_locales as $disp_locale )
|
||||
{
|
||||
$scr = ut_loc_get_display_name( $locale ,$disp_locale );
|
||||
$scr = str_replace(array('(', ')'), '#', $scr);
|
||||
$res_str .= "disp_locale=$disp_locale : display_name=$scr";
|
||||
$res_str .= "\n";
|
||||
}
|
||||
$res_str .= "-----------------\n";
|
||||
}
|
||||
|
||||
return $res_str;
|
||||
|
||||
}
|
||||
|
||||
include_once( 'ut_common.inc' );
|
||||
ut_run();
|
||||
|
||||
?>
|
||||
--EXPECTREGEX--
|
||||
locale='sl_IT_nedis_KIRTI'
|
||||
disp_locale=en : display_name=Slovenian #Italy, NEDIS_KIRTI#
|
||||
disp_locale=fr : display_name=slovène #Italie, NEDIS_KIRTI#
|
||||
disp_locale=de : display_name=Slowenisch #Italien, NEDIS_KIRTI#
|
||||
-----------------
|
||||
locale='sl_IT_nedis-a-kirti-x-xyz'
|
||||
disp_locale=en : display_name=Slovenian #Italy, NEDIS_A_KIRTI_X_XYZ#
|
||||
disp_locale=fr : display_name=slovène #Italie, NEDIS_A_KIRTI_X_XYZ#
|
||||
disp_locale=de : display_name=Slowenisch #Italien, NEDIS_A_KIRTI_X_XYZ#
|
||||
-----------------
|
||||
locale='sl_IT_rozaj'
|
||||
disp_locale=en : display_name=Slovenian #Italy, Resian#
|
||||
disp_locale=fr : display_name=slovène #Italie, dialecte de Resia#
|
||||
disp_locale=de : display_name=Slowenisch #Italien, (ROZAJ|Resianisch)#
|
||||
-----------------
|
||||
locale='sl_IT_NEDIS_ROJAZ_1901'
|
||||
disp_locale=en : display_name=Slovenian #Italy, NEDIS_ROJAZ_1901#
|
||||
disp_locale=fr : display_name=slovène #Italie, NEDIS_ROJAZ_1901#
|
||||
disp_locale=de : display_name=Slowenisch #Italien, NEDIS_ROJAZ_1901#
|
||||
-----------------
|
||||
locale='i-enochian'
|
||||
disp_locale=en : display_name=i-enochian #Private-Use=i-enochian#
|
||||
disp_locale=fr : display_name=i-enochian #usage privé=i-enochian#
|
||||
disp_locale=de : display_name=i-enochian #Privatnutzung=i-enochian#
|
||||
-----------------
|
||||
locale='zh-hakka'
|
||||
disp_locale=en : display_name=Chinese( #HAKKA#)?
|
||||
disp_locale=fr : display_name=chinois( #HAKKA#)?
|
||||
disp_locale=de : display_name=Chinesisch( #HAKKA#)?
|
||||
-----------------
|
||||
locale='zh-wuu'
|
||||
disp_locale=en : display_name=Chinese #WUU#
|
||||
disp_locale=fr : display_name=chinois #WUU#
|
||||
disp_locale=de : display_name=Chinesisch #WUU#
|
||||
-----------------
|
||||
locale='i-tay'
|
||||
disp_locale=en : display_name=i-tay
|
||||
disp_locale=fr : display_name=i-tay
|
||||
disp_locale=de : display_name=i-tay
|
||||
-----------------
|
||||
locale='sgn-BE-nl'
|
||||
disp_locale=en : display_name=sgn #Belgium, NL#
|
||||
disp_locale=fr : display_name=sgn #Belgique, NL#
|
||||
disp_locale=de : display_name=sgn #Belgien, NL#
|
||||
-----------------
|
||||
locale='sgn-CH-de'
|
||||
disp_locale=en : display_name=sgn #Switzerland, DE#
|
||||
disp_locale=fr : display_name=sgn #Suisse, DE#
|
||||
disp_locale=de : display_name=sgn #Schweiz, DE#
|
||||
-----------------
|
||||
locale='sl_IT_rozaj@currency=EUR'
|
||||
disp_locale=en : display_name=Slovenian #Italy, Resian, [Cc]urrency=Euro#
|
||||
disp_locale=fr : display_name=slovène #Italie, dialecte de Resia, [Dd]evise=euro#
|
||||
disp_locale=de : display_name=Slowenisch #Italien, (ROZAJ|Resianisch), Währung=Euro#
|
||||
-----------------
|
||||
locale='uk-ua_CALIFORNIA@currency=;currency=GRN'
|
||||
disp_locale=en : display_name=
|
||||
disp_locale=fr : display_name=
|
||||
disp_locale=de : display_name=
|
||||
-----------------
|
||||
locale='root'
|
||||
disp_locale=en : display_name=Unknown language
|
||||
disp_locale=fr : display_name=langue indéterminée
|
||||
disp_locale=de : display_name=Unbekannte Sprache
|
||||
-----------------
|
||||
locale='uk@currency=EURO'
|
||||
disp_locale=en : display_name=Ukrainian #[Cc]urrency=EURO#
|
||||
disp_locale=fr : display_name=ukrainien #[Dd]evise=EURO#
|
||||
disp_locale=de : display_name=Ukrainisch #Währung=EURO#
|
||||
-----------------
|
||||
locale='Hindi'
|
||||
disp_locale=en : display_name=hindi
|
||||
disp_locale=fr : display_name=hindi
|
||||
disp_locale=de : display_name=hindi
|
||||
-----------------
|
||||
locale='de'
|
||||
disp_locale=en : display_name=German
|
||||
disp_locale=fr : display_name=allemand
|
||||
disp_locale=de : display_name=Deutsch
|
||||
-----------------
|
||||
locale='fr'
|
||||
disp_locale=en : display_name=French
|
||||
disp_locale=fr : display_name=français
|
||||
disp_locale=de : display_name=Französisch
|
||||
-----------------
|
||||
locale='ja'
|
||||
disp_locale=en : display_name=Japanese
|
||||
disp_locale=fr : display_name=japonais
|
||||
disp_locale=de : display_name=Japanisch
|
||||
-----------------
|
||||
locale='i-enochian'
|
||||
disp_locale=en : display_name=i-enochian #Private-Use=i-enochian#
|
||||
disp_locale=fr : display_name=i-enochian #usage privé=i-enochian#
|
||||
disp_locale=de : display_name=i-enochian #Privatnutzung=i-enochian#
|
||||
-----------------
|
||||
locale='zh-Hant'
|
||||
disp_locale=en : display_name=Chinese #Traditional#
|
||||
disp_locale=fr : display_name=chinois #traditionnel#
|
||||
disp_locale=de : display_name=Chinesisch #Traditionell#
|
||||
-----------------
|
||||
locale='zh-Hans'
|
||||
disp_locale=en : display_name=Chinese #Simplified#
|
||||
disp_locale=fr : display_name=chinois #simplifié#
|
||||
disp_locale=de : display_name=Chinesisch #Vereinfacht#
|
||||
-----------------
|
||||
locale='sr-Cyrl'
|
||||
disp_locale=en : display_name=Serbian #Cyrillic#
|
||||
disp_locale=fr : display_name=serbe #cyrillique#
|
||||
disp_locale=de : display_name=Serbisch #Kyrillisch#
|
||||
-----------------
|
||||
locale='sr-Latn'
|
||||
disp_locale=en : display_name=Serbian #Latin#
|
||||
disp_locale=fr : display_name=serbe #latin#
|
||||
disp_locale=de : display_name=Serbisch #Lateinisch#
|
||||
-----------------
|
||||
locale='zh-Hans-CN'
|
||||
disp_locale=en : display_name=Chinese #Simplified, China#
|
||||
disp_locale=fr : display_name=chinois #simplifié, Chine#
|
||||
disp_locale=de : display_name=Chinesisch #Vereinfacht, China#
|
||||
-----------------
|
||||
locale='sr-Latn-CS'
|
||||
disp_locale=en : display_name=Serbian #Latin, Serbia#
|
||||
disp_locale=fr : display_name=serbe #latin, Serbie#
|
||||
disp_locale=de : display_name=Serbisch #Lateinisch, Serbien#
|
||||
-----------------
|
||||
locale='sl-rozaj'
|
||||
disp_locale=en : display_name=Slovenian #Resian#
|
||||
disp_locale=fr : display_name=slovène #dialecte de Resia#
|
||||
disp_locale=de : display_name=Slowenisch( #(ROZAJ|Resianisch)#)?
|
||||
-----------------
|
||||
locale='sl-nedis'
|
||||
disp_locale=en : display_name=Slovenian #Natisone dialect#
|
||||
disp_locale=fr : display_name=slovène #dialecte de Natisone#
|
||||
disp_locale=de : display_name=Slowenisch #Natisone-Dialekt#
|
||||
-----------------
|
||||
locale='de-CH-1901'
|
||||
disp_locale=en : display_name=German #Switzerland, Traditional German orthography#
|
||||
disp_locale=fr : display_name=allemand #Suisse, orthographe allemande traditionnelle#
|
||||
disp_locale=de : display_name=Deutsch #Schweiz, (1901|[aA]lte deutsche Rechtschreibung)#
|
||||
-----------------
|
||||
locale='sl-IT-nedis'
|
||||
disp_locale=en : display_name=Slovenian #Italy, Natisone dialect#
|
||||
disp_locale=fr : display_name=slovène #Italie, dialecte de Natisone#
|
||||
disp_locale=de : display_name=Slowenisch #Italien, (NEDIS|Natisone-Dialekt)#
|
||||
-----------------
|
||||
locale='sl-Latn-IT-nedis'
|
||||
disp_locale=en : display_name=Slovenian #Latin, Italy, Natisone dialect#
|
||||
disp_locale=fr : display_name=slovène #latin, Italie, dialecte de Natisone#
|
||||
disp_locale=de : display_name=Slowenisch #Lateinisch, Italien, (NEDIS|Natisone-Dialekt)#
|
||||
-----------------
|
||||
locale='de-DE'
|
||||
disp_locale=en : display_name=German #Germany#
|
||||
disp_locale=fr : display_name=allemand #Allemagne#
|
||||
disp_locale=de : display_name=Deutsch #Deutschland#
|
||||
-----------------
|
||||
locale='en-US'
|
||||
disp_locale=en : display_name=English #United States#
|
||||
disp_locale=fr : display_name=anglais #États-Unis#
|
||||
disp_locale=de : display_name=Englisch #Vereinigte Staaten#
|
||||
-----------------
|
||||
locale='es-419'
|
||||
disp_locale=en : display_name=Spanish #Latin America#
|
||||
disp_locale=fr : display_name=espagnol #Amérique latine#
|
||||
disp_locale=de : display_name=Spanisch #Lateinamerika#
|
||||
-----------------
|
||||
locale='de-CH-x-phonebk'
|
||||
disp_locale=en : display_name=German #Switzerland, Private-Use=phonebk#
|
||||
disp_locale=fr : display_name=allemand #Suisse, usage privé=phonebk#
|
||||
disp_locale=de : display_name=Deutsch #Schweiz, Privatnutzung=phonebk#
|
||||
-----------------
|
||||
locale='az-Arab-x-AZE-derbend'
|
||||
disp_locale=en : display_name=Azerbaijani #Arabic, Private-Use=aze-derbend#
|
||||
disp_locale=fr : display_name=azéri #arabe, usage privé=aze-derbend#
|
||||
disp_locale=de : display_name=Aserbaidschanisch #Arabisch, Privatnutzung=aze-derbend#
|
||||
-----------------
|
||||
locale='zh-min'
|
||||
disp_locale=en : display_name=Chinese #MIN#
|
||||
disp_locale=fr : display_name=chinois #MIN#
|
||||
disp_locale=de : display_name=Chinesisch #MIN#
|
||||
-----------------
|
||||
locale='zh-min-nan-Hant-CN'
|
||||
disp_locale=en : display_name=Chinese #MIN, NAN_HANT_CN#
|
||||
disp_locale=fr : display_name=chinois #MIN, NAN_HANT_CN#
|
||||
disp_locale=de : display_name=Chinesisch #MIN, NAN_HANT_CN#
|
||||
-----------------
|
||||
locale='x-whatever'
|
||||
disp_locale=en : display_name=x-whatever #Private-Use=whatever#
|
||||
disp_locale=fr : display_name=x-whatever #usage privé=whatever#
|
||||
disp_locale=de : display_name=x-whatever #Privatnutzung=whatever#
|
||||
-----------------
|
||||
locale='qaa-Qaaa-QM-x-southern'
|
||||
disp_locale=en : display_name=qaa #Qaaa, QM, Private-Use=southern#
|
||||
disp_locale=fr : display_name=qaa #Qaaa, QM, usage privé=southern#
|
||||
disp_locale=de : display_name=qaa #Qaaa, QM, Privatnutzung=southern#
|
||||
-----------------
|
||||
locale='sr-Latn-QM'
|
||||
disp_locale=en : display_name=Serbian #Latin, QM#
|
||||
disp_locale=fr : display_name=serbe #latin, QM#
|
||||
disp_locale=de : display_name=Serbisch #Lateinisch, QM#
|
||||
-----------------
|
||||
locale='sr-Qaaa-CS'
|
||||
disp_locale=en : display_name=Serbian #Qaaa, Serbia#
|
||||
disp_locale=fr : display_name=serbe #Qaaa, Serbie#
|
||||
disp_locale=de : display_name=Serbisch #Qaaa, Serbien#
|
||||
-----------------
|
||||
locale='en-US-u-islamCal'
|
||||
disp_locale=en : display_name=English #United States, attribute=islamcal#
|
||||
disp_locale=fr : display_name=anglais #États-Unis, attribute=islamcal#
|
||||
disp_locale=de : display_name=Englisch #Vereinigte Staaten, attribute=islamcal#
|
||||
-----------------
|
||||
locale='zh-CN-a-myExt-x-private'
|
||||
disp_locale=en : display_name=Chinese #China, a=myext, Private-Use=private#
|
||||
disp_locale=fr : display_name=chinois #Chine, a=myext, usage privé=private#
|
||||
disp_locale=de : display_name=Chinesisch #China, a=myext, Privatnutzung=private#
|
||||
-----------------
|
||||
locale='en-a-myExt-b-another'
|
||||
disp_locale=en : display_name=English #a=myext, b=another#
|
||||
disp_locale=fr : display_name=anglais #a=myext, b=another#
|
||||
disp_locale=de : display_name=Englisch #a=myext, b=another#
|
||||
-----------------
|
||||
locale='de-419-DE'
|
||||
disp_locale=en : display_name=German #Latin America, DE#
|
||||
disp_locale=fr : display_name=allemand #Amérique latine, DE#
|
||||
disp_locale=de : display_name=Deutsch #Lateinamerika, DE#
|
||||
-----------------
|
||||
locale='a-DE'
|
||||
disp_locale=en : display_name=a #Germany#
|
||||
disp_locale=fr : display_name=a #Allemagne#
|
||||
disp_locale=de : display_name=a #Deutschland#
|
||||
-----------------
|
||||
locale='ar-a-aaa-b-bbb-a-ccc'
|
||||
disp_locale=en : display_name=Arabic #a=aaa, b=bbb#
|
||||
disp_locale=fr : display_name=arabe #a=aaa, b=bbb#
|
||||
disp_locale=de : display_name=Arabisch #a=aaa, b=bbb#
|
||||
-----------------
|
||||
@@ -3,6 +3,7 @@ Bug #76777 (first parameter of libxml_set_external_entity_loader callback undefi
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('libxml')) die('skip');
|
||||
if (!extension_loaded('dom')) die('skip dom extension not available');
|
||||
if (getenv("SKIP_ONLINE_TESTS")) die('skip online test');
|
||||
?>
|
||||
--FILE--
|
||||
|
||||
+9
-20
@@ -407,6 +407,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_decode_numericentity, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, string)
|
||||
ZEND_ARG_INFO(0, convmap)
|
||||
ZEND_ARG_INFO(0, encoding)
|
||||
ZEND_ARG_INFO(0, is_hex)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_send_mail, 0, 0, 3)
|
||||
@@ -4822,27 +4823,15 @@ PHP_FUNCTION(mb_check_encoding)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
switch(Z_TYPE_P(input)) {
|
||||
case IS_LONG:
|
||||
case IS_DOUBLE:
|
||||
case IS_NULL:
|
||||
case IS_TRUE:
|
||||
case IS_FALSE:
|
||||
RETURN_TRUE;
|
||||
break;
|
||||
case IS_STRING:
|
||||
if (!php_mb_check_encoding(Z_STRVAL_P(input), Z_STRLEN_P(input), enc ? ZSTR_VAL(enc): NULL)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
break;
|
||||
case IS_ARRAY:
|
||||
if (!php_mb_check_encoding_recursive(HASH_OF(input), enc)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
php_error_docref(NULL, E_WARNING, "Input is something other than scalar or array");
|
||||
if (Z_TYPE_P(input) == IS_ARRAY) {
|
||||
if (!php_mb_check_encoding_recursive(HASH_OF(input), enc)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
} else {
|
||||
convert_to_string(input);
|
||||
if (!php_mb_check_encoding(Z_STRVAL_P(input), Z_STRLEN_P(input), enc ? ZSTR_VAL(enc): NULL)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
RETURN_TRUE;
|
||||
}
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
ext/mbstring/oniguruma/src/config.h.win32 | 1 +
|
||||
ext/mbstring/oniguruma/src/config.h.win64 | 1 +
|
||||
2 files changed, 2 insertions(+)
|
||||
|
||||
diff --git a/ext/mbstring/oniguruma/src/config.h.win32 b/ext/mbstring/oniguruma/src/config.h.win32
|
||||
index bdbdaf25c1..9a9c43f26d 100644
|
||||
--- a/ext/mbstring/oniguruma/src/config.h.win32
|
||||
+++ b/ext/mbstring/oniguruma/src/config.h.win32
|
||||
@@ -15,6 +15,7 @@
|
||||
#define SIZEOF_VOIDP 4
|
||||
#define SIZEOF_FLOAT 4
|
||||
#define SIZEOF_DOUBLE 8
|
||||
+#define SIZEOF_SIZE_T 4
|
||||
#define HAVE_PROTOTYPES 1
|
||||
#define TOKEN_PASTE(x,y) x##y
|
||||
#define HAVE_STDARG_PROTOTYPES 1
|
||||
diff --git a/ext/mbstring/oniguruma/src/config.h.win64 b/ext/mbstring/oniguruma/src/config.h.win64
|
||||
index 01a86c7bb9..dec7b75773 100644
|
||||
--- a/ext/mbstring/oniguruma/src/config.h.win64
|
||||
+++ b/ext/mbstring/oniguruma/src/config.h.win64
|
||||
@@ -15,6 +15,7 @@
|
||||
#define SIZEOF_VOIDP 8
|
||||
#define SIZEOF_FLOAT 4
|
||||
#define SIZEOF_DOUBLE 8
|
||||
+#define SIZEOF_SIZE_T 8
|
||||
#define HAVE_PROTOTYPES 1
|
||||
#define TOKEN_PASTE(x,y) x##y
|
||||
#define HAVE_STDARG_PROTOTYPES 1
|
||||
@@ -1,8 +1,33 @@
|
||||
History
|
||||
|
||||
2019/11/29: Version 6.9.4
|
||||
|
||||
2019/11/22: Release Candidate 3 for Version 6.9.4
|
||||
|
||||
2019/11/20: fix a problem found by libFuzzer test
|
||||
2019/11/14: Release Candidate 2 for Version 6.9.4
|
||||
2019/11/12: fix integer overflow by nested quantifier
|
||||
2019/11/11: fix CVE-2019-19012: Integer overflow related to reg->dmax in search_in_range()
|
||||
2019/11/07: fix CVE-2019-19203: heap-buffer-overflow in gb18030_mbc_enc_len()
|
||||
2019/11/06: fix CVE-2019-19204: heap-buffer-overflow in fetch_interval_quantifier()
|
||||
2019/11/06: add HAVE_INTTYPES_H into config.h.windows.in and config.h.win{32,64}
|
||||
2019/11/06: add HAVE_STDINT_H into config.h.win{32,64}
|
||||
2019/11/05: Release Candidate 1 for Version 6.9.4
|
||||
2019/10/31: Update Unicode Emoji version to 12.1 (Nothing data changed)
|
||||
2019/10/29: implement USE_REPEAT_AND_EMPTY_CHECK_LOCAL_VAR configuration
|
||||
2019/10/18: re-implement case fold conversion
|
||||
2019/10/04: fix #156: Heap buffer overflow in match_at() with case-insensitive match
|
||||
2019/09/30: NEW API: add onig_regset_replace()
|
||||
2019/09/30: change Unicode VERSION value format
|
||||
2019/09/20: NEW API: add regset functions
|
||||
2019/09/20: add data ensure check before peek string value in OP_PUSH_IF_PEEK_NEXT
|
||||
2019/09/20: fix loose code in encode-harness.c
|
||||
2019/08/13: fix heap-buffer-overflow
|
||||
2019/08/13: Add a macro to disable direct threading in the match engine (PR#149)
|
||||
|
||||
2019/08/06: Version 6.9.3 (secirity fix release)
|
||||
|
||||
2019/07/30: add ONIG_SYN_ALLOW_INVALID_CODE_END_OF_RANGE
|
||||
2019/07/30: add ONIG_SYN_ALLOW_INVALID_CODE_END_OF_RANGE_IN_CC
|
||||
2019/07/29: add STK_PREC_READ_START/END stack type
|
||||
2019/07/29: Fix #147: Stack Exhaustion Problem caused by some parsing functions
|
||||
2019/07/11: add a dictionary file for libfuzzer
|
||||
|
||||
@@ -27,25 +27,34 @@ Supported character encodings:
|
||||
* doc/SYNTAX.md: contributed by seanofw
|
||||
|
||||
|
||||
Version 6.9.4
|
||||
-------------
|
||||
|
||||
* NEW API: RegSet (set of regexes)
|
||||
* Fixed CVE-2019-19012
|
||||
* Fixed CVE-2019-19203 (Does not affect UTF-8, UTF-16 and UTF-32 encodings)
|
||||
* Fixed CVE-2019-19204 (Affects only PosixBasic, Emacs and Grep syntaxes)
|
||||
* Fixed CVE-2019-19246
|
||||
* Fixed some problems (found by libFuzzer test)
|
||||
|
||||
|
||||
Version 6.9.3 (security fix release)
|
||||
------------------------------------
|
||||
|
||||
* Fixed CVE-2019-13224
|
||||
* Fixed CVE-2019-13225
|
||||
* Fixed many problems (found by libfuzzer programs)
|
||||
* Fixed CVE-2019-16163
|
||||
* Fixed many problems (found by libFuzzer test)
|
||||
|
||||
|
||||
Version 6.9.2 (Reiwa)
|
||||
---------------------
|
||||
|
||||
* add doc/SYNTAX.md
|
||||
* Direct threaded code (for GCC and Clang)
|
||||
* Update Unicode version 12.1.0
|
||||
* NEW: Unicode Text Segment mode option (?y{g}) (?y{w}) (*original)
|
||||
|
||||
g: Extended Grapheme Cluster mode / w: Word mode
|
||||
|
||||
(Unicode Standard Annex #29 [http://unicode.org/reports/tr29/])
|
||||
|
||||
|
||||
Version 6.9.1
|
||||
-------------
|
||||
@@ -118,7 +127,7 @@ Version 6.5.0
|
||||
* NEW: \O (true anychar)
|
||||
* NEW: if-then-else (?(...)...\|...)
|
||||
* NEW: Backreference validity checker (?(xxx)) (*original)
|
||||
* NEW: Absent repeater (?~absent) \[is equal to (?\~\|absent|\O*)]
|
||||
* NEW: Absent repeater (?~absent) \[is equal to (?\~\|(?:absent)|\O*)]
|
||||
* NEW: Absent expression (?~|absent|expr) (*original)
|
||||
* NEW: Absent stopper (?~|absent) (*original)
|
||||
|
||||
@@ -244,15 +253,18 @@ Sample Programs
|
||||
|
||||
|File |Description |
|
||||
|:---------------------|:-----------------------------------------|
|
||||
|sample/callout.c |example of callouts |
|
||||
|sample/count.c |example of built-in callout *COUNT |
|
||||
|sample/echo.c |example of user defined callouts of name |
|
||||
|sample/encode.c |example of some encodings |
|
||||
|sample/listcap.c |example of the capture history |
|
||||
|sample/names.c |example of the named group callback |
|
||||
|sample/posix.c |POSIX API sample |
|
||||
|sample/regset.c |example of using RegSet API |
|
||||
|sample/scan.c |example of using onig_scan() |
|
||||
|sample/simple.c |example of the minimum (Oniguruma API) |
|
||||
|sample/names.c |example of the named group callback. |
|
||||
|sample/encode.c |example of some encodings. |
|
||||
|sample/listcap.c |example of the capture history. |
|
||||
|sample/posix.c |POSIX API sample. |
|
||||
|sample/scan.c |example of using onig_scan(). |
|
||||
|sample/sql.c |example of the variable meta characters. |
|
||||
|sample/user_property.c|example of user defined Unicode property. |
|
||||
|sample/callout.c |example of callouts. |
|
||||
|sample/sql.c |example of the variable meta characters |
|
||||
|sample/user_property.c|example of user defined Unicode property |
|
||||
|
||||
|
||||
Test Programs
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Oniguruma API Version 6.9.3 2019/07/06
|
||||
Oniguruma API Version 6.9.4 2019/09/30
|
||||
|
||||
#include <oniguruma.h>
|
||||
|
||||
@@ -168,7 +168,7 @@ Oniguruma API Version 6.9.3 2019/07/06
|
||||
# int onig_new_deluxe(regex_t** reg, const UChar* pattern, const UChar* pattern_end,
|
||||
OnigCompileInfo* ci, OnigErrorInfo* einfo)
|
||||
|
||||
This function is deprecate, and it does not allow the case where
|
||||
This function is deprecated, and it does not allow the case where
|
||||
the encoding of pattern and target is different.
|
||||
|
||||
Create a regex object.
|
||||
@@ -306,6 +306,7 @@ Oniguruma API Version 6.9.3 2019/07/06
|
||||
|
||||
normal return: match position offset (i.e. p - str >= 0)
|
||||
not found: ONIG_MISMATCH (< 0)
|
||||
error: error code (< 0)
|
||||
|
||||
arguments
|
||||
1 reg: regex object
|
||||
@@ -342,7 +343,8 @@ Oniguruma API Version 6.9.3 2019/07/06
|
||||
Do not pass invalid byte string in the regex character encoding.
|
||||
|
||||
normal return: match length (>= 0)
|
||||
not match: ONIG_MISMATCH ( < 0)
|
||||
not match: ONIG_MISMATCH (< 0)
|
||||
error: error code (< 0)
|
||||
|
||||
arguments
|
||||
1 reg: regex object
|
||||
@@ -391,6 +393,136 @@ Oniguruma API Version 6.9.3 2019/07/06
|
||||
7 callback_arg: optional argument passed to callback
|
||||
|
||||
|
||||
# int onig_regset_new(OnigRegSet** rset, int n, regex_t* regs[])
|
||||
|
||||
Create a regset object.
|
||||
All regex objects must have the same character encoding.
|
||||
All regex objects are prohibited from having the ONIG_OPTION_FIND_LONGEST option.
|
||||
|
||||
arguments
|
||||
1 rset: return address of regset object
|
||||
2 n: number of regex in regs
|
||||
3 regs: array of regex
|
||||
|
||||
normal return: ONIG_NORMAL
|
||||
|
||||
|
||||
# int onig_regset_add(OnigRegSet* set, regex_t* reg)
|
||||
|
||||
Add a regex into regset.
|
||||
The regex object must have the same character encoding with the regset.
|
||||
The regex object is prohibited from having the ONIG_OPTION_FIND_LONGEST option.
|
||||
|
||||
arguments
|
||||
1 set: regset object
|
||||
2 reg: regex object
|
||||
|
||||
normal return: ONIG_NORMAL
|
||||
|
||||
|
||||
# int onig_regset_replace(OnigRegSet* set, int at, regex_t* reg)
|
||||
|
||||
Replace a regex in regset with another one.
|
||||
If the reg argument value is NULL, then remove at-th regex. (and indexes of other regexes are changed)
|
||||
|
||||
arguments
|
||||
1 set: regset object
|
||||
2 at: index of regex (zero origin)
|
||||
3 reg: regex object
|
||||
|
||||
normal return: ONIG_NORMAL
|
||||
|
||||
|
||||
# void onig_regset_free(OnigRegSet* set)
|
||||
|
||||
Free memory used by regset object and regex objects in the regset.
|
||||
If the same regex object is registered twice, the situation becomes destructive.
|
||||
|
||||
arguments
|
||||
1 set: regset object
|
||||
|
||||
|
||||
# int onig_regset_number_of_regex(OnigRegSet* set)
|
||||
|
||||
Returns number of regex objects in the regset.
|
||||
|
||||
arguments
|
||||
1 set: regset object
|
||||
|
||||
|
||||
# regex_t* onig_regset_get_regex(OnigRegSet* set, int at)
|
||||
|
||||
Returns the regex object corresponding to the at-th regex.
|
||||
|
||||
arguments
|
||||
1 set: regset object
|
||||
2 at: index of regex array (zero origin)
|
||||
|
||||
|
||||
# OnigRegion* onig_regset_get_region(OnigRegSet* set, int at)
|
||||
|
||||
Returns the region object corresponding to the at-th regex.
|
||||
|
||||
arguments
|
||||
1 set: regset object
|
||||
2 at: index of regex array (zero origin)
|
||||
|
||||
|
||||
# int onig_regset_search(OnigRegSet* set, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegSetLead lead, OnigOptionType option, int* rmatch_pos)
|
||||
|
||||
Perform a search with regset.
|
||||
|
||||
return value:
|
||||
normal return: index of match regex (zero origin)
|
||||
not found: ONIG_MISMATCH (< 0)
|
||||
error: error code (< 0)
|
||||
|
||||
arguments
|
||||
1 set: regset object
|
||||
2 str: target string
|
||||
3 end: terminate address of target string
|
||||
4 start: search start address of target string
|
||||
5 range: search terminate address of target string
|
||||
6 lead: outer loop element
|
||||
ONIG_REGSET_POSITION_LEAD (returns most left position)
|
||||
ONIG_REGSET_REGEX_LEAD (returns most left position)
|
||||
ONIG_REGSET_PRIORITY_TO_REGEX_ORDER (returns first match regex)
|
||||
7 option: search time option
|
||||
ONIG_OPTION_NOTBOL string head(str) isn't considered as begin of line
|
||||
ONIG_OPTION_NOTEOL string end (end) isn't considered as end of line
|
||||
8 rmatch_pos: return address of match position (match_address - str)
|
||||
|
||||
* ONIG_REGSET_POSITION_LEAD and ONIG_REGSET_REGEX_LEAD return the same result.
|
||||
These differences only appear in search time.
|
||||
In most cases, ONIG_REGSET_POSITION_LEAD seems to be faster.
|
||||
|
||||
|
||||
# int onig_regset_search_with_param(OnigRegSet* set, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegSetLead lead, OnigOptionType option, OnigMatchParam* mps[], int* rmatch_pos)
|
||||
|
||||
Perform a search with regset and match-params.
|
||||
|
||||
return value:
|
||||
normal return: index of match regex (zero origin)
|
||||
not found: ONIG_MISMATCH (< 0)
|
||||
error: error code (< 0)
|
||||
|
||||
arguments
|
||||
1 set: regset object
|
||||
2 str: target string
|
||||
3 end: terminate address of target string
|
||||
4 start: search start address of target string
|
||||
5 range: search terminate address of target string
|
||||
6 lead: outer loop element
|
||||
ONIG_REGSET_POSITION_LEAD (returns most left position)
|
||||
ONIG_REGSET_REGEX_LEAD (returns most left position)
|
||||
ONIG_REGSET_PRIORITY_TO_REGEX_ORDER (returns first match regex)
|
||||
7 option: search time option
|
||||
ONIG_OPTION_NOTBOL string head(str) isn't considered as begin of line
|
||||
ONIG_OPTION_NOTEOL string end (end) isn't considered as end of line
|
||||
8 mps: array of match-params
|
||||
9 rmatch_pos: return address of match position (match_address - str)
|
||||
|
||||
|
||||
# OnigRegion* onig_region_new(void)
|
||||
|
||||
Create a region.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
鬼車インターフェース Version 6.9.3 2019/07/06
|
||||
鬼車インターフェース Version 6.9.4 2019/09/30
|
||||
|
||||
#include <oniguruma.h>
|
||||
|
||||
@@ -390,6 +390,138 @@
|
||||
7 callback_arg: コールバック関数に渡される付加引数値
|
||||
|
||||
|
||||
# int onig_regset_new(OnigRegSet** rset, int n, regex_t* regs[])
|
||||
|
||||
regsetオブジェクトを生成する。
|
||||
全ての正規表現オブジェクトは、同じ文字エンコーディングでなければならない。
|
||||
全ての正規表現オブジェクトは、ONIG_OPTION_FIND_LONGESTオプションでコンパイルされていてはならない。
|
||||
|
||||
引数
|
||||
1 rset: regsetオブジェクトを返すためのアドレス
|
||||
2 n: 正規表現の個数
|
||||
3 regs: 正規表現オブジェクトの配列
|
||||
|
||||
正常終了戻り値: ONIG_NORMAL
|
||||
|
||||
|
||||
# int onig_regset_add(OnigRegSet* set, regex_t* reg)
|
||||
|
||||
regsetオブジェクトに正規表現を追加する。
|
||||
正規表現オブジェクトは、regsetと同じ文字エンコーディングでなければならない。
|
||||
正規表現オブジェクトは、ONIG_OPTION_FIND_LONGESTオプションでコンパイルされていてはならない。
|
||||
|
||||
引数
|
||||
1 set: regsetオブジェクト
|
||||
2 reg: 正規表現オブジェクト
|
||||
|
||||
正常終了戻り値: ONIG_NORMAL
|
||||
|
||||
|
||||
# int onig_regset_replace(OnigRegSet* set, int at, regex_t* reg)
|
||||
|
||||
regsetの中の一個の正規表現オブジェクトを別のものに変更する。
|
||||
若しreg引数の値がNULLであれば、at番目の正規表現オブジェクトを外す。(そして、以降の正規表現オブジェクトのインデックスは変化する)
|
||||
|
||||
引数
|
||||
1 set: regsetオブジェクト
|
||||
2 at: 変更する場所のインデックス
|
||||
2 reg: 正規表現オブジェクト
|
||||
|
||||
正常終了戻り値: ONIG_NORMAL
|
||||
|
||||
|
||||
# void onig_regset_free(OnigRegSet* set)
|
||||
|
||||
regsetオブジェクトとその中の正規表現オブジェクトの使用メモリを開放する。
|
||||
若し、同一の正規表現オブジェクトを重複して登録していれば、破壊的な状況になる。
|
||||
|
||||
引数
|
||||
1 set: regsetオブジェクト
|
||||
|
||||
|
||||
# int onig_regset_number_of_regex(OnigRegSet* set)
|
||||
|
||||
regsetの中の正規表現オブジェクトの個数を返す。
|
||||
|
||||
引数
|
||||
1 set: regsetオブジェクト
|
||||
|
||||
|
||||
# regex_t* onig_regset_get_regex(OnigRegSet* set, int at)
|
||||
|
||||
regsetのat番目の正規表現を返す。
|
||||
|
||||
引数
|
||||
1 set: regsetオブジェクト
|
||||
2 at: 正規表現オブジェクトのインデックス (ゼロ開始)
|
||||
|
||||
|
||||
# OnigRegion* onig_regset_get_region(OnigRegSet* set, int at)
|
||||
|
||||
regsetのat番目の正規表現に対応する領域を返す。
|
||||
|
||||
引数
|
||||
1 set: regsetオブジェクト
|
||||
2 at: 正規表現オブジェクトのインデックス (ゼロ開始)
|
||||
|
||||
|
||||
# int onig_regset_search(OnigRegSet* set, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegSetLead lead, OnigOptionType option, int* rmatch_pos)
|
||||
|
||||
regsetによる検索を実行する。
|
||||
|
||||
戻り値:
|
||||
検索成功: マッチした正規表現オブジェクトのインデックス (ゼロ開始)
|
||||
検索失敗: ONIG_MISMATCH (< 0)
|
||||
エラー: エラーコード (< 0)
|
||||
|
||||
引数
|
||||
1 set: regsetオブジェクト
|
||||
2 str: 検索対象文字列
|
||||
3 end: 検索対象文字列の終端アドレス
|
||||
4 start: 検索対象文字列の検索先頭位置アドレス
|
||||
5 range: 検索対象文字列の検索終了位置アドレス
|
||||
(start <= 探索される文字列 < range)
|
||||
6 lead: 外側のループ要素
|
||||
ONIG_REGSET_POSITION_LEAD (最左位置でマッチした結果を返す)
|
||||
ONIG_REGSET_REGEX_LEAD (最左位置でマッチした結果を返す)
|
||||
ONIG_REGSET_PRIORITY_TO_REGEX_ORDER (最初にマッチした正規表現の結果を返す)
|
||||
7 option: 検索時オプション
|
||||
ONIG_OPTION_NOTBOL 文字列の先頭(str)を行頭と看做さない
|
||||
ONIG_OPTION_NOTEOL 文字列の終端(end)を行末と看做さない
|
||||
8 rmatch_pos: マッチした位置を返すためのアドレス (match_address - str)
|
||||
|
||||
* ONIG_REGSET_POSITION_LEADとONIG_REGSET_REGEX_LEADは同じ結果を返す。
|
||||
これらの違いは検索時間にしか現れない。
|
||||
ほとんどの場合、ONIG_REGSET_POSITION_LEADのほうが速いと思われる。
|
||||
|
||||
|
||||
# int onig_regset_search_with_param(OnigRegSet* set, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegSetLead lead, OnigOptionType option, OnigMatchParam* mps[], int* rmatch_pos)
|
||||
|
||||
regsetとOnigMatchParamオブジェクトによる検索を実行する。
|
||||
|
||||
戻り値:
|
||||
検索成功: マッチした正規表現オブジェクトのインデックス (ゼロ開始)
|
||||
検索失敗: ONIG_MISMATCH (< 0)
|
||||
エラー: エラーコード (< 0)
|
||||
|
||||
引数
|
||||
1 set: regsetオブジェクト
|
||||
2 str: 検索対象文字列
|
||||
3 end: 検索対象文字列の終端アドレス
|
||||
4 start: 検索対象文字列の検索先頭位置アドレス
|
||||
5 range: 検索対象文字列の検索終了位置アドレス
|
||||
(start <= 探索される文字列 < range)
|
||||
6 lead: 外側のループ要素
|
||||
ONIG_REGSET_POSITION_LEAD (最左位置でマッチした結果を返す)
|
||||
ONIG_REGSET_REGEX_LEAD (最左位置でマッチした結果を返す)
|
||||
ONIG_REGSET_PRIORITY_TO_REGEX_ORDER (最初にマッチした正規表現の結果を返す)
|
||||
7 option: 検索時オプション
|
||||
ONIG_OPTION_NOTBOL 文字列の先頭(str)を行頭と看做さない
|
||||
ONIG_OPTION_NOTEOL 文字列の終端(end)を行末と看做さない
|
||||
8 mps: OnigMatchParamオブジェクトの配列
|
||||
9 rmatch_pos: マッチした位置を返すためのアドレス (match_address - str)
|
||||
|
||||
|
||||
# OnigRegion* onig_region_new(void)
|
||||
|
||||
マッチ領域情報(region)を作成する。
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Oniguruma Regular Expressions Version 6.9.2 2019/03/29
|
||||
Oniguruma Regular Expressions Version 6.9.4 2019/10/31
|
||||
|
||||
syntax: ONIG_SYNTAX_ONIGURUMA (default)
|
||||
|
||||
@@ -289,6 +289,11 @@ syntax: ONIG_SYNTAX_ONIGURUMA (default)
|
||||
In negative look-behind, capturing group isn't allowed,
|
||||
but non-capturing group (?:) is allowed.
|
||||
|
||||
* In look-behind and negative look-behind, support for
|
||||
ignore-case option is limited. Only supports conversion
|
||||
between single characters. (Does not support conversion
|
||||
of multiple characters in Unicode)
|
||||
|
||||
(?>subexp) atomic group
|
||||
no backtracks in subexp.
|
||||
|
||||
@@ -338,7 +343,7 @@ syntax: ONIG_SYNTAX_ONIGURUMA (default)
|
||||
This works like .* (more precisely \O*), but it is
|
||||
limited by the range that does not include the string
|
||||
match with <absent>.
|
||||
This is a written abbreviation of (?~|absent|\O*).
|
||||
This is a written abbreviation of (?~|(?:absent)|\O*).
|
||||
\O* is used as a repeater.
|
||||
|
||||
(?~|absent|exp) Absent expression (* original)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
鬼車 正規表現 Version 6.9.2 2019/03/29
|
||||
鬼車 正規表現 Version 6.9.4 2019/10/31
|
||||
|
||||
使用文法: ONIG_SYNTAX_ONIGURUMA (既定値)
|
||||
|
||||
@@ -21,10 +21,10 @@
|
||||
\f 改頁 (0x0C)
|
||||
\a 鐘 (0x07)
|
||||
\e 退避修飾 (0x1B)
|
||||
\nnn 八進数表現 符号化バイト値(の一部)
|
||||
\nnn 八進数表現 符号化バイト値
|
||||
\o{17777777777} 拡張八進数表現 コードポイント値
|
||||
\uHHHH 拡張十六進数表現 コードポイント値
|
||||
\xHH 十六進数表現 符号化バイト値(の一部)
|
||||
\xHH 十六進数表現 符号化バイト値
|
||||
\x{7HHHHHHH} 拡張十六進数表現 コードポイント値
|
||||
\cx 制御文字表現 コードポイント値
|
||||
\C-x 制御文字表現 コードポイント値
|
||||
@@ -284,6 +284,10 @@
|
||||
否定戻り読みでは、捕獲式集合は許されないが、
|
||||
非捕獲式集合は許される。
|
||||
|
||||
* 戻り読み、否定戻り読みの中では、ignore-caseオプションの
|
||||
対応が制限される。一文字と一文字の間の変換しか対応しない。
|
||||
(Unicodeでの複数文字の変換に対応しない)
|
||||
|
||||
(?>式) 原子的式集合
|
||||
式全体を通過したとき、式の中での後退再試行を行なわない
|
||||
|
||||
@@ -334,20 +338,20 @@
|
||||
|
||||
<不在機能群>
|
||||
|
||||
(?~不在式) 不在繰り返し (*原案 田中哲)
|
||||
これは .*(より正確には\O*)のように動作するが、<不在式>に
|
||||
(?~不在) 不在繰り返し (*原案 田中哲)
|
||||
これは .*(より正確には\O*)のように動作するが、<不在>に
|
||||
適合する文字列を含まない範囲に制限される。
|
||||
これは(?~|不在式|\O*)の省略表記である。
|
||||
これは(?~|(?:不在)|\O*)の省略表記である。
|
||||
|
||||
(?~|不在式|式) 不在式 (* 原作)
|
||||
これは<式>のように動作するが、<不在式>に適合する文字列を
|
||||
(?~|不在|式) 不在式 (* 原作)
|
||||
これは<式>のように動作するが、<不在>に適合する文字列を
|
||||
含まない範囲に制限される。
|
||||
|
||||
例 (?~|345|\d*) "12345678" ==> "12", "1", ""
|
||||
|
||||
(?~|不在式) 不在停止 (* 原作)
|
||||
(?~|不在) 不在停止 (* 原作)
|
||||
この演算子を通過した後は、対象文字列の適合範囲が
|
||||
<不在式>に適合する文字列を含まない範囲に制限される。
|
||||
<不在>に適合する文字列を含まない範囲に制限される。
|
||||
|
||||
(?~|) 範囲消去
|
||||
不在停止の効果を消して、それ以前の状態にする。
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
# Oniguruma syntax (operator) configuration
|
||||
|
||||
_Documented for Oniguruma 6.9.2 (2019/03/28)_
|
||||
_Documented for Oniguruma 6.9.3 (2019/08/08)_
|
||||
|
||||
|
||||
----------
|
||||
@@ -960,6 +960,12 @@ _Set in: Ruby, Oniguruma_
|
||||
If this flag is set, Oniguruma will warn about nested repeat operators those have no meaning, like `(?:a*)+`.
|
||||
If this flag is clear, Oniguruma will allow the nested repeat operators without warning about them.
|
||||
|
||||
### 26. ONIG_SYN_ALLOW_INVALID_CODE_END_OF_RANGE_IN_CC (allow [a-\x{7fffffff}])
|
||||
|
||||
_Set in: Oniguruma_
|
||||
|
||||
If this flag is set, then invalid code points at the end of range in character class are allowed.
|
||||
|
||||
### 31. ONIG_SYN_CONTEXT_INDEP_ANCHORS
|
||||
|
||||
_Set in: PosixExtended, GnuRegex, Java, Perl, Perl_NG, Ruby, Oniguruma_
|
||||
@@ -1066,4 +1072,5 @@ These tables show which of the built-in syntaxes use which flags and options, fo
|
||||
| 23 | `ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC` | - | Yes | - | - | Yes | Yes | Yes | Yes | Yes | Yes |
|
||||
| 24 | `ONIG_SYN_WARN_CC_OP_NOT_ESCAPED` | - | - | - | - | - | - | - | - | Yes | Yes |
|
||||
| 25 | `ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT` | - | - | - | - | - | - | - | - | Yes | Yes |
|
||||
| 26 | `ONIG_SYN_ALLOW_INVALID_CODE_END_OF_RANGE_IN_CC` | - | - | - | - | - | - | - | - | - | Yes |
|
||||
| 31 | `ONIG_SYN_CONTEXT_INDEP_ANCHORS` | - | Yes | - | - | Yes | Yes | Yes | Yes | Yes | Yes |
|
||||
@@ -1,4 +1,4 @@
|
||||
Unicode Properties (from Unicode Version: 12.1.0)
|
||||
Unicode Properties (Unicode Version: 12.1.0, Emoji: 12.1)
|
||||
|
||||
15: ASCII_Hex_Digit
|
||||
16: Adlam
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
ascii.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2018 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
big5.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2018 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -54,6 +54,16 @@ big5_mbc_enc_len(const UChar* p)
|
||||
return EncLen_BIG5[*p];
|
||||
}
|
||||
|
||||
static int
|
||||
big5_code_to_mbclen(OnigCodePoint code)
|
||||
{
|
||||
if ((code & (~0xffff)) != 0) return ONIGERR_INVALID_CODE_POINT_VALUE;
|
||||
if ((code & 0xff00) != 0) return 2;
|
||||
if (EncLen_BIG5[(int )(code & 0xff)] == 1) return 1;
|
||||
|
||||
return ONIGERR_INVALID_CODE_POINT_VALUE;
|
||||
}
|
||||
|
||||
static int
|
||||
is_valid_mbc_string(const UChar* p, const UChar* end)
|
||||
{
|
||||
@@ -99,15 +109,6 @@ big5_mbc_case_fold(OnigCaseFoldType flag, const UChar** pp, const UChar* end,
|
||||
pp, end, lower);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int
|
||||
big5_is_mbc_ambiguous(OnigCaseFoldType flag,
|
||||
const UChar** pp, const UChar* end)
|
||||
{
|
||||
return onigenc_mbn_is_mbc_ambiguous(ONIG_ENCODING_BIG5, flag, pp, end);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
big5_is_code_ctype(OnigCodePoint code, unsigned int ctype)
|
||||
{
|
||||
@@ -174,7 +175,7 @@ OnigEncodingType OnigEncodingBIG5 = {
|
||||
1, /* min enc length */
|
||||
onigenc_is_mbc_newline_0x0a,
|
||||
big5_mbc_to_code,
|
||||
onigenc_mb2_code_to_mbclen,
|
||||
big5_code_to_mbclen,
|
||||
big5_code_to_mbc,
|
||||
big5_mbc_case_fold,
|
||||
onigenc_ascii_apply_all_case_fold,
|
||||
|
||||
@@ -1,82 +1,56 @@
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
#define HAVE_STDLIB_H 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_MEMORY_H 1
|
||||
#define HAVE_FLOAT_H 1
|
||||
#define HAVE_OFF_T 1
|
||||
#define SIZEOF_INT 4
|
||||
#define SIZEOF_SHORT 2
|
||||
#define SIZEOF_LONG 4
|
||||
#define SIZEOF_LONG_LONG 8
|
||||
#define SIZEOF___INT64 8
|
||||
#define SIZEOF_OFF_T 4
|
||||
#define SIZEOF_VOIDP 4
|
||||
#define SIZEOF_FLOAT 4
|
||||
#define SIZEOF_DOUBLE 8
|
||||
#define SIZEOF_SIZE_T 4
|
||||
#define HAVE_PROTOTYPES 1
|
||||
#define TOKEN_PASTE(x,y) x##y
|
||||
#define HAVE_STDARG_PROTOTYPES 1
|
||||
#ifndef NORETURN
|
||||
#if _MSC_VER > 1100
|
||||
#define NORETURN(x) __declspec(noreturn) x
|
||||
#else
|
||||
#define NORETURN(x) x
|
||||
#endif
|
||||
#endif
|
||||
#define HAVE_DECL_SYS_NERR 1
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_STDLIB_H 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_LIMITS_H 1
|
||||
#define HAVE_FCNTL_H 1
|
||||
#define HAVE_SYS_UTIME_H 1
|
||||
#define HAVE_MEMORY_H 1
|
||||
#define uid_t int
|
||||
#define gid_t int
|
||||
#define GETGROUPS_T int
|
||||
#define HAVE_ALLOCA 1
|
||||
#define HAVE_DUP2 1
|
||||
#define HAVE_MEMCMP 1
|
||||
#define HAVE_MEMMOVE 1
|
||||
#define HAVE_MKDIR 1
|
||||
#define HAVE_STRCASECMP 1
|
||||
#define HAVE_STRNCASECMP 1
|
||||
#define HAVE_STRERROR 1
|
||||
#define HAVE_STRFTIME 1
|
||||
#define HAVE_STRCHR 1
|
||||
#define HAVE_STRSTR 1
|
||||
#define HAVE_STRTOD 1
|
||||
#define HAVE_STRTOL 1
|
||||
#define HAVE_STRTOUL 1
|
||||
#define HAVE_FLOCK 1
|
||||
#define HAVE_VSNPRINTF 1
|
||||
#define HAVE_FINITE 1
|
||||
#define HAVE_FMOD 1
|
||||
#define HAVE_FREXP 1
|
||||
#define HAVE_HYPOT 1
|
||||
#define HAVE_MODF 1
|
||||
#define HAVE_WAITPID 1
|
||||
#define HAVE_CHSIZE 1
|
||||
#define HAVE_TIMES 1
|
||||
#define HAVE__SETJMP 1
|
||||
#define HAVE_TELLDIR 1
|
||||
#define HAVE_SEEKDIR 1
|
||||
#define HAVE_MKTIME 1
|
||||
#define HAVE_COSH 1
|
||||
#define HAVE_SINH 1
|
||||
#define HAVE_TANH 1
|
||||
#define HAVE_EXECVE 1
|
||||
#define HAVE_TZNAME 1
|
||||
#define HAVE_DAYLIGHT 1
|
||||
#define SETPGRP_VOID 1
|
||||
#define inline __inline
|
||||
#define NEED_IO_SEEK_BETWEEN_RW 1
|
||||
#define RSHIFT(x,y) ((x)>>(int)y)
|
||||
#define FILE_COUNT _cnt
|
||||
#define FILE_READPTR _ptr
|
||||
#define DEFAULT_KCODE KCODE_NONE
|
||||
#define DLEXT ".so"
|
||||
#define DLEXT2 ".dll"
|
||||
#if defined(__MINGW32__) || _MSC_VER >= 1600
|
||||
#define HAVE_STDINT_H 1
|
||||
#endif
|
||||
#if defined(__MINGW32__) || _MSC_VER >= 1800
|
||||
#define HAVE_INTTYPES_H 1
|
||||
#endif
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
#define HAVE_MEMORY_H 1
|
||||
#define HAVE_OFF_T 1
|
||||
#define SIZEOF_INT 4
|
||||
#define SIZEOF_LONG 4
|
||||
#define SIZEOF_LONG_LONG 8
|
||||
#define SIZEOF___INT64 8
|
||||
#define SIZEOF_OFF_T 4
|
||||
#define SIZEOF_VOIDP 4
|
||||
#define SIZEOF_FLOAT 4
|
||||
#define SIZEOF_DOUBLE 8
|
||||
#define SIZEOF_SIZE_T 4
|
||||
#define TOKEN_PASTE(x,y) x##y
|
||||
#ifndef NORETURN
|
||||
#if _MSC_VER > 1100
|
||||
#define NORETURN(x) __declspec(noreturn) x
|
||||
#else
|
||||
#define NORETURN(x) x
|
||||
#endif
|
||||
#endif
|
||||
#define HAVE_DECL_SYS_NERR 1
|
||||
#define HAVE_FCNTL_H 1
|
||||
#define HAVE_SYS_UTIME_H 1
|
||||
#define HAVE_MEMORY_H 1
|
||||
#define uid_t int
|
||||
#define gid_t int
|
||||
#define GETGROUPS_T int
|
||||
#define HAVE_ALLOCA 1
|
||||
#define HAVE_DUP2 1
|
||||
#define HAVE_MKDIR 1
|
||||
#define HAVE_FLOCK 1
|
||||
#define HAVE_FINITE 1
|
||||
#define HAVE_HYPOT 1
|
||||
#define HAVE_WAITPID 1
|
||||
#define HAVE_CHSIZE 1
|
||||
#define HAVE_TIMES 1
|
||||
#define HAVE_TELLDIR 1
|
||||
#define HAVE_SEEKDIR 1
|
||||
#define HAVE_EXECVE 1
|
||||
#define HAVE_DAYLIGHT 1
|
||||
#define SETPGRP_VOID 1
|
||||
#define inline __inline
|
||||
#define NEED_IO_SEEK_BETWEEN_RW 1
|
||||
#define RSHIFT(x,y) ((x)>>(int)y)
|
||||
#define FILE_COUNT _cnt
|
||||
#define FILE_READPTR _ptr
|
||||
#define DEFAULT_KCODE KCODE_NONE
|
||||
#define DLEXT ".so"
|
||||
#define DLEXT2 ".dll"
|
||||
@@ -1,82 +1,56 @@
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
#define HAVE_STDLIB_H 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_MEMORY_H 1
|
||||
#define HAVE_FLOAT_H 1
|
||||
#define HAVE_OFF_T 1
|
||||
#define SIZEOF_INT 4
|
||||
#define SIZEOF_SHORT 2
|
||||
#define SIZEOF_LONG 4
|
||||
#define SIZEOF_LONG_LONG 8
|
||||
#define SIZEOF___INT64 8
|
||||
#define SIZEOF_OFF_T 4
|
||||
#define SIZEOF_VOIDP 8
|
||||
#define SIZEOF_FLOAT 4
|
||||
#define SIZEOF_DOUBLE 8
|
||||
#define SIZEOF_SIZE_T 8
|
||||
#define HAVE_PROTOTYPES 1
|
||||
#define TOKEN_PASTE(x,y) x##y
|
||||
#define HAVE_STDARG_PROTOTYPES 1
|
||||
#ifndef NORETURN
|
||||
#if _MSC_VER > 1100
|
||||
#define NORETURN(x) __declspec(noreturn) x
|
||||
#else
|
||||
#define NORETURN(x) x
|
||||
#endif
|
||||
#endif
|
||||
#define HAVE_DECL_SYS_NERR 1
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_STDLIB_H 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_LIMITS_H 1
|
||||
#define HAVE_FCNTL_H 1
|
||||
#define HAVE_SYS_UTIME_H 1
|
||||
#define HAVE_MEMORY_H 1
|
||||
#define uid_t int
|
||||
#define gid_t int
|
||||
#define GETGROUPS_T int
|
||||
#define HAVE_ALLOCA 1
|
||||
#define HAVE_DUP2 1
|
||||
#define HAVE_MEMCMP 1
|
||||
#define HAVE_MEMMOVE 1
|
||||
#define HAVE_MKDIR 1
|
||||
#define HAVE_STRCASECMP 1
|
||||
#define HAVE_STRNCASECMP 1
|
||||
#define HAVE_STRERROR 1
|
||||
#define HAVE_STRFTIME 1
|
||||
#define HAVE_STRCHR 1
|
||||
#define HAVE_STRSTR 1
|
||||
#define HAVE_STRTOD 1
|
||||
#define HAVE_STRTOL 1
|
||||
#define HAVE_STRTOUL 1
|
||||
#define HAVE_FLOCK 1
|
||||
#define HAVE_VSNPRINTF 1
|
||||
#define HAVE_FINITE 1
|
||||
#define HAVE_FMOD 1
|
||||
#define HAVE_FREXP 1
|
||||
#define HAVE_HYPOT 1
|
||||
#define HAVE_MODF 1
|
||||
#define HAVE_WAITPID 1
|
||||
#define HAVE_CHSIZE 1
|
||||
#define HAVE_TIMES 1
|
||||
#define HAVE__SETJMP 1
|
||||
#define HAVE_TELLDIR 1
|
||||
#define HAVE_SEEKDIR 1
|
||||
#define HAVE_MKTIME 1
|
||||
#define HAVE_COSH 1
|
||||
#define HAVE_SINH 1
|
||||
#define HAVE_TANH 1
|
||||
#define HAVE_EXECVE 1
|
||||
#define HAVE_TZNAME 1
|
||||
#define HAVE_DAYLIGHT 1
|
||||
#define SETPGRP_VOID 1
|
||||
#define inline __inline
|
||||
#define NEED_IO_SEEK_BETWEEN_RW 1
|
||||
#define RSHIFT(x,y) ((x)>>(int)y)
|
||||
#define FILE_COUNT _cnt
|
||||
#define FILE_READPTR _ptr
|
||||
#define DEFAULT_KCODE KCODE_NONE
|
||||
#define DLEXT ".so"
|
||||
#define DLEXT2 ".dll"
|
||||
#if defined(__MINGW32__) || _MSC_VER >= 1600
|
||||
#define HAVE_STDINT_H 1
|
||||
#endif
|
||||
#if defined(__MINGW32__) || _MSC_VER >= 1800
|
||||
#define HAVE_INTTYPES_H 1
|
||||
#endif
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
#define HAVE_MEMORY_H 1
|
||||
#define HAVE_OFF_T 1
|
||||
#define SIZEOF_INT 4
|
||||
#define SIZEOF_LONG 4
|
||||
#define SIZEOF_LONG_LONG 8
|
||||
#define SIZEOF___INT64 8
|
||||
#define SIZEOF_OFF_T 4
|
||||
#define SIZEOF_VOIDP 8
|
||||
#define SIZEOF_FLOAT 4
|
||||
#define SIZEOF_DOUBLE 8
|
||||
#define SIZEOF_SIZE_T 8
|
||||
#define TOKEN_PASTE(x,y) x##y
|
||||
#ifndef NORETURN
|
||||
#if _MSC_VER > 1100
|
||||
#define NORETURN(x) __declspec(noreturn) x
|
||||
#else
|
||||
#define NORETURN(x) x
|
||||
#endif
|
||||
#endif
|
||||
#define HAVE_DECL_SYS_NERR 1
|
||||
#define HAVE_FCNTL_H 1
|
||||
#define HAVE_SYS_UTIME_H 1
|
||||
#define HAVE_MEMORY_H 1
|
||||
#define uid_t int
|
||||
#define gid_t int
|
||||
#define GETGROUPS_T int
|
||||
#define HAVE_ALLOCA 1
|
||||
#define HAVE_DUP2 1
|
||||
#define HAVE_MKDIR 1
|
||||
#define HAVE_FLOCK 1
|
||||
#define HAVE_FINITE 1
|
||||
#define HAVE_HYPOT 1
|
||||
#define HAVE_WAITPID 1
|
||||
#define HAVE_CHSIZE 1
|
||||
#define HAVE_TIMES 1
|
||||
#define HAVE_TELLDIR 1
|
||||
#define HAVE_SEEKDIR 1
|
||||
#define HAVE_EXECVE 1
|
||||
#define HAVE_DAYLIGHT 1
|
||||
#define SETPGRP_VOID 1
|
||||
#define inline __inline
|
||||
#define NEED_IO_SEEK_BETWEEN_RW 1
|
||||
#define RSHIFT(x,y) ((x)>>(int)y)
|
||||
#define FILE_COUNT _cnt
|
||||
#define FILE_READPTR _ptr
|
||||
#define DEFAULT_KCODE KCODE_NONE
|
||||
#define DLEXT ".so"
|
||||
#define DLEXT2 ".dll"
|
||||
@@ -2,8 +2,8 @@
|
||||
cp1251.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2006-2018 Byte <byte AT mail DOT kna DOT ru>
|
||||
* K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2006-2019 Byte <byte AT mail DOT kna DOT ru>
|
||||
* K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
euc_jp.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2018 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -120,25 +120,6 @@ code_to_mbclen(OnigCodePoint code)
|
||||
return ONIGERR_INVALID_CODE_POINT_VALUE;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int
|
||||
code_to_mbc_first(OnigCodePoint code)
|
||||
{
|
||||
int first;
|
||||
|
||||
if ((code & 0xff0000) != 0) {
|
||||
first = (code >> 16) & 0xff;
|
||||
}
|
||||
else if ((code & 0xff00) != 0) {
|
||||
first = (code >> 8) & 0xff;
|
||||
}
|
||||
else {
|
||||
return (int )code;
|
||||
}
|
||||
return first;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
code_to_mbc(OnigCodePoint code, UChar *buf)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* ANSI-C code produced by gperf version 3.1 */
|
||||
/* Command-line: /usr/local/bin/gperf -pt -T -L ANSI-C -N onigenc_euc_jp_lookup_property_name --output-file gperf1.tmp euc_jp_prop.gperf */
|
||||
/* Command-line: gperf -pt -T -L ANSI-C -N onigenc_euc_jp_lookup_property_name --output-file gperf1.tmp euc_jp_prop.gperf */
|
||||
/* Computed positions: -k'1,3' */
|
||||
|
||||
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
euc_kr.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2018 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -54,6 +54,16 @@ euckr_mbc_enc_len(const UChar* p)
|
||||
return EncLen_EUCKR[*p];
|
||||
}
|
||||
|
||||
static int
|
||||
euckr_code_to_mbclen(OnigCodePoint code)
|
||||
{
|
||||
if ((code & (~0xffff)) != 0) return ONIGERR_INVALID_CODE_POINT_VALUE;
|
||||
if ((code & 0xff00) != 0) return 2;
|
||||
if (EncLen_EUCKR[(int )(code & 0xff)] == 1) return 1;
|
||||
|
||||
return ONIGERR_INVALID_CODE_POINT_VALUE;
|
||||
}
|
||||
|
||||
static int
|
||||
is_valid_mbc_string(const UChar* p, const UChar* end)
|
||||
{
|
||||
@@ -98,15 +108,6 @@ euckr_mbc_case_fold(OnigCaseFoldType flag, const UChar** pp, const UChar* end,
|
||||
pp, end, lower);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int
|
||||
euckr_is_mbc_ambiguous(OnigCaseFoldType flag,
|
||||
const UChar** pp, const UChar* end)
|
||||
{
|
||||
return onigenc_mbn_is_mbc_ambiguous(ONIG_ENCODING_EUC_KR, flag, pp, end);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
euckr_is_code_ctype(OnigCodePoint code, unsigned int ctype)
|
||||
{
|
||||
@@ -149,7 +150,7 @@ OnigEncodingType OnigEncodingEUC_KR = {
|
||||
1, /* min enc length */
|
||||
onigenc_is_mbc_newline_0x0a,
|
||||
euckr_mbc_to_code,
|
||||
onigenc_mb2_code_to_mbclen,
|
||||
euckr_code_to_mbclen,
|
||||
euckr_code_to_mbc,
|
||||
euckr_mbc_case_fold,
|
||||
onigenc_ascii_apply_all_case_fold,
|
||||
@@ -174,7 +175,7 @@ OnigEncodingType OnigEncodingEUC_CN = {
|
||||
1, /* min enc length */
|
||||
onigenc_is_mbc_newline_0x0a,
|
||||
euckr_mbc_to_code,
|
||||
onigenc_mb2_code_to_mbclen,
|
||||
euckr_code_to_mbclen,
|
||||
euckr_code_to_mbc,
|
||||
euckr_mbc_case_fold,
|
||||
onigenc_ascii_apply_all_case_fold,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
euc_tw.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2018 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -54,6 +54,20 @@ euctw_mbc_enc_len(const UChar* p)
|
||||
return EncLen_EUCTW[*p];
|
||||
}
|
||||
|
||||
static int
|
||||
euctw_code_to_mbclen(OnigCodePoint code)
|
||||
{
|
||||
if ((code & 0xff000000) != 0) return 4;
|
||||
else if ((code & 0xff0000) != 0) return ONIGERR_INVALID_CODE_POINT_VALUE;
|
||||
else if ((code & 0xff00) != 0) return 2;
|
||||
else {
|
||||
if (EncLen_EUCTW[(int )(code & 0xff)] == 1)
|
||||
return 1;
|
||||
|
||||
return ONIGERR_INVALID_CODE_POINT_VALUE;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
is_valid_mbc_string(const UChar* p, const UChar* end)
|
||||
{
|
||||
@@ -155,7 +169,7 @@ OnigEncodingType OnigEncodingEUC_TW = {
|
||||
1, /* min enc length */
|
||||
onigenc_is_mbc_newline_0x0a,
|
||||
euctw_mbc_to_code,
|
||||
onigenc_mb4_code_to_mbclen,
|
||||
euctw_code_to_mbclen,
|
||||
euctw_code_to_mbc,
|
||||
euctw_mbc_case_fold,
|
||||
onigenc_ascii_apply_all_case_fold,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2005-2019 KUBO Takehiro <kubo AT jiubao DOT org>
|
||||
* K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -33,6 +33,7 @@
|
||||
#if 1
|
||||
#define DEBUG_GB18030(arg)
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#define DEBUG_GB18030(arg) printf arg
|
||||
#endif
|
||||
|
||||
@@ -75,6 +76,20 @@ gb18030_mbc_enc_len(const UChar* p)
|
||||
return 2;
|
||||
}
|
||||
|
||||
static int
|
||||
gb18030_code_to_mbclen(OnigCodePoint code)
|
||||
{
|
||||
if ((code & 0xff000000) != 0) return 4;
|
||||
else if ((code & 0xff0000) != 0) return ONIGERR_INVALID_CODE_POINT_VALUE;
|
||||
else if ((code & 0xff00) != 0) return 2;
|
||||
else {
|
||||
if (GB18030_MAP[(int )(code & 0xff)] == CM)
|
||||
return ONIGERR_INVALID_CODE_POINT_VALUE;
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
is_valid_mbc_string(const UChar* p, const UChar* end)
|
||||
{
|
||||
@@ -135,15 +150,6 @@ gb18030_mbc_case_fold(OnigCaseFoldType flag, const UChar** pp, const UChar* end,
|
||||
pp, end, lower);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int
|
||||
gb18030_is_mbc_ambiguous(OnigCaseFoldType flag,
|
||||
const UChar** pp, const UChar* end)
|
||||
{
|
||||
return onigenc_mbn_is_mbc_ambiguous(ONIG_ENCODING_GB18030, flag, pp, end);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
gb18030_is_code_ctype(OnigCodePoint code, unsigned int ctype)
|
||||
{
|
||||
@@ -522,7 +528,7 @@ OnigEncodingType OnigEncodingGB18030 = {
|
||||
1, /* min enc length */
|
||||
onigenc_is_mbc_newline_0x0a,
|
||||
gb18030_mbc_to_code,
|
||||
onigenc_mb4_code_to_mbclen,
|
||||
gb18030_code_to_mbclen,
|
||||
gb18030_code_to_mbc,
|
||||
gb18030_mbc_case_fold,
|
||||
onigenc_ascii_apply_all_case_fold,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
iso8859_1.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2018 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -216,32 +216,6 @@ mbc_case_fold(OnigCaseFoldType flag, const UChar** pp,
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int
|
||||
is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end)
|
||||
{
|
||||
int v;
|
||||
const UChar* p = *pp;
|
||||
|
||||
if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
|
||||
(*pp)++;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
(*pp)++;
|
||||
v = (EncISO_8859_1_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));
|
||||
if ((v | BIT_CTYPE_LOWER) != 0) {
|
||||
/* 0xdf, 0xaa, 0xb5, 0xba are lower case letter, but can't convert. */
|
||||
if (*p >= 0xaa && *p <= 0xba)
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return (v != 0 ? TRUE : FALSE);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
is_code_ctype(OnigCodePoint code, unsigned int ctype)
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
iso8859_10.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2018 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -121,28 +121,6 @@ mbc_case_fold(OnigCaseFoldType flag,
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int
|
||||
is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end)
|
||||
{
|
||||
int v;
|
||||
const UChar* p = *pp;
|
||||
|
||||
if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
|
||||
(*pp)++;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
(*pp)++;
|
||||
v = (EncISO_8859_10_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));
|
||||
if ((v | BIT_CTYPE_LOWER) != 0) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return (v != 0 ? TRUE : FALSE);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
is_code_ctype(OnigCodePoint code, unsigned int ctype)
|
||||
{
|
||||
|
||||
Loaded 100 of 270 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user