mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-20 15:36:37 +00:00
Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6c5fc072c8 | ||
|
|
de646e6d72 | ||
|
|
72e7b0b77b | ||
|
|
9bbf7e879f | ||
|
|
41267abcee | ||
|
|
239f6a47dc |
No files matched your search
+1
-1
@@ -16,7 +16,7 @@ environment:
|
||||
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
|
||||
PHP_BUILD_OBJ_DIR: c:\obj
|
||||
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.2.0beta5
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.1.9beta1
|
||||
PHP_BUILD_CRT: vc15
|
||||
# ext and env setup for tests
|
||||
#MYSQL_TEST_PASSWD: Password12!
|
||||
|
||||
+5
-17
@@ -1,19 +1,17 @@
|
||||
# https://editorconfig.org/
|
||||
# http://editorconfig.org/
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
tab_width = 4
|
||||
|
||||
[*.{c,h,y,awk,w32,bat,mk,frag,cpp}]
|
||||
[*.{c,h,awk,w32,bat,mk,frag}]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
indent_style = tab
|
||||
tab_width = 4
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.{php,phpt,inc}]
|
||||
[*.{php,phpt}]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
@@ -33,15 +31,5 @@ insert_final_newline = true
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_style = space
|
||||
trim_trailing_whitespace = true
|
||||
trim_trailing_whitespace = false
|
||||
insert_final_newline = true
|
||||
max_line_length = 80
|
||||
|
||||
[COMMIT_EDITMSG]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
max_line_length = 80
|
||||
@@ -1,6 +1,3 @@
|
||||
git:
|
||||
quiet: true
|
||||
|
||||
dist: trusty
|
||||
language: c
|
||||
sudo: required
|
||||
|
||||
@@ -1,379 +1,5 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
30 May 2019, PHP 7.2.19
|
||||
|
||||
- EXIF:
|
||||
. Fixed bug #77988 (heap-buffer-overflow on php_jpg_get16).
|
||||
(CVE-2019-11040) (Stas)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #77934 (php-fpm kill -USR2 not working). (Jakub Zelenka)
|
||||
. Fixed bug #77921 (static.php.net doesn't work anymore). (Peter Kokot)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #77943 (imageantialias($image, false); does not work). (cmb)
|
||||
. Fixed bug #77973 (Uninitialized read in gdImageCreateFromXbm).
|
||||
(CVE-2019-11038) (cmb)
|
||||
|
||||
- Iconv:
|
||||
. Fixed bug #78069 (Out-of-bounds read in iconv.c:_php_iconv_mime_decode()
|
||||
due to integer overflow). (CVE-2019-11039). (maris dot adam)
|
||||
|
||||
- JSON:
|
||||
. Fixed bug #77843 (Use after free with json serializer). (Nikita)
|
||||
|
||||
- Opcache:
|
||||
. Fixed possible crashes, because of inconsistent PCRE cache and opcache
|
||||
SHM reset. (Alexey Kalinin, Dmitry)
|
||||
|
||||
- PDO_MySQL:
|
||||
. Fixed bug #77944 (Wrong meta pdo_type for bigint on LLP64). (cmb)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #75186 (Inconsistent reflection of Closure:::__invoke()). (Nikita)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #77911 (Wrong warning for session.sid_bits_per_character). (cmb)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #77024 (SplFileObject::__toString() may return array). (Craig
|
||||
Duncan)
|
||||
|
||||
- SQLite:
|
||||
. Fixed bug #77967 (Bypassing open_basedir restrictions via file uris). (Stas)
|
||||
|
||||
02 May 2019, PHP 7.2.18
|
||||
|
||||
- CLI:
|
||||
. Fixed bug #77794 (Incorrect Date header format in built-in server).
|
||||
(kelunik)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #77909 (DatePeriod::__construct() with invalid recurrence count
|
||||
value). (Ignace Nyamagana Butera)
|
||||
|
||||
- EXIF
|
||||
. Fixed bug #77950 (Heap-buffer-overflow in _estrndup via exif_process_IFD_TAG).
|
||||
(CVE-2019-11036) (Stas)
|
||||
|
||||
- Interbase:
|
||||
. Fixed bug #72175 (Impossibility of creating multiple connections to
|
||||
Interbase with php 7.x). (Nikita)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #77895 (IntlDateFormatter::create fails in strict mode if $locale
|
||||
= null). (Nikita)
|
||||
|
||||
- litespeed:
|
||||
. LiteSpeed SAPI 7.3.1, better process management, new API function
|
||||
litespeed_finish_request(). (George Wang)
|
||||
|
||||
- Mail
|
||||
. Fixed bug #77821 (Potential heap corruption in TSendMail()). (cmb)
|
||||
|
||||
- PCRE:
|
||||
. Fixed bug #77827 (preg_match does not ignore \r in regex flags). (requinix,
|
||||
cmb)
|
||||
|
||||
- PDO:
|
||||
. Fixed bug #77849 (Disable cloning of PDO handle/connection objects).
|
||||
(camporter)
|
||||
|
||||
- phpdbg:
|
||||
. Fixed bug #76801 (too many open files). (alekitto)
|
||||
. Fixed bug #77800 (phpdbg segfaults on listing some conditional breakpoints).
|
||||
(krakjoe)
|
||||
. Fixed bug #77805 (phpdbg build fails when readline is shared). (krakjoe)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #77772 (ReflectionClass::getMethods(null) doesn't work). (Nikita)
|
||||
. Fixed bug #77882 (Different behavior: always calls destructor). (Nikita)
|
||||
|
||||
- SOAP:
|
||||
. Fixed bug #77945 (Segmentation fault when constructing SoapClient with
|
||||
WSDL_CACHE_BOTH). (Nikita)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #77680 (recursive mkdir on ftp stream wrapper is incorrect).
|
||||
(Vlad Temian)
|
||||
. Fixed bug #77844 (Crash due to null pointer in parse_ini_string with
|
||||
INI_SCANNER_TYPED). (Nikita)
|
||||
. Fixed bug #77853 (Inconsistent substr_compare behaviour with empty
|
||||
haystack). (Nikita)
|
||||
|
||||
04 Apr 2019, PHP 7.2.17
|
||||
|
||||
- Core:
|
||||
. Fixed bug #77738 (Nullptr deref in zend_compile_expr). (Laruence)
|
||||
. Fixed bug #77660 (Segmentation fault on break 2147483648). (Laruence)
|
||||
. Fixed bug #77652 (Anonymous classes can lose their interface information).
|
||||
(Nikita)
|
||||
. Fixed bug #77676 (Unable to run tests when building shared extension on
|
||||
AIX). (Kevin Adler)
|
||||
|
||||
- Bcmath:
|
||||
. Fixed bug #77742 (bcpow() implementation related to gcc compiler
|
||||
optimization). (Nikita)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #77578 (Crash when php unload). (cmb)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #50020 (DateInterval:createDateFromString() silently fails).
|
||||
(Derick)
|
||||
. Fixed bug #75113 (Added DatePeriod::getRecurrences() method). (Ignace
|
||||
Nyamagana Butera)
|
||||
|
||||
- EXIF:
|
||||
. Fixed bug #77753 (Heap-buffer-overflow in php_ifd_get32s). (CVE-2019-11034)
|
||||
(Stas)
|
||||
. Fixed bug #77831 (Heap-buffer-overflow in exif_iif_add_value).
|
||||
(CVE-2019-11035) (Stas)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #77677 (FPM fails to build on AIX due to missing WCOREDUMP).
|
||||
(Kevin Adler)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #77700 (Writing truecolor images as GIF ignores interlace flag).
|
||||
(cmb)
|
||||
|
||||
- MySQLi:
|
||||
. Fixed bug #77597 (mysqli_fetch_field hangs scripts). (Nikita)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #77691 (Opcache passes wrong value for inline array push
|
||||
assignments). (Nikita)
|
||||
. Fixed bug #77743 (Incorrect pi node insertion for jmpznz with identical
|
||||
successors). (Nikita)
|
||||
|
||||
- phpdbg:
|
||||
. Fixed bug #77767 (phpdbg break cmd aliases listed in help do not match
|
||||
actual aliases). (Miriam Lauter)
|
||||
|
||||
- sodium:
|
||||
. Fixed bug #77646 (sign_detached() strings not terminated). (Frank)
|
||||
|
||||
- SQLite3:
|
||||
. Added sqlite3.defensive INI directive. (BohwaZ)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #77664 (Segmentation fault when using undefined constant in
|
||||
custom wrapper). (Laruence)
|
||||
. Fixed bug #77669 (Crash in extract() when overwriting extracted array).
|
||||
(Nikita)
|
||||
. Fixed bug #76717 (var_export() does not create a parsable value for
|
||||
PHP_INT_MIN). (Nikita)
|
||||
. Fixed bug #77765 (FTP stream wrapper should set the directory as
|
||||
executable). (Vlad Temian)
|
||||
|
||||
07 Mar 2019, PHP 7.2.16
|
||||
|
||||
- Core:
|
||||
. Fixed bug #77589 (Core dump using parse_ini_string with numeric sections).
|
||||
(Laruence)
|
||||
. Fixed bug #77630 (rename() across the device may allow unwanted access
|
||||
during processing). (Stas)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #77621 (Already defined constants are not properly reported).
|
||||
(cmb)
|
||||
|
||||
- EXIF:
|
||||
. Fixed bug #77509 (Uninitialized read in exif_process_IFD_in_TIFF). (Stas)
|
||||
. Fixed bug #77540 (Invalid Read on exif_process_SOFn). (Stas)
|
||||
. Fixed bug #77563 (Uninitialized read in exif_process_IFD_in_MAKERNOTE). (Stas)
|
||||
. Fixed bug #77659 (Uninitialized read in exif_process_IFD_in_MAKERNOTE). (Stas)
|
||||
|
||||
- PDO_OCI:
|
||||
. Support Oracle Database tracing attributes ACTION, MODULE,
|
||||
CLIENT_INFO, and CLIENT_IDENTIFIER. (Cameron Porter)
|
||||
|
||||
- PHAR:
|
||||
. Fixed bug #77396 (Null Pointer Dereference in phar_create_or_parse_filename).
|
||||
(bishop)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #51068 (DirectoryIterator glob:// don't support current path
|
||||
relative queries). (Ahmed Abdou)
|
||||
. Fixed bug #77431 (openFile() silently truncates after a null byte). (cmb)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #77552 (Unintialized php_stream_statbuf in stat functions).
|
||||
(John Stevenson)
|
||||
|
||||
- MySQL
|
||||
. Disabled LOCAL INFILE by default, can be enabled using php.ini directive
|
||||
mysqli.allow_local_infile for mysqli, or PDO::MYSQL_ATTR_LOCAL_INFILE
|
||||
attribute for pdo_mysql. (Darek Slusarczyk)
|
||||
|
||||
07 Feb 2019, PHP 7.2.15
|
||||
|
||||
- Core:
|
||||
. Fixed bug #77339 (__callStatic may get incorrect arguments). (Dmitry)
|
||||
. Fixed bug #77494 (Disabling class causes segfault on member access).
|
||||
(Dmitry)
|
||||
. Fixed bug #77530 (PHP crashes when parsing `(2)::class`). (Ekin)
|
||||
|
||||
- Curl:
|
||||
. Fixed bug #76675 (Segfault with H2 server push). (Pedro Magalhães)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #73281 (imagescale(…, IMG_BILINEAR_FIXED) can cause black border).
|
||||
(cmb)
|
||||
. Fixed bug #73614 (gdImageFilledArc() doesn't properly draw pies). (cmb)
|
||||
. Fixed bug #77272 (imagescale() may return image resource on failure). (cmb)
|
||||
. Fixed bug #77391 (1bpp BMPs may fail to be loaded). (Romain Déoux, cmb)
|
||||
. Fixed bug #77479 (imagewbmp() segfaults with very large images). (cmb)
|
||||
|
||||
- ldap:
|
||||
. Fixed bug #77440 (ldap_bind using ldaps or ldap_start_tls()=exception in
|
||||
libcrypto-1_1-x64.dll). (Anatol)
|
||||
|
||||
- Mbstring:
|
||||
. Fixed bug #77454 (mb_scrub() silently truncates after a null byte).
|
||||
(64796c6e69 at gmail dot com)
|
||||
|
||||
- MySQLnd:
|
||||
. Fixed bug #75684 (In mysqlnd_ext_plugin.h the plugin methods family has
|
||||
no external visibility). (Anatol)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #77361 (configure fails on 64-bit AIX when opcache enabled).
|
||||
(Kevin Adler)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #77390 (feof might hang on TLS streams in case of fragmented TLS
|
||||
records). (Abyl Valg, Jakub Zelenka)
|
||||
|
||||
- PDO:
|
||||
. Fixed bug #77273 (array_walk_recursive corrupts value types leading to PDO
|
||||
failure). (Nikita)
|
||||
|
||||
- phpdbg:
|
||||
. Fixed bug #76596 (phpdbg support for display_errors=stderr). (kabel)
|
||||
|
||||
- Sockets:
|
||||
. Fixed bug #76839 (socket_recvfrom may return an invalid 'from' address
|
||||
on MacOS). (Michael Meyer)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #77395 (segfault about array_multisort). (Laruence)
|
||||
. Fixed bug #77439 (parse_str segfaults when inserting item into existing
|
||||
array). (Nikita)
|
||||
|
||||
10 Jan 2019, PHP 7.2.14
|
||||
|
||||
- Core:
|
||||
. Fixed bug #77369 (memcpy with negative length via crafted DNS response). (Stas)
|
||||
. Fixed bug #71041 (zend_signal_startup() needs ZEND_API).
|
||||
(Valentin V. Bartenev)
|
||||
. Fixed bug #76046 (PHP generates "FE_FREE" opcode on the wrong line).
|
||||
(Nikita)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #77177 (Serializing or unserializing COM objects crashes). (cmb)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #77097 (DateTime::diff gives wrong diff when the actual diff is
|
||||
less than 1 second). (Derick)
|
||||
|
||||
- Exif:
|
||||
. Fixed bug #77184 (Unsigned rational numbers are written out as signed
|
||||
rationals). (Colin Basnett)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #77269 (efree() on uninitialized Heap data in imagescale leads to
|
||||
use-after-free). (cmb)
|
||||
. Fixed bug #77270 (imagecolormatch Out Of Bounds Write on Heap). (cmb)
|
||||
. Fixed bug #77195 (Incorrect error handling of imagecreatefromjpeg()). (cmb)
|
||||
. Fixed bug #77198 (auto cropping has insufficient precision). (cmb)
|
||||
. Fixed bug #77200 (imagecropauto(…, GD_CROP_SIDES) crops left but not right).
|
||||
(cmb)
|
||||
|
||||
- IMAP:
|
||||
. Fixed bug #77020 (null pointer dereference in imap_mail). (cmb)
|
||||
|
||||
- Mbstring:
|
||||
. Fixed bug #77370 (Buffer overflow on mb regex functions - fetch_token). (Stas)
|
||||
. Fixed bug #77371 (heap buffer overflow in mb regex functions
|
||||
- compile_string_node). (Stas)
|
||||
. Fixed bug #77381 (heap buffer overflow in multibyte match_at). (Stas)
|
||||
. Fixed bug #77382 (heap buffer overflow due to incorrect length in
|
||||
expand_case_fold_string). (Stas)
|
||||
. Fixed bug #77385 (buffer overflow in fetch_token). (Stas)
|
||||
. Fixed bug #77394 (Buffer overflow in multibyte case folding - unicode). (Stas)
|
||||
. Fixed bug #77418 (Heap overflow in utf32be_mbc_to_code). (Stas)
|
||||
|
||||
- OCI8:
|
||||
. Fixed bug #76804 (oci_pconnect with OCI_CRED_EXT not working). (KoenigsKind)
|
||||
. Added oci_set_call_timeout() for call timeouts.
|
||||
. Added oci_set_db_operation() for the DBOP end-to-end-tracing attribute.
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #77215 (CFG assertion failure on multiple finalizing switch
|
||||
frees in one block). (Nikita)
|
||||
|
||||
- PDO:
|
||||
. Handle invalid index passed to PDOStatement::fetchColumn() as error. (Sergei
|
||||
Morozov)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #77247 (heap buffer overflow in phar_detect_phar_fname_ext). (Stas)
|
||||
|
||||
- Sockets:
|
||||
. Fixed bug #77136 (Unsupported IPV6_RECVPKTINFO constants on macOS).
|
||||
(Mizunashi Mana)
|
||||
|
||||
- SQLite3:
|
||||
. Fixed bug #77051 (Issue with re-binding on SQLite3). (BohwaZ)
|
||||
|
||||
- Xmlrpc:
|
||||
. Fixed bug #77242 (heap out of bounds read in xmlrpc_decode()). (cmb)
|
||||
. Fixed bug #77380 (Global out of bounds read in xmlrpc base64 code). (Stas)
|
||||
|
||||
06 Dec 2018, PHP 7.2.13
|
||||
|
||||
- ftp:
|
||||
. Fixed bug #77151 (ftp_close(): SSL_read on shutdown). (Remi)
|
||||
|
||||
- CLI:
|
||||
. Fixed bug #77111 (php-win.exe corrupts unicode symbols from cli
|
||||
parameters). (Anatol)
|
||||
|
||||
- Fileinfo:
|
||||
. Fixed bug #77095 (slowness regression in 7.2/7.3 (compared to 7.1)).
|
||||
(Anatol)
|
||||
|
||||
- iconv:
|
||||
. Fixed bug #77147 (Fixing 60494 ignored ICONV_MIME_DECODE_CONTINUE_ON_ERROR).
|
||||
(cmb)
|
||||
|
||||
- IMAP:
|
||||
. Fixed bug #77153 (imap_open allows to run arbitrary shell commands via
|
||||
mailbox parameter). (Stas)
|
||||
|
||||
- ODBC:
|
||||
. Fixed bug #77079 (odbc_fetch_object has incorrect type signature).
|
||||
(Jon Allen)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #77058 (Type inference in opcache causes side effects). (Nikita)
|
||||
. Fixed bug #77092 (array_diff_key() - segmentation fault). (Nikita)
|
||||
|
||||
- PGSQL:
|
||||
. Fixed bug #77047 (pg_convert has a broken regex for the 'TIME WITHOUT
|
||||
TIMEZONE' data type). (Andy Gajetzki)
|
||||
|
||||
- SOAP:
|
||||
. Fixed bug #50675 (SoapClient can't handle object references correctly).
|
||||
(Cameron Porter)
|
||||
. Fixed bug #76348 (WSDL_CACHE_MEMORY causes Segmentation fault). (cmb)
|
||||
. Fixed bug #77141 (Signedness issue in SOAP when precision=-1). (cmb)
|
||||
|
||||
- Sockets:
|
||||
. Fixed bug #67619 (Validate length on socket_write). (thiagooak)
|
||||
|
||||
08 Nov 2018, PHP 7.2.12
|
||||
|
||||
- Core:
|
||||
|
||||
@@ -99,13 +99,6 @@ PHP 7.2 UPGRADE NOTES
|
||||
from PHP 7.1 on 64-bit machines. This change was necessary to resolve a
|
||||
modulo bias bug in the implementation.
|
||||
|
||||
- IMAP:
|
||||
Starting with 7.2.13, rsh/ssh logins are disabled by default. Use
|
||||
imap.enable_insecure_rsh if you want to enable them. Note that the IMAP
|
||||
library does not filter mailbox names before passing them to rsh/ssh
|
||||
command, thus passing untrusted data to this function with rsh/ssh enabled
|
||||
is insecure.
|
||||
|
||||
========================================
|
||||
2. New Features
|
||||
========================================
|
||||
|
||||
@@ -45,13 +45,6 @@ elseif (PHP_OS == 'FreeBSD') {
|
||||
if ($freeMemory < 2100*1024*1024) {
|
||||
die('skip Not enough memory.');
|
||||
}
|
||||
} elseif (PHP_OS == "WINNT") {
|
||||
$s = trim(shell_exec("wmic OS get FreeVirtualMemory /Value 2>nul"));
|
||||
$freeMemory = explode('=', $s)[1]*1;
|
||||
|
||||
if ($freeMemory < 2.1*1024*1024) {
|
||||
die('skip Not enough memory.');
|
||||
}
|
||||
}
|
||||
?>
|
||||
--INI--
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
Bug #75426: "Cannot use empty array elements" reports wrong position
|
||||
--FILE--
|
||||
<?php
|
||||
$a = [
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
,
|
||||
5,
|
||||
6,
|
||||
];
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot use empty array elements in arrays in %s on line 5
|
||||
@@ -1,33 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77339 (__callStatic may get incorrect arguments)
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo
|
||||
{
|
||||
static function __callStatic($name, $arguments) {
|
||||
if ($name === 'get') {
|
||||
if (!isset($arguments[0])) {
|
||||
var_dump(['getSomeWhat']);
|
||||
var_dump($arguments);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
echo "OK\n";
|
||||
}
|
||||
|
||||
protected function get ($key) {
|
||||
echo "BUG!!!\n";
|
||||
}
|
||||
}
|
||||
|
||||
class Bar
|
||||
{
|
||||
static function __callStatic($name, $arguments) {
|
||||
echo Foo::get('getSomeWhat');
|
||||
}
|
||||
}
|
||||
|
||||
Bar::someUndefinedStaticFunction();
|
||||
?>
|
||||
--EXPECT--
|
||||
OK
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77494 (Disabling class causes segfault on member access)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl")) exit("skip curl extension not loaded"); ?>
|
||||
--INI--
|
||||
disable_classes=CURLFile
|
||||
--FILE--
|
||||
<?php
|
||||
$a = new CURLFile();
|
||||
var_dump($a->name);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: CURLFile() has been disabled for security reasons in %sbug77494.php on line 2
|
||||
|
||||
Notice: Undefined property: CURLFile::$name in %sbug77494.php on line 3
|
||||
NULL
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77530: PHP crashes when parsing '(2)::class'
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
echo (2)::class;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Illegal class name in %s on line %d
|
||||
@@ -1,40 +0,0 @@
|
||||
--TEST--
|
||||
BUG #77589 (Core dump using parse_ini_string with numeric sections)
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(
|
||||
parse_ini_string(<<<INI
|
||||
[0]
|
||||
a = 1
|
||||
b = on
|
||||
c = true
|
||||
|
||||
["true"]
|
||||
a = 100
|
||||
b = null
|
||||
c = yes
|
||||
INI
|
||||
, TRUE, INI_SCANNER_TYPED));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
["a"]=>
|
||||
int(1)
|
||||
["b"]=>
|
||||
bool(true)
|
||||
["c"]=>
|
||||
bool(true)
|
||||
}
|
||||
["true"]=>
|
||||
array(3) {
|
||||
["a"]=>
|
||||
int(100)
|
||||
["b"]=>
|
||||
NULL
|
||||
["c"]=>
|
||||
bool(true)
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
<?php
|
||||
return [
|
||||
'I' => function() {
|
||||
return new class implements I {};
|
||||
},
|
||||
];
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77652: Anonymous classes can lose their interface information
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
interface I {}
|
||||
require __DIR__ . '/bug77652.inc';
|
||||
$data = require __DIR__ . '/bug77652.inc';
|
||||
print_r(class_implements($data['I']()));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Array
|
||||
(
|
||||
[I] => I
|
||||
)
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77660 (Segmentation fault on break 2147483648)
|
||||
--SKIPIF--
|
||||
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
for(;;) break 2147483648;
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot 'break' 2147483648 levels in %sbug77660.php on line %d
|
||||
@@ -1,8 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77738 (Nullptr deref in zend_compile_expr)
|
||||
--FILE--
|
||||
<?php
|
||||
__COMPILER_HALT_OFFSET__;
|
||||
; // <- important
|
||||
--EXPECTF--
|
||||
Warning: Use of undefined constant __COMPILER_HALT_OFFSET__ - assumed '__COMPILER_HALT_OFFSET__' %sbug77738.php on line %d
|
||||
@@ -1,7 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77993 (Wrong parse error for invalid hex literal on Windows)
|
||||
--FILE--
|
||||
<?php
|
||||
0xg10;
|
||||
--EXPECTF--
|
||||
Parse error: syntax error, unexpected 'xg10' (T_STRING) in %s on line %d
|
||||
@@ -1,30 +0,0 @@
|
||||
--TEST--
|
||||
Calling exception getters when properties hold references
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class MyException extends Exception {
|
||||
public function __construct(&$refMsg, &$refCode, &$refFile, &$refLine) {
|
||||
$this->message =& $refMsg;
|
||||
$this->code =& $refCode;
|
||||
$this->file =& $refFile;
|
||||
$this->line =& $refLine;
|
||||
}
|
||||
}
|
||||
|
||||
$refMsg = "foo";
|
||||
$refCode = 0;
|
||||
$refFile = "foobar";
|
||||
$refLine = 42;
|
||||
$ex = new MyException($refMsg, $refCode, $refFile, $refLine);
|
||||
var_dump($ex->getMessage());
|
||||
var_dump($ex->getCode());
|
||||
var_dump($ex->getFile());
|
||||
var_dump($ex->getLine());
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "foo"
|
||||
int(0)
|
||||
string(6) "foobar"
|
||||
int(42)
|
||||
@@ -1,14 +0,0 @@
|
||||
--TEST--
|
||||
Bug object gc not working in shutdown
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set('memory_limit', '2M');
|
||||
register_shutdown_function(function () {
|
||||
for ($n = 1000 * 1000; $n--;) {
|
||||
new stdClass;
|
||||
}
|
||||
echo "OK\n";
|
||||
});
|
||||
?>
|
||||
--EXPECT--
|
||||
OK
|
||||
@@ -1,23 +0,0 @@
|
||||
--TEST--
|
||||
Use of self::class inside a constant in an unknown scope
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Test {
|
||||
public function foobar() {
|
||||
eval("
|
||||
const FOO = self::class;
|
||||
var_dump(FOO);
|
||||
");
|
||||
}
|
||||
}
|
||||
(new Test)->foobar();
|
||||
|
||||
// This should error, but doesn't
|
||||
const BAR = self::class;
|
||||
var_dump(BAR);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(4) "Test"
|
||||
string(0) ""
|
||||
@@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
The parent class is not necessarily the class of the prototype
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
function test(): B {}
|
||||
}
|
||||
class B extends A {}
|
||||
class C extends B {
|
||||
function test(): parent {}
|
||||
}
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -930,6 +930,10 @@ void zend_shutdown(void) /* {{{ */
|
||||
GLOBAL_CONSTANTS_TABLE = NULL;
|
||||
#endif
|
||||
zend_destroy_rsrc_list_dtors();
|
||||
|
||||
#ifndef ZTS
|
||||
zend_interned_strings_dtor();
|
||||
#endif
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
@@ -2855,17 +2855,6 @@ static zend_object *display_disabled_class(zend_class_entry *class_type) /* {{{
|
||||
zend_object *intern;
|
||||
|
||||
intern = zend_objects_new(class_type);
|
||||
|
||||
/* Initialize default properties */
|
||||
if (EXPECTED(class_type->default_properties_count != 0)) {
|
||||
zval *p = intern->properties_table;
|
||||
zval *end = p + class_type->default_properties_count;
|
||||
do {
|
||||
ZVAL_UNDEF(p);
|
||||
p++;
|
||||
} while (p != end);
|
||||
}
|
||||
|
||||
zend_error(E_WARNING, "%s() has been disabled for security reasons", ZSTR_VAL(class_type->name));
|
||||
return intern;
|
||||
}
|
||||
|
||||
+7
-8
@@ -193,7 +193,9 @@ typedef struct _zend_mm_free_slot zend_mm_free_slot;
|
||||
typedef struct _zend_mm_chunk zend_mm_chunk;
|
||||
typedef struct _zend_mm_huge_list zend_mm_huge_list;
|
||||
|
||||
#ifdef MAP_HUGETLB
|
||||
int zend_mm_use_huge_pages = 0;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Memory is retrived from OS by chunks of fixed size 2MB.
|
||||
@@ -710,9 +712,7 @@ static void *zend_mm_chunk_alloc_int(size_t size, size_t alignment)
|
||||
return NULL;
|
||||
} else if (ZEND_MM_ALIGNED_OFFSET(ptr, alignment) == 0) {
|
||||
#ifdef MADV_HUGEPAGE
|
||||
if (zend_mm_use_huge_pages) {
|
||||
madvise(ptr, size, MADV_HUGEPAGE);
|
||||
}
|
||||
madvise(ptr, size, MADV_HUGEPAGE);
|
||||
#endif
|
||||
return ptr;
|
||||
} else {
|
||||
@@ -743,9 +743,7 @@ static void *zend_mm_chunk_alloc_int(size_t size, size_t alignment)
|
||||
zend_mm_munmap((char*)ptr + size, alignment - REAL_PAGE_SIZE);
|
||||
}
|
||||
# ifdef MADV_HUGEPAGE
|
||||
if (zend_mm_use_huge_pages) {
|
||||
madvise(ptr, size, MADV_HUGEPAGE);
|
||||
}
|
||||
madvise(ptr, size, MADV_HUGEPAGE);
|
||||
# endif
|
||||
#endif
|
||||
return ptr;
|
||||
@@ -2602,9 +2600,8 @@ ZEND_API void shutdown_memory_manager(int silent, int full_shutdown)
|
||||
|
||||
static void alloc_globals_ctor(zend_alloc_globals *alloc_globals)
|
||||
{
|
||||
char *tmp;
|
||||
#if ZEND_MM_CUSTOM
|
||||
tmp = getenv("USE_ZEND_ALLOC");
|
||||
char *tmp = getenv("USE_ZEND_ALLOC");
|
||||
|
||||
if (tmp && !zend_atoi(tmp, 0)) {
|
||||
alloc_globals->mm_heap = malloc(sizeof(zend_mm_heap));
|
||||
@@ -2616,10 +2613,12 @@ static void alloc_globals_ctor(zend_alloc_globals *alloc_globals)
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifdef MAP_HUGETLB
|
||||
tmp = getenv("USE_ZEND_ALLOC_HUGE_PAGES");
|
||||
if (tmp && zend_atoi(tmp, 0)) {
|
||||
zend_mm_use_huge_pages = 1;
|
||||
}
|
||||
#endif
|
||||
ZEND_TSRMLS_CACHE_UPDATE();
|
||||
alloc_globals->mm_heap = zend_mm_init();
|
||||
}
|
||||
|
||||
+18
-70
@@ -1494,7 +1494,6 @@ static void zend_ensure_valid_class_fetch_type(uint32_t fetch_type) /* {{{ */
|
||||
static zend_bool zend_try_compile_const_expr_resolve_class_name(zval *zv, zend_ast *class_ast, zend_ast *name_ast, zend_bool constant) /* {{{ */
|
||||
{
|
||||
uint32_t fetch_type;
|
||||
zval *class_name;
|
||||
|
||||
if (name_ast->kind != ZEND_AST_ZVAL) {
|
||||
return 0;
|
||||
@@ -1509,18 +1508,12 @@ static zend_bool zend_try_compile_const_expr_resolve_class_name(zval *zv, zend_a
|
||||
"Dynamic class names are not allowed in compile-time ::class fetch");
|
||||
}
|
||||
|
||||
class_name = zend_ast_get_zval(class_ast);
|
||||
|
||||
if (Z_TYPE_P(class_name) != IS_STRING) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Illegal class name");
|
||||
}
|
||||
|
||||
fetch_type = zend_get_class_fetch_type(Z_STR_P(class_name));
|
||||
fetch_type = zend_get_class_fetch_type(zend_ast_get_str(class_ast));
|
||||
zend_ensure_valid_class_fetch_type(fetch_type);
|
||||
|
||||
switch (fetch_type) {
|
||||
case ZEND_FETCH_CLASS_SELF:
|
||||
if (CG(active_class_entry) && zend_is_scope_known()) {
|
||||
if (constant || (CG(active_class_entry) && zend_is_scope_known())) {
|
||||
ZVAL_STR_COPY(zv, CG(active_class_entry)->name);
|
||||
} else {
|
||||
ZVAL_NULL(zv);
|
||||
@@ -3630,7 +3623,7 @@ int zend_compile_func_cuf(znode *result, zend_ast_list *args, zend_string *lcnam
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static void zend_compile_assert(znode *result, zend_ast_list *args, zend_string *name, zend_function *fbc) /* {{{ */
|
||||
static int zend_compile_assert(znode *result, zend_ast_list *args, zend_string *name, zend_function *fbc) /* {{{ */
|
||||
{
|
||||
if (EG(assertions) >= 0) {
|
||||
znode name_node;
|
||||
@@ -3673,6 +3666,8 @@ static void zend_compile_assert(znode *result, zend_ast_list *args, zend_string
|
||||
result->op_type = IS_CONST;
|
||||
ZVAL_TRUE(&result->u.constant);
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -3880,6 +3875,10 @@ int zend_try_compile_special_func(znode *result, zend_string *lcname, zend_ast_l
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
if (zend_string_equals_literal(lcname, "assert")) {
|
||||
return zend_compile_assert(result, args, lcname, fbc);
|
||||
}
|
||||
|
||||
if (CG(compiler_options) & ZEND_COMPILE_NO_BUILTINS) {
|
||||
return FAILURE;
|
||||
}
|
||||
@@ -3982,16 +3981,8 @@ void zend_compile_call(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
|
||||
zend_op *opline;
|
||||
|
||||
lcname = zend_string_tolower(Z_STR_P(name));
|
||||
|
||||
fbc = zend_hash_find_ptr(CG(function_table), lcname);
|
||||
|
||||
/* Special assert() handling should apply independently of compiler flags. */
|
||||
if (fbc && zend_string_equals_literal(lcname, "assert")) {
|
||||
zend_compile_assert(result, zend_ast_get_list(args_ast), lcname, fbc);
|
||||
zend_string_release(lcname);
|
||||
zval_ptr_dtor(&name_node.u.constant);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!fbc
|
||||
|| (fbc->type == ZEND_INTERNAL_FUNCTION && (CG(compiler_options) & ZEND_COMPILE_IGNORE_INTERNAL_FUNCTIONS))
|
||||
|| (fbc->type == ZEND_USER_FUNCTION && (CG(compiler_options) & ZEND_COMPILE_IGNORE_USER_FUNCTIONS))
|
||||
@@ -4136,14 +4127,6 @@ void zend_compile_static_call(znode *result, zend_ast *ast, uint32_t type) /* {{
|
||||
if (ce) {
|
||||
zend_string *lcname = Z_STR_P(CT_CONSTANT(opline->op2) + 1);
|
||||
fbc = zend_hash_find_ptr(&ce->function_table, lcname);
|
||||
if (fbc && !(fbc->common.fn_flags & ZEND_ACC_PUBLIC)) {
|
||||
if (ce != CG(active_class_entry)
|
||||
&&((fbc->common.fn_flags & ZEND_ACC_PRIVATE)
|
||||
|| !zend_check_protected(zend_get_function_root_class(fbc), CG(active_class_entry)))) {
|
||||
/* incompatibe function */
|
||||
fbc = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4508,7 +4491,7 @@ void zend_compile_break_continue(zend_ast *ast) /* {{{ */
|
||||
zend_ast *depth_ast = ast->child[0];
|
||||
|
||||
zend_op *opline;
|
||||
zend_long depth;
|
||||
int depth;
|
||||
|
||||
ZEND_ASSERT(ast->kind == ZEND_AST_BREAK || ast->kind == ZEND_AST_CONTINUE);
|
||||
|
||||
@@ -4535,7 +4518,7 @@ void zend_compile_break_continue(zend_ast *ast) /* {{{ */
|
||||
ast->kind == ZEND_AST_BREAK ? "break" : "continue");
|
||||
} else {
|
||||
if (!zend_handle_loops_and_finally_ex(depth, NULL)) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Cannot '%s' " ZEND_LONG_FMT " level%s",
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Cannot '%s' %d level%s",
|
||||
ast->kind == ZEND_AST_BREAK ? "break" : "continue",
|
||||
depth, depth == 1 ? "" : "s");
|
||||
}
|
||||
@@ -4814,10 +4797,6 @@ void zend_compile_foreach(zend_ast *ast) /* {{{ */
|
||||
|
||||
zend_compile_stmt(stmt_ast);
|
||||
|
||||
/* Place JMP and FE_FREE on the line where foreach starts. It would be
|
||||
* better to use the end line, but this information is not available
|
||||
* currently. */
|
||||
CG(zend_lineno) = ast->lineno;
|
||||
zend_emit_jump(opnum_fetch);
|
||||
|
||||
opline = &CG(active_op_array)->opcodes[opnum_reset];
|
||||
@@ -4916,10 +4895,6 @@ static zend_uchar determine_switch_jumptable_type(zend_ast_list *cases) {
|
||||
}
|
||||
|
||||
static zend_bool should_use_jumptable(zend_ast_list *cases, zend_uchar jumptable_type) {
|
||||
if (CG(compiler_options) & ZEND_COMPILE_NO_JUMPTABLES) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Thresholds are chosen based on when the average switch time for equidistributed
|
||||
* input becomes smaller when using the jumptable optimization. */
|
||||
if (jumptable_type == IS_LONG) {
|
||||
@@ -6365,32 +6340,10 @@ void zend_compile_class_decl(zend_ast *ast) /* {{{ */
|
||||
if (!zend_hash_exists(CG(class_table), lcname)) {
|
||||
zend_hash_add_ptr(CG(class_table), lcname, ce);
|
||||
} else {
|
||||
/* This anonymous class has been included, reuse the existing definition.
|
||||
* NB: This behavior is buggy, and this should always result in a separate
|
||||
* class declaration. However, until the problem of RTD key collisions is
|
||||
* solved, this gives a behavior close to what is expected. */
|
||||
/* this anonymous class has been included */
|
||||
zval zv;
|
||||
ZVAL_PTR(&zv, ce);
|
||||
destroy_zend_class(&zv);
|
||||
ce = zend_hash_find_ptr(CG(class_table), lcname);
|
||||
|
||||
/* Manually replicate emission of necessary inheritance opcodes here. We cannot
|
||||
* reuse the general code, as we only want to emit the opcodes, without modifying
|
||||
* the reused class definition. */
|
||||
if (ce->ce_flags & ZEND_ACC_IMPLEMENT_TRAITS) {
|
||||
zend_emit_op(NULL, ZEND_BIND_TRAITS, &declare_node, NULL);
|
||||
}
|
||||
if (implements_ast) {
|
||||
zend_ast_list *iface_list = zend_ast_get_list(implements_ast);
|
||||
uint32_t i;
|
||||
for (i = 0; i < iface_list->children; i++) {
|
||||
opline = zend_emit_op(NULL, ZEND_ADD_INTERFACE, &declare_node, NULL);
|
||||
opline->op2_type = IS_CONST;
|
||||
opline->op2.constant = zend_add_class_name_literal(CG(active_op_array),
|
||||
zend_resolve_class_name_ast(iface_list->child[i]));
|
||||
}
|
||||
zend_emit_op(NULL, ZEND_VERIFY_ABSTRACT_CLASS, &declare_node, NULL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
@@ -6955,7 +6908,6 @@ static inline void zend_ct_eval_greater(zval *result, zend_ast_kind kind, zval *
|
||||
static zend_bool zend_try_ct_eval_array(zval *result, zend_ast *ast) /* {{{ */
|
||||
{
|
||||
zend_ast_list *list = zend_ast_get_list(ast);
|
||||
zend_ast *last_elem_ast = NULL;
|
||||
uint32_t i;
|
||||
zend_bool is_constant = 1;
|
||||
|
||||
@@ -6968,10 +6920,6 @@ static zend_bool zend_try_ct_eval_array(zval *result, zend_ast *ast) /* {{{ */
|
||||
zend_ast *elem_ast = list->child[i];
|
||||
|
||||
if (elem_ast == NULL) {
|
||||
/* Report error at line of last non-empty element */
|
||||
if (last_elem_ast) {
|
||||
CG(zend_lineno) = zend_ast_get_lineno(last_elem_ast);
|
||||
}
|
||||
zend_error(E_COMPILE_ERROR, "Cannot use empty array elements in arrays");
|
||||
}
|
||||
|
||||
@@ -6983,8 +6931,6 @@ static zend_bool zend_try_ct_eval_array(zval *result, zend_ast *ast) /* {{{ */
|
||||
) {
|
||||
is_constant = 0;
|
||||
}
|
||||
|
||||
last_elem_ast = elem_ast;
|
||||
}
|
||||
|
||||
if (!is_constant) {
|
||||
@@ -7673,11 +7619,11 @@ void zend_compile_const(znode *result, zend_ast *ast) /* {{{ */
|
||||
if (zend_string_equals_literal(resolved_name, "__COMPILER_HALT_OFFSET__") || (name_ast->attr != ZEND_NAME_RELATIVE && zend_string_equals_literal(orig_name, "__COMPILER_HALT_OFFSET__"))) {
|
||||
zend_ast *last = CG(ast);
|
||||
|
||||
while (last && last->kind == ZEND_AST_STMT_LIST) {
|
||||
while (last->kind == ZEND_AST_STMT_LIST) {
|
||||
zend_ast_list *list = zend_ast_get_list(last);
|
||||
last = list->child[list->children-1];
|
||||
}
|
||||
if (last && last->kind == ZEND_AST_HALT_COMPILER) {
|
||||
if (last->kind == ZEND_AST_HALT_COMPILER) {
|
||||
result->op_type = IS_CONST;
|
||||
ZVAL_LONG(&result->u.constant, Z_LVAL_P(zend_ast_get_zval(last->child[0])));
|
||||
zend_string_release(resolved_name);
|
||||
@@ -8044,7 +7990,9 @@ void zend_compile_const_expr_magic_const(zend_ast **ast_ptr) /* {{{ */
|
||||
zend_ast *ast = *ast_ptr;
|
||||
|
||||
/* Other cases already resolved by constant folding */
|
||||
ZEND_ASSERT(ast->attr == T_CLASS_C);
|
||||
ZEND_ASSERT(ast->attr == T_CLASS_C &&
|
||||
CG(active_class_entry) &&
|
||||
(CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT) != 0);
|
||||
|
||||
{
|
||||
zval const_zv;
|
||||
|
||||
@@ -1040,9 +1040,6 @@ END_EXTERN_C()
|
||||
/* disable builtin special case function calls */
|
||||
#define ZEND_COMPILE_NO_BUILTINS (1<<10)
|
||||
|
||||
/* disable jumptable optimization for switch statements */
|
||||
#define ZEND_COMPILE_NO_JUMPTABLES (1<<11)
|
||||
|
||||
/* The default value for CG(compiler_options) */
|
||||
#define ZEND_COMPILE_DEFAULT ZEND_COMPILE_HANDLE_OP_ARRAY
|
||||
|
||||
|
||||
@@ -341,9 +341,7 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
|
||||
ret_constant = NULL;
|
||||
} else {
|
||||
if (!zend_verify_const_access(c, scope)) {
|
||||
if ((flags & ZEND_FETCH_CLASS_SILENT) == 0) {
|
||||
zend_throw_error(NULL, "Cannot access %s const %s::%s", zend_visibility_string(Z_ACCESS_FLAGS(c->value)), ZSTR_VAL(class_name), ZSTR_VAL(constant_name));
|
||||
}
|
||||
zend_throw_error(NULL, "Cannot access %s const %s::%s", zend_visibility_string(Z_ACCESS_FLAGS(c->value)), ZSTR_VAL(class_name), ZSTR_VAL(constant_name));
|
||||
goto failure;
|
||||
}
|
||||
ret_constant = &c->value;
|
||||
|
||||
+12
-24
@@ -401,13 +401,11 @@ ZEND_METHOD(error_exception, __construct)
|
||||
Get the file in which the exception occurred */
|
||||
ZEND_METHOD(exception, getFile)
|
||||
{
|
||||
zval *prop, rv;
|
||||
zval rv;
|
||||
|
||||
DEFAULT_0_PARAMS;
|
||||
|
||||
prop = GET_PROPERTY(getThis(), ZEND_STR_FILE);
|
||||
ZVAL_DEREF(prop);
|
||||
ZVAL_COPY(return_value, prop);
|
||||
ZVAL_COPY(return_value, GET_PROPERTY(getThis(), ZEND_STR_FILE));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -415,13 +413,11 @@ ZEND_METHOD(exception, getFile)
|
||||
Get the line in which the exception occurred */
|
||||
ZEND_METHOD(exception, getLine)
|
||||
{
|
||||
zval *prop, rv;
|
||||
zval rv;
|
||||
|
||||
DEFAULT_0_PARAMS;
|
||||
|
||||
prop = GET_PROPERTY(getThis(), ZEND_STR_LINE);
|
||||
ZVAL_DEREF(prop);
|
||||
ZVAL_COPY(return_value, prop);
|
||||
ZVAL_COPY(return_value, GET_PROPERTY(getThis(), ZEND_STR_LINE));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -429,13 +425,11 @@ ZEND_METHOD(exception, getLine)
|
||||
Get the exception message */
|
||||
ZEND_METHOD(exception, getMessage)
|
||||
{
|
||||
zval *prop, rv;
|
||||
zval rv;
|
||||
|
||||
DEFAULT_0_PARAMS;
|
||||
|
||||
prop = GET_PROPERTY(getThis(), ZEND_STR_MESSAGE);
|
||||
ZVAL_DEREF(prop);
|
||||
ZVAL_COPY(return_value, prop);
|
||||
ZVAL_COPY(return_value, GET_PROPERTY(getThis(), ZEND_STR_MESSAGE));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -443,13 +437,11 @@ ZEND_METHOD(exception, getMessage)
|
||||
Get the exception code */
|
||||
ZEND_METHOD(exception, getCode)
|
||||
{
|
||||
zval *prop, rv;
|
||||
zval rv;
|
||||
|
||||
DEFAULT_0_PARAMS;
|
||||
|
||||
prop = GET_PROPERTY(getThis(), ZEND_STR_CODE);
|
||||
ZVAL_DEREF(prop);
|
||||
ZVAL_COPY(return_value, prop);
|
||||
ZVAL_COPY(return_value, GET_PROPERTY(getThis(), ZEND_STR_CODE));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -457,13 +449,11 @@ ZEND_METHOD(exception, getCode)
|
||||
Get the stack trace for the location in which the exception occurred */
|
||||
ZEND_METHOD(exception, getTrace)
|
||||
{
|
||||
zval *prop, rv;
|
||||
zval rv;
|
||||
|
||||
DEFAULT_0_PARAMS;
|
||||
|
||||
prop = GET_PROPERTY(getThis(), ZEND_STR_TRACE);
|
||||
ZVAL_DEREF(prop);
|
||||
ZVAL_COPY(return_value, prop);
|
||||
ZVAL_COPY(return_value, GET_PROPERTY(getThis(), ZEND_STR_TRACE));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -471,13 +461,11 @@ ZEND_METHOD(exception, getTrace)
|
||||
Get the exception severity */
|
||||
ZEND_METHOD(error_exception, getSeverity)
|
||||
{
|
||||
zval *prop, rv;
|
||||
zval rv;
|
||||
|
||||
DEFAULT_0_PARAMS;
|
||||
|
||||
prop = GET_PROPERTY(getThis(), ZEND_STR_SEVERITY);
|
||||
ZVAL_DEREF(prop);
|
||||
ZVAL_COPY(return_value, prop);
|
||||
ZVAL_COPY(return_value, GET_PROPERTY(getThis(), ZEND_STR_SEVERITY));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
+2
-3
@@ -230,9 +230,8 @@ struct _zend_executor_globals {
|
||||
void *reserved[ZEND_MAX_RESERVED_RESOURCES];
|
||||
};
|
||||
|
||||
#define EG_FLAGS_INITIAL (0)
|
||||
#define EG_FLAGS_IN_SHUTDOWN (1<<0)
|
||||
#define EG_FLAGS_OBJECT_STORE_NO_REUSE (1<<1)
|
||||
#define EG_FLAGS_INITIAL 0x00
|
||||
#define EG_FLAGS_IN_SHUTDOWN 0x01
|
||||
|
||||
struct _zend_ini_scanner_globals {
|
||||
zend_file_handle *yy_in;
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ static void _zend_is_inconsistent(const HashTable *ht, const char *file, int lin
|
||||
zend_output_debug_string(1, "%s(%d) : ht=%p is inconsistent", file, line, ht);
|
||||
break;
|
||||
}
|
||||
ZEND_ASSERT(0);
|
||||
zend_bailout();
|
||||
}
|
||||
#define IS_CONSISTENT(a) _zend_is_inconsistent(a, __FILE__, __LINE__);
|
||||
#define SET_INCONSISTENT(n) do { \
|
||||
|
||||
@@ -193,8 +193,8 @@ static int zend_do_perform_type_hint_check(const zend_function *fe, zend_arg_inf
|
||||
fe_class_name = ZEND_TYPE_NAME(fe_arg_info->type);
|
||||
class_name = ZSTR_VAL(fe_class_name);
|
||||
class_name_len = ZSTR_LEN(fe_class_name);
|
||||
if (class_name_len == sizeof("parent")-1 && !strcasecmp(class_name, "parent") && fe->common.scope && fe->common.scope->parent) {
|
||||
fe_class_name = zend_string_copy(fe->common.scope->parent->name);
|
||||
if (class_name_len == sizeof("parent")-1 && !strcasecmp(class_name, "parent") && proto->common.scope) {
|
||||
fe_class_name = zend_string_copy(proto->common.scope->name);
|
||||
} else if (class_name_len == sizeof("self")-1 && !strcasecmp(class_name, "self") && fe->common.scope) {
|
||||
fe_class_name = zend_string_copy(fe->common.scope->name);
|
||||
} else {
|
||||
|
||||
+16
-18
@@ -48,22 +48,6 @@ int ini_parse(void);
|
||||
|
||||
#define ZEND_SYSTEM_INI CG(ini_parser_unbuffered_errors)
|
||||
|
||||
static int get_int_val(zval *op) {
|
||||
switch (Z_TYPE_P(op)) {
|
||||
case IS_LONG:
|
||||
return Z_LVAL_P(op);
|
||||
case IS_DOUBLE:
|
||||
return (int)Z_DVAL_P(op);
|
||||
case IS_STRING:
|
||||
{
|
||||
int val = atoi(Z_STRVAL_P(op));
|
||||
zend_string_free(Z_STR_P(op));
|
||||
return val;
|
||||
}
|
||||
EMPTY_SWITCH_DEFAULT_CASE()
|
||||
}
|
||||
}
|
||||
|
||||
/* {{{ zend_ini_do_op()
|
||||
*/
|
||||
static void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2)
|
||||
@@ -73,8 +57,22 @@ static void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2)
|
||||
int str_len;
|
||||
char str_result[MAX_LENGTH_OF_LONG+1];
|
||||
|
||||
i_op1 = get_int_val(op1);
|
||||
i_op2 = op2 ? get_int_val(op2) : 0;
|
||||
if (IS_LONG == Z_TYPE_P(op1)) {
|
||||
i_op1 = Z_LVAL_P(op1);
|
||||
} else {
|
||||
i_op1 = atoi(Z_STRVAL_P(op1));
|
||||
zend_string_free(Z_STR_P(op1));
|
||||
}
|
||||
if (op2) {
|
||||
if (IS_LONG == Z_TYPE_P(op2)) {
|
||||
i_op2 = Z_LVAL_P(op2);
|
||||
} else {
|
||||
i_op2 = atoi(Z_STRVAL_P(op2));
|
||||
zend_string_free(Z_STR_P(op2));
|
||||
}
|
||||
} else {
|
||||
i_op2 = 0;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case '|':
|
||||
|
||||
+123
-124
@@ -144,14 +144,13 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
|
||||
ZVAL_NEW_STR(retval, zend_string_init(str, len, ZEND_SYSTEM_INI))
|
||||
|
||||
|
||||
#define RETURN_TOKEN(type, str, len) { \
|
||||
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_TYPED && \
|
||||
(YYSTATE == STATE(ST_VALUE) || YYSTATE == STATE(ST_RAW))) {\
|
||||
zend_ini_copy_typed_value(ini_lval, type, str, len); \
|
||||
} else { \
|
||||
zend_ini_copy_value(ini_lval, str, len); \
|
||||
} \
|
||||
return type; \
|
||||
#define RETURN_TOKEN(type, str, len) { \
|
||||
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_TYPED) { \
|
||||
zend_ini_copy_typed_value(ini_lval, type, str, len); \
|
||||
} else { \
|
||||
zend_ini_copy_value(ini_lval, str, len); \
|
||||
} \
|
||||
return type; \
|
||||
}
|
||||
|
||||
static inline int convert_to_number(zval *retval, const char *str, const int str_len)
|
||||
@@ -384,7 +383,7 @@ restart:
|
||||
}
|
||||
}
|
||||
|
||||
#line 388 "Zend/zend_ini_scanner.c"
|
||||
#line 387 "Zend/zend_ini_scanner.c"
|
||||
{
|
||||
YYCTYPE yych;
|
||||
unsigned int yyaccept = 0;
|
||||
@@ -506,7 +505,7 @@ yy4:
|
||||
yy5:
|
||||
YYDEBUG(5, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 484 "Zend/zend_ini_scanner.l"
|
||||
#line 483 "Zend/zend_ini_scanner.l"
|
||||
{ /* Get option name */
|
||||
/* Eat leading whitespace */
|
||||
EAT_LEADING_WHITESPACE();
|
||||
@@ -516,7 +515,7 @@ yy5:
|
||||
|
||||
RETURN_TOKEN(TC_LABEL, yytext, yyleng);
|
||||
}
|
||||
#line 520 "Zend/zend_ini_scanner.c"
|
||||
#line 519 "Zend/zend_ini_scanner.c"
|
||||
yy6:
|
||||
YYDEBUG(6, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -540,24 +539,24 @@ yy6:
|
||||
yy8:
|
||||
YYDEBUG(8, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 637 "Zend/zend_ini_scanner.l"
|
||||
#line 636 "Zend/zend_ini_scanner.l"
|
||||
{
|
||||
/* eat whitespace */
|
||||
goto restart;
|
||||
}
|
||||
#line 549 "Zend/zend_ini_scanner.c"
|
||||
#line 548 "Zend/zend_ini_scanner.c"
|
||||
yy9:
|
||||
YYDEBUG(9, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
yy10:
|
||||
YYDEBUG(10, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 642 "Zend/zend_ini_scanner.l"
|
||||
#line 641 "Zend/zend_ini_scanner.l"
|
||||
{
|
||||
SCNG(lineno)++;
|
||||
return END_OF_LINE;
|
||||
}
|
||||
#line 561 "Zend/zend_ini_scanner.c"
|
||||
#line 560 "Zend/zend_ini_scanner.c"
|
||||
yy11:
|
||||
YYDEBUG(11, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -618,11 +617,11 @@ yy14:
|
||||
++YYCURSOR;
|
||||
YYDEBUG(15, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 565 "Zend/zend_ini_scanner.l"
|
||||
#line 564 "Zend/zend_ini_scanner.l"
|
||||
{ /* Disallow these chars outside option values */
|
||||
return yytext[0];
|
||||
}
|
||||
#line 626 "Zend/zend_ini_scanner.c"
|
||||
#line 625 "Zend/zend_ini_scanner.c"
|
||||
yy16:
|
||||
YYDEBUG(16, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -630,11 +629,11 @@ yy16:
|
||||
goto yy32;
|
||||
YYDEBUG(17, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 658 "Zend/zend_ini_scanner.l"
|
||||
#line 657 "Zend/zend_ini_scanner.l"
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#line 638 "Zend/zend_ini_scanner.c"
|
||||
#line 637 "Zend/zend_ini_scanner.c"
|
||||
yy18:
|
||||
YYDEBUG(18, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -645,7 +644,7 @@ yy18:
|
||||
if (yych == ' ') goto yy18;
|
||||
YYDEBUG(20, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 494 "Zend/zend_ini_scanner.l"
|
||||
#line 493 "Zend/zend_ini_scanner.l"
|
||||
{ /* Start option value */
|
||||
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW) {
|
||||
BEGIN(ST_RAW);
|
||||
@@ -654,7 +653,7 @@ yy18:
|
||||
}
|
||||
return '=';
|
||||
}
|
||||
#line 658 "Zend/zend_ini_scanner.c"
|
||||
#line 657 "Zend/zend_ini_scanner.c"
|
||||
yy21:
|
||||
YYDEBUG(21, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -710,7 +709,7 @@ yy26:
|
||||
++YYCURSOR;
|
||||
YYDEBUG(27, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 409 "Zend/zend_ini_scanner.l"
|
||||
#line 408 "Zend/zend_ini_scanner.l"
|
||||
{ /* Section start */
|
||||
/* Enter section data lookup state */
|
||||
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW) {
|
||||
@@ -720,7 +719,7 @@ yy26:
|
||||
}
|
||||
return TC_SECTION;
|
||||
}
|
||||
#line 724 "Zend/zend_ini_scanner.c"
|
||||
#line 723 "Zend/zend_ini_scanner.c"
|
||||
yy28:
|
||||
YYDEBUG(28, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -731,7 +730,7 @@ yy28:
|
||||
if (yych == ' ') goto yy28;
|
||||
YYDEBUG(30, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 434 "Zend/zend_ini_scanner.l"
|
||||
#line 433 "Zend/zend_ini_scanner.l"
|
||||
{ /* Start of option with offset */
|
||||
/* Eat leading whitespace */
|
||||
EAT_LEADING_WHITESPACE();
|
||||
@@ -744,7 +743,7 @@ yy28:
|
||||
|
||||
RETURN_TOKEN(TC_OFFSET, yytext, yyleng);
|
||||
}
|
||||
#line 748 "Zend/zend_ini_scanner.c"
|
||||
#line 747 "Zend/zend_ini_scanner.c"
|
||||
yy31:
|
||||
YYDEBUG(31, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -762,13 +761,13 @@ yy33:
|
||||
yy34:
|
||||
YYDEBUG(34, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 647 "Zend/zend_ini_scanner.l"
|
||||
#line 646 "Zend/zend_ini_scanner.l"
|
||||
{ /* Comment */
|
||||
BEGIN(INITIAL);
|
||||
SCNG(lineno)++;
|
||||
return END_OF_LINE;
|
||||
}
|
||||
#line 772 "Zend/zend_ini_scanner.c"
|
||||
#line 771 "Zend/zend_ini_scanner.c"
|
||||
yy35:
|
||||
YYDEBUG(35, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -823,11 +822,11 @@ yy37:
|
||||
yy38:
|
||||
YYDEBUG(38, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 476 "Zend/zend_ini_scanner.l"
|
||||
#line 475 "Zend/zend_ini_scanner.l"
|
||||
{ /* FALSE value (when used outside option value/offset this causes parse error!)*/
|
||||
RETURN_TOKEN(BOOL_FALSE, "", 0);
|
||||
}
|
||||
#line 831 "Zend/zend_ini_scanner.c"
|
||||
#line 830 "Zend/zend_ini_scanner.c"
|
||||
yy39:
|
||||
YYDEBUG(39, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -884,11 +883,11 @@ yy41:
|
||||
yy43:
|
||||
YYDEBUG(43, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 472 "Zend/zend_ini_scanner.l"
|
||||
#line 471 "Zend/zend_ini_scanner.l"
|
||||
{ /* TRUE value (when used outside option value/offset this causes parse error!) */
|
||||
RETURN_TOKEN(BOOL_TRUE, "1", 1);
|
||||
}
|
||||
#line 892 "Zend/zend_ini_scanner.c"
|
||||
#line 891 "Zend/zend_ini_scanner.c"
|
||||
yy44:
|
||||
YYDEBUG(44, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -1035,11 +1034,11 @@ yy56:
|
||||
yy58:
|
||||
YYDEBUG(58, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 480 "Zend/zend_ini_scanner.l"
|
||||
#line 479 "Zend/zend_ini_scanner.l"
|
||||
{
|
||||
RETURN_TOKEN(NULL_NULL, "", 0);
|
||||
}
|
||||
#line 1043 "Zend/zend_ini_scanner.c"
|
||||
#line 1042 "Zend/zend_ini_scanner.c"
|
||||
yy59:
|
||||
YYDEBUG(59, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -1097,7 +1096,7 @@ yyc_ST_DOUBLE_QUOTES:
|
||||
yy64:
|
||||
YYDEBUG(64, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 597 "Zend/zend_ini_scanner.l"
|
||||
#line 596 "Zend/zend_ini_scanner.l"
|
||||
{ /* Escape double quoted string contents */
|
||||
if (YYCURSOR > YYLIMIT) {
|
||||
return 0;
|
||||
@@ -1133,7 +1132,7 @@ yy64:
|
||||
zend_ini_escape_string(ini_lval, yytext, yyleng, '"');
|
||||
return TC_QUOTED_STRING;
|
||||
}
|
||||
#line 1137 "Zend/zend_ini_scanner.c"
|
||||
#line 1136 "Zend/zend_ini_scanner.c"
|
||||
yy65:
|
||||
YYDEBUG(65, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -1145,12 +1144,12 @@ yy65:
|
||||
}
|
||||
YYDEBUG(67, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 592 "Zend/zend_ini_scanner.l"
|
||||
#line 591 "Zend/zend_ini_scanner.l"
|
||||
{ /* Double quoted '"' string ends */
|
||||
yy_pop_state();
|
||||
return '"';
|
||||
}
|
||||
#line 1154 "Zend/zend_ini_scanner.c"
|
||||
#line 1153 "Zend/zend_ini_scanner.c"
|
||||
yy68:
|
||||
YYDEBUG(68, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -1159,12 +1158,12 @@ yy68:
|
||||
++YYCURSOR;
|
||||
YYDEBUG(70, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 452 "Zend/zend_ini_scanner.l"
|
||||
#line 451 "Zend/zend_ini_scanner.l"
|
||||
{ /* Variable start */
|
||||
yy_push_state(ST_VARNAME);
|
||||
return TC_DOLLAR_CURLY;
|
||||
}
|
||||
#line 1168 "Zend/zend_ini_scanner.c"
|
||||
#line 1167 "Zend/zend_ini_scanner.c"
|
||||
}
|
||||
/* *********************************** */
|
||||
yyc_ST_OFFSET:
|
||||
@@ -1264,11 +1263,11 @@ yy74:
|
||||
yy75:
|
||||
YYDEBUG(75, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 583 "Zend/zend_ini_scanner.l"
|
||||
#line 582 "Zend/zend_ini_scanner.l"
|
||||
{ /* Get rest as section/offset value */
|
||||
RETURN_TOKEN(TC_STRING, yytext, yyleng);
|
||||
}
|
||||
#line 1272 "Zend/zend_ini_scanner.c"
|
||||
#line 1271 "Zend/zend_ini_scanner.c"
|
||||
yy76:
|
||||
YYDEBUG(76, *YYCURSOR);
|
||||
yyaccept = 0;
|
||||
@@ -1308,22 +1307,22 @@ yy78:
|
||||
yy79:
|
||||
YYDEBUG(79, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 658 "Zend/zend_ini_scanner.l"
|
||||
#line 657 "Zend/zend_ini_scanner.l"
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#line 1316 "Zend/zend_ini_scanner.c"
|
||||
#line 1315 "Zend/zend_ini_scanner.c"
|
||||
yy80:
|
||||
YYDEBUG(80, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(81, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 587 "Zend/zend_ini_scanner.l"
|
||||
#line 586 "Zend/zend_ini_scanner.l"
|
||||
{ /* Double quoted '"' string start */
|
||||
yy_push_state(ST_DOUBLE_QUOTES);
|
||||
return '"';
|
||||
}
|
||||
#line 1327 "Zend/zend_ini_scanner.c"
|
||||
#line 1326 "Zend/zend_ini_scanner.c"
|
||||
yy82:
|
||||
YYDEBUG(82, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -1389,11 +1388,11 @@ yy85:
|
||||
yy87:
|
||||
YYDEBUG(87, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 561 "Zend/zend_ini_scanner.l"
|
||||
#line 560 "Zend/zend_ini_scanner.l"
|
||||
{ /* Get number option value as string */
|
||||
RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
|
||||
}
|
||||
#line 1397 "Zend/zend_ini_scanner.c"
|
||||
#line 1396 "Zend/zend_ini_scanner.c"
|
||||
yy88:
|
||||
YYDEBUG(88, *YYCURSOR);
|
||||
yyaccept = 3;
|
||||
@@ -1426,11 +1425,11 @@ yy88:
|
||||
yy90:
|
||||
YYDEBUG(90, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 557 "Zend/zend_ini_scanner.l"
|
||||
#line 556 "Zend/zend_ini_scanner.l"
|
||||
{ /* Get constant option value */
|
||||
RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
|
||||
}
|
||||
#line 1434 "Zend/zend_ini_scanner.c"
|
||||
#line 1433 "Zend/zend_ini_scanner.c"
|
||||
yy91:
|
||||
YYDEBUG(91, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -1440,12 +1439,12 @@ yy92:
|
||||
++YYCURSOR;
|
||||
YYDEBUG(93, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 447 "Zend/zend_ini_scanner.l"
|
||||
#line 446 "Zend/zend_ini_scanner.l"
|
||||
{ /* End of section or an option offset */
|
||||
BEGIN(INITIAL);
|
||||
return ']';
|
||||
}
|
||||
#line 1449 "Zend/zend_ini_scanner.c"
|
||||
#line 1448 "Zend/zend_ini_scanner.c"
|
||||
yy94:
|
||||
YYDEBUG(94, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -1495,12 +1494,12 @@ yy99:
|
||||
++YYCURSOR;
|
||||
YYDEBUG(100, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 452 "Zend/zend_ini_scanner.l"
|
||||
#line 451 "Zend/zend_ini_scanner.l"
|
||||
{ /* Variable start */
|
||||
yy_push_state(ST_VARNAME);
|
||||
return TC_DOLLAR_CURLY;
|
||||
}
|
||||
#line 1504 "Zend/zend_ini_scanner.c"
|
||||
#line 1503 "Zend/zend_ini_scanner.c"
|
||||
yy101:
|
||||
YYDEBUG(101, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -1554,7 +1553,7 @@ yy105:
|
||||
++YYCURSOR;
|
||||
YYDEBUG(106, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 419 "Zend/zend_ini_scanner.l"
|
||||
#line 418 "Zend/zend_ini_scanner.l"
|
||||
{ /* Raw string */
|
||||
/* Eat leading and trailing single quotes */
|
||||
if (yytext[0] == '\'' && yytext[yyleng - 1] == '\'') {
|
||||
@@ -1563,7 +1562,7 @@ yy105:
|
||||
}
|
||||
RETURN_TOKEN(TC_RAW, yytext, yyleng);
|
||||
}
|
||||
#line 1567 "Zend/zend_ini_scanner.c"
|
||||
#line 1566 "Zend/zend_ini_scanner.c"
|
||||
}
|
||||
/* *********************************** */
|
||||
yyc_ST_RAW:
|
||||
@@ -1627,19 +1626,19 @@ yyc_ST_RAW:
|
||||
++YYCURSOR;
|
||||
YYDEBUG(110, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 653 "Zend/zend_ini_scanner.l"
|
||||
#line 652 "Zend/zend_ini_scanner.l"
|
||||
{ /* End of option value (if EOF is reached before EOL */
|
||||
BEGIN(INITIAL);
|
||||
return END_OF_LINE;
|
||||
}
|
||||
#line 1636 "Zend/zend_ini_scanner.c"
|
||||
#line 1635 "Zend/zend_ini_scanner.c"
|
||||
yy111:
|
||||
YYDEBUG(111, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
yy112:
|
||||
YYDEBUG(112, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 503 "Zend/zend_ini_scanner.l"
|
||||
#line 502 "Zend/zend_ini_scanner.l"
|
||||
{ /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
|
||||
unsigned char *sc = NULL;
|
||||
EAT_LEADING_WHITESPACE();
|
||||
@@ -1683,7 +1682,7 @@ end_raw_value_chars:
|
||||
|
||||
RETURN_TOKEN(TC_RAW, yytext, yyleng);
|
||||
}
|
||||
#line 1687 "Zend/zend_ini_scanner.c"
|
||||
#line 1686 "Zend/zend_ini_scanner.c"
|
||||
yy113:
|
||||
YYDEBUG(113, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -1707,13 +1706,13 @@ yy114:
|
||||
yy115:
|
||||
YYDEBUG(115, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 551 "Zend/zend_ini_scanner.l"
|
||||
#line 550 "Zend/zend_ini_scanner.l"
|
||||
{ /* End of option value */
|
||||
BEGIN(INITIAL);
|
||||
SCNG(lineno)++;
|
||||
return END_OF_LINE;
|
||||
}
|
||||
#line 1717 "Zend/zend_ini_scanner.c"
|
||||
#line 1716 "Zend/zend_ini_scanner.c"
|
||||
yy116:
|
||||
YYDEBUG(116, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -1743,12 +1742,12 @@ yy119:
|
||||
yy120:
|
||||
YYDEBUG(120, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 637 "Zend/zend_ini_scanner.l"
|
||||
#line 636 "Zend/zend_ini_scanner.l"
|
||||
{
|
||||
/* eat whitespace */
|
||||
goto restart;
|
||||
}
|
||||
#line 1752 "Zend/zend_ini_scanner.c"
|
||||
#line 1751 "Zend/zend_ini_scanner.c"
|
||||
yy121:
|
||||
YYDEBUG(121, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -1766,13 +1765,13 @@ yy123:
|
||||
yy124:
|
||||
YYDEBUG(124, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 647 "Zend/zend_ini_scanner.l"
|
||||
#line 646 "Zend/zend_ini_scanner.l"
|
||||
{ /* Comment */
|
||||
BEGIN(INITIAL);
|
||||
SCNG(lineno)++;
|
||||
return END_OF_LINE;
|
||||
}
|
||||
#line 1776 "Zend/zend_ini_scanner.c"
|
||||
#line 1775 "Zend/zend_ini_scanner.c"
|
||||
yy125:
|
||||
YYDEBUG(125, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -1835,21 +1834,21 @@ yy128:
|
||||
}
|
||||
YYDEBUG(130, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 547 "Zend/zend_ini_scanner.l"
|
||||
#line 546 "Zend/zend_ini_scanner.l"
|
||||
{ /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
|
||||
RETURN_TOKEN(TC_RAW, yytext, yyleng);
|
||||
}
|
||||
#line 1843 "Zend/zend_ini_scanner.c"
|
||||
#line 1842 "Zend/zend_ini_scanner.c"
|
||||
yy131:
|
||||
YYDEBUG(131, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(132, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 658 "Zend/zend_ini_scanner.l"
|
||||
#line 657 "Zend/zend_ini_scanner.l"
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#line 1853 "Zend/zend_ini_scanner.c"
|
||||
#line 1852 "Zend/zend_ini_scanner.c"
|
||||
yy133:
|
||||
YYDEBUG(133, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -1865,13 +1864,13 @@ yy133:
|
||||
yy135:
|
||||
YYDEBUG(135, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 428 "Zend/zend_ini_scanner.l"
|
||||
#line 427 "Zend/zend_ini_scanner.l"
|
||||
{ /* End of section */
|
||||
BEGIN(INITIAL);
|
||||
SCNG(lineno)++;
|
||||
return ']';
|
||||
}
|
||||
#line 1875 "Zend/zend_ini_scanner.c"
|
||||
#line 1874 "Zend/zend_ini_scanner.c"
|
||||
yy136:
|
||||
YYDEBUG(136, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -1980,11 +1979,11 @@ yy141:
|
||||
yy142:
|
||||
YYDEBUG(142, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 583 "Zend/zend_ini_scanner.l"
|
||||
#line 582 "Zend/zend_ini_scanner.l"
|
||||
{ /* Get rest as section/offset value */
|
||||
RETURN_TOKEN(TC_STRING, yytext, yyleng);
|
||||
}
|
||||
#line 1988 "Zend/zend_ini_scanner.c"
|
||||
#line 1987 "Zend/zend_ini_scanner.c"
|
||||
yy143:
|
||||
YYDEBUG(143, *YYCURSOR);
|
||||
yyaccept = 0;
|
||||
@@ -2024,22 +2023,22 @@ yy145:
|
||||
yy146:
|
||||
YYDEBUG(146, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 658 "Zend/zend_ini_scanner.l"
|
||||
#line 657 "Zend/zend_ini_scanner.l"
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#line 2032 "Zend/zend_ini_scanner.c"
|
||||
#line 2031 "Zend/zend_ini_scanner.c"
|
||||
yy147:
|
||||
YYDEBUG(147, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(148, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 587 "Zend/zend_ini_scanner.l"
|
||||
#line 586 "Zend/zend_ini_scanner.l"
|
||||
{ /* Double quoted '"' string start */
|
||||
yy_push_state(ST_DOUBLE_QUOTES);
|
||||
return '"';
|
||||
}
|
||||
#line 2043 "Zend/zend_ini_scanner.c"
|
||||
#line 2042 "Zend/zend_ini_scanner.c"
|
||||
yy149:
|
||||
YYDEBUG(149, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -2105,11 +2104,11 @@ yy152:
|
||||
yy154:
|
||||
YYDEBUG(154, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 561 "Zend/zend_ini_scanner.l"
|
||||
#line 560 "Zend/zend_ini_scanner.l"
|
||||
{ /* Get number option value as string */
|
||||
RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
|
||||
}
|
||||
#line 2113 "Zend/zend_ini_scanner.c"
|
||||
#line 2112 "Zend/zend_ini_scanner.c"
|
||||
yy155:
|
||||
YYDEBUG(155, *YYCURSOR);
|
||||
yyaccept = 3;
|
||||
@@ -2142,11 +2141,11 @@ yy155:
|
||||
yy157:
|
||||
YYDEBUG(157, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 557 "Zend/zend_ini_scanner.l"
|
||||
#line 556 "Zend/zend_ini_scanner.l"
|
||||
{ /* Get constant option value */
|
||||
RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
|
||||
}
|
||||
#line 2150 "Zend/zend_ini_scanner.c"
|
||||
#line 2149 "Zend/zend_ini_scanner.c"
|
||||
yy158:
|
||||
YYDEBUG(158, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -2168,13 +2167,13 @@ yy159:
|
||||
yy161:
|
||||
YYDEBUG(161, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 428 "Zend/zend_ini_scanner.l"
|
||||
#line 427 "Zend/zend_ini_scanner.l"
|
||||
{ /* End of section */
|
||||
BEGIN(INITIAL);
|
||||
SCNG(lineno)++;
|
||||
return ']';
|
||||
}
|
||||
#line 2178 "Zend/zend_ini_scanner.c"
|
||||
#line 2177 "Zend/zend_ini_scanner.c"
|
||||
yy162:
|
||||
YYDEBUG(162, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -2224,12 +2223,12 @@ yy167:
|
||||
++YYCURSOR;
|
||||
YYDEBUG(168, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 452 "Zend/zend_ini_scanner.l"
|
||||
#line 451 "Zend/zend_ini_scanner.l"
|
||||
{ /* Variable start */
|
||||
yy_push_state(ST_VARNAME);
|
||||
return TC_DOLLAR_CURLY;
|
||||
}
|
||||
#line 2233 "Zend/zend_ini_scanner.c"
|
||||
#line 2232 "Zend/zend_ini_scanner.c"
|
||||
yy169:
|
||||
YYDEBUG(169, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -2292,7 +2291,7 @@ yy175:
|
||||
++YYCURSOR;
|
||||
YYDEBUG(176, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 419 "Zend/zend_ini_scanner.l"
|
||||
#line 418 "Zend/zend_ini_scanner.l"
|
||||
{ /* Raw string */
|
||||
/* Eat leading and trailing single quotes */
|
||||
if (yytext[0] == '\'' && yytext[yyleng - 1] == '\'') {
|
||||
@@ -2301,7 +2300,7 @@ yy175:
|
||||
}
|
||||
RETURN_TOKEN(TC_RAW, yytext, yyleng);
|
||||
}
|
||||
#line 2305 "Zend/zend_ini_scanner.c"
|
||||
#line 2304 "Zend/zend_ini_scanner.c"
|
||||
}
|
||||
/* *********************************** */
|
||||
yyc_ST_VALUE:
|
||||
@@ -2437,12 +2436,12 @@ yy179:
|
||||
yy180:
|
||||
YYDEBUG(180, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 653 "Zend/zend_ini_scanner.l"
|
||||
#line 652 "Zend/zend_ini_scanner.l"
|
||||
{ /* End of option value (if EOF is reached before EOL */
|
||||
BEGIN(INITIAL);
|
||||
return END_OF_LINE;
|
||||
}
|
||||
#line 2446 "Zend/zend_ini_scanner.c"
|
||||
#line 2445 "Zend/zend_ini_scanner.c"
|
||||
yy181:
|
||||
YYDEBUG(181, *YYCURSOR);
|
||||
yyaccept = 0;
|
||||
@@ -2459,11 +2458,11 @@ yy182:
|
||||
yy183:
|
||||
YYDEBUG(183, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 579 "Zend/zend_ini_scanner.l"
|
||||
#line 578 "Zend/zend_ini_scanner.l"
|
||||
{ /* Get everything else as option/offset value */
|
||||
RETURN_TOKEN(TC_STRING, yytext, yyleng);
|
||||
}
|
||||
#line 2467 "Zend/zend_ini_scanner.c"
|
||||
#line 2466 "Zend/zend_ini_scanner.c"
|
||||
yy184:
|
||||
YYDEBUG(184, *YYCURSOR);
|
||||
yyaccept = 1;
|
||||
@@ -2488,24 +2487,24 @@ yy184:
|
||||
yy186:
|
||||
YYDEBUG(186, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 633 "Zend/zend_ini_scanner.l"
|
||||
#line 632 "Zend/zend_ini_scanner.l"
|
||||
{
|
||||
RETURN_TOKEN(TC_WHITESPACE, yytext, yyleng);
|
||||
}
|
||||
#line 2496 "Zend/zend_ini_scanner.c"
|
||||
#line 2495 "Zend/zend_ini_scanner.c"
|
||||
yy187:
|
||||
YYDEBUG(187, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
yy188:
|
||||
YYDEBUG(188, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 551 "Zend/zend_ini_scanner.l"
|
||||
#line 550 "Zend/zend_ini_scanner.l"
|
||||
{ /* End of option value */
|
||||
BEGIN(INITIAL);
|
||||
SCNG(lineno)++;
|
||||
return END_OF_LINE;
|
||||
}
|
||||
#line 2509 "Zend/zend_ini_scanner.c"
|
||||
#line 2508 "Zend/zend_ini_scanner.c"
|
||||
yy189:
|
||||
YYDEBUG(189, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -2521,22 +2520,22 @@ yy190:
|
||||
if (yych == ' ') goto yy190;
|
||||
YYDEBUG(192, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 569 "Zend/zend_ini_scanner.l"
|
||||
#line 568 "Zend/zend_ini_scanner.l"
|
||||
{ /* Boolean operators */
|
||||
return yytext[0];
|
||||
}
|
||||
#line 2529 "Zend/zend_ini_scanner.c"
|
||||
#line 2528 "Zend/zend_ini_scanner.c"
|
||||
yy193:
|
||||
YYDEBUG(193, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(194, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 587 "Zend/zend_ini_scanner.l"
|
||||
#line 586 "Zend/zend_ini_scanner.l"
|
||||
{ /* Double quoted '"' string start */
|
||||
yy_push_state(ST_DOUBLE_QUOTES);
|
||||
return '"';
|
||||
}
|
||||
#line 2540 "Zend/zend_ini_scanner.c"
|
||||
#line 2539 "Zend/zend_ini_scanner.c"
|
||||
yy195:
|
||||
YYDEBUG(195, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -2611,11 +2610,11 @@ yy198:
|
||||
yy200:
|
||||
YYDEBUG(200, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 561 "Zend/zend_ini_scanner.l"
|
||||
#line 560 "Zend/zend_ini_scanner.l"
|
||||
{ /* Get number option value as string */
|
||||
RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
|
||||
}
|
||||
#line 2619 "Zend/zend_ini_scanner.c"
|
||||
#line 2618 "Zend/zend_ini_scanner.c"
|
||||
yy201:
|
||||
YYDEBUG(201, *YYCURSOR);
|
||||
yyaccept = 2;
|
||||
@@ -2626,13 +2625,13 @@ yy202:
|
||||
++YYCURSOR;
|
||||
YYDEBUG(203, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 573 "Zend/zend_ini_scanner.l"
|
||||
#line 572 "Zend/zend_ini_scanner.l"
|
||||
{ /* Make = used in option value to trigger error */
|
||||
yyless(0);
|
||||
BEGIN(INITIAL);
|
||||
return END_OF_LINE;
|
||||
}
|
||||
#line 2636 "Zend/zend_ini_scanner.c"
|
||||
#line 2635 "Zend/zend_ini_scanner.c"
|
||||
yy204:
|
||||
YYDEBUG(204, *YYCURSOR);
|
||||
yyaccept = 4;
|
||||
@@ -2679,11 +2678,11 @@ yy204:
|
||||
yy206:
|
||||
YYDEBUG(206, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 557 "Zend/zend_ini_scanner.l"
|
||||
#line 556 "Zend/zend_ini_scanner.l"
|
||||
{ /* Get constant option value */
|
||||
RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
|
||||
}
|
||||
#line 2687 "Zend/zend_ini_scanner.c"
|
||||
#line 2686 "Zend/zend_ini_scanner.c"
|
||||
yy207:
|
||||
YYDEBUG(207, *YYCURSOR);
|
||||
yyaccept = 4;
|
||||
@@ -3037,12 +3036,12 @@ yy217:
|
||||
++YYCURSOR;
|
||||
YYDEBUG(218, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 452 "Zend/zend_ini_scanner.l"
|
||||
#line 451 "Zend/zend_ini_scanner.l"
|
||||
{ /* Variable start */
|
||||
yy_push_state(ST_VARNAME);
|
||||
return TC_DOLLAR_CURLY;
|
||||
}
|
||||
#line 3046 "Zend/zend_ini_scanner.c"
|
||||
#line 3045 "Zend/zend_ini_scanner.c"
|
||||
yy219:
|
||||
YYDEBUG(219, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -3108,13 +3107,13 @@ yy223:
|
||||
yy224:
|
||||
YYDEBUG(224, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 647 "Zend/zend_ini_scanner.l"
|
||||
#line 646 "Zend/zend_ini_scanner.l"
|
||||
{ /* Comment */
|
||||
BEGIN(INITIAL);
|
||||
SCNG(lineno)++;
|
||||
return END_OF_LINE;
|
||||
}
|
||||
#line 3118 "Zend/zend_ini_scanner.c"
|
||||
#line 3117 "Zend/zend_ini_scanner.c"
|
||||
yy225:
|
||||
YYDEBUG(225, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -3225,11 +3224,11 @@ yy227:
|
||||
yy228:
|
||||
YYDEBUG(228, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 476 "Zend/zend_ini_scanner.l"
|
||||
#line 475 "Zend/zend_ini_scanner.l"
|
||||
{ /* FALSE value (when used outside option value/offset this causes parse error!)*/
|
||||
RETURN_TOKEN(BOOL_FALSE, "", 0);
|
||||
}
|
||||
#line 3233 "Zend/zend_ini_scanner.c"
|
||||
#line 3232 "Zend/zend_ini_scanner.c"
|
||||
yy229:
|
||||
YYDEBUG(229, *YYCURSOR);
|
||||
yyaccept = 4;
|
||||
@@ -3376,11 +3375,11 @@ yy231:
|
||||
yy232:
|
||||
YYDEBUG(232, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 472 "Zend/zend_ini_scanner.l"
|
||||
#line 471 "Zend/zend_ini_scanner.l"
|
||||
{ /* TRUE value (when used outside option value/offset this causes parse error!) */
|
||||
RETURN_TOKEN(BOOL_TRUE, "1", 1);
|
||||
}
|
||||
#line 3384 "Zend/zend_ini_scanner.c"
|
||||
#line 3383 "Zend/zend_ini_scanner.c"
|
||||
yy233:
|
||||
YYDEBUG(233, *YYCURSOR);
|
||||
yyaccept = 4;
|
||||
@@ -3500,7 +3499,7 @@ yy237:
|
||||
++YYCURSOR;
|
||||
YYDEBUG(238, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 419 "Zend/zend_ini_scanner.l"
|
||||
#line 418 "Zend/zend_ini_scanner.l"
|
||||
{ /* Raw string */
|
||||
/* Eat leading and trailing single quotes */
|
||||
if (yytext[0] == '\'' && yytext[yyleng - 1] == '\'') {
|
||||
@@ -3509,7 +3508,7 @@ yy237:
|
||||
}
|
||||
RETURN_TOKEN(TC_RAW, yytext, yyleng);
|
||||
}
|
||||
#line 3513 "Zend/zend_ini_scanner.c"
|
||||
#line 3512 "Zend/zend_ini_scanner.c"
|
||||
yy239:
|
||||
YYDEBUG(239, *YYCURSOR);
|
||||
yyaccept = 4;
|
||||
@@ -3824,11 +3823,11 @@ yy248:
|
||||
yy249:
|
||||
YYDEBUG(249, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 480 "Zend/zend_ini_scanner.l"
|
||||
#line 479 "Zend/zend_ini_scanner.l"
|
||||
{
|
||||
RETURN_TOKEN(NULL_NULL, "", 0);
|
||||
}
|
||||
#line 3832 "Zend/zend_ini_scanner.c"
|
||||
#line 3831 "Zend/zend_ini_scanner.c"
|
||||
yy250:
|
||||
YYDEBUG(250, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -3895,7 +3894,7 @@ yy254:
|
||||
}
|
||||
YYDEBUG(256, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 457 "Zend/zend_ini_scanner.l"
|
||||
#line 456 "Zend/zend_ini_scanner.l"
|
||||
{ /* Variable name */
|
||||
/* Eat leading whitespace */
|
||||
EAT_LEADING_WHITESPACE();
|
||||
@@ -3905,30 +3904,30 @@ yy254:
|
||||
|
||||
RETURN_TOKEN(TC_VARNAME, yytext, yyleng);
|
||||
}
|
||||
#line 3909 "Zend/zend_ini_scanner.c"
|
||||
#line 3908 "Zend/zend_ini_scanner.c"
|
||||
yy257:
|
||||
YYDEBUG(257, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(258, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 658 "Zend/zend_ini_scanner.l"
|
||||
#line 657 "Zend/zend_ini_scanner.l"
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#line 3919 "Zend/zend_ini_scanner.c"
|
||||
#line 3918 "Zend/zend_ini_scanner.c"
|
||||
yy259:
|
||||
YYDEBUG(259, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(260, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 467 "Zend/zend_ini_scanner.l"
|
||||
#line 466 "Zend/zend_ini_scanner.l"
|
||||
{ /* Variable end */
|
||||
yy_pop_state();
|
||||
return '}';
|
||||
}
|
||||
#line 3930 "Zend/zend_ini_scanner.c"
|
||||
#line 3929 "Zend/zend_ini_scanner.c"
|
||||
}
|
||||
}
|
||||
#line 662 "Zend/zend_ini_scanner.l"
|
||||
#line 661 "Zend/zend_ini_scanner.l"
|
||||
|
||||
}
|
||||
@@ -142,14 +142,13 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
|
||||
ZVAL_NEW_STR(retval, zend_string_init(str, len, ZEND_SYSTEM_INI))
|
||||
|
||||
|
||||
#define RETURN_TOKEN(type, str, len) { \
|
||||
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_TYPED && \
|
||||
(YYSTATE == STATE(ST_VALUE) || YYSTATE == STATE(ST_RAW))) {\
|
||||
zend_ini_copy_typed_value(ini_lval, type, str, len); \
|
||||
} else { \
|
||||
zend_ini_copy_value(ini_lval, str, len); \
|
||||
} \
|
||||
return type; \
|
||||
#define RETURN_TOKEN(type, str, len) { \
|
||||
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_TYPED) { \
|
||||
zend_ini_copy_typed_value(ini_lval, type, str, len); \
|
||||
} else { \
|
||||
zend_ini_copy_value(ini_lval, str, len); \
|
||||
} \
|
||||
return type; \
|
||||
}
|
||||
|
||||
static inline int convert_to_number(zval *retval, const char *str, const int str_len)
|
||||
|
||||
+6008
-6005
File diff suppressed because it is too large.
Load diff
@@ -1648,8 +1648,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
|
||||
char *end;
|
||||
if (yyleng < MAX_LENGTH_OF_LONG - 1) { /* Won't overflow */
|
||||
errno = 0;
|
||||
/* base must be passed explicitly for correct parse error on Windows */
|
||||
ZVAL_LONG(zendlval, ZEND_STRTOL(yytext, &end, yytext[0] == '0' ? 8 : 10));
|
||||
ZVAL_LONG(zendlval, ZEND_STRTOL(yytext, &end, 0));
|
||||
/* This isn't an assert, we need to ensure 019 isn't valid octal
|
||||
* Because the lexing itself doesn't do that for us
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 1.0.1 */
|
||||
/* Generated by re2c 0.16 */
|
||||
#line 3 "Zend/zend_language_scanner_defs.h"
|
||||
|
||||
enum YYCONDTYPE {
|
||||
|
||||
@@ -43,7 +43,6 @@ ZEND_API void zend_objects_store_destroy(zend_objects_store *objects)
|
||||
|
||||
ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects)
|
||||
{
|
||||
EG(flags) |= EG_FLAGS_OBJECT_STORE_NO_REUSE;
|
||||
if (objects->top > 1) {
|
||||
uint32_t i;
|
||||
for (i = 1; i < objects->top; i++) {
|
||||
@@ -134,10 +133,10 @@ ZEND_API void zend_objects_store_put(zend_object *object)
|
||||
{
|
||||
int handle;
|
||||
|
||||
/* When in shutdown sequence - do not reuse previously freed handles, to make sure
|
||||
/* When in shutdown sequesnce - do not reuse previously freed handles, to make sure
|
||||
* the dtors for newly created objects are called in zend_objects_store_call_destructors() loop
|
||||
*/
|
||||
if (EG(objects_store).free_list_head != -1 && EXPECTED(!(EG(flags) & EG_FLAGS_OBJECT_STORE_NO_REUSE))) {
|
||||
if (!(EG(flags) & EG_FLAGS_IN_SHUTDOWN) && EG(objects_store).free_list_head != -1) {
|
||||
handle = EG(objects_store).free_list_head;
|
||||
EG(objects_store).free_list_head = GET_OBJ_BUCKET_NUMBER(EG(objects_store).object_buckets[handle]);
|
||||
} else {
|
||||
|
||||
+1
-1
@@ -399,7 +399,7 @@ void zend_signal_init(void) /* {{{ */
|
||||
|
||||
/* {{{ zend_signal_startup
|
||||
* alloc zend signal globals */
|
||||
ZEND_API void zend_signal_startup(void)
|
||||
void zend_signal_startup(void)
|
||||
{
|
||||
|
||||
#ifdef ZTS
|
||||
|
||||
+1
-1
@@ -89,7 +89,7 @@ ZEND_API void zend_signal_handler_unblock(void);
|
||||
void zend_signal_activate(void);
|
||||
void zend_signal_deactivate(void);
|
||||
BEGIN_EXTERN_C()
|
||||
ZEND_API void zend_signal_startup(void);
|
||||
void zend_signal_startup(void);
|
||||
END_EXTERN_C()
|
||||
void zend_signal_init(void);
|
||||
|
||||
|
||||
@@ -903,7 +903,7 @@ function gen_code($f, $spec, $kind, $export, $code, $op1, $op2, $name, $extra_sp
|
||||
}
|
||||
|
||||
/* Remove unused free_op1 and free_op2 declarations */
|
||||
if ($spec && preg_match_all('/^\s*zend_free_op\s+[^;]+;\s*$/m', $code, $matches, PREG_SET_ORDER)) {
|
||||
if ($spec && preg_match_all('/^\s*zend_free_op\s+[^;]+;\s*$/me', $code, $matches, PREG_SET_ORDER)) {
|
||||
$n = 0;
|
||||
foreach ($matches as $match) {
|
||||
$code = preg_replace('/'.preg_quote($match[0],'/').'/', "\$D$n", $code);
|
||||
@@ -1805,7 +1805,7 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name)
|
||||
$prolog = $m[1];
|
||||
out($f,$prolog."if (UNEXPECTED(execute_data == NULL)) {\n");
|
||||
out($f,$prolog."\tstatic const void* labels[] = {\n");
|
||||
gen_labels($f, $spec, ($kind == ZEND_VM_KIND_HYBRID) ? ZEND_VM_KIND_GOTO : $kind, $prolog."\t\t", $specs);
|
||||
gen_labels($f, $spec, ZEND_VM_KIND_GOTO, $prolog."\t\t", $specs);
|
||||
out($f,$prolog."\t};\n");
|
||||
out($f,$prolog."\tzend_opcode_handlers = (const void **) labels;\n");
|
||||
out($f,$prolog."\tzend_handlers_count = sizeof(labels) / sizeof(void*);\n");
|
||||
@@ -1920,7 +1920,7 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name)
|
||||
out($f,$prolog.$executor_name."_ex(NULL);\n");
|
||||
} else {
|
||||
out($f,$prolog."static const void *labels[] = {\n");
|
||||
gen_labels($f, $spec, ($kind == ZEND_VM_KIND_HYBRID) ? ZEND_VM_KIND_CALL : $kind, $prolog."\t", $specs, $switch_labels);
|
||||
gen_labels($f, $spec, ZEND_VM_KIND_CALL, $prolog."\t", $specs, $switch_labels);
|
||||
out($f,$prolog."};\n");
|
||||
out($f,$prolog."static const uint32_t specs[] = {\n");
|
||||
gen_specs($f, $prolog."\t", $specs);
|
||||
@@ -2383,7 +2383,6 @@ function gen_vm($def, $skel) {
|
||||
|
||||
// Generate specialized executor
|
||||
gen_executor($f, $skl, ZEND_VM_SPEC, ZEND_VM_KIND, "execute", "zend_init_opcodes_handlers");
|
||||
out($f, "\n");
|
||||
|
||||
// Generate zend_vm_get_opcode_handler() function
|
||||
out($f, "static const void *zend_vm_get_opcode_handler_ex(uint32_t spec, const zend_op* op)\n");
|
||||
|
||||
+40
-70
@@ -836,11 +836,15 @@ dnl from object_var in build-dir.
|
||||
dnl
|
||||
AC_DEFUN([PHP_SHARED_MODULE],[
|
||||
install_modules="install-modules"
|
||||
suffix=la
|
||||
|
||||
case $host_alias in
|
||||
*aix*[)]
|
||||
additional_flags="-Wl,-G"
|
||||
suffix=so
|
||||
link_cmd='$(LIBTOOL) --mode=link ifelse($4,,[$(CC)],[$(CXX)]) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$3'/$1.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $($2) $(translit($1,a-z_-,A-Z__)_SHARED_LIBADD) && mv -f '$3'/.libs/$1.so '$3'/$1.so'
|
||||
;;
|
||||
*[)]
|
||||
suffix=la
|
||||
link_cmd='$(LIBTOOL) --mode=link ifelse($4,,[$(CC)],[$(CXX)]) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o [$]@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $($2) $(translit($1,a-z_-,A-Z__)_SHARED_LIBADD)'
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -855,7 +859,7 @@ AC_DEFUN([PHP_SHARED_MODULE],[
|
||||
\$(LIBTOOL) --mode=install cp $3/$1.$suffix \$(phplibdir)
|
||||
|
||||
$3/$1.$suffix: \$($2) \$(translit($1,a-z_-,A-Z__)_SHARED_DEPENDENCIES)
|
||||
\$(LIBTOOL) --mode=link ifelse($4,,[\$(CC)],[\$(CXX)]) \$(COMMON_FLAGS) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(LDFLAGS) $additional_flags -o [\$]@ -export-dynamic -avoid-version -prefer-pic -module -rpath \$(phplibdir) \$(EXTRA_LDFLAGS) \$($2) \$(translit($1,a-z_-,A-Z__)_SHARED_LIBADD)
|
||||
$link_cmd
|
||||
|
||||
EOF
|
||||
])
|
||||
@@ -971,7 +975,7 @@ dnl ---------------------------------------------- Shared module
|
||||
dnl ---------------------------------------------- CLI static module
|
||||
[PHP_]translit($1,a-z_-,A-Z__)[_SHARED]=no
|
||||
case "$PHP_SAPI" in
|
||||
cgi|embed|phpdbg[)]
|
||||
cgi|embed[)]
|
||||
PHP_ADD_SOURCES($ext_dir,$2,$ac_extra,)
|
||||
EXT_STATIC="$EXT_STATIC $1;$ext_dir"
|
||||
;;
|
||||
@@ -2197,79 +2201,45 @@ AC_DEFUN([PHP_SETUP_ICU],[
|
||||
PHP_ICU_DIR=DEFAULT
|
||||
fi
|
||||
|
||||
if test "$PHP_ICU_DIR" = "DEFAULT"; then
|
||||
dnl Try to find icu-config
|
||||
AC_PATH_PROG(ICU_CONFIG, icu-config, no, [$PATH:/usr/local/bin])
|
||||
else
|
||||
ICU_CONFIG="$PHP_ICU_DIR/bin/icu-config"
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([for location of ICU headers and libraries])
|
||||
found_icu=no
|
||||
|
||||
dnl First try to find pkg-config
|
||||
if test -z "$PKG_CONFIG"; then
|
||||
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
|
||||
fi
|
||||
dnl Trust icu-config to know better what the install prefix is..
|
||||
icu_install_prefix=`$ICU_CONFIG --prefix 2> /dev/null`
|
||||
if test "$?" != "0" || test -z "$icu_install_prefix"; then
|
||||
AC_MSG_RESULT([not found])
|
||||
AC_MSG_ERROR([Unable to detect ICU prefix or $ICU_CONFIG failed. Please verify ICU install prefix and make sure icu-config works.])
|
||||
else
|
||||
AC_MSG_RESULT([$icu_install_prefix])
|
||||
|
||||
dnl If pkg-config is found try using it
|
||||
if test "$PHP_ICU_DIR" = "DEFAULT" && test -x "$PKG_CONFIG" && $PKG_CONFIG --exists icu-uc icu-io icu-i18n; then
|
||||
if $PKG_CONFIG --atleast-version=40 icu-uc; then
|
||||
found_icu=yes
|
||||
icu_version_full=`$PKG_CONFIG --modversion icu-uc`
|
||||
ac_IFS=$IFS
|
||||
IFS="."
|
||||
set $icu_version_full
|
||||
IFS=$ac_IFS
|
||||
icu_version=`expr [$]1 \* 1000 + [$]2`
|
||||
AC_MSG_RESULT([found $icu_version_full])
|
||||
dnl Check ICU version
|
||||
AC_MSG_CHECKING([for ICU 4.0 or greater])
|
||||
icu_version_full=`$ICU_CONFIG --version`
|
||||
ac_IFS=$IFS
|
||||
IFS="."
|
||||
set $icu_version_full
|
||||
IFS=$ac_IFS
|
||||
icu_version=`expr [$]1 \* 1000 + [$]2`
|
||||
AC_MSG_RESULT([found $icu_version_full])
|
||||
|
||||
ICU_LIBS=`$PKG_CONFIG --libs icu-uc icu-io icu-i18n`
|
||||
ICU_INCS=`$PKG_CONFIG --cflags-only-I icu-uc icu-io icu-i18n`
|
||||
ICU_CXXFLAGS="-DU_USING_ICU_NAMESPACE=1"
|
||||
|
||||
AC_MSG_RESULT([found $ICU_VERSION])
|
||||
|
||||
PHP_EVAL_LIBLINE($ICU_LIBS, $1)
|
||||
PHP_EVAL_INCLINE($ICU_INCS)
|
||||
else
|
||||
AC_MSG_ERROR([ICU version 4.0 or later required.])
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl If pkg-config fails for some reason, revert to the old method
|
||||
if test "$found_icu" = "no"; then
|
||||
if test "$PHP_ICU_DIR" = "DEFAULT"; then
|
||||
dnl Try to find icu-config
|
||||
AC_PATH_PROG(ICU_CONFIG, icu-config, no, [$PATH:/usr/local/bin])
|
||||
else
|
||||
ICU_CONFIG="$PHP_ICU_DIR/bin/icu-config"
|
||||
if test "$icu_version" -lt "4000"; then
|
||||
AC_MSG_ERROR([ICU version 4.0 or later is required])
|
||||
fi
|
||||
|
||||
dnl Trust icu-config to know better what the install prefix is..
|
||||
icu_install_prefix=`$ICU_CONFIG --prefix 2> /dev/null`
|
||||
if test "$?" != "0" || test -z "$icu_install_prefix"; then
|
||||
AC_MSG_RESULT([not found])
|
||||
AC_MSG_ERROR([Unable to detect ICU prefix or $ICU_CONFIG failed. Please verify ICU install prefix and make sure icu-config works.])
|
||||
else
|
||||
AC_MSG_RESULT([$icu_install_prefix])
|
||||
ICU_VERSION=$icu_version
|
||||
ICU_INCS=`$ICU_CONFIG --cppflags-searchpath`
|
||||
ICU_LIBS=`$ICU_CONFIG --ldflags --ldflags-icuio`
|
||||
PHP_EVAL_INCLINE($ICU_INCS)
|
||||
PHP_EVAL_LIBLINE($ICU_LIBS, $1)
|
||||
|
||||
dnl Check ICU version
|
||||
AC_MSG_CHECKING([for ICU 4.0 or greater])
|
||||
icu_version_full=`$ICU_CONFIG --version`
|
||||
ac_IFS=$IFS
|
||||
IFS="."
|
||||
set $icu_version_full
|
||||
IFS=$ac_IFS
|
||||
icu_version=`expr [$]1 \* 1000 + [$]2`
|
||||
AC_MSG_RESULT([found $icu_version_full])
|
||||
|
||||
if test "$icu_version" -lt "4000"; then
|
||||
AC_MSG_ERROR([ICU version 4.0 or later is required])
|
||||
fi
|
||||
|
||||
ICU_VERSION=$icu_version
|
||||
ICU_INCS=`$ICU_CONFIG --cppflags-searchpath`
|
||||
ICU_LIBS=`$ICU_CONFIG --ldflags --ldflags-icuio`
|
||||
PHP_EVAL_INCLINE($ICU_INCS)
|
||||
PHP_EVAL_LIBLINE($ICU_LIBS, $1)
|
||||
|
||||
ICU_CXXFLAGS=`$ICU_CONFIG --cxxflags`
|
||||
ICU_CXXFLAGS="$ICU_CXXFLAGS -DU_USING_ICU_NAMESPACE=1"
|
||||
fi
|
||||
ICU_CXXFLAGS=`$ICU_CONFIG --cxxflags`
|
||||
ICU_CXXFLAGS="$ICU_CXXFLAGS -DU_USING_ICU_NAMESPACE=1"
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
@echo off
|
||||
|
||||
set SDK_REMOTE=https://github.com/Microsoft/php-sdk-binary-tools.git
|
||||
set SDK_REMOTE=https://github.com/OSTC/php-sdk-binary-tools.git
|
||||
set SDK_BRANCH=%PHP_BUILD_SDK_BRANCH%
|
||||
set SDK_RUNNER=%PHP_BUILD_CACHE_SDK_DIR%\phpsdk-%PHP_BUILD_CRT%-%PLATFORM%.bat
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ set PDO_MYSQL_TEST_USER=%MYSQL_TEST_USER%
|
||||
set PDO_MYSQL_TEST_PASS=%MYSQL_PWD%
|
||||
set PDO_MYSQL_TEST_HOST=%MYSQL_TEST_HOST%
|
||||
set PDO_MYSQL_TEST_PORT=%MYSQL_TEST_PORT%
|
||||
set PDO_MYSQL_TEST_DSN=mysql:host=%PDO_MYSQL_TEST_HOST%;port=%PDO_MYSQL_TEST_PORT%;dbname=test;user=%PDO_MYSQL_TEST_USER%;password=%MYSQL_PW%
|
||||
set PDO_MYSQL_TEST_DSN=mysql:host=%PDO_MYSQL_TEST_HOST% port=%PDO_MYSQL_TEST_PORT% dbname=test user=%PDO_MYSQL_TEST_USER% password=%MYSQL_PW%
|
||||
"C:\Program Files\MySql\MySQL Server 5.7\bin\mysql.exe" --user=%MYSQL_TEST_USER% -e "CREATE DATABASE IF NOT EXISTS test"
|
||||
if %errorlevel% neq 0 exit /b 3
|
||||
|
||||
@@ -52,7 +52,7 @@ rem set OPENSSL_CONF=
|
||||
rem set SSLEAY_CONF=
|
||||
|
||||
rem prepare for Opcache
|
||||
if "%OPCACHE%" equ "1" set OPCACHE_OPTS=-d opcache.enable=1 -d opcache.enable_cli=1
|
||||
if "%OPCACHE%" equ "1" set OPCACHE_OPTS=-d opcache.enabled=1 -d opcache.enable_cli=1
|
||||
|
||||
rem prepare for enchant
|
||||
mkdir c:\enchant_plugins
|
||||
|
||||
+2
-2
@@ -107,8 +107,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=7
|
||||
PHP_MINOR_VERSION=2
|
||||
PHP_RELEASE_VERSION=19
|
||||
PHP_EXTRA_VERSION="-dev"
|
||||
PHP_RELEASE_VERSION=12
|
||||
PHP_EXTRA_VERSION=""
|
||||
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
|
||||
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
|
||||
|
||||
|
||||
@@ -54,19 +54,12 @@ bc_num2long (num)
|
||||
/* Extract the int value, ignore the fraction. */
|
||||
val = 0;
|
||||
nptr = num->n_value;
|
||||
for (index = num->n_len; index > 0; index--) {
|
||||
char n = *nptr++;
|
||||
for (index=num->n_len; (index>0) && (val<=(LONG_MAX/BASE)); index--)
|
||||
val = val*BASE + *nptr++;
|
||||
|
||||
if (val > LONG_MAX/BASE) {
|
||||
return 0;
|
||||
}
|
||||
val *= BASE;
|
||||
|
||||
if (val > LONG_MAX - n) {
|
||||
return 0;
|
||||
}
|
||||
val += n;
|
||||
}
|
||||
/* Check for overflow. If overflow, return zero. */
|
||||
if (index>0) val = 0;
|
||||
if (val < 0) val = 0;
|
||||
|
||||
/* Return the value. */
|
||||
if (num->n_sign == PLUS)
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
#include "php_com_dotnet.h"
|
||||
#include "php_com_dotnet_internal.h"
|
||||
#include "Zend/zend_exceptions.h"
|
||||
#include "Zend/zend_interfaces.h"
|
||||
|
||||
ZEND_DECLARE_MODULE_GLOBALS(com_dotnet)
|
||||
static PHP_GINIT_FUNCTION(com_dotnet);
|
||||
@@ -355,8 +354,6 @@ PHP_MINIT_FUNCTION(com_dotnet)
|
||||
{
|
||||
zend_class_entry ce, *tmp;
|
||||
|
||||
zend_hash_init(&com_dotnet_object_properties, 0, NULL, NULL, 0);
|
||||
|
||||
php_com_wrapper_minit(INIT_FUNC_ARGS_PASSTHRU);
|
||||
php_com_persist_minit(INIT_FUNC_ARGS_PASSTHRU);
|
||||
|
||||
@@ -375,15 +372,11 @@ PHP_MINIT_FUNCTION(com_dotnet)
|
||||
ce.create_object = php_com_object_new;
|
||||
php_com_variant_class_entry = zend_register_internal_class(&ce);
|
||||
php_com_variant_class_entry->get_iterator = php_com_iter_get;
|
||||
php_com_variant_class_entry->serialize = zend_class_serialize_deny;
|
||||
php_com_variant_class_entry->unserialize = zend_class_unserialize_deny;
|
||||
|
||||
INIT_CLASS_ENTRY(ce, "com", NULL);
|
||||
ce.create_object = php_com_object_new;
|
||||
tmp = zend_register_internal_class_ex(&ce, php_com_variant_class_entry);
|
||||
tmp->get_iterator = php_com_iter_get;
|
||||
tmp->serialize = zend_class_serialize_deny;
|
||||
tmp->unserialize = zend_class_unserialize_deny;
|
||||
|
||||
zend_ts_hash_init(&php_com_typelibraries, 0, NULL, php_com_typelibrary_dtor, 1);
|
||||
|
||||
@@ -392,8 +385,6 @@ PHP_MINIT_FUNCTION(com_dotnet)
|
||||
ce.create_object = php_com_object_new;
|
||||
tmp = zend_register_internal_class_ex(&ce, php_com_variant_class_entry);
|
||||
tmp->get_iterator = php_com_iter_get;
|
||||
tmp->serialize = zend_class_serialize_deny;
|
||||
tmp->unserialize = zend_class_unserialize_deny;
|
||||
#endif
|
||||
|
||||
REGISTER_INI_ENTRIES();
|
||||
|
||||
@@ -29,8 +29,6 @@
|
||||
#include "php_com_dotnet_internal.h"
|
||||
#include "Zend/zend_exceptions.h"
|
||||
|
||||
const HashTable com_dotnet_object_properties;
|
||||
|
||||
static zval *com_property_read(zval *object, zval *member, int type, void **cahce_slot, zval *rv)
|
||||
{
|
||||
php_com_dotnet_object *obj;
|
||||
@@ -233,7 +231,7 @@ static HashTable *com_properties_get(zval *object)
|
||||
* infinite recursion when the hash is displayed via var_dump().
|
||||
* Perhaps it is best to leave it un-implemented.
|
||||
*/
|
||||
return &com_dotnet_object_properties;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void function_dtor(zval *zv)
|
||||
|
||||
@@ -197,10 +197,9 @@ PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode, int codepa
|
||||
SysFreeString(bstr_ids);
|
||||
|
||||
/* sanity check for the case where the constant is already defined */
|
||||
php_com_zval_from_variant(&value, pVarDesc->lpvarValue, codepage);
|
||||
if ((exists = zend_get_constant(c.name)) != NULL) {
|
||||
if (COMG(autoreg_verbose) && !compare_function(&results, &value, exists)) {
|
||||
php_error_docref(NULL, E_WARNING, "Type library constant %s is already defined", ZSTR_VAL(c.name));
|
||||
if (COMG(autoreg_verbose) && !compare_function(&results, &c.value, exists)) {
|
||||
php_error_docref(NULL, E_WARNING, "Type library constant %s is already defined", c.name);
|
||||
}
|
||||
zend_string_release(c.name);
|
||||
ITypeInfo_ReleaseVarDesc(TypeInfo, pVarDesc);
|
||||
@@ -208,6 +207,7 @@ PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode, int codepa
|
||||
}
|
||||
|
||||
/* register the constant */
|
||||
php_com_zval_from_variant(&value, pVarDesc->lpvarValue, codepage);
|
||||
if (Z_TYPE(value) == IS_LONG) {
|
||||
c.flags = mode;
|
||||
ZVAL_LONG(&c.value, Z_LVAL(value));
|
||||
@@ -225,8 +225,8 @@ PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode, int codepa
|
||||
/* Type-library stuff */
|
||||
void php_com_typelibrary_dtor(zval *pDest)
|
||||
{
|
||||
ITypeLib *Lib = (ITypeLib*)Z_PTR_P(pDest);
|
||||
ITypeLib_Release(Lib);
|
||||
ITypeLib **Lib = (ITypeLib**)Z_PTR_P(pDest);
|
||||
ITypeLib_Release(*Lib);
|
||||
}
|
||||
|
||||
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib_via_cache(char *search_string,
|
||||
|
||||
@@ -31,8 +31,6 @@
|
||||
|
||||
#include "zend_ts_hash.h"
|
||||
|
||||
extern const HashTable com_dotnet_object_properties;
|
||||
|
||||
typedef struct _php_com_dotnet_object {
|
||||
zend_object zo;
|
||||
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77177 (Serializing or unserializing COM objects crashes)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('com_dotnet')) die('skip com_dotnet extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$com = new COM("WScript.Shell");
|
||||
$dotnet = new DOTNET("mscorlib", "System.Collections.Stack");
|
||||
$variant = new VARIANT;
|
||||
foreach ([$com, $dotnet, $variant] as $object) {
|
||||
try {
|
||||
serialize($object);
|
||||
} catch (Exception $ex) {
|
||||
echo "Exception: {$ex->getMessage()}\n";
|
||||
}
|
||||
}
|
||||
|
||||
$strings = ['C:3:"com":0:{}', 'C:6:"dotnet":0:{}', 'C:7:"variant":0:{}'];
|
||||
foreach ($strings as $string) {
|
||||
try {
|
||||
unserialize($string);
|
||||
} catch (Exception $ex) {
|
||||
echo "Exception: {$ex->getMessage()}\n";
|
||||
}
|
||||
}
|
||||
|
||||
$strings = ['O:3:"com":0:{}', 'O:6:"dotnet":0:{}', 'O:7:"variant":0:{}'];
|
||||
foreach ($strings as $string) {
|
||||
var_dump(unserialize($string));
|
||||
}
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Exception: Serialization of 'com' is not allowed
|
||||
Exception: Serialization of 'dotnet' is not allowed
|
||||
Exception: Serialization of 'variant' is not allowed
|
||||
Exception: Unserialization of 'com' is not allowed
|
||||
Exception: Unserialization of 'dotnet' is not allowed
|
||||
Exception: Unserialization of 'variant' is not allowed
|
||||
|
||||
Warning: Erroneous data format for unserializing 'com' in %s on line %d
|
||||
|
||||
Notice: unserialize(): Error at offset 13 of 14 bytes in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: Erroneous data format for unserializing 'dotnet' in %s on line %d
|
||||
|
||||
Notice: unserialize(): Error at offset 16 of 17 bytes in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: Erroneous data format for unserializing 'variant' in %s on line %d
|
||||
|
||||
Notice: unserialize(): Error at offset 17 of 18 bytes in %s on line %d
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -1,23 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77578 (Crash when php unload)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('com_dotnet')) die('skip com_dotnet extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
// To actually be able to verify the crash during shutdown on Windows, we have
|
||||
// to execute a PHP subprocess, and check its exit status.
|
||||
$php = PHP_BINARY;
|
||||
$ini = php_ini_loaded_file();
|
||||
$iniopt = $ini ? "-c $ini" : '';
|
||||
$command = "$php $iniopt -d com.autoregister_typelib=1 -r \"new COM('WbemScripting.SWbemLocator');\"";
|
||||
exec($command, $output, $status);
|
||||
var_dump($output, $status);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
array(0) {
|
||||
}
|
||||
int(0)
|
||||
===DONE===
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77621 (Already defined constants are not properly reported)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('com_dotnet')) die('skip com_dotnet extension not available');
|
||||
?>
|
||||
--INI--
|
||||
com.autoregister_verbose=1
|
||||
--FILE--
|
||||
<?php
|
||||
define('ADSTYPE_INVALID', 0);
|
||||
$root = dirname(array_change_key_case($_SERVER, CASE_UPPER)['COMSPEC']);
|
||||
com_load_typelib("$root\activeds.tlb");
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Warning: com_load_typelib(): Type library constant ADSTYPE_INVALID is already defined in %s on line %d
|
||||
===DONE===
|
||||
@@ -3310,12 +3310,8 @@ PHP_FUNCTION(curl_error)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (ch->err.no) {
|
||||
ch->err.str[CURL_ERROR_SIZE] = 0;
|
||||
RETURN_STRING(ch->err.str);
|
||||
} else {
|
||||
RETURN_EMPTY_STRING();
|
||||
}
|
||||
ch->err.str[CURL_ERROR_SIZE] = 0;
|
||||
RETURN_STRING(ch->err.str);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
+5
-2
@@ -425,7 +425,6 @@ void _php_curl_multi_close(zend_resource *rsrc) /* {{{ */
|
||||
curl_multi_cleanup(mh->multi);
|
||||
zend_llist_clean(&mh->easyh);
|
||||
if (mh->handlers->server_push) {
|
||||
zval_ptr_dtor(&mh->handlers->server_push->func_name);
|
||||
efree(mh->handlers->server_push);
|
||||
}
|
||||
if (mh->handlers) {
|
||||
@@ -510,7 +509,6 @@ static int _php_server_push_callback(CURL *parent_ch, CURL *easy, size_t num_hea
|
||||
Z_ADDREF_P(pz_parent_ch);
|
||||
|
||||
res = zend_register_resource(ch, le_curl);
|
||||
ch->res = res;
|
||||
ZVAL_RES(&pz_ch, res);
|
||||
|
||||
size_t i;
|
||||
@@ -588,6 +586,11 @@ static int _php_curl_multi_setopt(php_curlm *mh, zend_long option, zval *zvalue,
|
||||
|
||||
ZVAL_COPY(&mh->handlers->server_push->func_name, zvalue);
|
||||
mh->handlers->server_push->method = PHP_CURL_USER;
|
||||
if (!Z_ISUNDEF(mh->handlers->server_push->func_name)) {
|
||||
zval_ptr_dtor(&mh->handlers->server_push->func_name);
|
||||
mh->handlers->server_push->fci_cache = empty_fcall_info_cache;
|
||||
|
||||
}
|
||||
error = curl_multi_setopt(mh->multi, option, _php_server_push_callback);
|
||||
if (error != CURLM_OK) {
|
||||
return 0;
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
--TEST--
|
||||
Bug #76675 (Segfault with H2 server push write/writeheader handlers)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
include 'skipif.inc';
|
||||
if (getenv("SKIP_ONLINE_TESTS")) {
|
||||
die("skip online test");
|
||||
}
|
||||
$curl_version = curl_version();
|
||||
if ($curl_version['version_number'] < 0x073d00) {
|
||||
exit("skip: test may crash with curl < 7.61.0");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$transfers = 1;
|
||||
$callback = function($parent, $passed) use (&$transfers) {
|
||||
curl_setopt($passed, CURLOPT_WRITEFUNCTION, function ($ch, $data) {
|
||||
echo "Received ".strlen($data);
|
||||
return strlen($data);
|
||||
});
|
||||
$transfers++;
|
||||
return CURL_PUSH_OK;
|
||||
};
|
||||
$mh = curl_multi_init();
|
||||
curl_multi_setopt($mh, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX);
|
||||
curl_multi_setopt($mh, CURLMOPT_PUSHFUNCTION, $callback);
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, 'https://http2.golang.org/serverpush');
|
||||
curl_setopt($ch, CURLOPT_HTTP_VERSION, 3);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_multi_add_handle($mh, $ch);
|
||||
$active = null;
|
||||
do {
|
||||
$status = curl_multi_exec($mh, $active);
|
||||
do {
|
||||
$info = curl_multi_info_read($mh);
|
||||
if (false !== $info && $info['msg'] == CURLMSG_DONE) {
|
||||
$handle = $info['handle'];
|
||||
if ($handle !== null) {
|
||||
$transfers--;
|
||||
curl_multi_remove_handle($mh, $handle);
|
||||
curl_close($handle);
|
||||
}
|
||||
}
|
||||
} while ($info);
|
||||
} while ($transfers);
|
||||
curl_multi_close($mh);
|
||||
?>
|
||||
--EXPECTREGEX--
|
||||
(Received \d+)+
|
||||
@@ -1,77 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77535 (Invalid callback, h2 server push)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
include 'skipif.inc';
|
||||
if (getenv("SKIP_ONLINE_TESTS")) {
|
||||
die("skip online test");
|
||||
}
|
||||
$curl_version = curl_version();
|
||||
if ($curl_version['version_number'] < 0x073d00) {
|
||||
exit("skip: test may crash with curl < 7.61.0");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
class MyHttpClient
|
||||
{
|
||||
private $mh;
|
||||
private $curl;
|
||||
|
||||
public function sendRequest()
|
||||
{
|
||||
if (false === $this->mh = curl_multi_init()) {
|
||||
throw new \RuntimeException('Unable to create a new cURL multi handle');
|
||||
}
|
||||
|
||||
$this->addServerPushCallback();
|
||||
|
||||
$this->curl = curl_init();
|
||||
curl_setopt($this->curl, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);
|
||||
curl_setopt($this->curl, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);
|
||||
curl_setopt($this->curl, CURLOPT_HEADER, false);
|
||||
curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, false);
|
||||
curl_setopt($this->curl, CURLOPT_FAILONERROR, false);
|
||||
curl_setopt($this->curl, CURLOPT_URL, 'https://http2.golang.org/serverpush');
|
||||
curl_setopt($this->curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
|
||||
curl_setopt($this->curl, CURLOPT_HEADERFUNCTION, function ($ch, $data) {
|
||||
return \strlen($data);
|
||||
});
|
||||
curl_setopt($this->curl, CURLOPT_WRITEFUNCTION, function ($ch, $data) {
|
||||
return \strlen($data);
|
||||
});
|
||||
curl_multi_add_handle($this->mh, $this->curl);
|
||||
|
||||
$stillRunning = null;
|
||||
while (true) {
|
||||
do {
|
||||
$mrc = curl_multi_exec($this->mh, $stillRunning);
|
||||
} while (CURLM_CALL_MULTI_PERFORM === $mrc);
|
||||
|
||||
$info = curl_multi_info_read($this->mh);
|
||||
while (false !== $info && $info['msg'] == CURLMSG_DONE) {
|
||||
if (CURLMSG_DONE !== $info['msg']) {
|
||||
continue;
|
||||
}
|
||||
die("Start handle request.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function addServerPushCallback(): void
|
||||
{
|
||||
|
||||
$callback = static function () {
|
||||
return CURL_PUSH_OK;
|
||||
};
|
||||
|
||||
curl_multi_setopt($this->mh, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX);
|
||||
curl_multi_setopt($this->mh, CURLMOPT_PUSHFUNCTION, $callback);
|
||||
}
|
||||
}
|
||||
|
||||
$buzz = new MyHttpClient();
|
||||
$buzz->sendRequest();
|
||||
--EXPECT--
|
||||
Start handle request.
|
||||
|
||||
@@ -45,7 +45,7 @@ GSSAPI => No
|
||||
KERBEROS5 => Yes
|
||||
UNIX_SOCKETS => No
|
||||
PSL => No
|
||||
Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtsp, scp, sftp, smb, smbs, smtp, smtps, telnet, tftp
|
||||
Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, pop3, pop3s, rtsp, scp, sftp, smb, smbs, smtp, smtps, telnet, tftp
|
||||
Host => %s-pc-win32
|
||||
SSL Version => OpenSSL/%s
|
||||
ZLib Version => %s
|
||||
|
||||
@@ -18,6 +18,6 @@ curl_close($ch);
|
||||
|
||||
|
||||
?>
|
||||
--EXPECTREGEX--
|
||||
string\(\d+\) "([^\r\n]*rotocol[^\r\n]+|Could not resolve host: .+)"
|
||||
int\(\d\)
|
||||
--EXPECTF--
|
||||
string(%d) "%Srotocol%s"
|
||||
int(1)
|
||||
+2
-8
@@ -1,14 +1,8 @@
|
||||
dnl $Id$
|
||||
dnl config.m4 for date extension
|
||||
|
||||
dnl Check for headers needed by timelib
|
||||
AC_CHECK_HEADERS([ \
|
||||
strings.h \
|
||||
io.h
|
||||
])
|
||||
|
||||
dnl Check for strtoll, atoll
|
||||
AC_CHECK_FUNCS(strtoll atoll)
|
||||
sinclude(ext/date/lib/timelib.m4)
|
||||
sinclude(lib/timelib.m4)
|
||||
|
||||
PHP_DATE_CFLAGS="-I@ext_builddir@/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DHAVE_TIMELIB_CONFIG_H=1"
|
||||
timelib_sources="lib/astro.c lib/dow.c lib/parse_date.c lib/parse_tz.c
|
||||
|
||||
@@ -35,10 +35,7 @@ timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two)
|
||||
|
||||
rt = timelib_rel_time_ctor();
|
||||
rt->invert = 0;
|
||||
if (
|
||||
(one->sse > two->sse) ||
|
||||
(one->sse == two->sse && one->us > two->us)
|
||||
) {
|
||||
if (one->sse > two->sse) {
|
||||
swp = two;
|
||||
two = one;
|
||||
one = swp;
|
||||
|
||||
@@ -310,9 +310,9 @@ typedef struct _timelib_tzdb {
|
||||
# define timelib_free free
|
||||
#endif
|
||||
|
||||
#define TIMELIB_VERSION 201709
|
||||
#define TIMELIB_EXTENDED_VERSION 20170900
|
||||
#define TIMELIB_ASCII_VERSION "2017.09"
|
||||
#define TIMELIB_VERSION 201708
|
||||
#define TIMELIB_EXTENDED_VERSION 20170800
|
||||
#define TIMELIB_ASCII_VERSION "2017.08"
|
||||
|
||||
#define TIMELIB_NONE 0x00
|
||||
#define TIMELIB_OVERRIDE_TIME 0x01
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
dnl
|
||||
dnl TL_DEF_HAVE(what [, why])
|
||||
dnl
|
||||
dnl Generates 'AC_DEFINE(HAVE_WHAT, 1, [WHY])'
|
||||
dnl
|
||||
AC_DEFUN([TL_DEF_HAVE],[AC_DEFINE([HAVE_]translit($1,a-z_.-,A-Z___),1,[ $2 ])])dnl
|
||||
|
||||
dnl
|
||||
dnl TL_CHECK_INT_TYPE(type)
|
||||
dnl
|
||||
AC_DEFUN([TL_CHECK_INT_TYPE],[
|
||||
AC_CACHE_CHECK([for $1], ac_cv_int_type_$1, [
|
||||
AC_TRY_COMPILE([
|
||||
#if HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
#if HAVE_INTTYPES_H
|
||||
# include <inttypes.h>
|
||||
#elif HAVE_STDINT_H
|
||||
# include <stdint.h>
|
||||
#endif],
|
||||
[if (($1 *) 0)
|
||||
return 0;
|
||||
if (sizeof ($1))
|
||||
return 0;
|
||||
], [ac_cv_int_type_$1=yes], [ac_cv_int_type_$1=no])
|
||||
])
|
||||
if test "$ac_cv_int_type_$1" = "yes"; then
|
||||
TL_DEF_HAVE($1, [Define if $1 type is present.])
|
||||
fi
|
||||
])dnl
|
||||
|
||||
dnl
|
||||
dnl AC_TIMELIB_C_BIGENDIAN
|
||||
dnl Replacement macro for AC_C_BIGENDIAN
|
||||
dnl
|
||||
AC_DEFUN([AC_TIMELIB_C_BIGENDIAN],
|
||||
[AC_CACHE_CHECK([whether byte ordering is bigendian], ac_cv_c_bigendian_php,
|
||||
[
|
||||
ac_cv_c_bigendian_php=unknown
|
||||
AC_TRY_RUN(
|
||||
[
|
||||
int main(void)
|
||||
{
|
||||
short one = 1;
|
||||
char *cp = (char *)&one;
|
||||
|
||||
if (*cp == 0) {
|
||||
return(0);
|
||||
} else {
|
||||
return(1);
|
||||
}
|
||||
}
|
||||
], [ac_cv_c_bigendian_php=yes], [ac_cv_c_bigendian_php=no], [ac_cv_c_bigendian_php=unknown])
|
||||
])
|
||||
if test $ac_cv_c_bigendian_php = yes; then
|
||||
AC_DEFINE(WORDS_BIGENDIAN, [], [Define if processor uses big-endian word])
|
||||
fi
|
||||
])dnl
|
||||
|
||||
dnl Check for types, sizes, etc. needed by timelib
|
||||
AC_CHECK_SIZEOF(long, 8)
|
||||
AC_CHECK_SIZEOF(int, 4)
|
||||
TL_CHECK_INT_TYPE(int32_t)
|
||||
TL_CHECK_INT_TYPE(uint32_t)
|
||||
|
||||
dnl Check for headers needed by timelib
|
||||
AC_CHECK_HEADERS([ \
|
||||
sys/time.h \
|
||||
sys/types.h \
|
||||
stdint.h \
|
||||
dirent.h \
|
||||
string.h \
|
||||
strings.h \
|
||||
unistd.h \
|
||||
io.h
|
||||
])
|
||||
|
||||
dnl Check for strtoll, atoll
|
||||
AC_CHECK_FUNCS(strtoll atoll strftime gettimeofday)
|
||||
+998
-1306
File diff suppressed because it is too large.
Load diff
+10
-38
@@ -543,7 +543,6 @@ const zend_function_entry date_funcs_period[] = {
|
||||
PHP_ME(DatePeriod, getStartDate, NULL, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(DatePeriod, getEndDate, NULL, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(DatePeriod, getDateInterval, NULL, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(DatePeriod, getRecurrences, NULL, ZEND_ACC_PUBLIC)
|
||||
PHP_FE_END
|
||||
};
|
||||
|
||||
@@ -4436,21 +4435,12 @@ PHP_FUNCTION(date_interval_create_from_date_string)
|
||||
Z_PARAM_STR(time_str)
|
||||
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
||||
|
||||
time = timelib_strtotime(ZSTR_VAL(time_str), ZSTR_LEN(time_str), &err, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper);
|
||||
|
||||
if (err->error_count > 0) {
|
||||
php_error_docref(NULL, E_WARNING, "Unknown or bad format (%s) at position %d (%c): %s", ZSTR_VAL(time_str),
|
||||
err->error_messages[0].position, err->error_messages[0].character ? err->error_messages[0].character : ' ', err->error_messages[0].message);
|
||||
RETVAL_FALSE;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
php_date_instantiate(date_ce_interval, return_value);
|
||||
|
||||
time = timelib_strtotime(ZSTR_VAL(time_str), ZSTR_LEN(time_str), &err, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper);
|
||||
diobj = Z_PHPINTERVAL_P(return_value);
|
||||
diobj->diff = timelib_rel_time_clone(&time->relative);
|
||||
diobj->initialized = 1;
|
||||
|
||||
cleanup:
|
||||
timelib_time_dtor(time);
|
||||
timelib_error_container_dtor(err);
|
||||
}
|
||||
@@ -4645,10 +4635,6 @@ PHP_METHOD(DatePeriod, __construct)
|
||||
dpobj->end = clone;
|
||||
}
|
||||
}
|
||||
|
||||
if (dpobj->end == NULL && recurrences < 1) {
|
||||
php_error_docref(NULL, E_WARNING, "The recurrence count '%d' is invalid. Needs to be > 0", (int) recurrences);
|
||||
}
|
||||
|
||||
/* options */
|
||||
dpobj->include_start_date = !(options & PHP_DATE_PERIOD_EXCLUDE_START_DATE);
|
||||
@@ -4741,27 +4727,6 @@ PHP_METHOD(DatePeriod, getDateInterval)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto int DatePeriod::getRecurrences()
|
||||
Get recurrences.
|
||||
*/
|
||||
PHP_METHOD(DatePeriod, getRecurrences)
|
||||
{
|
||||
php_period_obj *dpobj;
|
||||
|
||||
if (zend_parse_parameters_none() == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
dpobj = Z_PHPPERIOD_P(getThis());
|
||||
|
||||
if (0 == dpobj->recurrences - dpobj->include_start_date) {
|
||||
return;
|
||||
}
|
||||
|
||||
RETURN_LONG(dpobj->recurrences - dpobj->include_start_date);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int check_id_allowed(char *id, zend_long what) /* {{{ */
|
||||
{
|
||||
if (what & PHP_DATE_TIMEZONE_GROUP_AFRICA && strncasecmp(id, "Africa/", 7) == 0) return 1;
|
||||
@@ -5313,6 +5278,7 @@ PHP_METHOD(DatePeriod, __wakeup)
|
||||
/* {{{ date_period_read_property */
|
||||
static zval *date_period_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv)
|
||||
{
|
||||
zval *zv;
|
||||
if (type != BP_VAR_IS && type != BP_VAR_R) {
|
||||
zend_throw_error(NULL, "Retrieval of DatePeriod properties for modification is unsupported");
|
||||
return &EG(uninitialized_zval);
|
||||
@@ -5320,7 +5286,13 @@ static zval *date_period_read_property(zval *object, zval *member, int type, voi
|
||||
|
||||
Z_OBJPROP_P(object); /* build properties hash table */
|
||||
|
||||
return std_object_handlers.read_property(object, member, type, cache_slot, rv);
|
||||
zv = std_object_handlers.read_property(object, member, type, cache_slot, rv);
|
||||
if (Z_TYPE_P(zv) == IS_OBJECT && Z_OBJ_HANDLER_P(zv, clone_obj)) {
|
||||
/* defensive copy */
|
||||
ZVAL_OBJ(zv, Z_OBJ_HANDLER_P(zv, clone_obj)(zv));
|
||||
}
|
||||
|
||||
return zv;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
@@ -112,7 +112,6 @@ PHP_METHOD(DatePeriod, __set_state);
|
||||
PHP_METHOD(DatePeriod, getStartDate);
|
||||
PHP_METHOD(DatePeriod, getEndDate);
|
||||
PHP_METHOD(DatePeriod, getDateInterval);
|
||||
PHP_METHOD(DatePeriod, getRecurrences);
|
||||
|
||||
/* Options and Configuration */
|
||||
PHP_FUNCTION(date_default_timezone_set);
|
||||
|
||||
@@ -8,7 +8,6 @@ $start = new DateTime('2000-01-01 00:00:00', new DateTimeZone('Europe/Berlin'));
|
||||
$end = new DateTime('2000-01-31 00:00:00', new DateTimeZone('UTC'));
|
||||
$interval = new DateInterval('P1D');
|
||||
$period = new DatePeriod($start, $interval, $end);
|
||||
$recurrences = 4;
|
||||
|
||||
var_dump($period->getStartDate()->format('Y-m-d H:i:s'));
|
||||
var_dump($period->getStartDate()->getTimeZone()->getName());
|
||||
@@ -17,17 +16,6 @@ var_dump($period->getEndDate()->format('Y-m-d H:i:s'));
|
||||
var_dump($period->getEndDate()->getTimeZone()->getName());
|
||||
|
||||
var_dump($period->getDateInterval()->format('%R%y-%m-%d-%h-%i-%s'));
|
||||
var_dump($period->getRecurrences());
|
||||
|
||||
$periodWithRecurrences = new DatePeriod($start, $interval, $recurrences);
|
||||
|
||||
var_dump($periodWithRecurrences->getRecurrences());
|
||||
var_dump($periodWithRecurrences->getEndDate());
|
||||
|
||||
$periodWithRecurrencesWithoutStart = new DatePeriod($start, $interval, $recurrences, DatePeriod::EXCLUDE_START_DATE);
|
||||
|
||||
var_dump($periodWithRecurrences->getRecurrences());
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(19) "2000-01-01 00:00:00"
|
||||
@@ -35,7 +23,3 @@ string(13) "Europe/Berlin"
|
||||
string(19) "2000-01-31 00:00:00"
|
||||
string(3) "UTC"
|
||||
string(12) "+0-0-1-0-0-0"
|
||||
NULL
|
||||
int(4)
|
||||
NULL
|
||||
int(4)
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
DatePeriod: Test wrong recurrence parameter on __construct
|
||||
--FILE--
|
||||
<?php
|
||||
try {
|
||||
new DatePeriod(new DateTime('yesterday'), new DateInterval('P1D'), 0);
|
||||
} catch (Exception $exception) {
|
||||
echo $exception->getMessage(), "\n";
|
||||
}
|
||||
|
||||
try {
|
||||
new DatePeriod(new DateTime('yesterday'), new DateInterval('P1D'),-1);
|
||||
} catch (Exception $exception) {
|
||||
echo $exception->getMessage(), "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
DatePeriod::__construct(): The recurrence count '0' is invalid. Needs to be > 0
|
||||
DatePeriod::__construct(): The recurrence count '-1' is invalid. Needs to be > 0
|
||||
@@ -95,11 +95,11 @@ print "wanted=Friday 00:00:00\n\n";
|
||||
|
||||
print "TZ=Pacific/Kwajalein - wrong day.\n";
|
||||
date_default_timezone_set("Pacific/Kwajalein");
|
||||
$tStamp = mktime (17, 17, 17, 1, 8627, 1970);
|
||||
$tStamp = mktime (17, 17, 17, 1, 8626, 1970);
|
||||
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
|
||||
$strtotime_tstamp = strtotime("next Saturday", $tStamp);
|
||||
$strtotime_tstamp = strtotime("next Friday", $tStamp);
|
||||
print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
|
||||
print "wanted=Sunday 00:00:00\n\n";
|
||||
print "wanted=Friday 00:00:00\n\n";
|
||||
|
||||
print "TZ=Asia/Ulan_Bator - wrong day.\n";
|
||||
date_default_timezone_set("Asia/Ulan_Bator");
|
||||
@@ -256,9 +256,9 @@ result=Friday 2003-04-04 00:00:00 EEST 1
|
||||
wanted=Friday 00:00:00
|
||||
|
||||
TZ=Pacific/Kwajalein - wrong day.
|
||||
tStamp=Saturday 1993-08-14 17:17:17 -12 0
|
||||
result=Sunday 1993-08-22 00:00:00 +12 0
|
||||
wanted=Sunday 00:00:00
|
||||
tStamp=Friday 1993-08-13 17:17:17 -12 0
|
||||
result=Saturday 1993-08-21 00:00:00 +12 0
|
||||
wanted=Friday 00:00:00
|
||||
|
||||
TZ=Asia/Ulan_Bator - wrong day.
|
||||
tStamp=Saturday 2001-09-22 17:17:17 +09 1
|
||||
|
||||
@@ -132,11 +132,11 @@ print "wanted=Wednesday 00:15:00\n\n";
|
||||
|
||||
print "TZ=Pacific/Nauru - Is it OK for this to be 0:30? yes\n";
|
||||
date_default_timezone_set('Pacific/Nauru');
|
||||
$tStamp = mktime (17, 17, 17, 2, 3, 1979);
|
||||
$tStamp = mktime (17, 17, 17, 1, 3401, 1970);
|
||||
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
|
||||
$strtotime_tstamp = strtotime("next Saturday +2 hours", $tStamp);
|
||||
$strtotime_tstamp = strtotime("next Tuesday", $tStamp);
|
||||
print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
|
||||
print "wanted=Saturday 02:30:00\n\n";
|
||||
print "wanted=Tuesday 00:30:00\n\n";
|
||||
|
||||
print "TZ=Pacific/Niue - Is it OK for this to be 0:30 AM? yes\n";
|
||||
date_default_timezone_set('Pacific/Niue');
|
||||
@@ -292,9 +292,9 @@ result=Wednesday 1986-01-01 00:15:00 +0545 0
|
||||
wanted=Wednesday 00:15:00
|
||||
|
||||
TZ=Pacific/Nauru - Is it OK for this to be 0:30? yes
|
||||
tStamp=Saturday 1979-02-03 17:17:17 +1130 0
|
||||
result=Saturday 1979-02-10 02:30:00 +12 0
|
||||
wanted=Saturday 02:30:00
|
||||
tStamp=Tuesday 1979-04-24 17:17:17 +1130 0
|
||||
result=Tuesday 1979-05-01 00:30:00 +12 0
|
||||
wanted=Tuesday 00:30:00
|
||||
|
||||
TZ=Pacific/Niue - Is it OK for this to be 0:30 AM? yes
|
||||
tStamp=Sunday 1978-09-24 17:17:17 -1130 0
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77097 (DateTime::diff gives wrong diff when the actual diff is less than 1 second)
|
||||
--FILE--
|
||||
<?php
|
||||
$now = new DateTime('2018-11-03 11:34:20.781751');
|
||||
$ago = new DateTime('2018-11-03 11:34:20.000000');
|
||||
|
||||
$diff = $now->diff($ago);
|
||||
var_dump($diff->invert, $diff->s, $diff->f);
|
||||
|
||||
$diff = $ago->diff($now);
|
||||
var_dump($diff->invert, $diff->s, $diff->f);
|
||||
|
||||
$diff = $now->diff($ago, true);
|
||||
var_dump($diff->invert, $diff->s, $diff->f);
|
||||
|
||||
$diff = $ago->diff($now, true);
|
||||
var_dump($diff->invert, $diff->s, $diff->f);
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(1)
|
||||
int(0)
|
||||
float(0.781751)
|
||||
int(0)
|
||||
int(0)
|
||||
float(0.781751)
|
||||
int(0)
|
||||
int(0)
|
||||
float(0.781751)
|
||||
int(0)
|
||||
int(0)
|
||||
float(0.781751)
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
Test date_interval_create_from_date_string() function : nonsense data
|
||||
--FILE--
|
||||
<?php
|
||||
$i = date_interval_create_from_date_string("foobar");
|
||||
var_dump($i);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: date_interval_create_from_date_string(): Unknown or bad format (foobar) at position 0 (f): The timezone could not be found in the database in %sdate_interval_create_from_date_string_broken.php on line 2
|
||||
bool(false)
|
||||
@@ -4,9 +4,41 @@ Test date_interval_create_from_date_string() function : null parameter
|
||||
Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
|
||||
--FILE--
|
||||
<?php
|
||||
$i = date_interval_create_from_date_string(null);
|
||||
$i = date_interval_create_from_date_string(null); //returns a empty object
|
||||
var_dump($i);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: date_interval_create_from_date_string(): Unknown or bad format () at position 0 ( ): Empty string in %sdate_interval_create_from_date_string_nullparam.php on line 2
|
||||
bool(false)
|
||||
object(DateInterval)#%d (16) {
|
||||
["y"]=>
|
||||
int(0)
|
||||
["m"]=>
|
||||
int(0)
|
||||
["d"]=>
|
||||
int(0)
|
||||
["h"]=>
|
||||
int(0)
|
||||
["i"]=>
|
||||
int(0)
|
||||
["s"]=>
|
||||
int(0)
|
||||
["f"]=>
|
||||
float(0)
|
||||
["weekday"]=>
|
||||
int(0)
|
||||
["weekday_behavior"]=>
|
||||
int(0)
|
||||
["first_last_day_of"]=>
|
||||
int(0)
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
int(0)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(0)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
@@ -5,7 +5,7 @@ date_modify() function [1]
|
||||
--FILE--
|
||||
<?php
|
||||
date_default_timezone_set("Pacific/Kwajalein");
|
||||
$ts = date_create("Fri Aug 20 1993 23:59:59");
|
||||
$ts = date_create("Thu Aug 19 1993 23:59:59");
|
||||
echo date_format($ts, 'D, d M Y H:i:s T'), "\n";
|
||||
$ts->modify("+1 second");
|
||||
echo date_format($ts, 'D, d M Y H:i:s T'), "\n";
|
||||
@@ -22,8 +22,8 @@ $ts->modify("+ 1 hour 1 second");
|
||||
echo date_format($ts, 'D, d M Y H:i:s T'), "\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
Fri, 20 Aug 1993 23:59:59 -12
|
||||
Sun, 22 Aug 1993 00:00:00 +12
|
||||
Thu, 19 Aug 1993 23:59:59 -12
|
||||
Sat, 21 Aug 1993 00:00:00 +12
|
||||
Sun, 27 Mar 2005 01:59:59 CET
|
||||
Sun, 27 Mar 2005 03:00:00 CEST
|
||||
Sun, 30 Oct 2005 01:59:59 CEST
|
||||
|
||||
+27
-57
@@ -2062,10 +2062,10 @@ static int exif_file_sections_free(image_info_type *ImageInfo)
|
||||
/* {{{ exif_iif_add_value
|
||||
Add a value to image_info
|
||||
*/
|
||||
static void exif_iif_add_value(image_info_type *image_info, int section_index, char *name, int tag, int format, int length, void* value, size_t value_len, int motorola_intel)
|
||||
static void exif_iif_add_value(image_info_type *image_info, int section_index, char *name, int tag, int format, int length, void* value, int motorola_intel)
|
||||
{
|
||||
size_t idex;
|
||||
void *vptr, *vptr_end;
|
||||
void *vptr;
|
||||
image_info_value *info_value;
|
||||
image_info_data *info_data;
|
||||
image_info_data *list;
|
||||
@@ -2087,12 +2087,8 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
|
||||
|
||||
switch (format) {
|
||||
case TAG_FMT_STRING:
|
||||
if (length > value_len) {
|
||||
exif_error_docref("exif_iif_add_value" EXIFERR_CC, image_info, E_WARNING, "length > value_len: %d > %zu", length, value_len);
|
||||
value = NULL;
|
||||
}
|
||||
if (value) {
|
||||
length = (int)php_strnlen(value, length);
|
||||
length = php_strnlen(value, length);
|
||||
info_value->s = estrndup(value, length);
|
||||
info_data->length = length;
|
||||
} else {
|
||||
@@ -2114,10 +2110,6 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
|
||||
if (!length)
|
||||
break;
|
||||
case TAG_FMT_UNDEFINED:
|
||||
if (length > value_len) {
|
||||
exif_error_docref("exif_iif_add_value" EXIFERR_CC, image_info, E_WARNING, "length > value_len: %d > %zu", length, value_len);
|
||||
value = NULL;
|
||||
}
|
||||
if (value) {
|
||||
if (tag == TAG_MAKER_NOTE) {
|
||||
length = (int) php_strnlen(value, length);
|
||||
@@ -2148,12 +2140,7 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
|
||||
} else {
|
||||
info_value = &info_data->value;
|
||||
}
|
||||
vptr_end = (char *) value + value_len;
|
||||
for (idex=0,vptr=value; idex<(size_t)length; idex++,vptr=(char *) vptr + php_tiff_bytes_per_format[format]) {
|
||||
if ((char *) vptr_end - (char *) vptr < php_tiff_bytes_per_format[format]) {
|
||||
exif_error_docref("exif_iif_add_value" EXIFERR_CC, image_info, E_WARNING, "Value too short");
|
||||
break;
|
||||
}
|
||||
if (length>1) {
|
||||
info_value = &info_data->value.list[idex];
|
||||
}
|
||||
@@ -2189,7 +2176,7 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
|
||||
php_error_docref(NULL, E_WARNING, "Found value of type single");
|
||||
#endif
|
||||
info_value->f = *(float *)value;
|
||||
break;
|
||||
|
||||
case TAG_FMT_DOUBLE:
|
||||
#ifdef EXIF_DEBUG
|
||||
php_error_docref(NULL, E_WARNING, "Found value of type double");
|
||||
@@ -2207,9 +2194,9 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
|
||||
/* {{{ exif_iif_add_tag
|
||||
Add a tag from IFD to image_info
|
||||
*/
|
||||
static void exif_iif_add_tag(image_info_type *image_info, int section_index, char *name, int tag, int format, size_t length, void* value, size_t value_len)
|
||||
static void exif_iif_add_tag(image_info_type *image_info, int section_index, char *name, int tag, int format, size_t length, void* value)
|
||||
{
|
||||
exif_iif_add_value(image_info, section_index, name, tag, format, (int)length, value, value_len, image_info->motorola_intel);
|
||||
exif_iif_add_value(image_info, section_index, name, tag, format, (int)length, value, image_info->motorola_intel);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -2453,7 +2440,7 @@ static void add_assoc_image_info(zval *value, int sub_array, image_info_type *im
|
||||
break;
|
||||
|
||||
case TAG_FMT_URATIONAL:
|
||||
snprintf(buffer, sizeof(buffer), "%u/%u", info_value->ur.num, info_value->ur.den);
|
||||
snprintf(buffer, sizeof(buffer), "%i/%i", info_value->ur.num, info_value->ur.den);
|
||||
if (l==1) {
|
||||
add_assoc_string(&tmpi, name, buffer);
|
||||
} else {
|
||||
@@ -2630,7 +2617,7 @@ static void add_assoc_image_info(zval *value, int sub_array, image_info_type *im
|
||||
*/
|
||||
static void exif_process_COM (image_info_type *image_info, char *value, size_t length)
|
||||
{
|
||||
exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_STRING, length-2, value+2, length-2);
|
||||
exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_STRING, length-2, value+2);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -2645,17 +2632,17 @@ static void exif_process_CME (image_info_type *image_info, char *value, size_t l
|
||||
if (length>3) {
|
||||
switch(value[2]) {
|
||||
case 0:
|
||||
exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_UNDEFINED, length, value, length);
|
||||
exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_UNDEFINED, length, value);
|
||||
break;
|
||||
case 1:
|
||||
exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_STRING, length, value, length);
|
||||
exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_STRING, length, value);
|
||||
break;
|
||||
default:
|
||||
php_error_docref(NULL, E_NOTICE, "Undefined JPEG2000 comment encoding");
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_UNDEFINED, 0, NULL, 0);
|
||||
exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_UNDEFINED, 0, NULL);
|
||||
php_error_docref(NULL, E_NOTICE, "JPEG2000 comment section too small");
|
||||
}
|
||||
}
|
||||
@@ -3165,7 +3152,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
||||
break;
|
||||
}
|
||||
|
||||
if (value_len < 2 || maker_note->offset >= value_len - 1) {
|
||||
if (maker_note->offset >= value_len) {
|
||||
/* Do not go past the value end */
|
||||
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "IFD data too short: 0x%04X offset 0x%04X", value_len, maker_note->offset);
|
||||
return FALSE;
|
||||
@@ -3220,7 +3207,6 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
||||
#endif
|
||||
default:
|
||||
case MN_OFFSET_NORMAL:
|
||||
data_len = value_len;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -3228,10 +3214,6 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
||||
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD size: 2 + 0x%04X*12 = 0x%04X > 0x%04X", NumDirEntries, 2+NumDirEntries*12, value_len);
|
||||
return FALSE;
|
||||
}
|
||||
if ((dir_start - value_ptr) > value_len - (2+NumDirEntries*12)) {
|
||||
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD size: 0x%04X > 0x%04X", (dir_start - value_ptr) + (2+NumDirEntries*12), value_len);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
for (de=0;de<NumDirEntries;de++) {
|
||||
if (!exif_process_IFD_TAG(ImageInfo, dir_start + 2 + 12 * de,
|
||||
@@ -3253,7 +3235,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
||||
static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, char *offset_base, size_t IFDlength, size_t displacement, int section_index, int ReadNextIFD, tag_table_type tag_table)
|
||||
{
|
||||
size_t length;
|
||||
unsigned int tag, format, components;
|
||||
int tag, format, components;
|
||||
char *value_ptr, tagname[64], cbuf[32], *outside=NULL;
|
||||
size_t byte_count, offset_val, fpos, fgot;
|
||||
int64_t byte_count_signed;
|
||||
@@ -3304,7 +3286,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
|
||||
offset_base is ImageInfo->file.list[sn].data-dir_offset
|
||||
dir_entry - offset_base is dir_offset+2+i*12
|
||||
*/
|
||||
if (byte_count > IFDlength || offset_val > IFDlength-byte_count || value_ptr < dir_entry || offset_val < (size_t)(dir_entry-offset_base) || dir_entry <= offset_base) {
|
||||
if (byte_count > IFDlength || offset_val > IFDlength-byte_count || value_ptr < dir_entry || offset_val < (size_t)(dir_entry-offset_base)) {
|
||||
/* It is important to check for IMAGE_FILETYPE_TIFF
|
||||
* JPEG does not use absolute pointers instead its pointers are
|
||||
* relative to the start of the TIFF header in APP1 section. */
|
||||
@@ -3423,10 +3405,6 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
|
||||
break;
|
||||
|
||||
case TAG_USERCOMMENT:
|
||||
EFREE_IF(ImageInfo->UserComment);
|
||||
ImageInfo->UserComment = NULL;
|
||||
EFREE_IF(ImageInfo->UserCommentEncoding);
|
||||
ImageInfo->UserCommentEncoding = NULL;
|
||||
ImageInfo->UserCommentLength = exif_process_user_comment(ImageInfo, &(ImageInfo->UserComment), &(ImageInfo->UserCommentEncoding), value_ptr, byte_count);
|
||||
break;
|
||||
|
||||
@@ -3568,7 +3546,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
|
||||
}
|
||||
}
|
||||
}
|
||||
exif_iif_add_tag(ImageInfo, section_index, exif_get_tagname(tag, tagname, sizeof(tagname), tag_table), tag, format, components, value_ptr, byte_count);
|
||||
exif_iif_add_tag(ImageInfo, section_index, exif_get_tagname(tag, tagname, sizeof(tagname), tag_table), tag, format, components, value_ptr);
|
||||
EFREE_IF(outside);
|
||||
return TRUE;
|
||||
}
|
||||
@@ -3730,10 +3708,10 @@ static void exif_process_APP12(image_info_type *ImageInfo, char *buffer, size_t
|
||||
size_t l1, l2=0;
|
||||
|
||||
if ((l1 = php_strnlen(buffer+2, length-2)) > 0) {
|
||||
exif_iif_add_tag(ImageInfo, SECTION_APP12, "Company", TAG_NONE, TAG_FMT_STRING, l1, buffer+2, l1);
|
||||
exif_iif_add_tag(ImageInfo, SECTION_APP12, "Company", TAG_NONE, TAG_FMT_STRING, l1, buffer+2);
|
||||
if (length > 2+l1+1) {
|
||||
l2 = php_strnlen(buffer+2+l1+1, length-2-l1-1);
|
||||
exif_iif_add_tag(ImageInfo, SECTION_APP12, "Info", TAG_NONE, TAG_FMT_STRING, l2, buffer+2+l1+1, l2);
|
||||
exif_iif_add_tag(ImageInfo, SECTION_APP12, "Info", TAG_NONE, TAG_FMT_STRING, l2, buffer+2+l1+1);
|
||||
}
|
||||
}
|
||||
#ifdef EXIF_DEBUG
|
||||
@@ -3947,10 +3925,8 @@ static int exif_scan_thumbnail(image_info_type *ImageInfo)
|
||||
if (c == 0xFF)
|
||||
return FALSE;
|
||||
marker = c;
|
||||
if (pos>=ImageInfo->Thumbnail.size)
|
||||
return FALSE;
|
||||
length = php_jpg_get16(data+pos);
|
||||
if (length > ImageInfo->Thumbnail.size || pos >= ImageInfo->Thumbnail.size - length) {
|
||||
if (pos+length>=ImageInfo->Thumbnail.size) {
|
||||
return FALSE;
|
||||
}
|
||||
#ifdef EXIF_DEBUG
|
||||
@@ -3971,10 +3947,6 @@ static int exif_scan_thumbnail(image_info_type *ImageInfo)
|
||||
case M_SOF14:
|
||||
case M_SOF15:
|
||||
/* handle SOFn block */
|
||||
if (length < 8 || ImageInfo->Thumbnail.size - 8 < pos) {
|
||||
/* exif_process_SOFn needs 8 bytes */
|
||||
return FALSE;
|
||||
}
|
||||
exif_process_SOFn(data+pos, marker, &sof_info);
|
||||
ImageInfo->Thumbnail.height = sof_info.height;
|
||||
ImageInfo->Thumbnail.width = sof_info.width;
|
||||
@@ -4012,10 +3984,10 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
|
||||
tag_table_type tag_table = exif_get_tag_table(section_index);
|
||||
|
||||
if (ImageInfo->ifd_nesting_level > MAX_IFD_NESTING_LEVEL) {
|
||||
return FALSE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (ImageInfo->FileSize >= 2 && ImageInfo->FileSize - 2 >= dir_offset) {
|
||||
if (ImageInfo->FileSize >= dir_offset+2) {
|
||||
sn = exif_file_sections_add(ImageInfo, M_PSEUDO, 2, NULL);
|
||||
#ifdef EXIF_DEBUG
|
||||
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read from TIFF: filesize(x%04X), IFD dir(x%04X + x%04X)", ImageInfo->FileSize, dir_offset, 2);
|
||||
@@ -4023,8 +3995,8 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
|
||||
php_stream_seek(ImageInfo->infile, dir_offset, SEEK_SET); /* we do not know the order of sections */
|
||||
php_stream_read(ImageInfo->infile, (char*)ImageInfo->file.list[sn].data, 2);
|
||||
num_entries = php_ifd_get16u(ImageInfo->file.list[sn].data, ImageInfo->motorola_intel);
|
||||
dir_size = 2/*num dir entries*/ +12/*length of entry*/*(size_t)num_entries +4/* offset to next ifd (points to thumbnail or NULL)*/;
|
||||
if (ImageInfo->FileSize >= dir_size && ImageInfo->FileSize - dir_size >= dir_offset) {
|
||||
dir_size = 2/*num dir entries*/ +12/*length of entry*/*num_entries +4/* offset to next ifd (points to thumbnail or NULL)*/;
|
||||
if (ImageInfo->FileSize >= dir_offset+dir_size) {
|
||||
#ifdef EXIF_DEBUG
|
||||
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read from TIFF: filesize(x%04X), IFD dir(x%04X + x%04X), IFD entries(%d)", ImageInfo->FileSize, dir_offset+2, dir_size-2, num_entries);
|
||||
#endif
|
||||
@@ -4107,9 +4079,9 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ImageInfo->FileSize >= ImageInfo->file.list[sn].size && ImageInfo->FileSize - ImageInfo->file.list[sn].size >= dir_offset) {
|
||||
if (ImageInfo->FileSize >= dir_offset + ImageInfo->file.list[sn].size) {
|
||||
if (ifd_size > dir_size) {
|
||||
if (ImageInfo->FileSize < ifd_size || dir_offset > ImageInfo->FileSize - ifd_size) {
|
||||
if (dir_offset + ifd_size > ImageInfo->FileSize) {
|
||||
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Error in TIFF: filesize(x%04X) less than size of IFD(x%04X + x%04X)", ImageInfo->FileSize, dir_offset, ifd_size);
|
||||
return FALSE;
|
||||
}
|
||||
@@ -4603,7 +4575,7 @@ PHP_FUNCTION(exif_read_data)
|
||||
if (ImageInfo.Thumbnail.size) {
|
||||
if (read_thumbnail) {
|
||||
/* not exif_iif_add_str : this is a buffer */
|
||||
exif_iif_add_tag(&ImageInfo, SECTION_THUMBNAIL, "THUMBNAIL", TAG_NONE, TAG_FMT_UNDEFINED, ImageInfo.Thumbnail.size, ImageInfo.Thumbnail.data, ImageInfo.Thumbnail.size);
|
||||
exif_iif_add_tag(&ImageInfo, SECTION_THUMBNAIL, "THUMBNAIL", TAG_NONE, TAG_FMT_UNDEFINED, ImageInfo.Thumbnail.size, ImageInfo.Thumbnail.data);
|
||||
}
|
||||
if (!ImageInfo.Thumbnail.width || !ImageInfo.Thumbnail.height) {
|
||||
/* try to evaluate if thumbnail data is present */
|
||||
@@ -4706,9 +4678,7 @@ PHP_FUNCTION(exif_thumbnail)
|
||||
ZVAL_STRINGL(return_value, ImageInfo.Thumbnail.data, ImageInfo.Thumbnail.size);
|
||||
if (arg_c >= 3) {
|
||||
if (!ImageInfo.Thumbnail.width || !ImageInfo.Thumbnail.height) {
|
||||
if (!exif_scan_thumbnail(&ImageInfo)) {
|
||||
ImageInfo.Thumbnail.width = ImageInfo.Thumbnail.height = 0;
|
||||
}
|
||||
exif_scan_thumbnail(&ImageInfo);
|
||||
}
|
||||
zval_dtor(z_width);
|
||||
zval_dtor(z_height);
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 25 KiB |
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74428 (Unsigned rational numbers are written out as signed rationals)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
|
||||
--INI--
|
||||
output_handler=
|
||||
zlib.output_compression=0
|
||||
--FILE--
|
||||
<?php
|
||||
$infile = dirname(__FILE__).'/DJI_0245_tiny.JPG';
|
||||
$tags = exif_read_data($infile);
|
||||
echo $tags['GPSLatitude'][2], PHP_EOL;
|
||||
echo $tags['GPSLongitude'][2], PHP_EOL;
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
156691934/70000000
|
||||
2672193571/70000000
|
||||
===DONE===
|
||||
Binary file not shown.
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug 77540 (Invalid Read on exif_process_SOFn)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
|
||||
--FILE--
|
||||
<?php
|
||||
$width = $height = 42;
|
||||
$s = exif_thumbnail(__DIR__."/bug77540.jpg", $width, $height);
|
||||
echo "Width ".$width."\n";
|
||||
echo "Height ".$height."\n";
|
||||
?>
|
||||
DONE
|
||||
--EXPECTF--
|
||||
Width 0
|
||||
Height 0
|
||||
DONE
|
||||
Binary file not shown.
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug 77563 (Uninitialized read in exif_process_IFD_in_MAKERNOTE)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
|
||||
--FILE--
|
||||
<?php
|
||||
$s = exif_thumbnail(__DIR__."/bug77563.jpg");
|
||||
?>
|
||||
DONE
|
||||
--EXPECTF--
|
||||
Warning: exif_thumbnail(bug77563.jpg): IFD data too short: 0x0009 offset 0x0008 in %s%ebug77563.php on line %d
|
||||
|
||||
Warning: exif_thumbnail(bug77563.jpg): File structure corrupted in %s%ebug77563.php on line %d
|
||||
|
||||
Warning: exif_thumbnail(bug77563.jpg): Invalid JPEG file in %s%ebug77563.php on line %d
|
||||
DONE
|
||||
Binary file not shown.
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Bug 77564 (Memory leak in exif_process_IFD_TAG)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(exif_read_data(dirname(__FILE__) . '/bug77564.jpg'));
|
||||
?>
|
||||
DONE
|
||||
--EXPECTF--
|
||||
|
||||
Warning: exif_read_data(bug77564.jpg): Illegal IFD offset in %sbug77564.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug77564.jpg): File structure corrupted in %sbug77564.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug77564.jpg): Invalid JPEG file in %sbug77564.php on line %d
|
||||
bool(false)
|
||||
DONE
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77753 (Heap-buffer-overflow in php_ifd_get32s)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(exif_read_data(__DIR__."/bug77753.tiff"));
|
||||
?>
|
||||
DONE
|
||||
--EXPECTF--
|
||||
%A
|
||||
Warning: exif_read_data(bug77753.tiff): Illegal IFD size: 0x006A > 0x0065 in %sbug77753.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug77753.tiff): Invalid TIFF file in %sbug77753.php on line %d
|
||||
bool(false)
|
||||
DONE
|
||||
Binary file not shown.
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77831 (Heap-buffer-overflow in exif_iif_add_value in EXIF)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(exif_read_data(__DIR__."/bug77831.tiff"));
|
||||
?>
|
||||
DONE
|
||||
--EXPECTF--
|
||||
%A
|
||||
bool(false)
|
||||
DONE
|
||||
Binary file not shown.
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77950 (Heap-buffer-overflow in _estrndup via exif_process_IFD_TAG)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
|
||||
--FILE--
|
||||
<?php
|
||||
exif_read_data(__DIR__."/bug77950.tiff");
|
||||
?>
|
||||
DONE
|
||||
--EXPECTF--
|
||||
%A
|
||||
DONE
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,11 +0,0 @@
|
||||
--TEST--
|
||||
Bug #77988 (heap-buffer-overflow on php_jpg_get16)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
|
||||
--FILE--
|
||||
<?php
|
||||
exif_read_data(__DIR__."/bug77988.jpg", 'COMMENT', FALSE, TRUE);
|
||||
?>
|
||||
DONE
|
||||
--EXPECTF--
|
||||
DONE
|
||||
+230639
-230489
File diff suppressed because it is too large.
Load diff
+129
-87
@@ -1,6 +1,6 @@
|
||||
diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
|
||||
--- libmagic.orig/apprentice.c 2017-05-08 20:10:13.000000000 +0200
|
||||
+++ libmagic/apprentice.c 2018-11-05 20:23:12.586762678 +0100
|
||||
+++ libmagic/apprentice.c 2017-12-21 15:19:13.441294900 +0100
|
||||
@@ -29,6 +29,8 @@
|
||||
* apprentice - make one pass through /etc/magic, learning its secrets.
|
||||
*/
|
||||
@@ -605,7 +605,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
|
||||
sizeof(m->mimetype), "MIME", "+-/.", 1);
|
||||
}
|
||||
|
||||
@@ -2584,14 +2524,19 @@
|
||||
@@ -2584,14 +2524,18 @@
|
||||
return -1;
|
||||
}
|
||||
if (m->type == FILE_REGEX) {
|
||||
@@ -614,25 +614,24 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
|
||||
- if (rc) {
|
||||
- if (ms->flags & MAGIC_CHECK)
|
||||
- file_regerror(&rx, rc, ms);
|
||||
+ zval pattern;
|
||||
+ /* XXX do we need this? */
|
||||
+ /*zval pattern;
|
||||
+ int options = 0;
|
||||
+ pcre_cache_entry *pce;
|
||||
+
|
||||
+ convert_libmagic_pattern(&pattern, m->value.s, strlen(m->value.s), options);
|
||||
+
|
||||
+ if ((pce = pcre_get_compiled_regex_cache(Z_STR(pattern))) == NULL) {
|
||||
+ zval_dtor(&pattern);
|
||||
+ return -1;
|
||||
}
|
||||
- file_regfree(&rx);
|
||||
- return rc ? -1 : 0;
|
||||
+ zval_dtor(&pattern);
|
||||
+
|
||||
+ return 0;
|
||||
+ return 0;*/
|
||||
}
|
||||
return 0;
|
||||
case FILE_FLOAT:
|
||||
@@ -2909,7 +2854,7 @@
|
||||
@@ -2909,7 +2853,7 @@
|
||||
{
|
||||
struct magic_map *map;
|
||||
|
||||
@@ -641,7 +640,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
|
||||
file_oomem(ms, sizeof(*map));
|
||||
return NULL;
|
||||
}
|
||||
@@ -2930,79 +2875,145 @@
|
||||
@@ -2930,79 +2874,145 @@
|
||||
private struct magic_map *
|
||||
apprentice_map(struct magic_set *ms, const char *fn)
|
||||
{
|
||||
@@ -824,7 +823,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
|
||||
}
|
||||
|
||||
private int
|
||||
@@ -3028,7 +3039,7 @@
|
||||
@@ -3028,7 +3038,7 @@
|
||||
version = ptr[1];
|
||||
if (version != VERSIONNO) {
|
||||
file_error(ms, 0, "File %s supports only version %d magic "
|
||||
@@ -833,7 +832,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
|
||||
VERSIONNO, dbname, version);
|
||||
return -1;
|
||||
}
|
||||
@@ -3069,7 +3080,6 @@
|
||||
@@ -3069,7 +3079,6 @@
|
||||
{
|
||||
static const size_t nm = sizeof(*map->nmagic) * MAGIC_SETS;
|
||||
static const size_t m = sizeof(**map->magic);
|
||||
@@ -841,7 +840,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
|
||||
size_t len;
|
||||
char *dbname;
|
||||
int rv = -1;
|
||||
@@ -3078,14 +3088,17 @@
|
||||
@@ -3078,14 +3087,17 @@
|
||||
struct magic m;
|
||||
uint32_t h[2 + MAGIC_SETS];
|
||||
} hdr;
|
||||
@@ -861,7 +860,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
|
||||
file_error(ms, errno, "cannot open `%s'", dbname);
|
||||
goto out;
|
||||
}
|
||||
@@ -3094,25 +3107,25 @@
|
||||
@@ -3094,25 +3106,25 @@
|
||||
hdr.h[1] = VERSIONNO;
|
||||
memcpy(hdr.h + 2, map->nmagic, nm);
|
||||
|
||||
@@ -893,7 +892,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
|
||||
return rv;
|
||||
}
|
||||
|
||||
@@ -3146,16 +3159,18 @@
|
||||
@@ -3146,16 +3158,18 @@
|
||||
q++;
|
||||
/* Compatibility with old code that looked in .mime */
|
||||
if (ms->flags & MAGIC_MIME) {
|
||||
@@ -918,7 +917,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
|
||||
|
||||
/* Compatibility with old code that looked in .mime */
|
||||
if (strstr(fn, ".mime") != NULL)
|
||||
@@ -3245,7 +3260,7 @@
|
||||
@@ -3245,7 +3259,7 @@
|
||||
m->offset = swap4((uint32_t)m->offset);
|
||||
m->in_offset = swap4((uint32_t)m->in_offset);
|
||||
m->lineno = swap4((uint32_t)m->lineno);
|
||||
@@ -929,7 +928,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
|
||||
}
|
||||
diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
|
||||
--- libmagic.orig/ascmagic.c 2016-06-27 22:56:25.000000000 +0200
|
||||
+++ libmagic/ascmagic.c 2018-11-04 00:59:30.775724767 +0100
|
||||
+++ libmagic/ascmagic.c 2017-10-18 12:52:13.745336900 +0200
|
||||
@@ -133,7 +133,7 @@
|
||||
/* malloc size is a conservative overestimate; could be
|
||||
improved, or at least realloced after conversion. */
|
||||
@@ -951,7 +950,7 @@ diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
|
||||
}
|
||||
diff -u libmagic.orig/cdf.c libmagic/cdf.c
|
||||
--- libmagic.orig/cdf.c 2017-05-08 20:10:13.000000000 +0200
|
||||
+++ libmagic/cdf.c 2018-11-07 19:06:50.045202539 +0100
|
||||
+++ libmagic/cdf.c 2017-11-30 13:21:54.096926600 +0100
|
||||
@@ -43,7 +43,17 @@
|
||||
#include <err.h>
|
||||
#endif
|
||||
@@ -1076,7 +1075,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
|
||||
return -1;
|
||||
diff -u libmagic.orig/cdf.h libmagic/cdf.h
|
||||
--- libmagic.orig/cdf.h 2017-03-16 16:06:24.000000000 +0100
|
||||
+++ libmagic/cdf.h 2018-11-04 00:59:30.775724767 +0100
|
||||
+++ libmagic/cdf.h 2017-11-30 13:21:54.112572000 +0100
|
||||
@@ -35,10 +35,12 @@
|
||||
#ifndef _H_CDF_
|
||||
#define _H_CDF_
|
||||
@@ -1106,7 +1105,7 @@ diff -u libmagic.orig/cdf.h libmagic/cdf.h
|
||||
void cdf_unpack_header(cdf_header_t *, char *);
|
||||
diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
|
||||
--- libmagic.orig/cdf_time.c 2017-03-29 17:57:48.000000000 +0200
|
||||
+++ libmagic/cdf_time.c 2018-11-04 00:59:30.775724767 +0100
|
||||
+++ libmagic/cdf_time.c 2017-11-30 13:21:54.112572000 +0100
|
||||
@@ -96,7 +96,7 @@
|
||||
}
|
||||
|
||||
@@ -1157,7 +1156,7 @@ diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
|
||||
static const char *ref = "Sat Apr 23 01:30:00 1977";
|
||||
diff -u libmagic.orig/compress.c libmagic/compress.c
|
||||
--- libmagic.orig/compress.c 2017-03-29 17:57:48.000000000 +0200
|
||||
+++ libmagic/compress.c 2018-11-04 00:59:30.775724767 +0100
|
||||
+++ libmagic/compress.c 2017-11-30 13:21:54.128198700 +0100
|
||||
@@ -45,15 +45,13 @@
|
||||
#endif
|
||||
#include <string.h>
|
||||
@@ -1324,7 +1323,7 @@ diff -u libmagic.orig/compress.c libmagic/compress.c
|
||||
+#endif /* if PHP_FILEINFO_UNCOMPRESS */
|
||||
diff -u libmagic.orig/der.c libmagic/der.c
|
||||
--- libmagic.orig/der.c 2017-03-07 23:20:58.000000000 +0100
|
||||
+++ libmagic/der.c 2018-11-04 00:59:30.775724767 +0100
|
||||
+++ libmagic/der.c 2017-11-30 13:21:54.128198700 +0100
|
||||
@@ -51,7 +51,9 @@
|
||||
#include "magic.h"
|
||||
#include "der.h"
|
||||
@@ -1354,7 +1353,7 @@ diff -u libmagic.orig/der.c libmagic/der.c
|
||||
snprintf(buf + z, blen - z, "%.2x", d[i]);
|
||||
diff -u libmagic.orig/elfclass.h libmagic/elfclass.h
|
||||
--- libmagic.orig/elfclass.h 2014-12-16 23:23:50.000000000 +0100
|
||||
+++ libmagic/elfclass.h 2018-11-04 00:59:30.775724767 +0100
|
||||
+++ libmagic/elfclass.h 2017-10-11 15:25:46.389495700 +0200
|
||||
@@ -41,7 +41,7 @@
|
||||
return toomany(ms, "program headers", phnum);
|
||||
flags |= FLAGS_IS_CORE;
|
||||
@@ -1384,7 +1383,7 @@ diff -u libmagic.orig/elfclass.h libmagic/elfclass.h
|
||||
(int)elf_getu16(swap, elfhdr.e_shstrndx),
|
||||
diff -u libmagic.orig/file.h libmagic/file.h
|
||||
--- libmagic.orig/file.h 2017-05-08 20:10:13.000000000 +0200
|
||||
+++ libmagic/file.h 2018-11-05 21:31:50.155688068 +0100
|
||||
+++ libmagic/file.h 2017-11-30 13:21:54.143819800 +0100
|
||||
@@ -33,15 +33,9 @@
|
||||
#ifndef __file_h__
|
||||
#define __file_h__
|
||||
@@ -1525,7 +1524,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
|
||||
protected void file_showstr(FILE *, const char *, size_t);
|
||||
protected size_t file_mbswidth(const char *);
|
||||
protected const char *file_getbuffer(struct magic_set *);
|
||||
@@ -497,31 +488,8 @@
|
||||
@@ -497,32 +488,6 @@
|
||||
size_t);
|
||||
#endif /* __EMX__ */
|
||||
|
||||
@@ -1554,12 +1553,11 @@ diff -u libmagic.orig/file.h libmagic/file.h
|
||||
- int);
|
||||
-protected void file_regfree(file_regex_t *);
|
||||
-protected void file_regerror(file_regex_t *, int, struct magic_set *);
|
||||
+public void
|
||||
+convert_libmagic_pattern(zval *pattern, char *val, int len, int options);
|
||||
|
||||
-
|
||||
typedef struct {
|
||||
char *buf;
|
||||
@@ -531,10 +499,8 @@
|
||||
uint32_t offset;
|
||||
@@ -531,10 +496,8 @@
|
||||
protected file_pushbuf_t *file_push_buffer(struct magic_set *);
|
||||
protected char *file_pop_buffer(struct magic_set *, file_pushbuf_t *);
|
||||
|
||||
@@ -1570,7 +1568,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
|
||||
|
||||
#ifndef HAVE_STRERROR
|
||||
extern int sys_nerr;
|
||||
@@ -547,23 +513,10 @@
|
||||
@@ -547,23 +510,10 @@
|
||||
#define strtoul(a, b, c) strtol(a, b, c)
|
||||
#endif
|
||||
|
||||
@@ -1596,7 +1594,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
|
||||
size_t strlcat(char *, const char *, size_t);
|
||||
#endif
|
||||
#ifndef HAVE_STRCASESTR
|
||||
@@ -579,16 +532,6 @@
|
||||
@@ -579,16 +529,6 @@
|
||||
#ifndef HAVE_ASCTIME_R
|
||||
char *asctime_r(const struct tm *, char *);
|
||||
#endif
|
||||
@@ -1613,7 +1611,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
|
||||
|
||||
#if defined(HAVE_MMAP) && defined(HAVE_SYS_MMAN_H) && !defined(QUICK)
|
||||
#define QUICK
|
||||
@@ -611,6 +554,18 @@
|
||||
@@ -611,6 +551,18 @@
|
||||
#else
|
||||
#define FILE_RCSID(id)
|
||||
#endif
|
||||
@@ -1634,7 +1632,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
|
||||
#endif
|
||||
diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
|
||||
--- libmagic.orig/fsmagic.c 2016-05-03 17:48:37.000000000 +0200
|
||||
+++ libmagic/fsmagic.c 2018-11-04 00:59:30.775724767 +0100
|
||||
+++ libmagic/fsmagic.c 2017-10-18 12:52:13.745336900 +0200
|
||||
@@ -63,27 +63,21 @@
|
||||
# define minor(dev) ((dev) & 0xff)
|
||||
#endif
|
||||
@@ -1952,7 +1950,7 @@ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
|
||||
case S_IFSOCK:
|
||||
diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
--- libmagic.orig/funcs.c 2017-05-08 20:10:13.000000000 +0200
|
||||
+++ libmagic/funcs.c 2018-11-05 21:31:50.155688068 +0100
|
||||
+++ libmagic/funcs.c 2017-11-30 13:21:54.143819800 +0100
|
||||
@@ -31,7 +31,6 @@
|
||||
#endif /* lint */
|
||||
|
||||
@@ -1961,7 +1959,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -42,78 +41,77 @@
|
||||
@@ -42,78 +41,79 @@
|
||||
#if defined(HAVE_WCTYPE_H)
|
||||
#include <wctype.h>
|
||||
#endif
|
||||
@@ -1983,14 +1981,17 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
-{
|
||||
- int len;
|
||||
- char *buf, *newstr;
|
||||
-
|
||||
+#include "php.h"
|
||||
+#include "main/php_network.h"
|
||||
|
||||
- if (ms->event_flags & EVENT_HAD_ERR)
|
||||
- return 0;
|
||||
- len = vasprintf(&buf, fmt, ap);
|
||||
- if (len < 0)
|
||||
- goto out;
|
||||
+#include "php.h"
|
||||
+#include "main/php_network.h"
|
||||
+#ifndef PREG_OFFSET_CAPTURE
|
||||
+# define PREG_OFFSET_CAPTURE (1<<8)
|
||||
+#endif
|
||||
|
||||
- if (ms->o.buf != NULL) {
|
||||
- len = asprintf(&newstr, "%s%s", ms->o.buf, buf);
|
||||
@@ -2006,9 +2007,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
- fprintf(stderr, "vasprintf failed (%s)", strerror(errno));
|
||||
- return -1;
|
||||
-}
|
||||
+#ifndef PREG_OFFSET_CAPTURE
|
||||
+# define PREG_OFFSET_CAPTURE (1<<8)
|
||||
+#endif
|
||||
+extern public void convert_libmagic_pattern(zval *pattern, char *val, int len, int options);
|
||||
|
||||
protected int
|
||||
file_printf(struct magic_set *ms, const char *fmt, ...)
|
||||
@@ -2079,7 +2078,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
ms->event_flags |= EVENT_HAD_ERR;
|
||||
ms->error = error;
|
||||
}
|
||||
@@ -160,7 +158,6 @@
|
||||
@@ -160,7 +160,6 @@
|
||||
file_error(ms, errno, "error reading");
|
||||
}
|
||||
|
||||
@@ -2087,7 +2086,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
|
||||
static int
|
||||
checkdone(struct magic_set *ms, int *rv)
|
||||
@@ -174,8 +171,8 @@
|
||||
@@ -174,8 +173,8 @@
|
||||
|
||||
/*ARGSUSED*/
|
||||
protected int
|
||||
@@ -2098,7 +2097,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
{
|
||||
int m = 0, rv = 0, looks_text = 0;
|
||||
const unsigned char *ubuf = CAST(const unsigned char *, buf);
|
||||
@@ -216,10 +213,10 @@
|
||||
@@ -216,10 +215,10 @@
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -2112,7 +2111,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
if ((ms->flags & MAGIC_DEBUG) != 0)
|
||||
(void)fprintf(stderr, "[try zmagic %d]\n", m);
|
||||
if (m) {
|
||||
@@ -240,12 +237,15 @@
|
||||
@@ -240,12 +239,15 @@
|
||||
|
||||
/* Check if we have a CDF file */
|
||||
if ((ms->flags & MAGIC_NO_CHECK_CDF) == 0) {
|
||||
@@ -2128,7 +2127,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
}
|
||||
}
|
||||
|
||||
@@ -316,7 +316,7 @@
|
||||
@@ -316,7 +318,7 @@
|
||||
if (file_printf(ms, "%s", code_mime) == -1)
|
||||
rv = -1;
|
||||
}
|
||||
@@ -2137,7 +2136,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
done_encoding:
|
||||
#endif
|
||||
free(u8buf);
|
||||
@@ -325,7 +325,6 @@
|
||||
@@ -325,7 +327,6 @@
|
||||
|
||||
return m;
|
||||
}
|
||||
@@ -2145,7 +2144,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
|
||||
protected int
|
||||
file_reset(struct magic_set *ms)
|
||||
@@ -335,11 +334,11 @@
|
||||
@@ -335,11 +336,11 @@
|
||||
return -1;
|
||||
}
|
||||
if (ms->o.buf) {
|
||||
@@ -2159,7 +2158,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
ms->o.pbuf = NULL;
|
||||
}
|
||||
ms->event_flags &= ~EVENT_HAD_ERR;
|
||||
@@ -377,7 +376,7 @@
|
||||
@@ -377,7 +378,7 @@
|
||||
return NULL;
|
||||
}
|
||||
psize = len * 4 + 1;
|
||||
@@ -2168,7 +2167,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
file_oomem(ms, psize);
|
||||
return NULL;
|
||||
}
|
||||
@@ -441,8 +440,8 @@
|
||||
@@ -441,8 +442,8 @@
|
||||
if (level >= ms->c.len) {
|
||||
len = (ms->c.len = 20 + level) * sizeof(*ms->c.li);
|
||||
ms->c.li = CAST(struct level_info *, (ms->c.li == NULL) ?
|
||||
@@ -2179,7 +2178,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
if (ms->c.li == NULL) {
|
||||
file_oomem(ms, len);
|
||||
return -1;
|
||||
@@ -465,76 +464,41 @@
|
||||
@@ -465,76 +466,41 @@
|
||||
protected int
|
||||
file_replace(struct magic_set *ms, const char *pat, const char *rep)
|
||||
{
|
||||
@@ -2285,7 +2284,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
}
|
||||
|
||||
protected file_pushbuf_t *
|
||||
@@ -545,7 +509,7 @@
|
||||
@@ -545,7 +511,7 @@
|
||||
if (ms->event_flags & EVENT_HAD_ERR)
|
||||
return NULL;
|
||||
|
||||
@@ -2294,7 +2293,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
return NULL;
|
||||
|
||||
pb->buf = ms->o.buf;
|
||||
@@ -563,8 +527,8 @@
|
||||
@@ -563,8 +529,8 @@
|
||||
char *rbuf;
|
||||
|
||||
if (ms->event_flags & EVENT_HAD_ERR) {
|
||||
@@ -2305,7 +2304,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -573,7 +537,7 @@
|
||||
@@ -573,7 +539,7 @@
|
||||
ms->o.buf = pb->buf;
|
||||
ms->offset = pb->offset;
|
||||
|
||||
@@ -2316,7 +2315,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
|
||||
diff -u libmagic.orig/magic.c libmagic/magic.c
|
||||
--- libmagic.orig/magic.c 2016-07-18 13:43:05.000000000 +0200
|
||||
+++ libmagic/magic.c 2018-11-04 00:59:30.775724767 +0100
|
||||
+++ libmagic/magic.c 2017-11-30 13:21:54.159443900 +0100
|
||||
@@ -25,11 +25,6 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
@@ -2812,28 +2811,9 @@ diff -u libmagic.orig/magic.c libmagic/magic.c
|
||||
|
||||
public const char *
|
||||
magic_error(struct magic_set *ms)
|
||||
diff -u libmagic.orig/magic.h libmagic/magic.h
|
||||
--- libmagic.orig/magic.h 2018-11-04 11:43:09.114597000 +0100
|
||||
+++ libmagic/magic.h 2018-11-04 00:59:30.775724767 +0100
|
||||
@@ -93,6 +93,7 @@
|
||||
|
||||
const char *magic_getpath(const char *, int);
|
||||
const char *magic_file(magic_t, const char *);
|
||||
+const char *magic_stream(magic_t, php_stream *);
|
||||
const char *magic_descriptor(magic_t, int);
|
||||
const char *magic_buffer(magic_t, const void *, size_t);
|
||||
|
||||
@@ -104,7 +105,6 @@
|
||||
int magic_load_buffers(magic_t, void **, size_t *, size_t);
|
||||
|
||||
int magic_compile(magic_t, const char *);
|
||||
-int magic_check(magic_t, const char *);
|
||||
int magic_list(magic_t, const char *);
|
||||
int magic_errno(magic_t);
|
||||
|
||||
diff -u libmagic.orig/print.c libmagic/print.c
|
||||
--- libmagic.orig/print.c 2017-03-07 23:20:58.000000000 +0100
|
||||
+++ libmagic/print.c 2018-11-04 00:59:30.775724767 +0100
|
||||
+++ libmagic/print.c 2017-11-30 13:21:54.175075200 +0100
|
||||
@@ -28,6 +28,8 @@
|
||||
/*
|
||||
* print.c - debugging printout routines
|
||||
@@ -3098,7 +3078,7 @@ diff -u libmagic.orig/print.c libmagic/print.c
|
||||
goto out;
|
||||
diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
|
||||
--- libmagic.orig/readcdf.c 2017-05-08 20:10:13.000000000 +0200
|
||||
+++ libmagic/readcdf.c 2018-11-04 00:59:30.775724767 +0100
|
||||
+++ libmagic/readcdf.c 2017-11-30 13:21:54.195206000 +0100
|
||||
@@ -1,5 +1,5 @@
|
||||
/*-
|
||||
- * Copyright (c) 2008, 2016 Christos Zoulas
|
||||
@@ -3205,7 +3185,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
|
||||
*ec = '\0';
|
||||
diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
--- libmagic.orig/softmagic.c 2017-05-08 20:10:13.000000000 +0200
|
||||
+++ libmagic/softmagic.c 2018-11-10 13:08:23.811239067 +0100
|
||||
+++ libmagic/softmagic.c 2017-11-30 13:21:54.196704800 +0100
|
||||
@@ -43,6 +43,10 @@
|
||||
#include <time.h>
|
||||
#include "der.h"
|
||||
@@ -3267,7 +3247,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
- if (rc) {
|
||||
- file_regerror(&rx, rc, ms);
|
||||
+ (void)setlocale(LC_CTYPE, "C");
|
||||
+ pattern = zend_string_init("~%[-0-9\\.]*s~", sizeof("~%[-0-9\\.]*s~") - 1, 0);
|
||||
+ pattern = zend_string_init("~%[-0-9.]*s~", sizeof("~%[-0-9.]*s~") - 1, 0);
|
||||
+ if ((pce = pcre_get_compiled_regex(pattern, &re_extra, &re_options)) == NULL) {
|
||||
+ rv = -1;
|
||||
} else {
|
||||
@@ -3303,16 +3283,21 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
private int32_t
|
||||
mprint(struct magic_set *ms, struct magic *m)
|
||||
{
|
||||
@@ -672,14 +662,10 @@
|
||||
@@ -667,19 +657,18 @@
|
||||
t = ms->offset + sizeof(double);
|
||||
break;
|
||||
|
||||
- case FILE_SEARCH:
|
||||
case FILE_REGEX: {
|
||||
char *cp;
|
||||
int rval;
|
||||
|
||||
- cp = strndup((const char *)ms->search.s, ms->search.rm_len);
|
||||
- if (cp == NULL) {
|
||||
- file_oomem(ms, ms->search.rm_len);
|
||||
- return -1;
|
||||
- }
|
||||
+ cp = estrndup((const char *)ms->search.s, ms->search.rm_len);
|
||||
if (cp == NULL) {
|
||||
file_oomem(ms, ms->search.rm_len);
|
||||
return -1;
|
||||
}
|
||||
rval = file_printf(ms, F(ms, m, "%s"),
|
||||
file_printable(sbuf, sizeof(sbuf), cp));
|
||||
- free(cp);
|
||||
@@ -3320,7 +3305,64 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
|
||||
if (rval == -1)
|
||||
return -1;
|
||||
@@ -1373,9 +1359,6 @@
|
||||
@@ -691,6 +680,15 @@
|
||||
break;
|
||||
}
|
||||
|
||||
+ case FILE_SEARCH:
|
||||
+ if (file_printf(ms, F(ms, m, "%s"), m->value.s) == -1)
|
||||
+ return -1;
|
||||
+ if ((m->str_flags & REGEX_OFFSET_START))
|
||||
+ t = ms->search.offset;
|
||||
+ else
|
||||
+ t = ms->search.offset + m->vallen;
|
||||
+ break;
|
||||
+
|
||||
case FILE_DEFAULT:
|
||||
case FILE_CLEAR:
|
||||
if (file_printf(ms, "%s", m->desc) == -1)
|
||||
@@ -1205,21 +1203,28 @@
|
||||
return 0;
|
||||
}
|
||||
|
||||
- if (m->str_flags & REGEX_LINE_COUNT) {
|
||||
- linecnt = m->str_range;
|
||||
- bytecnt = linecnt * 80;
|
||||
- } else {
|
||||
- linecnt = 0;
|
||||
- bytecnt = m->str_range;
|
||||
- }
|
||||
+ /* bytecnt checks are to be kept for PHP, see cve-2014-3538.
|
||||
+ PCRE might get stuck if the input buffer is too big. */
|
||||
+ linecnt = m->str_range;
|
||||
+ bytecnt = linecnt * 80;
|
||||
|
||||
- if (bytecnt == 0 || bytecnt > nbytes - offset)
|
||||
- bytecnt = nbytes - offset;
|
||||
- if (bytecnt > ms->regex_max)
|
||||
- bytecnt = ms->regex_max;
|
||||
+ if (bytecnt == 0) {
|
||||
+ bytecnt = 1 << 14;
|
||||
+ }
|
||||
|
||||
+ if (bytecnt > nbytes) {
|
||||
+ bytecnt = nbytes;
|
||||
+ }
|
||||
+ if (offset > bytecnt) {
|
||||
+ offset = bytecnt;
|
||||
+ }
|
||||
+ if (s == NULL) {
|
||||
+ ms->search.s_len = 0;
|
||||
+ ms->search.s = NULL;
|
||||
+ return 0;
|
||||
+ }
|
||||
buf = RCAST(const char *, s) + offset;
|
||||
- end = last = RCAST(const char *, s) + bytecnt + offset;
|
||||
+ end = last = RCAST(const char *, s) + bytecnt;
|
||||
/* mget() guarantees buf <= last */
|
||||
for (lines = linecnt, b = buf; lines && b < end &&
|
||||
((b = CAST(const char *,
|
||||
@@ -1373,9 +1378,6 @@
|
||||
m->type, m->flag, offset, o, nbytes,
|
||||
*indir_count, *name_count);
|
||||
mdebug(offset, (char *)(void *)p, sizeof(union VALUETYPE));
|
||||
@@ -3330,7 +3372,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
}
|
||||
|
||||
if (m->flag & INDIR) {
|
||||
@@ -1488,9 +1471,6 @@
|
||||
@@ -1488,9 +1490,6 @@
|
||||
if ((ms->flags & MAGIC_DEBUG) != 0) {
|
||||
mdebug(offset, (char *)(void *)p,
|
||||
sizeof(union VALUETYPE));
|
||||
@@ -3340,7 +3382,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1572,15 +1552,15 @@
|
||||
@@ -1572,15 +1571,15 @@
|
||||
if (rv == 1) {
|
||||
if ((ms->flags & MAGIC_NODESC) == 0 &&
|
||||
file_printf(ms, F(ms, m, "%u"), offset) == -1) {
|
||||
@@ -3359,7 +3401,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
return rv;
|
||||
|
||||
case FILE_USE:
|
||||
@@ -1703,6 +1683,41 @@
|
||||
@@ -1703,6 +1702,41 @@
|
||||
return file_strncmp(a, b, len, flags);
|
||||
}
|
||||
|
||||
@@ -3401,7 +3443,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
private int
|
||||
magiccheck(struct magic_set *ms, struct magic *m)
|
||||
{
|
||||
@@ -1863,65 +1878,77 @@
|
||||
@@ -1863,65 +1897,77 @@
|
||||
break;
|
||||
}
|
||||
case FILE_REGEX: {
|
||||
@@ -3533,7 +3575,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
case FILE_INDIRECT:
|
||||
diff -u libmagic.orig/strcasestr.c libmagic/strcasestr.c
|
||||
--- libmagic.orig/strcasestr.c 2014-09-11 17:05:33.000000000 +0200
|
||||
+++ libmagic/strcasestr.c 2018-11-04 00:59:30.779724789 +0100
|
||||
+++ libmagic/strcasestr.c 2017-10-11 15:25:46.558395300 +0200
|
||||
@@ -39,6 +39,8 @@
|
||||
|
||||
#include "file.h"
|
||||
|
||||
@@ -2524,19 +2524,18 @@ getvalue(struct magic_set *ms, struct magic *m, const char **p, int action)
|
||||
return -1;
|
||||
}
|
||||
if (m->type == FILE_REGEX) {
|
||||
zval pattern;
|
||||
/* XXX do we need this? */
|
||||
/*zval pattern;
|
||||
int options = 0;
|
||||
pcre_cache_entry *pce;
|
||||
|
||||
convert_libmagic_pattern(&pattern, m->value.s, strlen(m->value.s), options);
|
||||
|
||||
if ((pce = pcre_get_compiled_regex_cache(Z_STR(pattern))) == NULL) {
|
||||
zval_dtor(&pattern);
|
||||
return -1;
|
||||
}
|
||||
zval_dtor(&pattern);
|
||||
|
||||
return 0;
|
||||
return 0;*/
|
||||
}
|
||||
return 0;
|
||||
case FILE_FLOAT:
|
||||
|
||||
@@ -488,9 +488,6 @@ protected int file_os2_apptype(struct magic_set *, const char *, const void *,
|
||||
size_t);
|
||||
#endif /* __EMX__ */
|
||||
|
||||
public void
|
||||
convert_libmagic_pattern(zval *pattern, char *val, int len, int options);
|
||||
|
||||
typedef struct {
|
||||
char *buf;
|
||||
uint32_t offset;
|
||||
|
||||
@@ -56,6 +56,8 @@ FILE_RCSID("@(#)$File: funcs.c,v 1.92 2017/04/07 20:10:24 christos Exp $")
|
||||
# define PREG_OFFSET_CAPTURE (1<<8)
|
||||
#endif
|
||||
|
||||
extern public void convert_libmagic_pattern(zval *pattern, char *val, int len, int options);
|
||||
|
||||
protected int
|
||||
file_printf(struct magic_set *ms, const char *fmt, ...)
|
||||
{
|
||||
|
||||
@@ -421,7 +421,7 @@ check_fmt(struct magic_set *ms, struct magic *m)
|
||||
return 0;
|
||||
|
||||
(void)setlocale(LC_CTYPE, "C");
|
||||
pattern = zend_string_init("~%[-0-9\\.]*s~", sizeof("~%[-0-9\\.]*s~") - 1, 0);
|
||||
pattern = zend_string_init("~%[-0-9.]*s~", sizeof("~%[-0-9.]*s~") - 1, 0);
|
||||
if ((pce = pcre_get_compiled_regex(pattern, &re_extra, &re_options)) == NULL) {
|
||||
rv = -1;
|
||||
} else {
|
||||
@@ -657,12 +657,15 @@ mprint(struct magic_set *ms, struct magic *m)
|
||||
t = ms->offset + sizeof(double);
|
||||
break;
|
||||
|
||||
case FILE_SEARCH:
|
||||
case FILE_REGEX: {
|
||||
char *cp;
|
||||
int rval;
|
||||
|
||||
cp = estrndup((const char *)ms->search.s, ms->search.rm_len);
|
||||
if (cp == NULL) {
|
||||
file_oomem(ms, ms->search.rm_len);
|
||||
return -1;
|
||||
}
|
||||
rval = file_printf(ms, F(ms, m, "%s"),
|
||||
file_printable(sbuf, sizeof(sbuf), cp));
|
||||
efree(cp);
|
||||
@@ -677,6 +680,15 @@ mprint(struct magic_set *ms, struct magic *m)
|
||||
break;
|
||||
}
|
||||
|
||||
case FILE_SEARCH:
|
||||
if (file_printf(ms, F(ms, m, "%s"), m->value.s) == -1)
|
||||
return -1;
|
||||
if ((m->str_flags & REGEX_OFFSET_START))
|
||||
t = ms->search.offset;
|
||||
else
|
||||
t = ms->search.offset + m->vallen;
|
||||
break;
|
||||
|
||||
case FILE_DEFAULT:
|
||||
case FILE_CLEAR:
|
||||
if (file_printf(ms, "%s", m->desc) == -1)
|
||||
@@ -1191,21 +1203,28 @@ mcopy(struct magic_set *ms, union VALUETYPE *p, int type, int indir,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (m->str_flags & REGEX_LINE_COUNT) {
|
||||
linecnt = m->str_range;
|
||||
bytecnt = linecnt * 80;
|
||||
} else {
|
||||
linecnt = 0;
|
||||
bytecnt = m->str_range;
|
||||
/* bytecnt checks are to be kept for PHP, see cve-2014-3538.
|
||||
PCRE might get stuck if the input buffer is too big. */
|
||||
linecnt = m->str_range;
|
||||
bytecnt = linecnt * 80;
|
||||
|
||||
if (bytecnt == 0) {
|
||||
bytecnt = 1 << 14;
|
||||
}
|
||||
|
||||
if (bytecnt == 0 || bytecnt > nbytes - offset)
|
||||
bytecnt = nbytes - offset;
|
||||
if (bytecnt > ms->regex_max)
|
||||
bytecnt = ms->regex_max;
|
||||
|
||||
if (bytecnt > nbytes) {
|
||||
bytecnt = nbytes;
|
||||
}
|
||||
if (offset > bytecnt) {
|
||||
offset = bytecnt;
|
||||
}
|
||||
if (s == NULL) {
|
||||
ms->search.s_len = 0;
|
||||
ms->search.s = NULL;
|
||||
return 0;
|
||||
}
|
||||
buf = RCAST(const char *, s) + offset;
|
||||
end = last = RCAST(const char *, s) + bytecnt + offset;
|
||||
end = last = RCAST(const char *, s) + bytecnt;
|
||||
/* mget() guarantees buf <= last */
|
||||
for (lines = linecnt, b = buf; lines && b < end &&
|
||||
((b = CAST(const char *,
|
||||
|
||||
+215
-111
@@ -1,45 +1,65 @@
|
||||
diff --git a/magic/Magdir/rpm b/magic/Magdir/rpm
|
||||
index 9a795f8..31db083 100644
|
||||
--- a/magic/Magdir/rpm
|
||||
+++ b/magic/Magdir/rpm
|
||||
@@ -29,6 +29,7 @@
|
||||
>>8 beshort 17 SuperH
|
||||
>>8 beshort 18 Xtensa
|
||||
>>8 beshort 255 noarch
|
||||
+>>10 string x %s
|
||||
diff -u file-5.31.orig/magic/Magdir/cafebabe file-5.31/magic/Magdir/cafebabe
|
||||
--- file-5.31.orig/magic/Magdir/cafebabe 2017-03-17 21:35:28.000000000 +0000
|
||||
+++ file-5.31/magic/Magdir/cafebabe 2017-10-11 14:30:57.476077825 +0000
|
||||
@@ -15,22 +15,6 @@
|
||||
# might add another one or two as time goes by...
|
||||
#
|
||||
### JAVA START ###
|
||||
-0 belong 0xcafebabe
|
||||
->4 belong >30 compiled Java class data,
|
||||
-!:mime application/x-java-applet
|
||||
->>6 beshort x version %d.
|
||||
->>4 beshort x \b%d
|
||||
-# Which is which?
|
||||
-#>>4 belong 0x032d (Java 1.0)
|
||||
-#>>4 belong 0x032d (Java 1.1)
|
||||
->>4 belong 0x002e (Java 1.2)
|
||||
->>4 belong 0x002f (Java 1.3)
|
||||
->>4 belong 0x0030 (Java 1.4)
|
||||
->>4 belong 0x0031 (Java 1.5)
|
||||
->>4 belong 0x0032 (Java 1.6)
|
||||
->>4 belong 0x0033 (Java 1.7)
|
||||
->>4 belong 0x0034 (Java 1.8)
|
||||
-
|
||||
0 belong 0xcafed00d JAR compressed with pack200,
|
||||
>5 byte x version %d.
|
||||
>4 byte x \b%d
|
||||
@@ -52,15 +36,28 @@
|
||||
|
||||
#delta RPM Daniel Novotny (dnovotny@redhat.com)
|
||||
0 string drpm Delta RPM
|
||||
diff --git a/magic/Magdir/securitycerts b/magic/Magdir/securitycerts
|
||||
index 8785dd8..1c340be 100644
|
||||
--- a/magic/Magdir/securitycerts
|
||||
+++ b/magic/Magdir/securitycerts
|
||||
@@ -4,3 +4,5 @@
|
||||
0 search/1 -----BEGIN\ CERTIFICATE------ RFC1421 Security Certificate text
|
||||
0 search/1 -----BEGIN\ NEW\ CERTIFICATE RFC1421 Security Certificate Signing Request text
|
||||
0 belong 0xedfeedfe Sun 'jks' Java Keystore File data
|
||||
+
|
||||
+0 string \0volume_key volume_key escrow packet
|
||||
From 898f5d27b66b5d5592cb56fa9da5b776628ea6ca Mon Sep 17 00:00:00 2001
|
||||
From: Christos Zoulas <christos@zoulas.com>
|
||||
Date: Wed, 31 May 2017 15:48:50 +0000
|
||||
Subject: [PATCH] Fix \s vs \w confusion.
|
||||
|
||||
Upstream commit: https://github.com/file/file/commit/898f5d27b66b5d5592cb56fa9da5b776628ea6ca
|
||||
|
||||
Fixes awk/perl script recognition
|
||||
|
||||
Signed-off-by: Marek Cermak <macermak@redhat.com>
|
||||
---
|
||||
magic/Magdir/commands | 4 ++--
|
||||
magic/Magdir/images | 14 +++++++-------
|
||||
magic/Magdir/python | 4 ++--
|
||||
3 files changed, 11 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/magic/Magdir/commands b/magic/Magdir/commands
|
||||
index 1a46efd8..f4326a9e 100644
|
||||
--- a/magic/Magdir/commands
|
||||
+++ b/magic/Magdir/commands
|
||||
0 belong 0xcafebabe
|
||||
>4 belong 1 Mach-O universal binary with 1 architecture:
|
||||
-!:mime application/x-mach-binary
|
||||
>>8 use mach-o \b
|
||||
+0 belong 0xcafebabe
|
||||
+>4 belong >30 compiled Java class data,
|
||||
+!:mime application/x-java-applet
|
||||
+>>6 beshort x version %d.
|
||||
+>>4 beshort x \b%d
|
||||
+# Which is which?
|
||||
+#>>4 belong 0x032d (Java 1.0)
|
||||
+#>>4 belong 0x032d (Java 1.1)
|
||||
+>>4 belong 0x002e (Java 1.2)
|
||||
+>>4 belong 0x002f (Java 1.3)
|
||||
+>>4 belong 0x0030 (Java 1.4)
|
||||
+>>4 belong 0x0031 (Java 1.5)
|
||||
+>>4 belong 0x0032 (Java 1.6)
|
||||
+>>4 belong 0x0033 (Java 1.7)
|
||||
+>>4 belong 0x0034 (Java 1.8)
|
||||
>4 belong >1
|
||||
>>4 belong <20 Mach-O universal binary with %d architectures:
|
||||
-!:mime application/x-mach-binary
|
||||
>>>8 use mach-o \b
|
||||
->>4 belong 2
|
||||
+>>4 belong >2
|
||||
>>>28 use mach-o \b
|
||||
->>4 belong 3
|
||||
+>>4 belong >3
|
||||
>>>48 use mach-o \b
|
||||
>>4 belong 4
|
||||
>>>68 use mach-o \b
|
||||
diff -u file-5.31.orig/magic/Magdir/commands file-5.31/magic/Magdir/commands
|
||||
--- file-5.31.orig/magic/Magdir/commands 2017-04-04 20:34:24.000000000 +0000
|
||||
+++ file-5.31/magic/Magdir/commands 2017-10-11 14:29:57.653552987 +0000
|
||||
@@ -56,7 +56,7 @@
|
||||
!:mime text/x-awk
|
||||
0 string/wt #!\ /usr/bin/awk awk script text executable
|
||||
@@ -49,10 +69,43 @@ index 1a46efd8..f4326a9e 100644
|
||||
|
||||
# AT&T Bell Labs' Plan 9 shell
|
||||
0 string/wt #!\ /bin/rc Plan 9 rc shell script text executable
|
||||
diff --git a/magic/Magdir/images b/magic/Magdir/images
|
||||
index ce68e00d..d14c1de1 100644
|
||||
--- a/magic/Magdir/images
|
||||
+++ b/magic/Magdir/images
|
||||
diff -u file-5.31.orig/magic/Magdir/dump file-5.31/magic/Magdir/dump
|
||||
--- file-5.31.orig/magic/Magdir/dump 2017-03-17 21:35:28.000000000 +0000
|
||||
+++ file-5.31/magic/Magdir/dump 2017-10-11 14:30:09.622057792 +0000
|
||||
@@ -69,6 +69,8 @@
|
||||
>0 use old-dump-be
|
||||
|
||||
24 lelong 60012 new-fs dump file (little endian),
|
||||
+# to correctly recognize '*.mo' GNU message catalog (little endian)
|
||||
+!:strength - 15
|
||||
>0 use \^new-dump-be
|
||||
|
||||
24 lelong 60011 old-fs dump file (little endian),
|
||||
diff -u file-5.31.orig/magic/Magdir/filesystems file-5.31/magic/Magdir/filesystems
|
||||
--- file-5.31.orig/magic/Magdir/filesystems 2017-03-24 19:29:26.000000000 +0000
|
||||
+++ file-5.31/magic/Magdir/filesystems 2017-10-11 14:30:57.476077825 +0000
|
||||
@@ -254,7 +254,7 @@
|
||||
30 search/481 \x55\xAA
|
||||
# to display DOS/MBR boot sector (40) before old one (strength=50+21),Syslinux bootloader (71),SYSLINUX MBR (37+36),NetBSD mbr (110),AdvanceMAME mbr (111)
|
||||
# DOS BPB information (70) and after DOS floppy (120) like in previous file version
|
||||
-!:strength +65
|
||||
+!:strength +0
|
||||
# for sector sizes < 512 Bytes
|
||||
>11 uleshort <512
|
||||
>>(11.s-2) uleshort 0xAA55 DOS/MBR boot sector
|
||||
@@ -266,7 +266,7 @@
|
||||
0x1FE leshort 0xAA55 DOS/MBR boot sector
|
||||
#
|
||||
# to display information (50) before DOS BPB (strength=70) and after DOS floppy (120) like in old file version
|
||||
-!:strength +65
|
||||
+!:strength +0
|
||||
>2 string OSBS OS/BS MBR
|
||||
# added by Joerg Jenderek at Feb 2013 according to http://thestarman.pcministry.com/asm/mbr/
|
||||
# and http://en.wikipedia.org/wiki/Master_Boot_Record
|
||||
Only in file-5.31/magic/Magdir/: gconv
|
||||
diff -u file-5.31.orig/magic/Magdir/images file-5.31/magic/Magdir/images
|
||||
--- file-5.31.orig/magic/Magdir/images 2017-04-04 20:34:24.000000000 +0000
|
||||
+++ file-5.31/magic/Magdir/images 2017-10-11 14:29:57.653552987 +0000
|
||||
@@ -175,42 +175,42 @@
|
||||
>>>&0 regex =[0-9]{1,50} \b %s
|
||||
|
||||
@@ -102,10 +155,9 @@ index ce68e00d..d14c1de1 100644
|
||||
>>0 use netpbm
|
||||
>>>0 string x \b, rawbits, pixmap
|
||||
!:strength + 45
|
||||
diff --git a/magic/Magdir/python b/magic/Magdir/python
|
||||
index 81d1cc39..d6c2220a 100644
|
||||
--- a/magic/Magdir/python
|
||||
+++ b/magic/Magdir/python
|
||||
diff -u file-5.31.orig/magic/Magdir/python file-5.31/magic/Magdir/python
|
||||
--- file-5.31.orig/magic/Magdir/python 2017-05-08 18:10:13.000000000 +0000
|
||||
+++ file-5.31/magic/Magdir/python 2017-10-11 14:29:57.653552987 +0000
|
||||
@@ -64,7 +64,7 @@
|
||||
# except: or finally:
|
||||
# block
|
||||
@@ -115,68 +167,120 @@ index 81d1cc39..d6c2220a 100644
|
||||
!:strength + 15
|
||||
!:mime text/x-python
|
||||
>&0 search/4096 finally: Python script text executable
|
||||
--
|
||||
2.13.3
|
||||
|
||||
From 2e5e9e16a4847b2e60cabc70e6b9bd7d633cb68a Mon Sep 17 00:00:00 2001
|
||||
From: Christos Zoulas <christos@zoulas.com>
|
||||
Date: Sat, 22 Jul 2017 17:21:24 +0000
|
||||
Subject: [PATCH] Strength decreased in magic file magic/Magdir/dump for new-fs
|
||||
dump file (little endian) to correctly recognize '*.mo' GNU message catalog
|
||||
(little endian).
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1226215
|
||||
|
||||
Upstream commit: https://github.com/file/file/commit/2e5e9e16a4847b2e60cabc70e6b9bd7d633cb68a
|
||||
|
||||
Signed-off-by: Marek Cermak <macermak@redhat.com>
|
||||
---
|
||||
magic/Magdir/dump | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/magic/Magdir/dump b/magic/Magdir/dump
|
||||
index 64742b7a..c5711661 100644
|
||||
--- a/magic/Magdir/dump
|
||||
+++ b/magic/Magdir/dump
|
||||
@@ -69,6 +69,8 @@
|
||||
>0 use old-dump-be
|
||||
diff -u file-5.31.orig/magic/Magdir/rpm file-5.31/magic/Magdir/rpm
|
||||
--- file-5.31.orig/magic/Magdir/rpm 2017-03-17 21:34:26.000000000 +0000
|
||||
+++ file-5.31/magic/Magdir/rpm 2017-10-11 14:30:57.480078009 +0000
|
||||
@@ -29,6 +29,7 @@
|
||||
>>8 beshort 17 SuperH
|
||||
>>8 beshort 18 Xtensa
|
||||
>>8 beshort 255 noarch
|
||||
+>>10 string x %s
|
||||
|
||||
24 lelong 60012 new-fs dump file (little endian),
|
||||
+# to correctly recognize '*.mo' GNU message catalog (little endian)
|
||||
+!:strength - 15
|
||||
>0 use \^new-dump-be
|
||||
#delta RPM Daniel Novotny (dnovotny@redhat.com)
|
||||
0 string drpm Delta RPM
|
||||
diff -u file-5.31.orig/magic/Magdir/ruby file-5.31/magic/Magdir/ruby
|
||||
--- file-5.31.orig/magic/Magdir/ruby 2017-03-17 21:34:26.000000000 +0000
|
||||
+++ file-5.31/magic/Magdir/ruby 2017-10-11 14:30:24.410682267 +0000
|
||||
@@ -6,27 +6,46 @@
|
||||
# From: Reuben Thomas <rrt@sc3d.org>
|
||||
|
||||
24 lelong 60011 old-fs dump file (little endian),
|
||||
--
|
||||
2.13.3
|
||||
|
||||
From f0e846528e1c839ab44895a1f13d167a4ad8def3 Mon Sep 17 00:00:00 2001
|
||||
From: Marek Cermak <macermak@redhat.com>
|
||||
Date: Wed, 20 Dec 2017 16:18:46 +0100
|
||||
Subject: [PATCH] Resolves: #1515180 - image/gif classifed as
|
||||
application/octet-stream
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1515180
|
||||
|
||||
Signed-off-by: Marek Cermak <macermak@redhat.com>
|
||||
---
|
||||
magic/Magdir/images | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/magic/Magdir/images b/magic/Magdir/images
|
||||
index 69e8e90f..76f7e7da 100644
|
||||
--- a/magic/Magdir/images
|
||||
+++ b/magic/Magdir/images
|
||||
@@ -468,7 +468,9 @@
|
||||
!:mime image/x-unknown
|
||||
# Ruby scripts
|
||||
-0 search/1/w #!\ /usr/bin/ruby Ruby script text executable
|
||||
+0 search/1/w #!\ /usr/bin/ruby Ruby script text executable
|
||||
!:strength + 15
|
||||
!:mime text/x-ruby
|
||||
0 search/1/w #!\ /usr/local/bin/ruby Ruby script text executable
|
||||
!:strength + 15
|
||||
!:mime text/x-ruby
|
||||
-0 search/1 #!/usr/bin/env\ ruby Ruby script text executable
|
||||
+0 search/1 #!/usr/bin/env\ ruby Ruby script text executable
|
||||
!:strength + 15
|
||||
!:mime text/x-ruby
|
||||
-0 search/1 #!\ /usr/bin/env\ ruby Ruby script text executable
|
||||
+0 search/1 #!\ /usr/bin/env\ ruby Ruby script text executable
|
||||
!:strength + 15
|
||||
!:mime text/x-ruby
|
||||
|
||||
# GIF
|
||||
+# Strength set up to beat 0x55AA DOS/MBR signature word lookups (+65)
|
||||
0 string GIF8 GIF image data
|
||||
+!:strength +80
|
||||
!:mime image/gif
|
||||
!:apple 8BIMGIFf
|
||||
>4 string 7a \b, version 8%s,
|
||||
--
|
||||
2.13.6
|
||||
|
||||
# What looks like ruby, but does not have a shebang
|
||||
# (modules and such)
|
||||
# From: Lubomir Rintel <lkundrak@v3.sk>
|
||||
-0 regex \^[\ \t]*require[\ \t]'[A-Za-z_/]+'
|
||||
->0 regex include\ [A-Z]|def\ [a-z]|\ do$
|
||||
->>0 regex \^[\ \t]*end([\ \t]*[;#].*)?$ Ruby script text
|
||||
+0 regex \^[[:space:]]*require[[:space:]]'[A-Za-z_/]+'
|
||||
+>0 regex def\ [a-z]|\ do$
|
||||
+>>&0 regex \^[[:space:]]*end([[:space:]]+[;#].*)?$ Ruby script text
|
||||
+!:strength + 30
|
||||
!:mime text/x-ruby
|
||||
-0 regex \^[\ \t]*(class|module)[\ \t][A-Z]
|
||||
+0 regex \^[[:space:]]*(class|module)[[:space:]][A-Z]
|
||||
>0 regex (modul|includ)e\ [A-Z]|def\ [a-z]
|
||||
->>0 regex \^[\ \t]*end([\ \t]*[;#].*)?$ Ruby module source text
|
||||
+>>&0 regex \^[[:space:]]*end([[:space:]]+[;#].*)?$ Ruby script text
|
||||
+!:strength + 30
|
||||
+!:mime text/x-ruby
|
||||
+# Classes with no modules or defs, beats simple ASCII
|
||||
+0 regex \^[[:space:]]*(class|module)[[:space:]][A-Z]
|
||||
+>&0 regex \^[[:space:]]*end([[:space:]]+[;#if].*)?$ Ruby script text
|
||||
+!:strength + 10
|
||||
+!:mime text/x-ruby
|
||||
+# Looks for function definiton to balance python magic
|
||||
+# def name (args)
|
||||
+# end
|
||||
+0 regex \^[[:space:]]*def\ [a-z]|def\ [[:alpha:]]+::[a-z]
|
||||
+>&0 regex \^[[:space:]]*end([[:space:]]+[;#].*)?$ Ruby script text
|
||||
+!:strength + 10
|
||||
+!:mime text/x-ruby
|
||||
+
|
||||
+0 regex \^[[:space:]]*require[[:space:]]'[A-Za-z_/]+' Ruby script text
|
||||
+!:mime text/x-ruby
|
||||
+0 regex \^[[:space:]]*include\ ([A-Z]+[a-z]*(::))+ Ruby script text
|
||||
!:mime text/x-ruby
|
||||
diff -u file-5.31.orig/magic/Magdir/securitycerts file-5.31/magic/Magdir/securitycerts
|
||||
--- file-5.31.orig/magic/Magdir/securitycerts 2017-03-17 21:34:26.000000000 +0000
|
||||
+++ file-5.31/magic/Magdir/securitycerts 2017-10-11 14:30:57.480078009 +0000
|
||||
@@ -4,3 +4,5 @@
|
||||
0 search/1 -----BEGIN\ CERTIFICATE------ RFC1421 Security Certificate text
|
||||
0 search/1 -----BEGIN\ NEW\ CERTIFICATE RFC1421 Security Certificate Signing Request text
|
||||
0 belong 0xedfeedfe Sun 'jks' Java Keystore File data
|
||||
+
|
||||
+0 string \0volume_key volume_key escrow packet
|
||||
diff -u file-5.31.orig/magic/Magdir/varied.script file-5.31/magic/Magdir/varied.script
|
||||
--- file-5.31.orig/magic/Magdir/varied.script 2017-03-17 21:34:26.000000000 +0000
|
||||
+++ file-5.31/magic/Magdir/varied.script 2017-10-11 14:30:57.480078009 +0000
|
||||
@@ -4,27 +4,35 @@
|
||||
|
||||
0 string/t #!\ / a
|
||||
>3 string >\0 %s script text executable
|
||||
+!:strength / 10
|
||||
|
||||
0 string/b #!\ / a
|
||||
>3 string >\0 %s script executable (binary data)
|
||||
+!:strength / 10
|
||||
|
||||
0 string/t #!\t/ a
|
||||
>3 string >\0 %s script text executable
|
||||
+!:strength / 10
|
||||
|
||||
0 string/b #!\t/ a
|
||||
>3 string >\0 %s script executable (binary data)
|
||||
+!:strength / 10
|
||||
|
||||
0 string/t #!/ a
|
||||
>2 string >\0 %s script text executable
|
||||
+!:strength / 10
|
||||
|
||||
0 string/b #!/ a
|
||||
>2 string >\0 %s script executable (binary data)
|
||||
+!:strength / 10
|
||||
|
||||
0 string/t #!\ script text executable
|
||||
>3 string >\0 for %s
|
||||
+!:strength / 10
|
||||
|
||||
0 string/b #!\ script executable
|
||||
>3 string >\0 for %s (binary data)
|
||||
+!:strength / 10
|
||||
|
||||
# using env
|
||||
0 string/t #!/usr/bin/env a
|
||||
@@ -1,40 +0,0 @@
|
||||
--TEST--
|
||||
Bug #66731: file: extensive backtraking, with pcre.jit=0
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (defined("PHP_DEBUG") && PHP_DEBUG)
|
||||
die("skip not suitable for debug build");
|
||||
if (!class_exists('finfo'))
|
||||
die('skip no fileinfo extension');
|
||||
?>
|
||||
--INI--
|
||||
pcre.jit=0
|
||||
--FILE--
|
||||
<?php
|
||||
$fd = __DIR__.'/cve-2014-3538.data';
|
||||
|
||||
file_put_contents($fd,
|
||||
'try:' .
|
||||
str_repeat("\n", 1000000));
|
||||
|
||||
$fi = finfo_open(FILEINFO_NONE);
|
||||
$t = microtime(true);
|
||||
var_dump(finfo_file($fi, $fd));
|
||||
$t = microtime(true) - $t;
|
||||
finfo_close($fi);
|
||||
if ($t < 1) {
|
||||
echo "Ok\n";
|
||||
} else {
|
||||
printf("Failed, time=%.2f\n", $t);
|
||||
}
|
||||
|
||||
?>
|
||||
Done
|
||||
--CLEAN--
|
||||
<?php
|
||||
@unlink(__DIR__.'/cve-2014-3538.data');
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(%d) "%s"
|
||||
Ok
|
||||
Done
|
||||
+64
-32
@@ -4829,22 +4829,6 @@
|
||||
# might add another one or two as time goes by...
|
||||
#
|
||||
### JAVA START ###
|
||||
0 belong 0xcafebabe
|
||||
>4 belong >30 compiled Java class data,
|
||||
!:mime application/x-java-applet
|
||||
>>6 beshort x version %d.
|
||||
>>4 beshort x \b%d
|
||||
# Which is which?
|
||||
#>>4 belong 0x032d (Java 1.0)
|
||||
#>>4 belong 0x032d (Java 1.1)
|
||||
>>4 belong 0x002e (Java 1.2)
|
||||
>>4 belong 0x002f (Java 1.3)
|
||||
>>4 belong 0x0030 (Java 1.4)
|
||||
>>4 belong 0x0031 (Java 1.5)
|
||||
>>4 belong 0x0032 (Java 1.6)
|
||||
>>4 belong 0x0033 (Java 1.7)
|
||||
>>4 belong 0x0034 (Java 1.8)
|
||||
|
||||
0 belong 0xcafed00d JAR compressed with pack200,
|
||||
>5 byte x version %d.
|
||||
>4 byte x \b%d
|
||||
@@ -4866,15 +4850,28 @@
|
||||
|
||||
0 belong 0xcafebabe
|
||||
>4 belong 1 Mach-O universal binary with 1 architecture:
|
||||
!:mime application/x-mach-binary
|
||||
>>8 use mach-o \b
|
||||
0 belong 0xcafebabe
|
||||
>4 belong >30 compiled Java class data,
|
||||
!:mime application/x-java-applet
|
||||
>>6 beshort x version %d.
|
||||
>>4 beshort x \b%d
|
||||
# Which is which?
|
||||
#>>4 belong 0x032d (Java 1.0)
|
||||
#>>4 belong 0x032d (Java 1.1)
|
||||
>>4 belong 0x002e (Java 1.2)
|
||||
>>4 belong 0x002f (Java 1.3)
|
||||
>>4 belong 0x0030 (Java 1.4)
|
||||
>>4 belong 0x0031 (Java 1.5)
|
||||
>>4 belong 0x0032 (Java 1.6)
|
||||
>>4 belong 0x0033 (Java 1.7)
|
||||
>>4 belong 0x0034 (Java 1.8)
|
||||
>4 belong >1
|
||||
>>4 belong <20 Mach-O universal binary with %d architectures:
|
||||
!:mime application/x-mach-binary
|
||||
>>>8 use mach-o \b
|
||||
>>4 belong 2
|
||||
>>4 belong >2
|
||||
>>>28 use mach-o \b
|
||||
>>4 belong 3
|
||||
>>4 belong >3
|
||||
>>>48 use mach-o \b
|
||||
>>4 belong 4
|
||||
>>>68 use mach-o \b
|
||||
@@ -8677,7 +8674,7 @@
|
||||
30 search/481 \x55\xAA
|
||||
# to display DOS/MBR boot sector (40) before old one (strength=50+21),Syslinux bootloader (71),SYSLINUX MBR (37+36),NetBSD mbr (110),AdvanceMAME mbr (111)
|
||||
# DOS BPB information (70) and after DOS floppy (120) like in previous file version
|
||||
!:strength +65
|
||||
!:strength +0
|
||||
# for sector sizes < 512 Bytes
|
||||
>11 uleshort <512
|
||||
>>(11.s-2) uleshort 0xAA55 DOS/MBR boot sector
|
||||
@@ -8689,7 +8686,7 @@
|
||||
0x1FE leshort 0xAA55 DOS/MBR boot sector
|
||||
#
|
||||
# to display information (50) before DOS BPB (strength=70) and after DOS floppy (120) like in old file version
|
||||
!:strength +65
|
||||
!:strength +0
|
||||
>2 string OSBS OS/BS MBR
|
||||
# added by Joerg Jenderek at Feb 2013 according to http://thestarman.pcministry.com/asm/mbr/
|
||||
# and http://en.wikipedia.org/wiki/Master_Boot_Record
|
||||
@@ -11684,6 +11681,16 @@
|
||||
>4 byte 43 for C++
|
||||
>4 byte 79 for Objective-C++
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# $File: gconv
|
||||
# gconv: file(1) magic for iconv/gconv module configuration cache
|
||||
#
|
||||
# Magic number defined in glibc/iconv/iconvconfig.h as GCONVCACHE_MAGIC
|
||||
#
|
||||
# From: Marek Cermak <macermak@redhat.com>
|
||||
#
|
||||
0 lelong 0x20010324 gconv module configuration cache data
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# $File: geo,v 1.4 2017/03/17 21:35:28 christos Exp $
|
||||
# Geo- files from Kurt Schwehr <schwehr@ccom.unh.edu>
|
||||
@@ -13699,9 +13706,7 @@
|
||||
!:mime image/x-unknown
|
||||
|
||||
# GIF
|
||||
# Strength set up to beat 0x55AA DOS/MBR signature word lookups (+65)
|
||||
0 string GIF8 GIF image data
|
||||
!:strength +80
|
||||
!:mime image/gif
|
||||
!:apple 8BIMGIFf
|
||||
>4 string 7a \b, version 8%s,
|
||||
@@ -21624,29 +21629,48 @@
|
||||
# From: Reuben Thomas <rrt@sc3d.org>
|
||||
|
||||
# Ruby scripts
|
||||
0 search/1/w #!\ /usr/bin/ruby Ruby script text executable
|
||||
0 search/1/w #!\ /usr/bin/ruby Ruby script text executable
|
||||
!:strength + 15
|
||||
!:mime text/x-ruby
|
||||
0 search/1/w #!\ /usr/local/bin/ruby Ruby script text executable
|
||||
!:strength + 15
|
||||
!:mime text/x-ruby
|
||||
0 search/1 #!/usr/bin/env\ ruby Ruby script text executable
|
||||
0 search/1 #!/usr/bin/env\ ruby Ruby script text executable
|
||||
!:strength + 15
|
||||
!:mime text/x-ruby
|
||||
0 search/1 #!\ /usr/bin/env\ ruby Ruby script text executable
|
||||
0 search/1 #!\ /usr/bin/env\ ruby Ruby script text executable
|
||||
!:strength + 15
|
||||
!:mime text/x-ruby
|
||||
|
||||
# What looks like ruby, but does not have a shebang
|
||||
# (modules and such)
|
||||
# From: Lubomir Rintel <lkundrak@v3.sk>
|
||||
0 regex \^[\ \t]*require[\ \t]'[A-Za-z_/]+'
|
||||
>0 regex include\ [A-Z]|def\ [a-z]|\ do$
|
||||
>>0 regex \^[\ \t]*end([\ \t]*[;#].*)?$ Ruby script text
|
||||
0 regex \^[[:space:]]*require[[:space:]]'[A-Za-z_/]+'
|
||||
>0 regex def\ [a-z]|\ do$
|
||||
>>&0 regex \^[[:space:]]*end([[:space:]]+[;#].*)?$ Ruby script text
|
||||
!:strength + 30
|
||||
!:mime text/x-ruby
|
||||
0 regex \^[\ \t]*(class|module)[\ \t][A-Z]
|
||||
0 regex \^[[:space:]]*(class|module)[[:space:]][A-Z]
|
||||
>0 regex (modul|includ)e\ [A-Z]|def\ [a-z]
|
||||
>>0 regex \^[\ \t]*end([\ \t]*[;#].*)?$ Ruby module source text
|
||||
>>&0 regex \^[[:space:]]*end([[:space:]]+[;#].*)?$ Ruby script text
|
||||
!:strength + 30
|
||||
!:mime text/x-ruby
|
||||
# Classes with no modules or defs, beats simple ASCII
|
||||
0 regex \^[[:space:]]*(class|module)[[:space:]][A-Z]
|
||||
>&0 regex \^[[:space:]]*end([[:space:]]+[;#if].*)?$ Ruby script text
|
||||
!:strength + 10
|
||||
!:mime text/x-ruby
|
||||
# Looks for function definiton to balance python magic
|
||||
# def name (args)
|
||||
# end
|
||||
0 regex \^[[:space:]]*def\ [a-z]|def\ [[:alpha:]]+::[a-z]
|
||||
>&0 regex \^[[:space:]]*end([[:space:]]+[;#].*)?$ Ruby script text
|
||||
!:strength + 10
|
||||
!:mime text/x-ruby
|
||||
|
||||
0 regex \^[[:space:]]*require[[:space:]]'[A-Za-z_/]+' Ruby script text
|
||||
!:mime text/x-ruby
|
||||
0 regex \^[[:space:]]*include\ ([A-Z]+[a-z]*(::))+ Ruby script text
|
||||
!:mime text/x-ruby
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
@@ -24170,27 +24194,35 @@
|
||||
|
||||
0 string/t #!\ / a
|
||||
>3 string >\0 %s script text executable
|
||||
!:strength / 10
|
||||
|
||||
0 string/b #!\ / a
|
||||
>3 string >\0 %s script executable (binary data)
|
||||
!:strength / 10
|
||||
|
||||
0 string/t #!\t/ a
|
||||
>3 string >\0 %s script text executable
|
||||
!:strength / 10
|
||||
|
||||
0 string/b #!\t/ a
|
||||
>3 string >\0 %s script executable (binary data)
|
||||
!:strength / 10
|
||||
|
||||
0 string/t #!/ a
|
||||
>2 string >\0 %s script text executable
|
||||
!:strength / 10
|
||||
|
||||
0 string/b #!/ a
|
||||
>2 string >\0 %s script executable (binary data)
|
||||
!:strength / 10
|
||||
|
||||
0 string/t #!\ script text executable
|
||||
>3 string >\0 for %s
|
||||
!:strength / 10
|
||||
|
||||
0 string/b #!\ script executable
|
||||
>3 string >\0 for %s (binary data)
|
||||
!:strength / 10
|
||||
|
||||
# using env
|
||||
0 string/t #!/usr/bin/env a
|
||||
|
||||
@@ -4829,22 +4829,6 @@
|
||||
# might add another one or two as time goes by...
|
||||
#
|
||||
### JAVA START ###
|
||||
0 belong 0xcafebabe
|
||||
>4 belong >30 compiled Java class data,
|
||||
!:mime application/x-java-applet
|
||||
>>6 beshort x version %d.
|
||||
>>4 beshort x \b%d
|
||||
# Which is which?
|
||||
#>>4 belong 0x032d (Java 1.0)
|
||||
#>>4 belong 0x032d (Java 1.1)
|
||||
>>4 belong 0x002e (Java 1.2)
|
||||
>>4 belong 0x002f (Java 1.3)
|
||||
>>4 belong 0x0030 (Java 1.4)
|
||||
>>4 belong 0x0031 (Java 1.5)
|
||||
>>4 belong 0x0032 (Java 1.6)
|
||||
>>4 belong 0x0033 (Java 1.7)
|
||||
>>4 belong 0x0034 (Java 1.8)
|
||||
|
||||
0 belong 0xcafed00d JAR compressed with pack200,
|
||||
>5 byte x version %d.
|
||||
>4 byte x \b%d
|
||||
@@ -4866,15 +4850,28 @@
|
||||
|
||||
0 belong 0xcafebabe
|
||||
>4 belong 1 Mach-O universal binary with 1 architecture:
|
||||
!:mime application/x-mach-binary
|
||||
>>8 use mach-o \b
|
||||
0 belong 0xcafebabe
|
||||
>4 belong >30 compiled Java class data,
|
||||
!:mime application/x-java-applet
|
||||
>>6 beshort x version %d.
|
||||
>>4 beshort x \b%d
|
||||
# Which is which?
|
||||
#>>4 belong 0x032d (Java 1.0)
|
||||
#>>4 belong 0x032d (Java 1.1)
|
||||
>>4 belong 0x002e (Java 1.2)
|
||||
>>4 belong 0x002f (Java 1.3)
|
||||
>>4 belong 0x0030 (Java 1.4)
|
||||
>>4 belong 0x0031 (Java 1.5)
|
||||
>>4 belong 0x0032 (Java 1.6)
|
||||
>>4 belong 0x0033 (Java 1.7)
|
||||
>>4 belong 0x0034 (Java 1.8)
|
||||
>4 belong >1
|
||||
>>4 belong <20 Mach-O universal binary with %d architectures:
|
||||
!:mime application/x-mach-binary
|
||||
>>>8 use mach-o \b
|
||||
>>4 belong 2
|
||||
>>4 belong >2
|
||||
>>>28 use mach-o \b
|
||||
>>4 belong 3
|
||||
>>4 belong >3
|
||||
>>>48 use mach-o \b
|
||||
>>4 belong 4
|
||||
>>>68 use mach-o \b
|
||||
@@ -8677,7 +8674,7 @@
|
||||
30 search/481 \x55\xAA
|
||||
# to display DOS/MBR boot sector (40) before old one (strength=50+21),Syslinux bootloader (71),SYSLINUX MBR (37+36),NetBSD mbr (110),AdvanceMAME mbr (111)
|
||||
# DOS BPB information (70) and after DOS floppy (120) like in previous file version
|
||||
!:strength +65
|
||||
!:strength +0
|
||||
# for sector sizes < 512 Bytes
|
||||
>11 uleshort <512
|
||||
>>(11.s-2) uleshort 0xAA55 DOS/MBR boot sector
|
||||
@@ -8689,7 +8686,7 @@
|
||||
0x1FE leshort 0xAA55 DOS/MBR boot sector
|
||||
#
|
||||
# to display information (50) before DOS BPB (strength=70) and after DOS floppy (120) like in old file version
|
||||
!:strength +65
|
||||
!:strength +0
|
||||
>2 string OSBS OS/BS MBR
|
||||
# added by Joerg Jenderek at Feb 2013 according to http://thestarman.pcministry.com/asm/mbr/
|
||||
# and http://en.wikipedia.org/wiki/Master_Boot_Record
|
||||
@@ -11684,6 +11681,16 @@
|
||||
>4 byte 43 for C++
|
||||
>4 byte 79 for Objective-C++
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# $File: gconv
|
||||
# gconv: file(1) magic for iconv/gconv module configuration cache
|
||||
#
|
||||
# Magic number defined in glibc/iconv/iconvconfig.h as GCONVCACHE_MAGIC
|
||||
#
|
||||
# From: Marek Cermak <macermak@redhat.com>
|
||||
#
|
||||
0 lelong 0x20010324 gconv module configuration cache data
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# $File: geo,v 1.4 2017/03/17 21:35:28 christos Exp $
|
||||
# Geo- files from Kurt Schwehr <schwehr@ccom.unh.edu>
|
||||
@@ -13699,9 +13706,7 @@
|
||||
!:mime image/x-unknown
|
||||
|
||||
# GIF
|
||||
# Strength set up to beat 0x55AA DOS/MBR signature word lookups (+65)
|
||||
0 string GIF8 GIF image data
|
||||
!:strength +80
|
||||
!:mime image/gif
|
||||
!:apple 8BIMGIFf
|
||||
>4 string 7a \b, version 8%s,
|
||||
@@ -21624,29 +21629,48 @@
|
||||
# From: Reuben Thomas <rrt@sc3d.org>
|
||||
|
||||
# Ruby scripts
|
||||
0 search/1/w #!\ /usr/bin/ruby Ruby script text executable
|
||||
0 search/1/w #!\ /usr/bin/ruby Ruby script text executable
|
||||
!:strength + 15
|
||||
!:mime text/x-ruby
|
||||
0 search/1/w #!\ /usr/local/bin/ruby Ruby script text executable
|
||||
!:strength + 15
|
||||
!:mime text/x-ruby
|
||||
0 search/1 #!/usr/bin/env\ ruby Ruby script text executable
|
||||
0 search/1 #!/usr/bin/env\ ruby Ruby script text executable
|
||||
!:strength + 15
|
||||
!:mime text/x-ruby
|
||||
0 search/1 #!\ /usr/bin/env\ ruby Ruby script text executable
|
||||
0 search/1 #!\ /usr/bin/env\ ruby Ruby script text executable
|
||||
!:strength + 15
|
||||
!:mime text/x-ruby
|
||||
|
||||
# What looks like ruby, but does not have a shebang
|
||||
# (modules and such)
|
||||
# From: Lubomir Rintel <lkundrak@v3.sk>
|
||||
0 regex \^[\ \t]*require[\ \t]'[A-Za-z_/]+'
|
||||
>0 regex include\ [A-Z]|def\ [a-z]|\ do$
|
||||
>>0 regex \^[\ \t]*end([\ \t]*[;#].*)?$ Ruby script text
|
||||
0 regex \^[[:space:]]*require[[:space:]]'[A-Za-z_/]+'
|
||||
>0 regex def\ [a-z]|\ do$
|
||||
>>&0 regex \^[[:space:]]*end([[:space:]]+[;#].*)?$ Ruby script text
|
||||
!:strength + 30
|
||||
!:mime text/x-ruby
|
||||
0 regex \^[\ \t]*(class|module)[\ \t][A-Z]
|
||||
0 regex \^[[:space:]]*(class|module)[[:space:]][A-Z]
|
||||
>0 regex (modul|includ)e\ [A-Z]|def\ [a-z]
|
||||
>>0 regex \^[\ \t]*end([\ \t]*[;#].*)?$ Ruby module source text
|
||||
>>&0 regex \^[[:space:]]*end([[:space:]]+[;#].*)?$ Ruby script text
|
||||
!:strength + 30
|
||||
!:mime text/x-ruby
|
||||
# Classes with no modules or defs, beats simple ASCII
|
||||
0 regex \^[[:space:]]*(class|module)[[:space:]][A-Z]
|
||||
>&0 regex \^[[:space:]]*end([[:space:]]+[;#if].*)?$ Ruby script text
|
||||
!:strength + 10
|
||||
!:mime text/x-ruby
|
||||
# Looks for function definiton to balance python magic
|
||||
# def name (args)
|
||||
# end
|
||||
0 regex \^[[:space:]]*def\ [a-z]|def\ [[:alpha:]]+::[a-z]
|
||||
>&0 regex \^[[:space:]]*end([[:space:]]+[;#].*)?$ Ruby script text
|
||||
!:strength + 10
|
||||
!:mime text/x-ruby
|
||||
|
||||
0 regex \^[[:space:]]*require[[:space:]]'[A-Za-z_/]+' Ruby script text
|
||||
!:mime text/x-ruby
|
||||
0 regex \^[[:space:]]*include\ ([A-Z]+[a-z]*(::))+ Ruby script text
|
||||
!:mime text/x-ruby
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
@@ -24170,27 +24194,35 @@
|
||||
|
||||
0 string/t #!\ / a
|
||||
>3 string >\0 %s script text executable
|
||||
!:strength / 10
|
||||
|
||||
0 string/b #!\ / a
|
||||
>3 string >\0 %s script executable (binary data)
|
||||
!:strength / 10
|
||||
|
||||
0 string/t #!\t/ a
|
||||
>3 string >\0 %s script text executable
|
||||
!:strength / 10
|
||||
|
||||
0 string/b #!\t/ a
|
||||
>3 string >\0 %s script executable (binary data)
|
||||
!:strength / 10
|
||||
|
||||
0 string/t #!/ a
|
||||
>2 string >\0 %s script text executable
|
||||
!:strength / 10
|
||||
|
||||
0 string/b #!/ a
|
||||
>2 string >\0 %s script executable (binary data)
|
||||
!:strength / 10
|
||||
|
||||
0 string/t #!\ script text executable
|
||||
>3 string >\0 for %s
|
||||
!:strength / 10
|
||||
|
||||
0 string/b #!\ script executable
|
||||
>3 string >\0 for %s (binary data)
|
||||
!:strength / 10
|
||||
|
||||
# using env
|
||||
0 string/t #!/usr/bin/env a
|
||||
|
||||
Loaded 100 of 472 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user