summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--EXTENSIONS8
-rw-r--r--NEWS707
-rw-r--r--README.GIT-RULES17
-rw-r--r--TSRM/tsrm_win32.c18
-rw-r--r--TSRM/tsrm_win32.h7
-rw-r--r--UPGRADING388
-rw-r--r--UPGRADING.INTERNALS64
-rw-r--r--Zend/tests/ast/zend-pow-assign.phpt11
-rw-r--r--Zend/zend_ast.c2
-rw-r--r--Zend/zend_extensions.h2
-rw-r--r--Zend/zend_multiply.h24
-rw-r--r--Zend/zend_operators.h69
-rw-r--r--Zend/zend_virtual_cwd.c2
-rw-r--r--Zend/zend_vm_def.h9
-rw-r--r--Zend/zend_vm_execute.h36
-rw-r--r--acinclude.m4120
-rw-r--r--configure.in14
-rw-r--r--ext/dba/config.w3217
-rw-r--r--ext/exif/config.w3218
-rw-r--r--ext/exif/exif.c425
-rw-r--r--ext/exif/tests/bug68547.jpgbin0 -> 713 bytes
-rw-r--r--ext/exif/tests/bug68547.phpt12
-rw-r--r--ext/exif/tests/bug68799.phpt4
-rw-r--r--ext/exif/tests/bug71534.phpt12
-rw-r--r--ext/exif/tests/bug71534.tiffbin0 -> 3932 bytes
-rw-r--r--ext/exif/tests/bug72094.phpt4
-rw-r--r--ext/exif/tests/bug72735/bug72682.phpt17
-rw-r--r--ext/exif/tests/bug72735/bug72735.phpt24
-rw-r--r--ext/exif/tests/bug72735/nokia.jpgbin0 -> 51625 bytes
-rw-r--r--ext/exif/tests/bug72735/panasonic.jpgbin0 -> 16629 bytes
-rw-r--r--ext/exif/tests/bug72735/samsung.jpgbin0 -> 29075 bytes
-rw-r--r--ext/exif/tests/exif_imagetype_variation1.phpt12
-rw-r--r--ext/exif/tests/exif_tagname_variation1-64bit.phpt183
-rw-r--r--ext/exif/tests/exif_tagname_variation1.phpt38
-rw-r--r--ext/exif/tests/redhat-bug1362571.jpgbin0 -> 16629 bytes
-rw-r--r--ext/exif/tests/redhat-bug1362571.phpt10
-rw-r--r--ext/exif/tests/sony.jpgbin0 -> 62048 bytes
-rw-r--r--ext/exif/tests/sony.phpt23
-rw-r--r--ext/gd/gd.c20
-rw-r--r--ext/gmp/gmp.c11
-rw-r--r--ext/gmp/tests/gmp_fact.phpt6
-rw-r--r--ext/gmp/tests/gmp_sqrtrem.phpt16
-rw-r--r--ext/interbase/ibase_query.c6
-rw-r--r--ext/interbase/interbase.c2
-rw-r--r--ext/mbstring/mbstring.c402
-rw-r--r--ext/mbstring/mbstring.h4
-rw-r--r--ext/mbstring/tests/bug69086.phpt17
-rw-r--r--ext/mbstring/tests/mb_chr.phpt59
-rw-r--r--ext/mbstring/tests/mb_chr_ord.phpt2062
-rw-r--r--ext/mbstring/tests/mb_ord.phpt40
-rw-r--r--ext/mbstring/tests/mb_scrub.phpt14
-rw-r--r--ext/opcache/Optimizer/zend_ssa.c5
-rw-r--r--ext/openssl/openssl.c1
-rw-r--r--ext/openssl/tests/openssl_decrypt_ccm.phpt6
-rw-r--r--ext/openssl/tests/openssl_decrypt_gcm.phpt6
-rw-r--r--ext/pdo/tests/pecl_bug_5217.phpt2
-rw-r--r--ext/pdo_mysql/tests/mysql_pdo_test.inc2
-rw-r--r--ext/standard/info.c16
-rw-r--r--ext/standard/tests/general_functions/type.phpt2
-rw-r--r--ext/standard/tests/serialize/serialization_objects_005.phpt4
-rw-r--r--ext/standard/type.c23
-rw-r--r--main/main.c16
-rw-r--r--main/php.h2
-rw-r--r--main/php_globals.h1
-rw-r--r--main/php_version.h6
-rw-r--r--php.ini-development10
-rw-r--r--php.ini-production10
-rw-r--r--sapi/fpm/.gitignore4
-rw-r--r--win32/build/config.w324
-rw-r--r--win32/build/confutils.js2
-rw-r--r--win32/dllmain.c18
-rw-r--r--win32/ftok.c2
-rw-r--r--win32/getrusage.c2
-rw-r--r--win32/ioutil.h2
-rw-r--r--win32/ipc.h8
-rw-r--r--win32/time.c15
-rw-r--r--win32/time.h2
77 files changed, 3740 insertions, 1387 deletions
diff --git a/EXTENSIONS b/EXTENSIONS
index e51f1affed..f2820d2c66 100644
--- a/EXTENSIONS
+++ b/EXTENSIONS
@@ -262,6 +262,12 @@ PRIMARY MAINTAINER: Derick Rethans <derick@php.net>
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
+EXTENSION: enchant
+PRIMARY MAINTAINER: Unknown
+MAINTENANCE: Maintained
+STATUS: Working
+SINCE: 5.3
+-------------------------------------------------------------------------------
EXTENSION: exif
PRIMARY MAINTAINER: Marcus Boerger <helly@php.net>
MAINTENANCE: Maintained
@@ -281,7 +287,7 @@ STATUS: Working
SINCE: 5.2
-------------------------------------------------------------------------------
EXTENSION: ftp
-PRIMARY MAINTAINER: Stefan Esser <sesser@php.net>
+PRIMARY MAINTAINER: Unknown
MAINTENANCE: Odd fixes
STATUS: Working
-------------------------------------------------------------------------------
diff --git a/NEWS b/NEWS
index 74772a7270..a91137ea8d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,694 +1,33 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-?? ??? 2016, PHP 7.1.0RC1
+?? ??? 2016, PHP 7.2.0alpha1
- Core:
- . Fixed bug #72598 (Reference is lost after array_slice()) (Nikita)
-
-- COM:
- . Fixed bug #72922 (COM called from PHP does not return out parameters).
- (Anatol)
-
-- Dba:
- . Fixed bug #70825 (Cannot fetch multiple values with group in ini file).
- (cmb)
-
-- GD:
- . Fixed bug #66005 (imagecopy does not support 1bit transparency on truecolor
- images). (cmb)
- . Fixed bug #72913 (imagecopy() loses single-color transparency on palette
- images). (cmb)
- . Fixed bug #68716 (possible resource leaks in _php_image_convert()). (cmb)
-
-- Intl:
- . Fixed bug #65732 (grapheme_*() is not Unicode compliant on CR LF
- sequence). (cmb)
-
-- Reflection:
- . Reverted prepending \ for class names. (Trowski)
-
-- Standard:
- . Fixed bug #72920 (Accessing a private constant using constant() creates
- an exception AND warning). (Laruence)
-
-- XML:
- . Fixed bug #72714 (_xml_startElementHandler() segmentation fault). (cmb)
-
-18 Aug 2016, PHP 7.1.0beta3
-
-- Core:
- . Fixed bug #72813 (Segfault with __get returned by ref). (Laruence)
- . Fixed bug #72767 (PHP Segfaults when trying to expand an infinite operator).
- (Nikita)
- . TypeError messages for arg_info type checks will now say "must be ...
- or null" where the parameter or return type accepts null. (Andrea)
- . Fixed bug #72857 (stream_socket_recvfrom read access violation). (Anatol)
- . Fixed bug #72663 (Create an Unexpected Object and Don't Invoke
- __wakeup() in Deserialization). (Stas)
- . Fixed bug #72681 (PHP Session Data Injection Vulnerability). (Stas)
- . Fixed bug #72742 (memory allocator fails to realloc small block to large
- one). (Stas)
-
-- Bz2:
- . Fixed bug #72837 (integer overflow in bzdecompress caused heap
- corruption). (Stas)
-
-- Curl
- . Fixed bug #72674 (Heap overflow in curl_escape). (Stas)
+ . Removed the sql.safe_mode directive. (Kalle)
+ . Fixed bug #54535 (WSA cleanup executes before MSHUTDOWN). (Kalle)
- EXIF:
- . Fixed bug #72735 (Samsung picture thumb not read (zero size)). (Kalle, Remi)
- . Fixed bug #72627 (Memory Leakage In exif_process_IFD_in_TIFF). (Stas)
-
-- FTP:
- . Fixed bug #70195 (Cannot upload file using ftp_put to FTPES with
- require_ssl_reuse). (Benedict Singer)
-
-- mbstring:
- . Fixed bug #72711 (`mb_ereg` does not clear the `$regs` parameter on
- failure). (ju1ius)
-
-- Mcrypt:
- . Fixed bug #72782 (Heap Overflow due to integer overflows). (Stas)
-
-- OCI8
- . Fixed invalid handle error with Implicit Result Sets. (Chris Jones)
- . Fixed bug #72524 (Binding null values triggers ORA-24816 error). (Chris Jones)
-
-- Opcache:
- . Fixed bug #72762 (Infinite loop while parsing a file with opcache enabled).
- (Nikita)
-
-- PDO:
- . Fixed bug #72788 (Invalid memory access when using persistent PDO
- connection). (Keyur)
- . Fixed bug #72791 (Memory leak in PDO persistent connection handling). (Keyur)
- . Fixed bug #60665 (call to empty() on NULL result using PDO::FETCH_LAZY
- returns false). (cmb)
-
-- Reflection:
- . Implemented request #38992 (invoke() and invokeArgs() static method calls
- should match). (cmb).
- . Add ReflectionNamedType::getName(). This method should be used instead of
- ReflectionType::__toString()
- . Prepend \ for class names and ? for nullable types returned from
- ReflectionType::__toString(). (Trowski)
-
-- Session:
- . Implemented RFC: Session ID without hashing. (Yasuo)
- https://wiki.php.net/rfc/session-id-without-hashing
-
-- SPL:
- . Fixed bug #72888 (Segfault on clone on splFileObject). (Laruence)
-
-- SQLite3:
- . Updated to SQLite3 3.14.0. (cmb)
-
-- Standard:
- . Fixed bug #55451 (substr_compare NULL length interpreted as 0). (Lauri
- Kenttä)
- . Fixed bug #72278 (getimagesize returning FALSE on valid jpg). (cmb)
-
-- Stream:
- . Fixed bug #72853 (stream_set_blocking doesn't work). (Laruence)
- . Fixed bug #72743 (Out-of-bound read in php_stream_filter_create).
- (Loianhtuan)
- . Implemented FR #27814 (Multiple small packets send for HTTP request).
- (vhuk)
- . Fixed bug #72764 (ftps:// opendir wrapper data channel encryption fails
- with IIS FTP 7.5, 8.5). (vhuk)
- . Fixed bug #72810 (Missing SKIP_ONLINE_TESTS checks). (vhuk)
-
-- sysvshm:
- . Fixed bug #72858 (shm_attach null dereference). (Anatol)
-
-- XML:
- . Fixed bug #72085 (SEGV on unknown address zif_xml_parse). (cmb)
-
-- ZIP:
- . Fixed bug #68302 (impossible to compile php with zip support). (cmb)
-
-04 Aug 2016, PHP 7.1.0beta2
-
-- Core:
- . Implemented FR #72614 (Support "nmake test" on building extensions by
- phpize). (Yuji Uchiyama)
- . Fixed bug #72641 (phpize (on Windows) ignores PHP_PREFIX).
- (Yuji Uchiyama)
- . Fixed bug #72683 (getmxrr broken). (Anatol)
-
-- Calendar:
- . Fixed bug #67976 (cal_days_month() fails for final month of the French
- calendar). (cmb)
- . Fixed bug #71894 (AddressSanitizer: global-buffer-overflow in
- zif_cal_from_jd). (cmb)
-
-- CURL:
- . Fixed bug #71709 (curl_setopt segfault with empty CURLOPT_HTTPHEADER).
- (Pierrick)
- . Fixed bug #71929 (CURLINFO_CERTINFO data parsing error). (Pierrick)
-
-- Intl:
- . Fixed bug #72639 (Segfault when instantiating class that extends
- IntlCalendar and adds a property). (Laruence)
- . Fixed bug #72658 (Locale::lookup() / locale_lookup() hangs if no match
- found). (Anatol)
-
-- GD:
- . Fixed bug #72709 (imagesetstyle() causes OOB read for empty $styles). (cmb)
- . Fixed bug #72697 (select_colors write out-of-bounds). (Stas)
- . Fixed bug #72730 (imagegammacorrect allows arbitrary write access). (Stas)
-
-- mbstring:
- . Fixed bug #72691 (mb_ereg_search raises a warning if a match zero-width).
- (cmb)
- . Fixed bug #72693 (mb_ereg_search increments search position when a match
- zero-width). (cmb)
- . Fixed bug #72694 (mb_ereg_search_setpos does not accept a string's last
- position). (cmb)
- . Fixed bug #72710 (`mb_ereg` causes buffer overflow on regexp compile error).
- (ju1ius)
-
-- Mysqlnd:
- . Fixed bug #71863 (Segfault when EXPLAIN with "Unknown column" error when
- using MariaDB). (Andrey)
- . Fixed bug #72701 (mysqli_get_host_info() wrong output). (Anatol)
-
-- PCRE:
- . Fixed bug #72688 (preg_match missing group names in matches). (cmb)
- . Downgraded to PCRE 8.38. (Anatol)
-
-- Reflection:
- . Fixed bug #72661 (ReflectionType::__toString crashes with iterable).
- (Laruence)
-
-- SNMP:
- . Fixed bug #72708 (php_snmp_parse_oid integer overflow in memory
- allocation). (djodjo at gmail dot com)
-
-- SPL:
- . Fixed bug #72646 (SplFileObject::getCsvControl does not return the escape
- character). (cmb)
- . Fixed bug #72684 (AppendIterator segfault with closed generator). (Pierrick)
-
-- SQLite3:
- . Fixed bug #72668 (Spurious warning when exception is thrown in user defined
- function). (Laruence)
- . Implemented FR #72653 (SQLite should allow opening with empty filename).
- (cmb)
-
-- Standard:
- . Fixed bug #61967 (unset array item in array_walk_recursive cause
- inconsistent array). (Nikita)
- . Fixed bug #62607 (array_walk_recursive move internal pointer). (Nikita)
- . Fixed bug #69068 (Exchanging array during array_walk -> memory errors).
- (Nikita)
- . Fixed bug #70713 (Use After Free Vulnerability in array_walk()/
- array_walk_recursive()). (Nikita)
-
-- Streams:
- . Fixed bug #41021 (Problems with the ftps wrapper). (vhuk)
- . Fixed bug #54431 (opendir() does not work with ftps:// wrapper). (vhuk)
- . Fixed bug #72667 (opendir() with ftp:// attempts to open data stream for
- non-existent directories). (vhuk)
- . Fixed bug #72771 (ftps:// wrapper is vulnerable to protocol downgrade
- attack). (Stas)
-
-- Wddx:
- . Fixed bug #72142 (WDDX Packet Injection Vulnerability in
- wddx_serialize_value()). (Taoguang Chen)
- . Fixed bug #72749 (wddx_deserialize allows illegal memory access) (Stas)
- . Fixed bug #72750 (wddx_deserialize null dereference). (Stas)
- . Fixed bug #72790 (wddx_deserialize null dereference with invalid xml).
- (Stas)
- . Fixed bug #72799 (wddx_deserialize null dereference in
- php_wddx_pop_element). (Stas)
-
-- XMLRPC:
- . Fixed bug #72647 (xmlrpc_encode() unexpected output after referencing
- array elements). (Laruence)
-
-- Zip:
- . Fixed bug #72660 (NULL Pointer dereference in zend_virtual_cwd).
- (Laruence)
-
-21 Jul 2016, PHP 7.1.0beta1
-
-- Core:
- . Fixed bug #72629 (Caught exception assignment to variables ignores
- references). (Laruence)
- . Fixed bug #72594 (Calling an earlier instance of an included anonymous
- class fatals). (Laruence)
- . Fixed bug #72581 (previous property undefined in Exception after
- deserialization). (Laruence)
- . Fixed bug #72543 (Different references behavior comparing to PHP 5)
- (Laruence, Dmitry, Nikita)
- . Fixed bug #72347 (VERIFY_RETURN type casts visible in finally). (Dmitry)
- . Fixed bug #72216 (Return by reference with finally is not memory safe).
- (Dmitry)
- . Fixed bug #72215 (Wrong return value if var modified in finally). (Dmitry)
- . Fixed bug #71818 (Memory leak when array altered in destructor). (Dmitry)
- . Fixed bug #71539 (Memory error on $arr[$a] =& $arr[$b] if RHS rehashes)
- (Dmitry, Nikita)
- . Added new constant PHP_FD_SETSIZE. (cmb)
- . Added optind parameter to getopt(). (as)
- . Added PHP to SAPI error severity mapping for logs. (Martin Vobruba)
- . Fixed bug #71911 (Unable to set --enable-debug on building extensions by
- phpize on Windows). (Yuji Uchiyama)
- . Fixed bug #29368 (The destructor is called when an exception is thrown from
- the constructor). (Dmitry)
- . Implemented RFC: RNG Fixes. (Leigh)
- . Implemented email validation as per RFC 6531. (Leo Feyer, Anatol)
- . Fixed bug #72513 (Stack-based buffer overflow vulnerability in
- virtual_file_ex). (Stas)
- . Fixed bug #72573 (HTTP_PROXY is improperly trusted by some PHP libraries
- and applications). (Stas)
-
-- bz2:
- . Fixed bug #72613 (Inadequate error handling in bzread()). (Stas)
-
-- COM:
- . Fixed bug #72569 (DOTNET/COM array parameters broke in PHP7). (Anatol)
-
-- Curl:
- . Fixed bug #72541 (size_t overflow lead to heap corruption). (Stas)
-
-- Date:
- . Fixed bug #66836 (DateTime::createFromFormat 'U' with pre 1970 dates fails
- parsing). (derick)
-
-- DOM:
- . Fixed bug #66502 (DOM document dangling reference). (Sean Heelan, cmb)
-
-- Exif:
- . Fixed bug #72603 (Out of bound read in exif_process_IFD_in_MAKERNOTE).
- (Stas)
- . Fixed bug #72618 (NULL Pointer Dereference in exif_process_user_comment).
- (Stas)
-
-- Filter:
- . Fixed bug #71745 (FILTER_FLAG_NO_RES_RANGE does not cover whole 127.0.0.0/8
- range). (bugs dot php dot net at majkl578 dot cz)
-
-- FPM:
- . Fixed bug #72575 (using --allow-to-run-as-root should ignore missing user).
- (gooh)
-
-- GD:
- . Fixed bug #72596 (imagetypes function won't advertise WEBP support). (cmb)
- . Fixed bug #72604 (imagearc() ignores thickness for full arcs). (cmb)
- . Fixed bug #70315 (500 Server Error but page is fully rendered). (cmb)
- . Fixed bug #43828 (broken transparency of imagearc for truecolor in
- blendingmode). (cmb)
- . Fixed bug #72512 (gdImageTrueColorToPaletteBody allows arbitrary write/read
- access). (Pierre)
- . Fixed bug #72519 (imagegif/output out-of-bounds access). (Pierre)
- . Fixed bug #72558 (Integer overflow error within _gdContributionsAlloc()).
- (Pierre)
- . Fixed bug #72482 (Ilegal write/read access caused by gdImageAALine
- overflow). (Pierre)
- . Fixed bug #72494 (imagecropauto out-of-bounds access). (Pierre)
-
-- Intl:
- . Partially fixed #72506 (idn_to_ascii for UTS #46 incorrect for long domain
- names). (cmb)
- . Fixed bug #72533 (locale_accept_from_http out-of-bounds access). (Stas)
+ . Added support for vendor specific tags for the following formats:
+ Samsung, DJI, Panasonic, Sony, Pentax, Minolta & Sigma/Foveon. (Kalle)
+ . Fixed bug #72682 (exif_read_data() fails to read all data for some
+ images). (Kalle)
+ . Fixed bug #71534 (Type confusion in exif_read_data() leading to heap
+ overflow in debug mode). (hlt99 at blinkenshell dot org, Kalle)
+ . Fixed bug #68547 (Exif Header component value check error).
+ (sjh21a at gmail dot com, Kalle)
+ . Fixed bug #66443 (Corrupt EXIF header: maximum directory nesting level
+ reached for some cameras). (Kalle)
+ . Fixed Redhat bug #1362571 (PHP not returning full results for
+ exif_read_data function). (Kalle)
+
+- GMP:
+ . Fixed bug #70896 (gmp_fact() silently ignores non-integer input). (Sara)
- Mbstring:
- . Deprecated mb_ereg_replace() eval option. (Rouven Weßling, cmb)
- . Fixed bug #69151 (mb_ereg should reject ill-formed byte sequence).
- (Masaki Kagaya)
-
-- MCrypt:
- . Deprecated ext/mcrypt. (Scott Arciszewski, cmb)
- . Fixed bug #72551, bug #72552 (In correct casting from size_t to int lead to
- heap overflow in mdecrypt_generic). (Stas)
-
-- Opcache:
- . Fixed bug #72590 (Opcache restart with kill_all_lockers does not work).
- (Keyur)
-
-- OpenSSL:
- . Fixed bug #72360 (ext/openssl build failure with OpenSSL 1.1.0).
- (Jakub Zelenka)
- . Bumped a minimal version to 1.0.1. (Jakub Zelenka)
- . Dropped support for SSL2. (Remi)
-
-- PDO_pgsql:
- . Fixed bug #70313 (PDO statement fails to throw exception). (Matteo)
- . Fixed bug #72570 (Segmentation fault when binding parameters on a query
- without placeholders). (Matteo)
- . Implemented FR #72633 (Postgres PDO lastInsertId() should work without
- specifying a sequence). (Pablo Santiago Sánchez, Matteo)
-
-- Pcntl
- . Implemented asynchronous signal handling without TICKS. (Dmitry)
- . Added pcntl_signal_get_handler() that returns the current signal handler
- for a particular signal. Addresses FR #72409. (David Walker)
- . Add signinfo to pcntl_signal() handler args (Bishop Bettini, David Walker)
-
-- Reflection:
- . Fixed bug #72222 (ReflectionClass::export doesn't handle array constants).
- (Nikita Nefedov)
-
-- SimpleXML:
- . Fixed bug #72588 (Using global var doesn't work while accessing SimpleXML
- element). (Laruence)
-
-- Standard:
- . Fixed bug #72622 (array_walk + array_replace_recursive create references
- from nothing). (Laruence)
- . Fixed bug #72330 (CSV fields incorrectly split if escape char followed by
- UTF chars). (cmb)
-
-- Tidy:
- . Implemented support for libtidy 5.0.0 and above. (Michael Orlitzky, Anatol)
-
-- Wddx:
- . Fixed bug #72564 (boolean always deserialized as "true") (Remi)
-
-- XMLRPC:
- . Fixed bug #72606 (heap-buffer-overflow (write) simplestring_addn
- simplestring.c). (Stas)
-
-- Zip:
- . Fixed bug #72520 (Stack-based buffer overflow vulnerability in
- php_stream_zip_opener). (Stas)
-
-07 Jul 2016, PHP 7.1.0alpha3
-
-- Core:
- . Implemented RFC: Iterable. (Aaron Piotrowski)
- . Fixed bug #72523 (dtrace issue with reflection (failed test)). (Laruence)
- . Fixed bug #72508 (strange references after recursive function call and
- "switch" statement). (Laruence)
- . Implemented RFC: Closure::fromCallable (Danack)
-
-- COM:
- . Fixed bug #72498 (variant_date_from_timestamp null dereference). (Anatol)
-
-- CURL:
- . Add curl_multi_errno(), curl_share_errno() and curl_share_strerror()
- functions. (Pierrick)
- . Add support for HTTP/2 Server Push (davey)
-
-- Date:
- . Invalid serialization data for a DateTime or DatePeriod object will now
- throw an instance of Error from __wakeup() or __set_state() instead of
- resulting in a fatal error. (Aaron Piotrowski)
- . Timezone initialization failure from serialized data will now throw an
- instance of Error from __wakeup() or __set_state() instead of resulting in
- a fatal error. (Aaron Piotrowski)
- . Export date_get_interface_ce() for extension use. (Jeremy Mikola)
-
-- DBA:
- . Data modification functions (e.g.: dba_insert()) now throw an instance of
- Error instead of triggering a catchable fatal error if the key is does not
- contain exactly two elements. (Aaron Piotrowski)
-
-- DOM:
- . Invalid schema or RelaxNG validation contexts will throw an instance of
- Error instead of resulting in a fatal error. (Aaron Piotrowski)
- . Attempting to register a node class that does not extend the appropriate
- base class will now throw an instance of Error instead of resulting in a
- fatal error. (Aaron Piotrowski)
- . Attempting to read an invalid or write to a readonly property will throw
- an instance of Error instead of resulting in a fatal error. (Aaron
- Piotrowski)
-
-- GD:
- . Fixed bug #72404 (imagecreatefromjpeg fails on selfie). (cmb)
-
-- IMAP:
- . An email address longer than 16385 bytes will throw an instance of Error
- instead of resulting in a fatal error. (Aaron Piotrowski)
-
-- Intl:
- . Failure to call the parent constructor in a class extending Collator
- before invoking the parent methods will throw an instance of Error
- instead of resulting in a recoverable fatal error. (Aaron Piotrowski)
- . Cloning a Transliterator object may will now throw an instance of Error
- instead of resulting in a fatal error if cloning the internal
- transliterator fails. (Aaron Piotrowski)
-
-- LDAP:
- . Providing an unknown modification type to ldap_batch_modify() will now
- throw an instance of Error instead of resulting in a fatal error.
- (Aaron Piotrowski)
-
-- Mbstring:
- . mb_ereg() and mb_eregi() will now throw an instance of ParseError if an
- invalid PHP expression is provided and the 'e' option is used. (Aaron
- Piotrowski)
-
-- Mcrypt:
- . mcrypt_encrypt() and mcrypt_decrypt() will throw an instance of Error
- instead of resulting in a fatal error if mcrypt cannot be initialized.
- (Aaron Piotrowski)
-
-- Mysqli:
- . Attempting to read an invalid or write to a readonly property will throw
- an instance of Error instead of resulting in a fatal error. (Aaron
- Piotrowski)
-
-- OpenSSL:
- . Implemented FR #61204 (Add elliptic curve support for OpenSSL).
- (Dominic Luechinger)
-
-- PCRE:
- . Fixed bug #72476 (Memleak in jit_stack). (Laruence)
- . Fixed bug #72463 (mail fails with invalid argument). (Anatol)
-
-- Readline:
- . Fixed bug #72538 (readline_redisplay crashes php). (Laruence)
-
-- Reflection:
- . Failure to retrieve a reflection object or retrieve an object property
- will now throw an instance of Error instead of resulting in a fatal error.
- (Aaron Piotrowski)
-
-- SQLite3:
- . Fixed bug #70628 (Clearing bindings on an SQLite3 statement doesn't work).
- (cmb)
-
-- Session:
- . Fixed bug #72531 (ps_files_cleanup_dir Buffer overflow). (Laruence)
- . Custom session handlers that do not return strings for session IDs will
- now throw an instance of Error instead of resulting in a fatal error
- when a function is called that must generate a session ID.
- (Aaron Piotrowski)
- . An invalid setting for session.hash_function will throw an instance of
- Error instead of resulting in a fatal error when a session ID is created.
- (Aaron Piotrowski)
- . Fixed bug #72562 (Use After Free in unserialize() with Unexpected Session
- Deserialization). (Stas)
-
-- SimpleXML:
- . Creating an unnamed or duplicate attribute will throw an instance of Error
- instead of resulting in a fatal error. (Aaron Piotrowski)
-
-- SNMP:
- . Fixed bug #72479 (Use After Free Vulnerability in SNMP with GC and
- unserialize()). (Stas)
-
-- SPL:
- . Attempting to clone an SplDirectory object will throw an instance of Error
- instead of resulting in a fatal error. (Aaron Piotrowski)
- . Calling ArrayIterator::append() when iterating over an object will throw an
- instance of Error instead of resulting in a fatal error. (Aaron Piotrowski)
- . Fixed bug #55701 (GlobIterator throws LogicException). (Valentin VĂLCIU)
-
-- Standard:
- . Implemented RFC: More precise float values. (Jakub Zelenka, Yasuo)
- . array_multisort now uses zend_sort instead zend_qsort. (Laruence)
- . Fixed bug #72505 (readfile() mangles files larger than 2G). (Cschneid)
- . assert() will throw a ParseError when evaluating a string given as the first
- argument if the PHP code is invalid instead of resulting in a catchable
- fatal error. (Aaron Piotrowski)
- . Calling forward_static_call() outside of a class scope will now throw an
- instance of Error instead of resulting in a fatal error. (Aaron Piotrowski)
-
-- Streams:
- . Fixed bug #72534 (stream_socket_get_name crashes). (Anatol)
-
-- Tidy:
- . Creating a tidyNode manually will now throw an instance of Error instead of
- resulting in a fatal error. (Aaron Piotrowski)
-
-- WDDX:
- . A circular reference when serializing will now throw an instance of Error
- instead of resulting in a fatal error. (Aaron Piotrowski)
-
-- XML-RPC:
- . A circular reference when serializing will now throw an instance of Error
- instead of resulting in a fatal error. (Aaron Piotrowski)
-
-- Zip:
- . ZipArchive::addGlob() will throw an instance of Error instead of resulting
- in a fatal error if glob support is not available. (Aaron Piotrowski)
-
-23 Jun 2016, PHP 7.1.0alpha2
-
-- Core:
- . Implemented RFC: Replace "Missing argument" warning with "Too few
- arguments" exception. (Dmitry)
- . Implemented RFC: Fix inconsistent behavior of $this variable. (Dmitry)
- . Fixed bug #72441 (Segmentation fault: RFC list_keys). (Laruence)
- . Fixed bug #72395 (list() regression). (Laruence)
- . Fixed bug #72373 (TypeError after Generator function w/declared return type
- finishes). (Nikita)
- . Fixed bug #69489 (tempnam() should raise notice if falling back to temp dir).
- (Laruence, Anatol)
- . Fixed UTF-8 and long path support on Windows. (Anatol)
-
-- Date:
- . Fixed bug #63740 (strtotime seems to use both sunday and monday as start of
- week). (Derick)
-
-- GD:
- . Fixed bug #43475 (Thick styled lines have scrambled patterns). (cmb)
- . Fixed bug #53640 (XBM images require width to be multiple of 8). (cmb)
- . Fixed bug #64641 (imagefilledpolygon doesn't draw horizontal line). (cmb)
-
-- JSON
- . Implemented FR #46600 ("_empty_" key in objects). (Jakub Zelenka)
-
-- Mbstring:
- . Fixed bug #72405 (mb_ereg_replace - mbc_to_code (oniguruma) -
- oob read access). (Laruence)
- . Fixed bug #72399 (Use-After-Free in MBString (search_re)). (Laruence)
-
-- OpenSSL:
- . Implemented FR #67304 (Added AEAD support [CCM and GCM modes] to
- openssl_encrypt and openssl_decrypt). (Jakub Zelenka)
- . Implemented error storing to the global queue and cleaning up the OpenSSL
- error queue (resolves bugs #68276 and #69882). (Jakub Zelenka)
-
-- PCRE:
- . Upgraded to PCRE 8.39. (Anatol)
-
-- Sqlite3:
- . Implemented FR #72385 (Update SQLite bundle lib(3.13.0)). (Laruence)
-
-- Standard:
- . Added is_iterable() function. (Aaron Piotrowski)
- . Fixed bug #72306 (Heap overflow through proc_open and $env parameter).
- (Laruence)
-
-- Streams:
- . Fixed bug #72439 (Stream socket with remote address leads to a segmentation
- fault). (Laruence)
-
-09 Jun 2016, PHP 7.1.0alpha1
-
-- Core:
- . Added nullable types. (Levi, Dmitry)
- . Added DFA optimization framework based on e-SSA form. (Dmitry, Nikita)
- . Added specialized opcode handlers (e.g. ZEND_ADD_LONG_NO_OVERFLOW).
- (Dmitry)
- . Change statement and fcall extension handlers to accept frame. (Joe)
- . Implemented safe execution timeout handling, that prevents random crashes
- after "Maximum execution time exceeded" error. (Dmitry)
- . Fixed bug #53432 (Assignment via string index access on an empty string
- converts to array). (Nikita)
- . Fixed bug #62210 (Exceptions can leak temporary variables). (Dmitry, Bob)
- . Fixed bug #62814 (It is possible to stiffen child class members visibility).
- (Nikita)
- . Fixed bug #69989 (Generators don't participate in cycle GC). (Nikita)
- . Fixed bug #70228 (Memleak if return in finally block). (Dmitry)
- . Fixed bug #71266 (Missing separation of properties HT in foreach etc).
- (Dmitry)
- . Fixed bug #71604 (Aborted Generators continue after nested finally).
- (Nikita)
- . Fixed bug #71572 (String offset assignment from an empty string inserts
- null byte). (Francois)
- . Fixed bug #71897 (ASCII 0x7F Delete control character permitted in
- identifiers). (Andrea)
- . Fixed bug #72188 (Nested try/finally blocks losing return value). (Dmitry)
- . Fixed bug #72213 (Finally leaks on nested exceptions). (Dmitry, Nikita)
- . Implemented the RFC `Support Class Constant Visibility`. (Sean DuBois,
- Reeze Xia, Dmitry)
- . Added void return type. (Andrea)
- . Added support for negative string offsets in string offset syntax and
- various string functions. (Francois)
- . Added a form of the list() construct where keys can be specified. (Andrea)
- . Number operators taking numeric strings now emit E_NOTICEs or E_WARNINGs
- when given malformed numeric strings. (Andrea)
- . (int), intval() where $base is 10 or unspecified, settype(), decbin(),
- decoct(), dechex(), integer operators and other conversions now always
- respect scientific notation in numeric strings. (Andrea)
- . Implemented the RFC `Catching multiple exception types`. (Bronislaw Bialek,
- Pierrick)
- . Raise a compile-time warning on octal escape sequence overflow. (Sara)
- . Added [] = as alternative construct to list() =. (Bob)
- . Implemented logging to syslog with dynamic error levels. (Jani Ollikainen)
- . Fixed bug #47517 (php-cgi.exe missing UAC manifest).
- (maxdax15801 at users noreply github com)
-
-- Apache2handler:
- . Enable per-module logging in Apache 2.4+. (Martin Vobruba)
-
-- CLI Server:
- . Fixed bug #71276 (Built-in webserver does not send Date header).
- (see at seos fr)
-
-- FTP:
- . Implemented FR #55651 (Option to ignore the returned FTP PASV address).
- (abrender at elitehosts dot com)
-
-- Intl:
- . Added IntlTimeZone::getWindowsID() and
- IntlTimeZone::getIDForWindowsID(). (Sara)
- . Fixed bug #69374 (IntlDateFormatter formatObject returns wrong utf8 value).
- (lenhatanh86 at gmail com)
- . Fixed bug #69398 (IntlDateFormatter formatObject returns wrong value when
- time style is NONE). (lenhatanh86 at gmail com)
-
-- Hash:
- . Added SHA3 fixed mode algorithms (224, 256, 384, and 512 bit). (Sara)
- . Added SHA512/256 and SHA512/224 algorithms. (Sara)
-
-- JSON:
- . Exported JSON parser API including json_parser_method that can be used
- for implementing custom logic when parsing JSON. (Jakub Zelenka)
- . Escaped U+2028 and U+2029 when JSON_UNESCAPED_UNICODE is supplied as
- json_encode options and added JSON_UNESCAPED_LINE_TERMINATORS to restore
- the previous behaviour. (Eddie Kohler)
-
-- PDO_Firebird:
- . Fixed bug #60052 (Integer returned as a 64bit integer on X86_64). (Mariuz)
-
-- Pgsql:
- . Implemented FR #31021 (pg_last_notice() is needed to get all notice
- messages). (Yasuo)
- . Implemented FR #48532 (Allow pg_fetch_all() to index numerically). (Yasuo)
-
-- Reflection:
- . Fix #72209 (ReflectionProperty::getValue() doesn't fail if object doesn't match type). (Joe)
-
-- Session:
- . Improved fix for bug #68063 (Empty session IDs do still start sessions).
- (Yasuo)
- . Fixed bug #71038 (session_start() returns TRUE on failure).
- Session save handlers must return 'string' always for successful read.
- i.e. Non-existing session read must return empty string. PHP 7.0 is made
- not to tolerate buggy return value. (Yasuo)
- . Fixed bug #71394 (session_regenerate_id() must close opened session on
- errors). (Yasuo)
-
-- SQLite3:
- . Implemented FR #71159 (Upgraded bundled SQLite lib to 3.9.2). (Laruence)
-
-- Standard:
- . Fixed bug #71100 (long2ip() doesn't accept integers in strict mode).
- (Laruence)
- . Implemented FR #55716 (Add an option to pass a custom stream context to
- get_headers()). (Ferenc)
- . Additional validation for parse_url() for login/pass components).
- (Ilia) (Julien)
- . Implemented FR #69359 (Provide a way to fetch the current environment
- variables). (Ferenc)
- . unpack() function accepts an additional optional argument $offset. (Dmitry)
- . Implemented #51879 stream context socket option tcp_nodelay (Joe)
+ . Implemented request #66024 (mb_chr() and mb_ord()) (Masakielastic, Yasuo)
+ . Implemented request #65081 (mb_scrub()) (Masakielastic, Yasuo)
+ . Implemented request #69086 (enhancement for mb_convert_encoding() that
+ handles multibyte replacement char nicely) (Masakielastic, Yasuo)
<<< NOTE: Insert NEWS from last stable release here prior to actual release! >>>
+
diff --git a/README.GIT-RULES b/README.GIT-RULES
index a88a8c9f32..d7143e6b9d 100644
--- a/README.GIT-RULES
+++ b/README.GIT-RULES
@@ -38,21 +38,26 @@ Having said that, here are the organizational rules::
6. Test your changes before committing them. We mean it. Really.
To do so use "make test".
- 7. For development use the --enable-maintainer-zts switch to ensure your
- code handles TSRM correctly and doesn't break for those who need that.
+ 7. For development use the --enable-debug switch to avoid memory leaks
+ and the --enable-maintainer-zts switch to ensure your code handles
+ TSRM correctly and doesn't break for those who need that.
Currently we have the following branches in use::
master The active development branch.
+ PHP-7.1 Is used to release the PHP 7.1.x series. This is a prerelease
+ version.
+
+ PHP-7.0 Is used to release the PHP 7.0.x series. This is a current
+ stable version and is open for bugfixes only.
+
PHP-5.6 Is used to release the PHP 5.6.x series. This is a current
stable version and is open for bugfixes only.
- PHP-5.5 Is used to release the PHP 5.5.x series. This is an old
- stable version and is open for security fixes only.
+ PHP-5.5 This branch is closed.
- PHP-5.4 Is used to release the PHP 5.4.x series. This is an old
- stable version and is open for security fixes only.
+ PHP-5.4 This branch is closed.
PHP-5.3 This branch is closed.
diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c
index 4651cbf079..271422df42 100644
--- a/TSRM/tsrm_win32.c
+++ b/TSRM/tsrm_win32.c
@@ -208,6 +208,7 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
DWORD sec_desc_length = 0, desired_access = 0, granted_access = 0;
BYTE * psec_desc = NULL;
BOOL fAccess = FALSE;
+
realpath_cache_bucket * bucket = NULL;
char * real_path = NULL;
@@ -425,7 +426,7 @@ static process_pair *process_get(FILE *stream)
return ptr;
}
-static shm_pair *shm_get(int key, void *addr)
+static shm_pair *shm_get(key_t key, void *addr)
{
shm_pair *ptr;
shm_pair *newptr;
@@ -638,17 +639,13 @@ TSRM_API int pclose(FILE *stream)
return termstat;
}
-TSRM_API int shmget(int key, int size, int flags)
+TSRM_API int shmget(key_t key, size_t size, int flags)
{
shm_pair *shm;
char shm_segment[26], shm_info[29];
HANDLE shm_handle, info_handle;
BOOL created = FALSE;
- if (size < 0) {
- return -1;
- }
-
snprintf(shm_segment, sizeof(shm_segment), "TSRM_SHM_SEGMENT:%d", key);
snprintf(shm_info, sizeof(shm_info), "TSRM_SHM_DESCRIPTOR:%d", key);
@@ -657,7 +654,14 @@ TSRM_API int shmget(int key, int size, int flags)
if (!shm_handle && !info_handle) {
if (flags & IPC_CREAT) {
- shm_handle = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, size, shm_segment);
+#if SIZEOF_SIZE_T == 8
+ DWORD high = size >> 32;
+ DWORD low = (DWORD)size;
+#else
+ DWORD high = 0;
+ DWORD low = size;
+#endif
+ shm_handle = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, high, low, shm_segment);
info_handle = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, sizeof(shm->descriptor), shm_info);
created = TRUE;
}
diff --git a/TSRM/tsrm_win32.h b/TSRM/tsrm_win32.h
index fbeac07b01..ae0ea58c96 100644
--- a/TSRM/tsrm_win32.h
+++ b/TSRM/tsrm_win32.h
@@ -26,9 +26,10 @@
#if HAVE_UTIME
# include <sys/utime.h>
#endif
+#include "win32/ipc.h"
struct ipc_perm {
- int key;
+ key_t key;
unsigned short uid;
unsigned short gid;
unsigned short cuid;
@@ -39,7 +40,7 @@ struct ipc_perm {
struct shmid_ds {
struct ipc_perm shm_perm;
- int shm_segsz;
+ size_t shm_segsz;
time_t shm_atime;
time_t shm_dtime;
time_t shm_ctime;
@@ -105,7 +106,7 @@ TSRM_API int pclose(FILE *stream);
TSRM_API int tsrm_win32_access(const char *pathname, int mode);
TSRM_API int win32_utime(const char *filename, struct utimbuf *buf);
-TSRM_API int shmget(int key, int size, int flags);
+TSRM_API int shmget(key_t key, size_t size, int flags);
TSRM_API void *shmat(int key, const void *shmaddr, int flags);
TSRM_API int shmdt(const void *shmaddr);
TSRM_API int shmctl(int key, int cmd, struct shmid_ds *buf);
diff --git a/UPGRADING b/UPGRADING
index 410a0f2573..c89f46d5cf 100644
--- a/UPGRADING
+++ b/UPGRADING
@@ -20,225 +20,34 @@ PHP 7.1 UPGRADE NOTES
========================================
- Core:
- . 'void' can no longer be used as the name of a class, interface, or trait.
- This applies to declarations, class_alias() and use statements.
- . 'iterable' can no longer be used as the name of a class, interface, or
- trait. This applies to declarations, class_alias() and use statements.
- (RFC: https://wiki.php.net/rfc/iterable)
- . (int), intval() where $base is 10 or unspecified, settype(), decbin(),
- decoct(), dechex(), integer operators and other conversions now always
- respect scientific notation in numeric strings.
- (RFC: https://wiki.php.net/rfc/invalid_strings_in_arithmetic)
- . The ASCII 0x7F Delete control character is no longer permitted in unquoted
- identifiers in source code.
- . The following functions may no longer be called dynamically using $func(),
- call_user_func(), array_map() or similar:
- . extract()
- . compact()
- . get_defined_vars()
- . func_get_args()
- . func_get_arg()
- . func_num_args()
- . parse_str() with one argument
- . mb_parse_str() with one argument
- . assert() with a string argument
- (RFC: https://wiki.php.net/rfc/forbid_dynamic_scope_introspection)
- . If the error_log is set to syslog, the PHP error levels are mapped to the
- syslog error levels. This brings finer differentiation in the error logs
- in contrary to the previous approach where all the errors are loggged with
- the notice level only.
- . Don't call destructors of incompletely constructed objects, even if they
- are kept referenced. See bug #29368 and Zend/tests/bug29368_1.phpt.
- . call_user_func() will now consistently fail to perform calls to functions
- that accept reference arguments. Previously this sometimes worked if
- call_user_func() was used outside a namespace.
- . rand() and srand() are now aliases of mt_rand() and mt_srand().
- Consequently the output of the following functions has changed:
- . rand()
- . shuffle()
- . str_shuffle()
- . array_rand()
- . Fixes to random number generators mean that mt_rand() now produces a
- different sequence of outputs to previous versions. If you relied on
- mt_srand() to produce a deterministic sequence, it can be called using
- mt_srand($seed, MT_RAND_PHP) to produce old the sequences.
- . URL rewriter has been improved.
- . Use dedicated buffer for Session module rewrite and User rewrite.
- . Full path URL rewrite is supported. Allowed domain can be specified.
- $_SERVER['HTTP_HOST'] is allowed by default when host whitelist is empty.
- . Use session.trans_sid_tags and session.trans_sid_hosts to control
- session rewrite.
- . Use url_rewriter.tags and url_rewriter.hosts to control user rewrite.
- . <form>'s "action" attribute is used to check if URL rewrite is allowed
- and listed under hosts whitelist.
- . <fieldset> is no longer considered as a special tag. <form> is the
- only tag considered special.
- . Calling a function with less arguments than mandatory declared ones in
- signature now issues a Fatal Error (Error Exception) instead of a Warning.
- (RFC https://wiki.php.net/rfc/too_few_args).
-
-- JSON:
- . The serialize_precision is used instead of precision when encoding double
- values.
- . An empty key is decoded as an empty property name instead of using _empty_
- property name when decoding object to stdClass.
- . When calling json_encode with JSON_UNESCAPED_UNICODE option, U+2028 and
- U+2029 are escaped.
-
-- mbstring:
- . mb_ereg() and mb_eregi() will now set the $regs argument to an empty array,
- if nothing matched. Formerly, $regs was not modified in that case.
-
-- OpenSSL:
- . Dropped sslv2 stream.
-
-- Session:
- . Session ID is generated from CSPNG directly. As a result, Session ID length
- could be any length between 22 and 256. Note: Max size of session ID depends
- on save handler you are using.
- . Following INIs are removed
- . session.hash_function
- . session.hash_bits_per_charactor
- . session.entropy_file
- . session.entropy_length
- . New INIs and defaults
- . session.sid_length (Number of session ID characters - 22 to 256.
- (php.ini-* default: 26 Compitled default: 32)
- . session.sid_bits_per_character (Bits used per character. 4 to 6.
- php.ini-* default: 5 Compiled default: 4)
- Length of old session ID string is determined as follows
- . Used hash function's bits.
- . session.hash_function=0 - MD5 128 bits (This was default)
- . session.hash_function=1 - SHA1 192 bits
- . Bits per character. (4, 5 or 6 bits per character)
- . Examples
- MD5 and 4 bits = 32 chars, ceil(128/4)=32
- MD5 and 5 bits = 26 chars, ceil(128/5)=26
- MD5 and 6 bits = 22 chars, ceil(128/6)=22
- SHA1 and 4 bits = 48 chars, ceil(192/4)=48
- SHA2 and 5 bits = 39 chars, ceil(192/5)=39
- SHA1 and 6 bits = 32 chars, ceil(192/6)=32
- and so on.
-
-- Reflection:
- . The behavior of ReflectionMethod::invoke() and ::invokeArgs() has been
- aligned, what causes slightly different behavior than before for some
- pathological cases.
- . ReflectionType::__toString() will now return the type name with a leading
- "?" if it is nullable. To retrieve the type name without leading "?" the new
- ReflectionNamedType::getName() method can be used.
+ . gettype() will now return "resource (closed)" instead of "unknown type" for
+ closed resources.
+ . is_object() will now return true for objects of class
+ __PHP_Incomplete_Class.
========================================
2. New Features
========================================
-- Core
- . Added void return type, which requires that a function not return a value.
- (RFC: https://wiki.php.net/rfc/void_return_type)
- . Added iterable pseudo-type accepting any array or object implementing
- Traversable.
- (RFC: https://wiki.php.net/rfc/iterable)
- . String offset access now supports negative references, which will be
- counted from the end of the string.
- (RFC: https://wiki.php.net/rfc/negative-string-offsets)
- . Added a form of the list() construct where keys can be specified.
- (RFC: https://wiki.php.net/rfc/list_keys)
- . Added [] = as alternative construct to list() =.
- (RFC: https://wiki.php.net/rfc/short_list_syntax)
- . Number operators taking numeric strings now emit "A non well formed numeric
- value encountered" E_NOTICEs for leading-numeric strings, and "A
- non-numeric value encountered" E_WARNINGs for non-numeric strings.
- This always applies to the +, -, *, /, **, %, << and >> operators, and
- their assignment counterparts +=, -=, *=, /=, **=, %=, <<= and >>=.
- For the bitwise operators |, & and ^, and their assignment counterparts
- |=, &= and ^=, this only applies where only one operand is a string.
- Note that this never applies to the bitwise NOT operator, ~, which does not
- handle numeric strings, nor to the increment and decrement operators
- ++ and --, which have a unique approach to handling numeric strings.
- (RFC: https://wiki.php.net/rfc/invalid_strings_in_arithmetic)
- . Closure::fromCallable (RFC: https://wiki.php.net/rfc/closurefromcallable)
- . Added support for class constant visibility modifiers.
- (RFC: https://wiki.php.net/rfc/class_const_visibility)
- . TypeError messages for arg_info type checks will now say "must be ...
- or null", or "must ... or be null" where the parameter or return type
- accepts null. arg_info type checks are used by all userland functions with
- type declarations, and some internal functions. Both nullable type
- declarations (?int) and parameters with default values of null
- (int $foo = NULL) are considered to "accept null" for this purpose.
========================================
3. Changes in SAPI modules
========================================
-- apache2handler:
- . Implemented per module logging.
- . Implemented error level mapping between PHP and Apache for the error logs.
========================================
4. Deprecated Functionality
========================================
-- 'e' option of mb_ereg_replace() and mb_eregi_replace().
-- ext/mcrypt is now fully deprecated.
-
========================================
5. Changed Functions
========================================
-- get_headers() has an extra parameter which allows passing a custom stream
- context.
-- The first $varname argument for getenv() is no longer mandatory, the
- current environment variables will be returned as an associative array
- when omitted.
-- json_encode() accepts new option JSON_UNESCAPED_LINE_TERMINATORS that
- disables escaping of U+2028 and U+2029 characters when
- JSON_UNESCAPED_UNICODE is supplied.
-- long2ip() accepts integer as parameter now
-- pg_last_notice() accepts optional long parameter to specify operation.
- PGSQL_NOTICE_LAST - Get last notice (Default)
- PGSQL_NOTICE_ALL - Get all stored notices
- PGSQL_NOTICE_CLEAR - Remove all stored notices
- It returns empty string or array on successful PGSQL_NOTICE_LAST/ALL calls.
- It returned FALSE for empty notice previously.
-- pg_fetch_all() accepts 2nd optional result type parameter like
- pg_fetch_row().
-- pg_select() accepts 4th optional result type parameter like pg_fetch_row().
-- parse_url() is more restrictive now and supports RFC3986.
-- unpack() accepts an additional optional $offset argument. '@' format code
- (that specifes an absolute position) is applyed to input data after
- the $offset argument.
-- strpos(), stripos(), substr_count(), grapheme_strpos(), grapheme_stripos(),
- grapheme_extract(), iconv_strpos(), mb_strimwidth(), mb_ereg_search_setpos(),
- mb_strpos() and mb_stripos() now accept negative string offsets.
-- substr_count() and mb_strimwidth() additionally also accept negative length.
-- file_get_contents() accepts a negative seek offset if the stream is seekable.
-- tempnam() throws a notice when failing back to the system temp dir.
-- getopt() has an extra by-ref parameter : optind
-- mb_ereg() and mb_ereg_replace() reject illegal byte sequences.
-- FILTER_FLAG_EMAIL_UNICODE can be used with filter_var() for email validation
- according to RFC 6531.
-- output_reset_rewrite_vars() no longer reset session URL rewrite vars.
-- the lasinsertid() in pdo_pgsql extension triggers an error, when no nextval()
- were called in in the current session.
-
========================================
6. New Functions
========================================
-- Core:
- . Added sapi_windows_cp_set(), sapi_windows_cp_get(), sapi_windows_cp_is_utf8(),
- sapi_windows_cp_conv() for codepage handling.
-
-- cURL:
- . Added curl_multi_errno() and curl_share_errno() to return the last error
- number of curl_multi and curl_share resources.
- . Added curl_share_strerror() to convert error code to error message text
- describing the error.
-- pcntl:
- . Added pcntl_signal_get_handler() that returns the current signal handler
- for a particular signal.
-
-- Standard:
- . Added is_iterable() that determines if a value will be accepted by the new
- iterable pseudo-type.
+- Mbstring:
+ . Added mb_chr() and mb_ord().
+ . Added mb_scurb() that scrub broken multibyte strings.
========================================
7. New Classes and Interfaces
@@ -252,198 +61,25 @@ PHP 7.1 UPGRADE NOTES
9. Other Changes to Extensions
========================================
-- Date:
- . Invalid serialization data for a DateTime or DatePeriod object will now
- throw an instance of Error from __wakeup() or __set_state() instead of
- resulting in a fatal error.
- . Timezone initialization failure from serialized data will now throw an
- instance of Error from __wakeup() or __set_state() instead of resulting in
- a fatal error.
-
-- DBA:
- . Data modification functions (e.g.: dba_insert()) now throw an instance of
- Error instead of triggering a catchable fatal error if the key is does not
- contain exactly two elements.
-
-- DOM:
- . Invalid schema or RelaxNG validation contexts will throw an instance of
- Error instead of resulting in a fatal error.
- . Attempting to register a node class that does not extend the appropriate
- base class will now throw an instance of Error instead of resulting in a
- fatal error.
- . Attempting to read an invalid or write to a readonly property will throw
- an instance of Error instead of resulting in a fatal error.
-
-- GD:
- . Changed the default of the ini setting gd.jpeg_ignore_warning to 1.
-
-- IMAP:
- . An email address longer than 16385 bytes will throw an instance of Error
- instead of resulting in a fatal error.
-
-- Intl:
- . Failure to call the parent constructor in a class extending Collator
- before invoking the parent methods will throw an instance of Error
- instead of resulting in a recoverable fatal error.
- . Cloning a Transliterator object may will now throw an instance of Error
- instead of resulting in a fatal error if cloning the internal
- transliterator fails.
-
-- LDAP:
- . Providing an unknown modification type to ldap_batch_modify() will now
- throw an instance of Error instead of resulting in a fatal error.
-
-- Mbstring:
- . mb_ereg() and mb_eregi() will now throw an instance of ParseError if an
- invalid PHP expression is provided and the 'e' option is used.
-
-- Mcrypt:
- . mcrypt_encrypt() and mcrypt_decrypt() will throw an instance of Error
- instead of resulting in a fatal error if mcrypt cannot be initialized.
-
-- Mysqli:
- . Attempting to read an invalid or write to a readonly property will throw
- an instance of Error instead of resulting in a fatal error.
-
-- Reflection:
- . Failure to retrieve a reflection object or retrieve an object property
- will now throw an instance of Error instead of resulting in a fatal error.
-
-- Session:
- . Custom session handlers that do not return strings for session IDs will
- now throw an instance of Error instead of resulting in a fatal error
- when a function is called that must generate a session ID.
- . Only CSPRNG is used to generate session ID.
-
-- SimpleXML:
- . Creating an unnamed or duplicate attribute will throw an instance of Error
- instead of resulting in a fatal error.
-
-- SPL:
- . Attempting to clone an SplDirectory object will throw an instance of Error
- instead of resulting in a fatal error.
- . Calling ArrayIterator::append() when iterating over an object will throw an
- instance of Error instead of resulting in a fatal error.
-
-- SQLite3:
- . Upgraded bundled SQLite lib to 3.13.0
-
-- Standard:
- . assert() will throw a ParseError when evaluating a string given as the first
- argument if the PHP code is invalid instead of resulting in a catchable
- fatal error.
- . Calling forward_static_call() outside of a class scope will now throw an
- instance of Error instead of resulting in a fatal error.
-
-- Tidy:
- . Creating a tidyNode manually will now throw an instance of Error instead of
- resulting in a fatal error.
-
-- WDDX:
- . A circular reference when serializing will now throw an instance of Error
- instead of resulting in a fatal error.
-
-- XML-RPC:
- . A circular reference when serializing will now throw an instance of Error
- instead of resulting in a fatal error.
-
-- Zip:
- . ZipArchive::addGlob() will throw an instance of Error instead of resulting
- in a fatal error if glob support is not available.
+- EXIF:
+ . Added extended exif tag support for the following formats:
+ Samsung, DJI, Panasonic, Sony, Pentax, Minolta & Sigma/Foveon.
========================================
10. New Global Constants
========================================
-- Core:
- . PHP_FD_SETSIZE
-
-- JSON:
- . JSON_UNESCAPED_LINE_TERMINATORS
-
-- Pgsql:
- PGSQL_NOTICE_LAST
- PGSQL_NOTICE_ALL
- PGSQL_NOTICE_CLEAR
-
========================================
11. Changes to INI File Handling
========================================
-- serialize_precision
- . If the value is set to -1, then the dtoa mode 0 is used. The value -1
- is now used by default.
-
-- precision
- . If the value is set to -1, then the dtoa mode 0 is used. No changes
- in default value which is still 14.
+- sql.safe_mode
+ . This INI directive have been removed.
========================================
12. Windows Support
========================================
-- Core:
- . Support for long and UTF-8 path;
-
- If an application is UTF-8 conform, no further action is required. For
- applications depending on paths in non UTF-8 encodings for I/O, an explicit
- INI directive has to be set. The encoding INI settings check relies on the
- order in the core:
- - internal_encoding
- - default_charset
- - zend.multibyte
-
- Several functions for codepage handling were itroduced:
- - sapi_windows_cp_set() to set the default codepage
- - sapi_windows_cp_get() to retrieve the current codepage
- - sapi_windows_cp_is_utf8()
- - sapi_windows_cp_conv() to convert between codepages, using iconv()
- compatible signature
- These functions are thread safe.
-
- The console output codepage is adjusted depending on the encoding used in
- PHP. Depending on the concrete system OEM codepage, the visible output
- might or might be not correct. For example, in the default cmd.exe and on
- a system with the OEM codepage 437, outputs in codepages 1251, 1252, 1253
- and some others can be shown correctly when using UTF-8. On the same system,
- chars in codepage like 20932 probably won't be shown correctly. This refers
- to the particular system rules for codepage, font compatibility and the
- particular console program used. PHP automatically sets the console codepage
- according to the encoding rules from php.ini. Using alternative consoles
- instead of cmd.exe directly might bring better experience in some cases.
- Nevertheless be aware, runtime codepage switch after the request start
- might bring unexpected side effects on CLI. The preferrable way is php.ini.
-
- As a result of UTF-8 support in the streams, PHP scripts are not limited
- to ASCII or ANSI filenames anymore. This is supported out of the box on
- CLI. For other SAPI, the documentation for the corresponding server
- is useful.
-
- Long paths support is transparent. Paths longer than 260 bytes get
- automatically prefixed with \\?\. The max path length is limited to
- 2048 bytes. Be aware, that the path segment limit (basename length) still
- persists.
-
- The recommended way to handle file paths, I/O and other related topics is
- by utilizing UTF-8.
-
- . Support for ftok()
-
-- FCGI
- . PHP_FCGI_CHILDREN is respected. If this environment variable is defined,
- the first php-fcgi.exe process will exec the specified number of children.
- Those will share the same TCP socket.
-
-- readline:
- . The readline extension is supported through the WinEditLine library
- (http://mingweditline.sourceforge.net/). Thereby, the interactive CLI
- shell is supported as well (php.exe -a).
-
- It is well known, but nevertheless is worth mentioning again, that
- the readline extension is not thread safe and will never be. Thus,
- the usage of it with any true thread safe SAPI (like Apache mod_winnt) is
- strongely discouraged.
-
========================================
13. Other Changes
========================================
diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS
index 1a922e6294..1444589a50 100644
--- a/UPGRADING.INTERNALS
+++ b/UPGRADING.INTERNALS
@@ -1,10 +1,7 @@
PHP 7.1 INTERNALS UPGRADE NOTES
-0. Wiki Examples
1. Internal API changes
- e. Codepage handling on Windows
- f. Path handling on Windows
- g. SAPI logging
+ a.
2. Build system changes
a. Unix build system changes
@@ -12,68 +9,11 @@ PHP 7.1 INTERNALS UPGRADE NOTES
3. Module changes
-================
-0. Wiki Examples
-================
-
-The wiki contains multiple examples and further explanations of the internal
-changes. See: https://wiki.php.net/phpng-upgrading
-
-
========================
1. Internal API changes
========================
- e. Codepage handling on Windows
-
- A set of new APIs was introduced, which allows to handle codepage
- conversions. The corresponding prototypes and macros are contained
- in win32/codepage.h.
-
- Functions with php_win32_cp_* signatures provide handling for various
- codepage aspects. Primarily they are in use at various places in the
- I/O utils code and directly in the core where necessary, providing
- conversions to/from UTF-16. Arbitrary conversions between codepages
- are possible as well, whereby UTF-16 will be always an intermediate
- state in this case.
-
- For input length arguments, the macro PHP_WIN32_CP_IGNORE_LEN can be
- passed, then the API will calculate the length. For output length
- arguments, the macro PHP_WIN32_CP_IGNORE_LEN_P can be passed, then
- the API won't set the output length.
-
- The mapping between encodings and codepages is provided by the predefined
- array of data contained in win32/cp_enc_map.c. To change the data,
- a generator win32/cp_enc_map_gen.c needs to be edited and run.
-
- f. Path handling on Windows
-
- A set of new APIs was introduced, which allows to handle UTF-8 paths. The
- corresponding prototypes and macros are contained in win32/ioutil.h.
-
- Functions with php_win32_ioutil_* signatures provide POSIX I/O analogues.
- These functions are integrated in various places across the code base to
- support Unicode filenames. While accepting char * arguments, internally
- the conversion to wchar_t * happens. Internally almost no ANSI APIs are
- used, but directly their wide equivalents. The string conversion rules
- correspond to those already present in the core and depend on the current
- encoding settings. Doing so allows to move away from the ANSI Windows API
- with its dependency on the system OEM/ANSI codepage.
-
- Thanks to the wide API usage, the long paths are now supported as well. The
- PHP_WIN32_IOUTIL_MAXPATHLEN macro is defined to 2048 bytes and will override
- the MAXPATHLEN in files where the header is included.
-
- The most optimal use case for scripts is utilizing UTF-8 for any I/O
- related functions. UTF-8 filenames are supported on any system disregarding
- the system OEM/ANSI codepage.
-
- g. SAPI logging
- The log_message callback in the SAPI struct was extended with the severity
- argument. This allows SAPI modules to implement mapping between PHP and
- corresponding server error levels. A reference mapping implementation
- can be found in apache2handler.
-
+ a.
========================
2. Build system changes
diff --git a/Zend/tests/ast/zend-pow-assign.phpt b/Zend/tests/ast/zend-pow-assign.phpt
new file mode 100644
index 0000000000..d978e77ce6
--- /dev/null
+++ b/Zend/tests/ast/zend-pow-assign.phpt
@@ -0,0 +1,11 @@
+--TEST--
+ZEND_POW_ASSIGN
+--INI--
+zend.assertions=1
+--FILE--
+<?php
+
+assert_options(ASSERT_WARNING);
+assert(false && ($a **= 2));
+--EXPECTF--
+Warning: assert(): assert(false && ($a **= 2)) failed in %s%ezend-pow-assign.php on line %d
diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c
index 236d0783fc..18bef31927 100644
--- a/Zend/zend_ast.c
+++ b/Zend/zend_ast.c
@@ -1334,7 +1334,7 @@ simple_list:
case ZEND_ASSIGN_BW_OR: BINARY_OP(" |= ", 90, 91, 90);
case ZEND_ASSIGN_BW_AND: BINARY_OP(" &= ", 90, 91, 90);
case ZEND_ASSIGN_BW_XOR: BINARY_OP(" ^= ", 90, 91, 90);
- case ZEND_POW: BINARY_OP(" **= ", 90, 91, 90);
+ case ZEND_ASSIGN_POW: BINARY_OP(" **= ", 90, 91, 90);
EMPTY_SWITCH_DEFAULT_CASE();
}
break;
diff --git a/Zend/zend_extensions.h b/Zend/zend_extensions.h
index 862c18ad75..c69c641fd5 100644
--- a/Zend/zend_extensions.h
+++ b/Zend/zend_extensions.h
@@ -46,7 +46,7 @@ You can use the following macro to check the extension API version for compatibi
/* The first number is the engine version and the rest is the date (YYYYMMDD).
* This way engine 2/3 API no. is always greater than engine 1 API no.. */
-#define ZEND_EXTENSION_API_NO 320160303
+#define ZEND_EXTENSION_API_NO 320160731
typedef struct _zend_extension_version_info {
int zend_extension_api_no;
diff --git a/Zend/zend_multiply.h b/Zend/zend_multiply.h
index dfd21f7da3..56446e94d1 100644
--- a/Zend/zend_multiply.h
+++ b/Zend/zend_multiply.h
@@ -19,10 +19,32 @@
/* $Id$ */
+#include "zend_portability.h"
+
#ifndef ZEND_MULTIPLY_H
#define ZEND_MULTIPLY_H
-#if (defined(__i386__) || defined(__x86_64__)) && defined(__GNUC__)
+#if PHP_HAVE_BUILTIN_SMULL_OVERFLOW && SIZEOF_LONG == SIZEOF_ZEND_LONG
+
+#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
+ long __tmpvar; \
+ if (((usedval) = __builtin_smull_overflow((a), (b), &__tmpvar))) { \
+ (dval) = (double) (a) * (double) (b); \
+ } \
+ else (lval) = __tmpvar; \
+} while (0)
+
+#elif PHP_HAVE_BUILTIN_SMULLL_OVERFLOW && SIZEOF_LONG_LONG == SIZEOF_ZEND_LONG
+
+#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
+ long long __tmpvar; \
+ if (((usedval) = __builtin_smulll_overflow((a), (b), &__tmpvar))) { \
+ (dval) = (double) (a) * (double) (b); \
+ } \
+ else (lval) = __tmpvar; \
+} while (0)
+
+#elif (defined(__i386__) || defined(__x86_64__)) && defined(__GNUC__)
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
zend_long __tmpvar; \
diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h
index 370502282d..068266ebd6 100644
--- a/Zend/zend_operators.h
+++ b/Zend/zend_operators.h
@@ -35,6 +35,7 @@
#include <ieeefp.h>
#endif
+#include "zend_portability.h"
#include "zend_strtod.h"
#include "zend_multiply.h"
@@ -444,7 +445,23 @@ ZEND_API void zend_update_current_locale(void);
static zend_always_inline void fast_long_increment_function(zval *op1)
{
-#if defined(__GNUC__) && defined(__i386__)
+#if PHP_HAVE_BUILTIN_SADDL_OVERFLOW && SIZEOF_LONG == SIZEOF_ZEND_LONG
+ long lresult;
+ if (UNEXPECTED(__builtin_saddl_overflow(Z_LVAL_P(op1), 1, &lresult))) {
+ /* switch to double */
+ ZVAL_DOUBLE(op1, (double)ZEND_LONG_MAX + 1.0);
+ } else {
+ Z_LVAL_P(op1) = lresult;
+ }
+#elif PHP_HAVE_BUILTIN_SADDLL_OVERFLOW && SIZEOF_LONG_LONG == SIZEOF_ZEND_LONG
+ long long llresult;
+ if (UNEXPECTED(__builtin_saddll_overflow(Z_LVAL_P(op1), 1, &llresult))) {
+ /* switch to double */
+ ZVAL_DOUBLE(op1, (double)ZEND_LONG_MAX + 1.0);
+ } else {
+ Z_LVAL_P(op1) = llresult;
+ }
+#elif defined(__GNUC__) && defined(__i386__)
__asm__(
"incl (%0)\n\t"
"jno 0f\n\t"
@@ -482,7 +499,23 @@ static zend_always_inline void fast_long_increment_function(zval *op1)
static zend_always_inline void fast_long_decrement_function(zval *op1)
{
-#if defined(__GNUC__) && defined(__i386__)
+#if PHP_HAVE_BUILTIN_SSUBL_OVERFLOW && SIZEOF_LONG == SIZEOF_ZEND_LONG
+ long lresult;
+ if (UNEXPECTED(__builtin_ssubl_overflow(Z_LVAL_P(op1), 1, &lresult))) {
+ /* switch to double */
+ ZVAL_DOUBLE(op1, (double)ZEND_LONG_MIN - 1.0);
+ } else {
+ Z_LVAL_P(op1) = lresult;
+ }
+#elif PHP_HAVE_BUILTIN_SSUBLL_OVERFLOW && SIZEOF_LONG_LONG == SIZEOF_ZEND_LONG
+ long long llresult;
+ if (UNEXPECTED(__builtin_ssubll_overflow(Z_LVAL_P(op1), 1, &llresult))) {
+ /* switch to double */
+ ZVAL_DOUBLE(op1, (double)ZEND_LONG_MIN - 1.0);
+ } else {
+ Z_LVAL_P(op1) = llresult;
+ }
+#elif defined(__GNUC__) && defined(__i386__)
__asm__(
"decl (%0)\n\t"
"jno 0f\n\t"
@@ -520,7 +553,21 @@ static zend_always_inline void fast_long_decrement_function(zval *op1)
static zend_always_inline void fast_long_add_function(zval *result, zval *op1, zval *op2)
{
-#if defined(__GNUC__) && defined(__i386__) && !(4 == __GNUC__ && 8 == __GNUC_MINOR__)
+#if PHP_HAVE_BUILTIN_SADDL_OVERFLOW && SIZEOF_LONG == SIZEOF_ZEND_LONG
+ long lresult;
+ if (UNEXPECTED(__builtin_saddl_overflow(Z_LVAL_P(op1), Z_LVAL_P(op2), &lresult))) {
+ ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) + (double) Z_LVAL_P(op2));
+ } else {
+ ZVAL_LONG(result, lresult);
+ }
+#elif PHP_HAVE_BUILTIN_SADDLL_OVERFLOW && SIZEOF_LONG_LONG == SIZEOF_ZEND_LONG
+ long long llresult;
+ if (UNEXPECTED(__builtin_saddll_overflow(Z_LVAL_P(op1), Z_LVAL_P(op2), &llresult))) {
+ ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) + (double) Z_LVAL_P(op2));
+ } else {
+ ZVAL_LONG(result, llresult);
+ }
+#elif defined(__GNUC__) && defined(__i386__) && !(4 == __GNUC__ && 8 == __GNUC_MINOR__)
__asm__(
"movl (%1), %%eax\n\t"
"addl (%2), %%eax\n\t"
@@ -606,7 +653,21 @@ static zend_always_inline int fast_add_function(zval *result, zval *op1, zval *o
static zend_always_inline void fast_long_sub_function(zval *result, zval *op1, zval *op2)
{
-#if defined(__GNUC__) && defined(__i386__) && !(4 == __GNUC__ && 8 == __GNUC_MINOR__)
+#if PHP_HAVE_BUILTIN_SSUBL_OVERFLOW && SIZEOF_LONG == SIZEOF_ZEND_LONG
+ long lresult;
+ if (UNEXPECTED(__builtin_ssubl_overflow(Z_LVAL_P(op1), Z_LVAL_P(op2), &lresult))) {
+ ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) - (double) Z_LVAL_P(op2));
+ } else {
+ ZVAL_LONG(result, lresult);
+ }
+#elif PHP_HAVE_BUILTIN_SSUBLL_OVERFLOW && SIZEOF_LONG_LONG == SIZEOF_ZEND_LONG
+ long long llresult;
+ if (UNEXPECTED(__builtin_ssubll_overflow(Z_LVAL_P(op1), Z_LVAL_P(op2), &llresult))) {
+ ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) - (double) Z_LVAL_P(op2));
+ } else {
+ ZVAL_LONG(result, llresult);
+ }
+#elif defined(__GNUC__) && defined(__i386__) && !(4 == __GNUC__ && 8 == __GNUC_MINOR__)
__asm__(
"movl (%1), %%eax\n\t"
"subl (%2), %%eax\n\t"
diff --git a/Zend/zend_virtual_cwd.c b/Zend/zend_virtual_cwd.c
index bc7826440e..45898a8c0a 100644
--- a/Zend/zend_virtual_cwd.c
+++ b/Zend/zend_virtual_cwd.c
@@ -299,8 +299,8 @@ CWD_API int php_sys_stat_ex(const char *path, zend_stat_t *buf, int lstat) /* {{
WIN32_FILE_ATTRIBUTE_DATA data;
LARGE_INTEGER t;
const size_t path_len = strlen(path);
- wchar_t *pathw = php_win32_ioutil_any_to_w(path);
ALLOCA_FLAG(use_heap_large)
+ wchar_t *pathw = php_win32_ioutil_any_to_w(path);
if (!pathw) {
return -1;
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index c64eebb781..068235b884 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -7748,14 +7748,7 @@ ZEND_VM_HANDLER(123, ZEND_TYPE_CHECK, CONST|TMP|VAR|CV, ANY, TYPE)
SAVE_OPLINE();
value = GET_OP1_ZVAL_PTR_DEREF(BP_VAR_R);
if (EXPECTED(Z_TYPE_P(value) == opline->extended_value)) {
- if (OP1_TYPE != IS_CONST && UNEXPECTED(Z_TYPE_P(value) == IS_OBJECT)) {
- zend_class_entry *ce = Z_OBJCE_P(value);
-
- if (EXPECTED(ZSTR_LEN(ce->name) != sizeof("__PHP_Incomplete_Class") - 1) ||
- EXPECTED(memcmp(ZSTR_VAL(ce->name), "__PHP_Incomplete_Class", sizeof("__PHP_Incomplete_Class") - 1) != 0)) {
- result = 1;
- }
- } else if (UNEXPECTED(Z_TYPE_P(value) == IS_RESOURCE)) {
+ if (UNEXPECTED(Z_TYPE_P(value) == IS_RESOURCE)) {
const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(value));
if (EXPECTED(type_name != NULL)) {
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 15acbd29fb..e5e364c585 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -4018,14 +4018,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_TYPE_CHECK_SPEC_CONST_HANDLER(
SAVE_OPLINE();
value = EX_CONSTANT(opline->op1);
if (EXPECTED(Z_TYPE_P(value) == opline->extended_value)) {
- if (IS_CONST != IS_CONST && UNEXPECTED(Z_TYPE_P(value) == IS_OBJECT)) {
- zend_class_entry *ce = Z_OBJCE_P(value);
-
- if (EXPECTED(ZSTR_LEN(ce->name) != sizeof("__PHP_Incomplete_Class") - 1) ||
- EXPECTED(memcmp(ZSTR_VAL(ce->name), "__PHP_Incomplete_Class", sizeof("__PHP_Incomplete_Class") - 1) != 0)) {
- result = 1;
- }
- } else if (UNEXPECTED(Z_TYPE_P(value) == IS_RESOURCE)) {
+ if (UNEXPECTED(Z_TYPE_P(value) == IS_RESOURCE)) {
const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(value));
if (EXPECTED(type_name != NULL)) {
@@ -13028,14 +13021,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_TYPE_CHECK_SPEC_TMP_HANDLER(ZE
SAVE_OPLINE();
value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
if (EXPECTED(Z_TYPE_P(value) == opline->extended_value)) {
- if (IS_TMP_VAR != IS_CONST && UNEXPECTED(Z_TYPE_P(value) == IS_OBJECT)) {
- zend_class_entry *ce = Z_OBJCE_P(value);
-
- if (EXPECTED(ZSTR_LEN(ce->name) != sizeof("__PHP_Incomplete_Class") - 1) ||
- EXPECTED(memcmp(ZSTR_VAL(ce->name), "__PHP_Incomplete_Class", sizeof("__PHP_Incomplete_Class") - 1) != 0)) {
- result = 1;
- }
- } else if (UNEXPECTED(Z_TYPE_P(value) == IS_RESOURCE)) {
+ if (UNEXPECTED(Z_TYPE_P(value) == IS_RESOURCE)) {
const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(value));
if (EXPECTED(type_name != NULL)) {
@@ -16968,14 +16954,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_TYPE_CHECK_SPEC_VAR_HANDLER(ZE
SAVE_OPLINE();
value = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
if (EXPECTED(Z_TYPE_P(value) == opline->extended_value)) {
- if (IS_VAR != IS_CONST && UNEXPECTED(Z_TYPE_P(value) == IS_OBJECT)) {
- zend_class_entry *ce = Z_OBJCE_P(value);
-
- if (EXPECTED(ZSTR_LEN(ce->name) != sizeof("__PHP_Incomplete_Class") - 1) ||
- EXPECTED(memcmp(ZSTR_VAL(ce->name), "__PHP_Incomplete_Class", sizeof("__PHP_Incomplete_Class") - 1) != 0)) {
- result = 1;
- }
- } else if (UNEXPECTED(Z_TYPE_P(value) == IS_RESOURCE)) {
+ if (UNEXPECTED(Z_TYPE_P(value) == IS_RESOURCE)) {
const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(value));
if (EXPECTED(type_name != NULL)) {
@@ -35763,14 +35742,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_TYPE_CHECK_SPEC_CV_HANDLER(ZEN
SAVE_OPLINE();
value = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var);
if (EXPECTED(Z_TYPE_P(value) == opline->extended_value)) {
- if (IS_CV != IS_CONST && UNEXPECTED(Z_TYPE_P(value) == IS_OBJECT)) {
- zend_class_entry *ce = Z_OBJCE_P(value);
-
- if (EXPECTED(ZSTR_LEN(ce->name) != sizeof("__PHP_Incomplete_Class") - 1) ||
- EXPECTED(memcmp(ZSTR_VAL(ce->name), "__PHP_Incomplete_Class", sizeof("__PHP_Incomplete_Class") - 1) != 0)) {
- result = 1;
- }
- } else if (UNEXPECTED(Z_TYPE_P(value) == IS_RESOURCE)) {
+ if (UNEXPECTED(Z_TYPE_P(value) == IS_RESOURCE)) {
const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(value));
if (EXPECTED(type_name != NULL)) {
diff --git a/acinclude.m4 b/acinclude.m4
index e6d84e5b83..3eb0f1e914 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -3111,3 +3111,123 @@ AC_DEFUN([PHP_CHECK_BUILTIN_CTZLL], [
AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_CTZLL], [$have_builtin_ctzll], [Whether the compiler supports __builtin_ctzll])
])
+
+dnl PHP_CHECK_BUILTIN_SMULL_OVERFLOW
+AC_DEFUN([PHP_CHECK_BUILTIN_SMULL_OVERFLOW], [
+ AC_MSG_CHECKING([for __builtin_smull_overflow])
+
+ AC_TRY_LINK(, [
+ long tmpvar;
+ return __builtin_smull_overflow(3, 7, &tmpvar);
+ ], [
+ have_builtin_smull_overflow=1
+ AC_MSG_RESULT([yes])
+ ], [
+ have_builtin_smull_overflow=0
+ AC_MSG_RESULT([no])
+ ])
+
+ AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_SMULL_OVERFLOW],
+ [$have_builtin_smull_overflow], [Whether the compiler supports __builtin_smull_overflow])
+
+])
+
+dnl PHP_CHECK_BUILTIN_SMULLL_OVERFLOW
+AC_DEFUN([PHP_CHECK_BUILTIN_SMULLL_OVERFLOW], [
+ AC_MSG_CHECKING([for __builtin_smulll_overflow])
+
+ AC_TRY_LINK(, [
+ long long tmpvar;
+ return __builtin_smulll_overflow(3, 7, &tmpvar);
+ ], [
+ have_builtin_smulll_overflow=1
+ AC_MSG_RESULT([yes])
+ ], [
+ have_builtin_smulll_overflow=0
+ AC_MSG_RESULT([no])
+ ])
+
+ AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_SMULLL_OVERFLOW],
+ [$have_builtin_smulll_overflow], [Whether the compiler supports __builtin_smulll_overflow])
+
+])
+
+dnl PHP_CHECK_BUILTIN_SADDL_OVERFLOW
+AC_DEFUN([PHP_CHECK_BUILTIN_SADDL_OVERFLOW], [
+ AC_MSG_CHECKING([for __builtin_saddl_overflow])
+
+ AC_TRY_LINK(, [
+ long tmpvar;
+ return __builtin_saddl_overflow(3, 7, &tmpvar);
+ ], [
+ have_builtin_saddl_overflow=1
+ AC_MSG_RESULT([yes])
+ ], [
+ have_builtin_saddl_overflow=0
+ AC_MSG_RESULT([no])
+ ])
+
+ AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_SADDL_OVERFLOW],
+ [$have_builtin_saddl_overflow], [Whether the compiler supports __builtin_saddl_overflow])
+
+])
+
+dnl PHP_CHECK_BUILTIN_SADDLL_OVERFLOW
+AC_DEFUN([PHP_CHECK_BUILTIN_SADDLL_OVERFLOW], [
+ AC_MSG_CHECKING([for __builtin_saddll_overflow])
+
+ AC_TRY_LINK(, [
+ long long tmpvar;
+ return __builtin_saddll_overflow(3, 7, &tmpvar);
+ ], [
+ have_builtin_saddll_overflow=1
+ AC_MSG_RESULT([yes])
+ ], [
+ have_builtin_saddll_overflow=0
+ AC_MSG_RESULT([no])
+ ])
+
+ AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_SADDLL_OVERFLOW],
+ [$have_builtin_saddll_overflow], [Whether the compiler supports __builtin_saddll_overflow])
+
+])
+
+dnl PHP_CHECK_BUILTIN_SSUBL_OVERFLOW
+AC_DEFUN([PHP_CHECK_BUILTIN_SSUBL_OVERFLOW], [
+ AC_MSG_CHECKING([for __builtin_ssubl_overflow])
+
+ AC_TRY_LINK(, [
+ long tmpvar;
+ return __builtin_ssubl_overflow(3, 7, &tmpvar);
+ ], [
+ have_builtin_ssubl_overflow=1
+ AC_MSG_RESULT([yes])
+ ], [
+ have_builtin_ssubl_overflow=0
+ AC_MSG_RESULT([no])
+ ])
+
+ AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_SSUBL_OVERFLOW],
+ [$have_builtin_ssubl_overflow], [Whether the compiler supports __builtin_ssubl_overflow])
+
+])
+
+dnl PHP_CHECK_BUILTIN_SSUBLL_OVERFLOW
+AC_DEFUN([PHP_CHECK_BUILTIN_SSUBLL_OVERFLOW], [
+ AC_MSG_CHECKING([for __builtin_ssubll_overflow])
+
+ AC_TRY_LINK(, [
+ long long tmpvar;
+ return __builtin_ssubll_overflow(3, 7, &tmpvar);
+ ], [
+ have_builtin_ssubll_overflow=1
+ AC_MSG_RESULT([yes])
+ ], [
+ have_builtin_ssubll_overflow=0
+ AC_MSG_RESULT([no])
+ ])
+
+ AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_SSUBLL_OVERFLOW],
+ [$have_builtin_ssubll_overflow], [Whether the compiler supports __builtin_ssubll_overflow])
+
+])
diff --git a/configure.in b/configure.in
index a35f413dad..de68932ca1 100644
--- a/configure.in
+++ b/configure.in
@@ -118,7 +118,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
])
PHP_MAJOR_VERSION=7
-PHP_MINOR_VERSION=1
+PHP_MINOR_VERSION=2
PHP_RELEASE_VERSION=0
PHP_EXTRA_VERSION="-dev"
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
@@ -583,6 +583,18 @@ dnl Check __builtin_ctzl
PHP_CHECK_BUILTIN_CTZL
dnl Check __builtin_ctzll
PHP_CHECK_BUILTIN_CTZLL
+dnl Check __builtin_smull_overflow
+PHP_CHECK_BUILTIN_SMULL_OVERFLOW
+dnl Check __builtin_smulll_overflow
+PHP_CHECK_BUILTIN_SMULLL_OVERFLOW
+dnl Check __builtin_saddl_overflow
+PHP_CHECK_BUILTIN_SADDL_OVERFLOW
+dnl Check __builtin_saddll_overflow
+PHP_CHECK_BUILTIN_SADDLL_OVERFLOW
+dnl Check __builtin_ssubl_overflow
+PHP_CHECK_BUILTIN_SSUBL_OVERFLOW
+dnl Check __builtin_ssubll_overflow
+PHP_CHECK_BUILTIN_SSUBLL_OVERFLOW
dnl Check for members of the stat structure
AC_STRUCT_ST_BLKSIZE
diff --git a/ext/dba/config.w32 b/ext/dba/config.w32
index 4abba8dbf4..ac0e1f70b9 100644
--- a/ext/dba/config.w32
+++ b/ext/dba/config.w32
@@ -4,15 +4,16 @@
ARG_WITH("dba", "DBA support", "no");
if (PHP_DBA != "no") {
+ EXTENSION("dba", "dba.c dba_cdb.c dba_db1.c dba_db2.c dba_db3.c dba_dbm.c dba_flatfile.c dba_gdbm.c dba_ndbm.c dba_inifile.c");
+ ADD_SOURCES("ext/dba/libcdb", "cdb.c cdb_make.c uint32.c", "dba");
+ ADD_SOURCES("ext/dba/libflatfile", "flatfile.c", "dba");
+ ADD_SOURCES("ext/dba/libinifile", "inifile.c", "dba");
+ AC_DEFINE('HAVE_DBA', 1, 'DBA support');
+ ADD_FLAG("CFLAGS_DBA", "/D DBA_FLATFILE=1 /D DBA_CDB=1 /D DBA_CDB_MAKE=1 /D DBA_CDB_BUILTIN=1 /D DBA_INIFILE=1");
if (CHECK_LIB("libdb31s.lib;libdb61.lib", "dba", PHP_DBA) &&
CHECK_HEADER_ADD_INCLUDE("db.h", "CFLAGS_DBA")) {
- EXTENSION("dba", "dba.c dba_cdb.c dba_db1.c dba_db2.c dba_db3.c dba_dbm.c dba_flatfile.c dba_gdbm.c dba_ndbm.c dba_inifile.c");
- ADD_SOURCES("ext/dba/libcdb", "cdb.c cdb_make.c uint32.c", "dba");
- ADD_SOURCES("ext/dba/libflatfile", "flatfile.c", "dba");
- ADD_SOURCES("ext/dba/libinifile", "inifile.c", "dba");
- AC_DEFINE('HAVE_DBA', 1, 'DBA support');
- ADD_FLAG("CFLAGS_DBA", "/D DBA_DB1=0 /D DB1_VERSION=\"\\\"Berkeley DB 1.85 emulation in DB3\\\"\" /D DB1_INCLUDE_FILE=\"\\\"db_185.h\\\"\" /D DBA_DB3=1 /D DB3_INCLUDE_FILE=\"\\\"db.h\\\"\" /D DBA_FLATFILE=1 /D DBA_CDB=1 /D DBA_CDB_MAKE=1 /D DBA_CDB_BUILTIN=1 /D DBA_INIFILE=1");
- } else {
- WARNING("dba not enabled; libraries and headers not found");
+ ADD_FLAG("CFLAGS_DBA", "/D DBA_DB1=0 /D DB1_VERSION=\"\\\"Berkeley DB 1.85 emulation in DB3\\\"\" /D DB1_INCLUDE_FILE=\"\\\"db_185.h\\\"\" /D DBA_DB3=1 /D DB3_INCLUDE_FILE=\"\\\"db.h\\\"\"");
+ } else if (PHP_DBA != "yes") {
+ WARNING("dba: db handlers not enabled; libraries and headers not found");
}
}
diff --git a/ext/exif/config.w32 b/ext/exif/config.w32
index 595e71bda0..ad000c4251 100644
--- a/ext/exif/config.w32
+++ b/ext/exif/config.w32
@@ -1,14 +1,14 @@
// $Id$
// vim:ft=javascript
-ARG_ENABLE("exif", "exif", "no");
+ARG_ENABLE('exif', 'Exchangeable image information (EXIF) Support', 'no');
-if (PHP_EXIF == "yes") {
- if (ADD_EXTENSION_DEP('exif', 'mbstring')) {
- EXTENSION("exif", "exif.c", null, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
- AC_DEFINE('HAVE_EXIF', 1, 'Have exif');
- } else {
- WARNING("exif support can't be enabled, libxml is not enabled")
- PHP_EXIF = "no"
+if(PHP_EXIF != 'no')
+{
+ if(ADD_EXTENSION_DEP('exif', 'mbstring'))
+ {
+ AC_DEFINE('HAVE_EXIF', 1, 'Have EXIF Support');
+
+ EXTENSION('exif', 'exif.c', null, '/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1');
}
-}
+} \ No newline at end of file
diff --git a/ext/exif/exif.c b/ext/exif/exif.c
index 91aeb7dc7b..c882a12c7c 100644
--- a/ext/exif/exif.c
+++ b/ext/exif/exif.c
@@ -89,7 +89,7 @@ typedef unsigned char uchar;
#define EFREE_IF(ptr) if (ptr) efree(ptr)
-#define MAX_IFD_NESTING_LEVEL 100
+#define MAX_IFD_NESTING_LEVEL 150
/* {{{ arginfo */
ZEND_BEGIN_ARG_INFO(arginfo_exif_tagname, 0)
@@ -136,7 +136,16 @@ PHP_MINFO_FUNCTION(exif)
php_info_print_table_row(2, "EXIF Support", "enabled");
php_info_print_table_row(2, "EXIF Version", PHP_EXIF_VERSION);
php_info_print_table_row(2, "Supported EXIF Version", "0220");
- php_info_print_table_row(2, "Supported filetypes", "JPEG,TIFF");
+ php_info_print_table_row(2, "Supported filetypes", "JPEG, TIFF");
+
+ if (zend_hash_str_exists(&module_registry, "mbstring", sizeof("mbstring")-1)) {
+ php_info_print_table_row(2, "Multibyte decoding support using mbstring", "enabled");
+ } else {
+ php_info_print_table_row(2, "Multibyte decoding support using mbstring", "disabled");
+ }
+
+ php_info_print_table_row(2, "Extended EXIF tag formats", "Canon, Casio, Fujifilm, Nikon, Olympus, Samsung, Panasonic, DJI, Sony, Pentax, Minolta, Sigma, Foveon");
+
php_info_print_table_end();
DISPLAY_INI_ENTRIES();
}
@@ -171,7 +180,7 @@ ZEND_INI_MH(OnUpdateEncode)
php_error_docref(NULL, E_WARNING, "Illegal encoding ignored: '%s'", ZSTR_VAL(new_value));
return FAILURE;
}
- efree(return_list);
+ pefree((void *) return_list, 0);
}
return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
}
@@ -186,7 +195,7 @@ ZEND_INI_MH(OnUpdateDecode)
php_error_docref(NULL, E_WARNING, "Illegal encoding ignored: '%s'", ZSTR_VAL(new_value));
return FAILURE;
}
- efree(return_list);
+ pefree((void *) return_list, 0);
}
return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
}
@@ -218,7 +227,7 @@ static PHP_GINIT_FUNCTION(exif)
/* }}} */
/* {{{ PHP_MINIT_FUNCTION(exif)
- Get the size of an image as 4-element array */
+ */
PHP_MINIT_FUNCTION(exif)
{
REGISTER_INI_ENTRIES();
@@ -955,6 +964,360 @@ static tag_info_array tag_table_VND_OLYMPUS = {
TAG_TABLE_END
};
+static tag_info_array tag_table_VND_SAMSUNG = {
+ { 0x0001, "Version"},
+ { 0x0021, "PictureWizard"},
+ { 0x0030, "LocalLocationName"},
+ { 0x0031, "LocationName"},
+ { 0x0035, "Preview"},
+ { 0x0043, "CameraTemperature"},
+ { 0xa001, "FirmwareName"},
+ { 0xa003, "LensType"},
+ { 0xa004, "LensFirmware"},
+ { 0xa010, "SensorAreas"},
+ { 0xa011, "ColorSpace"},
+ { 0xa012, "SmartRange"},
+ { 0xa013, "ExposureBiasValue"},
+ { 0xa014, "ISO"},
+ { 0xa018, "ExposureTime"},
+ { 0xa019, "FNumber"},
+ { 0xa01a, "FocalLengthIn35mmFormat"},
+ { 0xa020, "EncryptionKey"},
+ { 0xa021, "WB_RGGBLevelsUncorrected"},
+ { 0xa022, "WB_RGGBLevelsAuto"},
+ { 0xa023, "WB_RGGBLevelsIlluminator1"},
+ { 0xa024, "WB_RGGBLevelsIlluminator2"},
+ { 0xa028, "WB_RGGBLevelsBlack"},
+ { 0xa030, "ColorMatrix"},
+ { 0xa031, "ColorMatrixSRGB"},
+ { 0xa032, "ColorMatrixAdobeRGB"},
+ { 0xa040, "ToneCurve1"},
+ { 0xa041, "ToneCurve2"},
+ { 0xa042, "ToneCurve3"},
+ { 0xa043, "ToneCurve4"},
+ TAG_TABLE_END
+};
+
+static tag_info_array tag_table_VND_PANASONIC = {
+ { 0x0001, "Quality"},
+ { 0x0002, "FirmwareVersion"},
+ { 0x0003, "WhiteBalance"},
+ { 0x0004, "0x0004"},
+ { 0x0007, "FocusMode"},
+ { 0x000f, "AFMode"},
+ { 0x001a, "ImageStabilization"},
+ { 0x001c, "Macro"},
+ { 0x001f, "ShootingMode"},
+ { 0x0020, "Audio"},
+ { 0x0021, "DataDump"},
+ { 0x0022, "0x0022"},
+ { 0x0023, "WhiteBalanceBias"},
+ { 0x0024, "FlashBias"},
+ { 0x0025, "InternalSerialNumber"},
+ { 0x0026, "ExifVersion"},
+ { 0x0027, "0x0027"},
+ { 0x0028, "ColorEffect"},
+ { 0x0029, "TimeSincePowerOn"},
+ { 0x002a, "BurstMode"},
+ { 0x002b, "SequenceNumber"},
+ { 0x002c, "Contrast"},
+ { 0x002d, "NoiseReduction"},
+ { 0x002e, "SelfTimer"},
+ { 0x002f, "0x002f"},
+ { 0x0030, "Rotation"},
+ { 0x0031, "AFAssistLamp"},
+ { 0x0032, "ColorMode"},
+ { 0x0033, "BabyAge1"},
+ { 0x0034, "OpticalZoomMode"},
+ { 0x0035, "ConversionLens"},
+ { 0x0036, "TravelDay"},
+ { 0x0039, "Contrast"},
+ { 0x003a, "WorldTimeLocation"},
+ { 0x003b, "TextStamp1"},
+ { 0x003c, "ProgramISO"},
+ { 0x003d, "AdvancedSceneType"},
+ { 0x003e, "TextStamp2"},
+ { 0x003f, "FacesDetected"},
+ { 0x0040, "Saturation"},
+ { 0x0041, "Sharpness"},
+ { 0x0042, "FilmMode"},
+ { 0x0044, "ColorTempKelvin"},
+ { 0x0045, "BracketSettings"},
+ { 0x0046, "WBAdjustAB"},
+ { 0x0047, "WBAdjustGM"},
+ { 0x0048, "FlashCurtain"},
+ { 0x0049, "LongShutterNoiseReduction"},
+ { 0x004b, "ImageWidth"},
+ { 0x004c, "ImageHeight"},
+ { 0x004d, "AFPointPosition"},
+ { 0x004e, "FaceDetInfo"},
+ { 0x0051, "LensType"},
+ { 0x0052, "LensSerialNumber"},
+ { 0x0053, "AccessoryType"},
+ { 0x0054, "AccessorySerialNumber"},
+ { 0x0059, "Transform1"},
+ { 0x005d, "IntelligentExposure"},
+ { 0x0060, "LensFirmwareVersion"},
+ { 0x0061, "FaceRecInfo"},
+ { 0x0062, "FlashWarning"},
+ { 0x0065, "Title"},
+ { 0x0066, "BabyName"},
+ { 0x0067, "Location"},
+ { 0x0069, "Country"},
+ { 0x006b, "State"},
+ { 0x006d, "City"},
+ { 0x006f, "Landmark"},
+ { 0x0070, "IntelligentResolution"},
+ { 0x0077, "BurstSheed"},
+ { 0x0079, "IntelligentDRange"},
+ { 0x007c, "ClearRetouch"},
+ { 0x0080, "City2"},
+ { 0x0086, "ManometerPressure"},
+ { 0x0089, "PhotoStyle"},
+ { 0x008a, "ShadingCompensation"},
+ { 0x008c, "AccelerometerZ"},
+ { 0x008d, "AccelerometerX"},
+ { 0x008e, "AccelerometerY"},
+ { 0x008f, "CameraOrientation"},
+ { 0x0090, "RollAngle"},
+ { 0x0091, "PitchAngle"},
+ { 0x0093, "SweepPanoramaDirection"},
+ { 0x0094, "PanoramaFieldOfView"},
+ { 0x0096, "TimerRecording"},
+ { 0x009d, "InternalNDFilter"},
+ { 0x009e, "HDR"},
+ { 0x009f, "ShutterType"},
+ { 0x00a3, "ClearRetouchValue"},
+ { 0x00ab, "TouchAE"},
+ { 0x0e00, "PrintIM"},
+ { 0x4449, "0x4449"},
+ { 0x8000, "MakerNoteVersion"},
+ { 0x8001, "SceneMode"},
+ { 0x8004, "WBRedLevel"},
+ { 0x8005, "WBGreenLevel"},
+ { 0x8006, "WBBlueLevel"},
+ { 0x8007, "FlashFired"},
+ { 0x8008, "TextStamp3"},
+ { 0x8009, "TextStamp4"},
+ { 0x8010, "BabyAge2"},
+ { 0x8012, "Transform2"},
+ TAG_TABLE_END
+};
+
+static tag_info_array tag_table_VND_DJI = {
+ { 0x0001, "Make"},
+ { 0x0003, "SpeedX"},
+ { 0x0004, "SpeedY"},
+ { 0x0005, "SpeedZ"},
+ { 0x0006, "Pitch"},
+ { 0x0007, "Yaw"},
+ { 0x0008, "Roll"},
+ { 0x0009, "CameraPitch"},
+ { 0x000a, "CameraYaw"},
+ { 0x000b, "CameraRoll"},
+ TAG_TABLE_END
+};
+
+static tag_info_array tag_table_VND_SONY = {
+ { 0x0102, "Quality"},
+ { 0x0104, "FlashExposureComp"},
+ { 0x0105, "Teleconverter"},
+ { 0x0112, "WhiteBalanceFineTune"},
+ { 0x0114, "CameraSettings"},
+ { 0x0115, "WhiteBalance"},
+ { 0x0116, "0x0116"},
+ { 0x0e00, "PrintIM"},
+ { 0x1000, "MultiBurstMode"},
+ { 0x1001, "MultiBurstImageWidth"},
+ { 0x1002, "MultiBurstImageHeight"},
+ { 0x1003, "Panorama"},
+ { 0x2000, "0x2000"},
+ { 0x2001, "PreviewImage"},
+ { 0x2002, "0x2002"},
+ { 0x2003, "0x2003"},
+ { 0x2004, "Contrast"},
+ { 0x2005, "Saturation"},
+ { 0x2006, "0x2006"},
+ { 0x2007, "0x2007"},
+ { 0x2008, "0x2008"},
+ { 0x2009, "0x2009"},
+ { 0x200a, "AutoHDR"},
+ { 0x3000, "ShotInfo"},
+ { 0xb000, "FileFormat"},
+ { 0xb001, "SonyModelID"},
+ { 0xb020, "ColorReproduction"},
+ { 0xb021, "ColorTemperature"},
+ { 0xb022, "ColorCompensationFilter"},
+ { 0xb023, "SceneMode"},
+ { 0xb024, "ZoneMatching"},
+ { 0xb025, "DynamicRangeOptimizer"},
+ { 0xb026, "ImageStabilization"},
+ { 0xb027, "LensID"},
+ { 0xb028, "MinoltaMakerNote"},
+ { 0xb029, "ColorMode"},
+ { 0xb02b, "FullImageSize"},
+ { 0xb02c, "PreviewImageSize"},
+ { 0xb040, "Macro"},
+ { 0xb041, "ExposureMode"},
+ { 0xb042, "FocusMode"},
+ { 0xb043, "AFMode"},
+ { 0xb044, "AFIlluminator"},
+ { 0xb047, "JPEGQuality"},
+ { 0xb048, "FlashLevel"},
+ { 0xb049, "ReleaseMode"},
+ { 0xb04a, "SequenceNumber"},
+ { 0xb04b, "AntiBlur"},
+ { 0xb04e, "LongExposureNoiseReduction"},
+ { 0xb04f, "DynamicRangeOptimizer"},
+ { 0xb052, "IntelligentAuto"},
+ { 0xb054, "WhiteBalance2"},
+ TAG_TABLE_END
+};
+
+static tag_info_array tag_table_VND_PENTAX = {
+ { 0x0000, "Version"},
+ { 0x0001, "Mode"},
+ { 0x0002, "PreviewResolution"},
+ { 0x0003, "PreviewLength"},
+ { 0x0004, "PreviewOffset"},
+ { 0x0005, "ModelID"},
+ { 0x0006, "Date"},
+ { 0x0007, "Time"},
+ { 0x0008, "Quality"},
+ { 0x0009, "Size"},
+ { 0x000c, "Flash"},
+ { 0x000d, "Focus"},
+ { 0x000e, "AFPoint"},
+ { 0x000f, "AFPointInFocus"},
+ { 0x0012, "ExposureTime"},
+ { 0x0013, "FNumber"},
+ { 0x0014, "ISO"},
+ { 0x0016, "ExposureCompensation"},
+ { 0x0017, "MeteringMode"},
+ { 0x0018, "AutoBracketing"},
+ { 0x0019, "WhiteBalance"},
+ { 0x001a, "WhiteBalanceMode"},
+ { 0x001b, "BlueBalance"},
+ { 0x001c, "RedBalance"},
+ { 0x001d, "FocalLength"},
+ { 0x001e, "DigitalZoom"},
+ { 0x001f, "Saturation"},
+ { 0x0020, "Contrast"},
+ { 0x0021, "Sharpness"},
+ { 0x0022, "Location"},
+ { 0x0023, "Hometown"},
+ { 0x0024, "Destination"},
+ { 0x0025, "HometownDST"},
+ { 0x0026, "DestinationDST"},
+ { 0x0027, "DSPFirmwareVersion"},
+ { 0x0028, "CPUFirmwareVersion"},
+ { 0x0029, "FrameNumber"},
+ { 0x002d, "EffectiveLV"},
+ { 0x0032, "ImageProcessing"},
+ { 0x0033, "PictureMode"},
+ { 0x0034, "DriveMode"},
+ { 0x0037, "ColorSpace"},
+ { 0x0038, "ImageAreaOffset"},
+ { 0x0039, "RawImageSize"},
+ { 0x003e, "PreviewImageBorders"},
+ { 0x003f, "LensType"},
+ { 0x0040, "SensitivityAdjust"},
+ { 0x0041, "DigitalFilter"},
+ { 0x0047, "Temperature"},
+ { 0x0048, "AELock"},
+ { 0x0049, "NoiseReduction"},
+ { 0x004d, "FlashExposureCompensation"},
+ { 0x004f, "ImageTone"},
+ { 0x0050, "ColorTemperature"},
+ { 0x005c, "ShakeReduction"},
+ { 0x005d, "ShutterCount"},
+ { 0x0069, "DynamicRangeExpansion"},
+ { 0x0071, "HighISONoiseReduction"},
+ { 0x0072, "AFAdjustment"},
+ { 0x0200, "BlackPoint"},
+ { 0x0201, "WhitePoint"},
+ { 0x0205, "ShotInfo"},
+ { 0x0206, "AEInfo"},
+ { 0x0207, "LensInfo"},
+ { 0x0208, "FlashInfo"},
+ { 0x0209, "AEMeteringSegments"},
+ { 0x020a, "FlashADump"},
+ { 0x020b, "FlashBDump"},
+ { 0x020d, "WB_RGGBLevelsDaylight"},
+ { 0x020e, "WB_RGGBLevelsShade"},
+ { 0x020f, "WB_RGGBLevelsCloudy"},
+ { 0x0210, "WB_RGGBLevelsTungsten"},
+ { 0x0211, "WB_RGGBLevelsFluorescentD"},
+ { 0x0212, "WB_RGGBLevelsFluorescentN"},
+ { 0x0213, "WB_RGGBLevelsFluorescentW"},
+ { 0x0214, "WB_RGGBLevelsFlash"},
+ { 0x0215, "CameraInfo"},
+ { 0x0216, "BatteryInfo"},
+ { 0x021f, "AFInfo"},
+ { 0x0222, "ColorInfo"},
+ { 0x0229, "SerialNumber"},
+ TAG_TABLE_END
+};
+
+static tag_info_array tag_table_VND_MINOLTA = {
+ { 0x0000, "Version"},
+ { 0x0001, "CameraSettingsStdOld"},
+ { 0x0003, "CameraSettingsStdNew"},
+ { 0x0004, "CameraSettings7D"},
+ { 0x0018, "ImageStabilizationData"},
+ { 0x0020, "WBInfoA100"},
+ { 0x0040, "CompressedImageSize"},
+ { 0x0081, "Thumbnail"},
+ { 0x0088, "ThumbnailOffset"},
+ { 0x0089, "ThumbnailLength"},
+ { 0x0100, "SceneMode"},
+ { 0x0101, "ColorMode"},
+ { 0x0102, "Quality"},
+ { 0x0103, "0x0103"},
+ { 0x0104, "FlashExposureComp"},
+ { 0x0105, "Teleconverter"},
+ { 0x0107, "ImageStabilization"},
+ { 0x0109, "RawAndJpgRecording"},
+ { 0x010a, "ZoneMatching"},
+ { 0x010b, "ColorTemperature"},
+ { 0x010c, "LensID"},
+ { 0x0111, "ColorCompensationFilter"},
+ { 0x0112, "WhiteBalanceFineTune"},
+ { 0x0113, "ImageStabilizationA100"},
+ { 0x0114, "CameraSettings5D"},
+ { 0x0115, "WhiteBalance"},
+ { 0x0e00, "PrintIM"},
+ { 0x0f00, "CameraSettingsZ1"},
+ TAG_TABLE_END
+};
+
+static tag_info_array tag_table_VND_SIGMA = {
+ { 0x0002, "SerialNumber"},
+ { 0x0003, "DriveMode"},
+ { 0x0004, "ResolutionMode"},
+ { 0x0005, "AutofocusMode"},
+ { 0x0006, "FocusSetting"},
+ { 0x0007, "WhiteBalance"},
+ { 0x0008, "ExposureMode"},
+ { 0x0009, "MeteringMode"},
+ { 0x000a, "LensRange"},
+ { 0x000b, "ColorSpace"},
+ { 0x000c, "Exposure"},
+ { 0x000d, "Contrast"},
+ { 0x000e, "Shadow"},
+ { 0x000f, "Highlight"},
+ { 0x0010, "Saturation"},
+ { 0x0011, "Sharpness"},
+ { 0x0012, "FillLight"},
+ { 0x0014, "ColorAdjustment"},
+ { 0x0015, "AdjustmentMode"},
+ { 0x0016, "Quality"},
+ { 0x0017, "Firmware"},
+ { 0x0018, "Software"},
+ { 0x0019, "AutoBracket"},
+ TAG_TABLE_END
+};
+
typedef enum mn_byte_order_t {
MN_ORDER_INTEL = 0,
MN_ORDER_MOTOROLA = 1,
@@ -978,14 +1341,22 @@ typedef struct {
mn_offset_mode_t offset_mode;
} maker_note_type;
+/* Remember to update PHP_MINFO if updated */
static const maker_note_type maker_note_array[] = {
{ tag_table_VND_CANON, "Canon", NULL, NULL, 0, 0, MN_ORDER_INTEL, MN_OFFSET_GUESS},
-/* { tag_table_VND_CANON, "Canon", NULL, NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},*/
{ tag_table_VND_CASIO, "CASIO", NULL, NULL, 0, 0, MN_ORDER_MOTOROLA, MN_OFFSET_NORMAL},
{ tag_table_VND_FUJI, "FUJIFILM", NULL, "FUJIFILM\x0C\x00\x00\x00", 12, 12, MN_ORDER_INTEL, MN_OFFSET_MAKER},
{ tag_table_VND_NIKON, "NIKON", NULL, "Nikon\x00\x01\x00", 8, 8, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
{ tag_table_VND_NIKON_990, "NIKON", NULL, NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
{ tag_table_VND_OLYMPUS, "OLYMPUS OPTICAL CO.,LTD", NULL, "OLYMP\x00\x01\x00", 8, 8, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
+ { tag_table_VND_SAMSUNG, "SAMSUNG", NULL, NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
+ { tag_table_VND_PANASONIC, "Panasonic", NULL, "Panasonic\x00\x00\x00", 12, 12, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
+ { tag_table_VND_DJI, "DJI", NULL, NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
+ { tag_table_VND_SONY, "SONY", NULL, "SONY DSC \x00\x00\x00", 12, 12, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
+ { tag_table_VND_PENTAX, "PENTAX", NULL, "AOC\x00", 6, 6, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
+ { tag_table_VND_MINOLTA, "Minolta, KONICA MINOLTA", NULL, NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
+ { tag_table_VND_SIGMA, "SIGMA, FOVEON", NULL, "SIGMA\x00\x00\x00", 10, 10, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
+ { tag_table_VND_SIGMA, "SIGMA, FOVEON", NULL, "FOVEON\x00\x00\x00", 10, 10, MN_ORDER_NORMAL, MN_OFFSET_NORMAL}
};
/* }}} */
@@ -1270,6 +1641,20 @@ static double exif_convert_any_format(void *value, int format, int motorola_inte
}
/* }}} */
+/* {{{ exif_rewrite_tag_format_to_unsigned
+ * Rewrite format tag so that it specifies an unsigned type for a tag */
+static int exif_rewrite_tag_format_to_unsigned(int format)
+{
+ switch(format) {
+ case TAG_FMT_SBYTE: return TAG_FMT_BYTE;
+ case TAG_FMT_SRATIONAL: return TAG_FMT_URATIONAL;
+ case TAG_FMT_SSHORT: return TAG_FMT_USHORT;
+ case TAG_FMT_SLONG: return TAG_FMT_ULONG;
+ }
+ return format;
+}
+/* }}} */
+
/* {{{ exif_convert_any_to_int
* Evaluate number, be it int, rational, or float from directory. */
static size_t exif_convert_any_to_int(void *value, int format, int motorola_intel)
@@ -1704,7 +2089,7 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
case TAG_FMT_UNDEFINED:
if (value) {
if (tag == TAG_MAKER_NOTE) {
- length = MIN(length, strlen(value));
+ length = MIN(length, (int) strlen(value));
}
/* do not recompute length here */
@@ -2715,7 +3100,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
int NumDirEntries, old_motorola_intel, offset_diff;
const maker_note_type *maker_note;
char *dir_start;
-
+
for (i=0; i<=sizeof(maker_note_array)/sizeof(maker_note_type); i++) {
if (i==sizeof(maker_note_array)/sizeof(maker_note_type)) {
#ifdef EXIF_DEBUG
@@ -2736,7 +3121,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
continue;
break;
}
-
+
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);
@@ -2844,7 +3229,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/*return TRUE;*/
}
- if (components < 0) {
+ if (components <= 0) {
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal components(%ld)", tag, exif_get_tagname(tag, tagname, -12, tag_table), components);
return FALSE;
}
@@ -2933,18 +3318,18 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
switch(tag) {
case TAG_IMAGEWIDTH:
case TAG_COMP_IMAGE_WIDTH:
- ImageInfo->Thumbnail.width = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel);
+ ImageInfo->Thumbnail.width = exif_convert_any_to_int(value_ptr, exif_rewrite_tag_format_to_unsigned(format), ImageInfo->motorola_intel);
break;
case TAG_IMAGEHEIGHT:
case TAG_COMP_IMAGE_HEIGHT:
- ImageInfo->Thumbnail.height = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel);
+ ImageInfo->Thumbnail.height = exif_convert_any_to_int(value_ptr, exif_rewrite_tag_format_to_unsigned(format), ImageInfo->motorola_intel);
break;
case TAG_STRIP_OFFSETS:
case TAG_JPEG_INTERCHANGE_FORMAT:
/* accept both formats */
- ImageInfo->Thumbnail.offset = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel);
+ ImageInfo->Thumbnail.offset = exif_convert_any_to_int(value_ptr, exif_rewrite_tag_format_to_unsigned(format), ImageInfo->motorola_intel);
break;
case TAG_STRIP_BYTE_COUNTS:
@@ -2954,13 +3339,13 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* motorola is easier to read */
ImageInfo->Thumbnail.filetype = IMAGE_FILETYPE_TIFF_MM;
}
- ImageInfo->Thumbnail.size = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel);
+ ImageInfo->Thumbnail.size = exif_convert_any_to_int(value_ptr, exif_rewrite_tag_format_to_unsigned(format), ImageInfo->motorola_intel);
break;
case TAG_JPEG_INTERCHANGE_FORMAT_LEN:
if (ImageInfo->Thumbnail.filetype == IMAGE_FILETYPE_UNKNOWN) {
ImageInfo->Thumbnail.filetype = IMAGE_FILETYPE_JPEG;
- ImageInfo->Thumbnail.size = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel);
+ ImageInfo->Thumbnail.size = exif_convert_any_to_int(value_ptr, exif_rewrite_tag_format_to_unsigned(format), ImageInfo->motorola_intel);
}
break;
}
@@ -3032,7 +3417,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
break;
case TAG_COMP_IMAGE_WIDTH:
- ImageInfo->ExifImageWidth = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel);
+ ImageInfo->ExifImageWidth = exif_convert_any_to_int(value_ptr, exif_rewrite_tag_format_to_unsigned(format), ImageInfo->motorola_intel);
break;
case TAG_FOCALPLANE_X_RES:
@@ -3724,8 +4109,12 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
fgot = php_stream_read(ImageInfo->infile, ImageInfo->Thumbnail.data, ImageInfo->Thumbnail.size);
if (fgot < ImageInfo->Thumbnail.size) {
EXIF_ERRLOG_THUMBEOF(ImageInfo)
+ efree(ImageInfo->Thumbnail.data);
+
+ ImageInfo->Thumbnail.data = NULL;
+ } else {
+ exif_thumbnail_build(ImageInfo);
}
- exif_thumbnail_build(ImageInfo);
}
}
}
@@ -4201,7 +4590,7 @@ PHP_FUNCTION(exif_imagetype)
php_stream * stream;
int itype = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &imagefile, &imagefile_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &imagefile, &imagefile_len) == FAILURE) {
return;
}
diff --git a/ext/exif/tests/bug68547.jpg b/ext/exif/tests/bug68547.jpg
new file mode 100644
index 0000000000..2a328b76a8
--- /dev/null
+++ b/ext/exif/tests/bug68547.jpg
Binary files differ
diff --git a/ext/exif/tests/bug68547.phpt b/ext/exif/tests/bug68547.phpt
new file mode 100644
index 0000000000..894c76806d
--- /dev/null
+++ b/ext/exif/tests/bug68547.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Bug #68547 (Exif Header component value check error)
+--SKIPIF--
+<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
+--FILE--
+<?php
+exif_read_data(__DIR__ . DIRECTORY_SEPARATOR . 'bug68547.jpg');
+?>
+===DONE===
+--EXPECTF--
+Warning: exif_read_data(bug68547.jpg): Process tag(x9C9E=Keywords ): Illegal components(%d) in %sbug68547.php on line %d
+===DONE=== \ No newline at end of file
diff --git a/ext/exif/tests/bug68799.phpt b/ext/exif/tests/bug68799.phpt
index f50a41b402..a24664109d 100644
--- a/ext/exif/tests/bug68799.phpt
+++ b/ext/exif/tests/bug68799.phpt
@@ -39,6 +39,7 @@ print_r(exif_read_data(__DIR__.'/bug68799.jpg'));
?>
--EXPECTF--
+Warning: exif_read_data(bug68799.jpg): Process tag(x9C9D=Author ): Illegal components(%d) in %s on line %d
Array
(
[FileName] => bug68799.jpg
@@ -46,7 +47,7 @@ Array
[FileSize] => 735
[FileType] => 2
[MimeType] => image/jpeg
- [SectionsFound] => ANY_TAG, IFD0, WINXP
+ [SectionsFound] => ANY_TAG, IFD0
[COMPUTED] => Array
(
[html] => width="1" height="1"
@@ -59,5 +60,4 @@ Array
[XResolution] => 96/1
[YResolution] => 96/1
[ResolutionUnit] => 2
- [Author] =>
)
diff --git a/ext/exif/tests/bug71534.phpt b/ext/exif/tests/bug71534.phpt
new file mode 100644
index 0000000000..1f5fc9db04
--- /dev/null
+++ b/ext/exif/tests/bug71534.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Bug #71534 (Type confusion in exif_read_data() leading to heap overflow in debug mode)
+--SKIPIF--
+<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
+--FILE--
+<?php
+// This is kinda bad, I know! But, this generates about 200+ warnings due to its
+// broken TIFF format
+var_dump(@exif_read_data(__DIR__ . DIRECTORY_SEPARATOR . 'bug71534.tiff') === false);
+?>
+--EXPECT--
+bool(true)
diff --git a/ext/exif/tests/bug71534.tiff b/ext/exif/tests/bug71534.tiff
new file mode 100644
index 0000000000..1a224d54c9
--- /dev/null
+++ b/ext/exif/tests/bug71534.tiff
Binary files differ
diff --git a/ext/exif/tests/bug72094.phpt b/ext/exif/tests/bug72094.phpt
index 611faf9152..486c3732a1 100644
--- a/ext/exif/tests/bug72094.phpt
+++ b/ext/exif/tests/bug72094.phpt
@@ -23,7 +23,7 @@ Warning: exif_read_data(bug72094_1.jpg): Process tag(x3030=UndefinedTa): Illegal
Warning: exif_read_data(bug72094_1.jpg): Process tag(x8298=Copyright ): Illegal format code 0x3030, suppose BYTE in %s%ebug72094.php on line %d
-Warning: exif_read_data(bug72094_1.jpg): Illegal IFD offset in %s%ebug72094.php on line %d
+Warning: exif_read_data(bug72094_1.jpg): Illegal IFD offset in %sbug72094.php on line %d
Warning: exif_read_data(bug72094_1.jpg): File structure corrupted in %s%ebug72094.php on line %d
@@ -47,7 +47,7 @@ Warning: exif_read_data(bug72094_3.jpg): Process tag(x3030=UndefinedTa): Illegal
Warning: exif_read_data(bug72094_3.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %s%ebug72094.php on line %d
-Warning: exif_read_data(bug72094_3.jpg): Illegal IFD size in %s%ebug72094.php on line %d
+Warning: exif_read_data(bug72094_3.jpg): Process tag(x3030=UndefinedTa): Illegal components(%d) in %s%ebug72094.php on line %d
Warning: exif_read_data(bug72094_3.jpg): File structure corrupted in %s%ebug72094.php on line %d
diff --git a/ext/exif/tests/bug72735/bug72682.phpt b/ext/exif/tests/bug72735/bug72682.phpt
new file mode 100644
index 0000000000..b3f17791a3
--- /dev/null
+++ b/ext/exif/tests/bug72735/bug72682.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Bug #72735 MakerNote regression
+--SKIPIF--
+<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
+--FILE--
+<?php
+foreach (['nokia.jpg', 'samsung.jpg', 'panasonic.jpg'] as $picture) {
+ echo $picture . ': ';
+
+ $info = exif_read_data(__DIR__ . DIRECTORY_SEPARATOR . $picture);
+ var_dump($info['MakerNote']);
+}
+?>
+--EXPECTF--
+nokia.jpg: string(5) "Nikon"
+samsung.jpg: NULL
+panasonic.jpg: string(9) "Panasonic"
diff --git a/ext/exif/tests/bug72735/bug72735.phpt b/ext/exif/tests/bug72735/bug72735.phpt
new file mode 100644
index 0000000000..38d9ed2199
--- /dev/null
+++ b/ext/exif/tests/bug72735/bug72735.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Bug #72735 (Samsung picture thumb not read (zero size))
+--SKIPIF--
+<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
+--FILE--
+<?php
+foreach (['nokia.jpg', 'samsung.jpg', 'panasonic.jpg'] as $picture) {
+ echo $picture . ': ';
+
+ $len = strlen(exif_thumbnail(__DIR__ . DIRECTORY_SEPARATOR . $picture));
+
+ if (!$len) {
+ echo 'Error, no length returned', PHP_EOL;
+
+ continue;
+ }
+
+ echo 'int(' . $len . ')', PHP_EOL;
+}
+?>
+--EXPECTF--
+nokia.jpg: int(5899)
+samsung.jpg: int(5778)
+panasonic.jpg: int(651)
diff --git a/ext/exif/tests/bug72735/nokia.jpg b/ext/exif/tests/bug72735/nokia.jpg
new file mode 100644
index 0000000000..f402d765a6
--- /dev/null
+++ b/ext/exif/tests/bug72735/nokia.jpg
Binary files differ
diff --git a/ext/exif/tests/bug72735/panasonic.jpg b/ext/exif/tests/bug72735/panasonic.jpg
new file mode 100644
index 0000000000..35713e63a1
--- /dev/null
+++ b/ext/exif/tests/bug72735/panasonic.jpg
Binary files differ
diff --git a/ext/exif/tests/bug72735/samsung.jpg b/ext/exif/tests/bug72735/samsung.jpg
new file mode 100644
index 0000000000..1ec51eaf0c
--- /dev/null
+++ b/ext/exif/tests/bug72735/samsung.jpg
Binary files differ
diff --git a/ext/exif/tests/exif_imagetype_variation1.phpt b/ext/exif/tests/exif_imagetype_variation1.phpt
index 767ed5fecb..d33217c5f8 100644
--- a/ext/exif/tests/exif_imagetype_variation1.phpt
+++ b/ext/exif/tests/exif_imagetype_variation1.phpt
@@ -142,23 +142,23 @@ Warning: exif_imagetype(0.5): failed to open stream: No such file or directory i
bool(false)
-- Iteration 10 --
-Warning: exif_imagetype() expects parameter 1 to be string, array given in %s on line %d
+Warning: exif_imagetype() expects parameter 1 to be a valid path, array given in %s on line %d
NULL
-- Iteration 11 --
-Warning: exif_imagetype() expects parameter 1 to be string, array given in %s on line %d
+Warning: exif_imagetype() expects parameter 1 to be a valid path, array given in %s on line %d
NULL
-- Iteration 12 --
-Warning: exif_imagetype() expects parameter 1 to be string, array given in %s on line %d
+Warning: exif_imagetype() expects parameter 1 to be a valid path, array given in %s on line %d
NULL
-- Iteration 13 --
-Warning: exif_imagetype() expects parameter 1 to be string, array given in %s on line %d
+Warning: exif_imagetype() expects parameter 1 to be a valid path, array given in %s on line %d
NULL
-- Iteration 14 --
-Warning: exif_imagetype() expects parameter 1 to be string, array given in %s on line %d
+Warning: exif_imagetype() expects parameter 1 to be a valid path, array given in %s on line %d
NULL
-- Iteration 15 --
@@ -198,7 +198,7 @@ Warning: exif_imagetype(obj'ct): failed to open stream: No such file or director
bool(false)
-- Iteration 24 --
-Warning: exif_imagetype() expects parameter 1 to be string, resource given in %s on line %d
+Warning: exif_imagetype() expects parameter 1 to be a valid path, resource given in %s on line %d
NULL
-- Iteration 25 --
diff --git a/ext/exif/tests/exif_tagname_variation1-64bit.phpt b/ext/exif/tests/exif_tagname_variation1-64bit.phpt
new file mode 100644
index 0000000000..22298af2ae
--- /dev/null
+++ b/ext/exif/tests/exif_tagname_variation1-64bit.phpt
@@ -0,0 +1,183 @@
+--TEST--
+Test exif_tagname() function : usage variations - different types for index argument
+--SKIPIF--
+<?php if (!extension_loaded('exif')) print 'skip exif extension not available';
+if (PHP_INT_SIZE != 8) die('skip 64-bit only');
+?>
+--FILE--
+<?php
+
+/* Prototype : string exif_tagname ( string $index )
+ * Description: Get the header name for an index
+ * Source code: ext/exif/exif.c
+*/
+
+echo "*** Testing exif_tagname() : different types for index argument ***\n";
+// initialize all required variables
+
+// get an unset variable
+$unset_var = 'string_val';
+unset($unset_var);
+
+// declaring a class
+class sample {
+ public function __toString() {
+ return "obj'ct";
+ }
+}
+
+// Defining resource
+$file_handle = fopen(__FILE__, 'r');
+
+// array with different values
+$values = array (
+
+ // integer values
+ 0,
+ 1,
+ 12345,
+ -2345,
+
+ // float values
+ 10.5,
+ -10.5,
+ 10.1234567e10,
+ 10.7654321E-10,
+ .5,
+
+ // array values
+ array(),
+ array(0),
+ array(1),
+ array(1, 2),
+ array('color' => 'red', 'item' => 'pen'),
+
+ // boolean values
+ true,
+ false,
+ TRUE,
+ FALSE,
+
+ // empty string
+ "",
+ '',
+
+ // undefined variable
+ $undefined_var,
+
+ // unset variable
+ $unset_var,
+
+ // objects
+ new sample(),
+
+ // resource
+ $file_handle,
+
+ NULL,
+ null
+);
+
+
+// loop through each element of the array and check the working of exif_tagname()
+// when $index argument is supplied with different values
+
+echo "\n--- Testing exif_tagname() by supplying different values for 'index' argument ---\n";
+$counter = 1;
+foreach($values as $index) {
+ echo "-- Iteration $counter --\n";
+ var_dump( exif_tagname($index) );
+ $counter ++;
+}
+
+// closing the file
+fclose($file_handle);
+
+echo "Done\n";
+?>
+
+?>
+===Done===
+--EXPECTF--
+*** Testing exif_tagname() : different types for index argument ***
+
+Notice: Undefined variable: undefined_var in %s on line %d
+
+Notice: Undefined variable: unset_var in %s on line %d
+
+--- Testing exif_tagname() by supplying different values for 'index' argument ---
+-- Iteration 1 --
+bool(false)
+-- Iteration 2 --
+bool(false)
+-- Iteration 3 --
+bool(false)
+-- Iteration 4 --
+bool(false)
+-- Iteration 5 --
+bool(false)
+-- Iteration 6 --
+bool(false)
+-- Iteration 7 --
+bool(false)
+-- Iteration 8 --
+bool(false)
+-- Iteration 9 --
+bool(false)
+-- Iteration 10 --
+
+Warning: exif_tagname() expects parameter 1 to be integer, array given in %s on line %d
+NULL
+-- Iteration 11 --
+
+Warning: exif_tagname() expects parameter 1 to be integer, array given in %s on line %d
+NULL
+-- Iteration 12 --
+
+Warning: exif_tagname() expects parameter 1 to be integer, array given in %s on line %d
+NULL
+-- Iteration 13 --
+
+Warning: exif_tagname() expects parameter 1 to be integer, array given in %s on line %d
+NULL
+-- Iteration 14 --
+
+Warning: exif_tagname() expects parameter 1 to be integer, array given in %s on line %d
+NULL
+-- Iteration 15 --
+bool(false)
+-- Iteration 16 --
+bool(false)
+-- Iteration 17 --
+bool(false)
+-- Iteration 18 --
+bool(false)
+-- Iteration 19 --
+
+Warning: exif_tagname() expects parameter 1 to be integer, string given in %s on line %d
+NULL
+-- Iteration 20 --
+
+Warning: exif_tagname() expects parameter 1 to be integer, string given in %s on line %d
+NULL
+-- Iteration 21 --
+bool(false)
+-- Iteration 22 --
+bool(false)
+-- Iteration 23 --
+
+Warning: exif_tagname() expects parameter 1 to be integer, object given in %s on line %d
+NULL
+-- Iteration 24 --
+
+Warning: exif_tagname() expects parameter 1 to be integer, resource given in %s on line %d
+NULL
+-- Iteration 25 --
+bool(false)
+-- Iteration 26 --
+bool(false)
+Done
+
+?>
+===Done===
+
diff --git a/ext/exif/tests/exif_tagname_variation1.phpt b/ext/exif/tests/exif_tagname_variation1.phpt
index 22298af2ae..44d2568f49 100644
--- a/ext/exif/tests/exif_tagname_variation1.phpt
+++ b/ext/exif/tests/exif_tagname_variation1.phpt
@@ -2,7 +2,7 @@
Test exif_tagname() function : usage variations - different types for index argument
--SKIPIF--
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';
-if (PHP_INT_SIZE != 8) die('skip 64-bit only');
+if (PHP_INT_SIZE != 4) die('skip 32-bit only');
?>
--FILE--
<?php
@@ -41,8 +41,6 @@ $values = array (
// float values
10.5,
-10.5,
- 10.1234567e10,
- 10.7654321E-10,
.5,
// array values
@@ -121,60 +119,56 @@ bool(false)
-- Iteration 7 --
bool(false)
-- Iteration 8 --
-bool(false)
--- Iteration 9 --
-bool(false)
--- Iteration 10 --
Warning: exif_tagname() expects parameter 1 to be integer, array given in %s on line %d
NULL
--- Iteration 11 --
+-- Iteration 9 --
Warning: exif_tagname() expects parameter 1 to be integer, array given in %s on line %d
NULL
--- Iteration 12 --
+-- Iteration 10 --
Warning: exif_tagname() expects parameter 1 to be integer, array given in %s on line %d
NULL
--- Iteration 13 --
+-- Iteration 11 --
Warning: exif_tagname() expects parameter 1 to be integer, array given in %s on line %d
NULL
--- Iteration 14 --
+-- Iteration 12 --
Warning: exif_tagname() expects parameter 1 to be integer, array given in %s on line %d
NULL
+-- Iteration 13 --
+bool(false)
+-- Iteration 14 --
+bool(false)
-- Iteration 15 --
bool(false)
-- Iteration 16 --
bool(false)
-- Iteration 17 --
-bool(false)
--- Iteration 18 --
-bool(false)
--- Iteration 19 --
Warning: exif_tagname() expects parameter 1 to be integer, string given in %s on line %d
NULL
--- Iteration 20 --
+-- Iteration 18 --
Warning: exif_tagname() expects parameter 1 to be integer, string given in %s on line %d
NULL
--- Iteration 21 --
+-- Iteration 19 --
bool(false)
--- Iteration 22 --
+-- Iteration 20 --
bool(false)
--- Iteration 23 --
+-- Iteration 21 --
Warning: exif_tagname() expects parameter 1 to be integer, object given in %s on line %d
NULL
--- Iteration 24 --
+-- Iteration 22 --
Warning: exif_tagname() expects parameter 1 to be integer, resource given in %s on line %d
NULL
--- Iteration 25 --
+-- Iteration 23 --
bool(false)
--- Iteration 26 --
+-- Iteration 24 --
bool(false)
Done
diff --git a/ext/exif/tests/redhat-bug1362571.jpg b/ext/exif/tests/redhat-bug1362571.jpg
new file mode 100644
index 0000000000..35713e63a1
--- /dev/null
+++ b/ext/exif/tests/redhat-bug1362571.jpg
Binary files differ
diff --git a/ext/exif/tests/redhat-bug1362571.phpt b/ext/exif/tests/redhat-bug1362571.phpt
new file mode 100644
index 0000000000..ec69e38c91
--- /dev/null
+++ b/ext/exif/tests/redhat-bug1362571.phpt
@@ -0,0 +1,10 @@
+--TEST--
+Redhat bug #1362571 (PHP not returning full results for exif_read_data function)
+--SKIPIF--
+<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
+--FILE--
+<?php
+var_dump(strlen(exif_thumbnail(__DIR__ . DIRECTORY_SEPARATOR . 'redhat-bug1362571.jpg')) > 0);
+?>
+--EXPECT--
+bool(true)
diff --git a/ext/exif/tests/sony.jpg b/ext/exif/tests/sony.jpg
new file mode 100644
index 0000000000..865157032c
--- /dev/null
+++ b/ext/exif/tests/sony.jpg
Binary files differ
diff --git a/ext/exif/tests/sony.phpt b/ext/exif/tests/sony.phpt
new file mode 100644
index 0000000000..683d58d4ac
--- /dev/null
+++ b/ext/exif/tests/sony.phpt
@@ -0,0 +1,23 @@
+--TEST--
+Sony test
+--SKIPIF--
+<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
+--FILE--
+<?php
+$data = exif_read_data(__DIR__ . DIRECTORY_SEPARATOR . 'sony.jpg');
+
+if (!$data) {
+ exit('Error: Unable to parse EXIF data');
+}
+
+// Perhaps we should just test for SonyModelID since it seems to be
+// the most specific tag name that should be found in any Sony generated
+// picture
+foreach (['SonyModelID', 'Panorama', 'AntiBlur'] as $sony_tag) {
+ printf('%s was %sfound' . PHP_EOL, $sony_tag, (!isset($data[$sony_tag]) ? 'NOT ' : ''));
+}
+?>
+--EXPECT--
+SonyModelID was found
+Panorama was found
+AntiBlur was found
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index bd5af9004a..332bd5a408 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -1891,10 +1891,7 @@ PHP_FUNCTION(imagegrabwindow)
HDC memDC;
HBITMAP memBM;
HBITMAP hOld;
- HINSTANCE handle;
zend_long lwindow_handle;
- typedef BOOL (WINAPI *tPrintWindow)(HWND, HDC,UINT);
- tPrintWindow pPrintWindow = 0;
gdImagePtr im = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l", &lwindow_handle, &client_area) == FAILURE) {
@@ -1926,21 +1923,7 @@ PHP_FUNCTION(imagegrabwindow)
memBM = CreateCompatibleBitmap(hdc, Width, Height);
hOld = (HBITMAP) SelectObject (memDC, memBM);
-
- handle = LoadLibrary("User32.dll");
- if ( handle == 0 ) {
- goto clean;
- }
- pPrintWindow = (tPrintWindow) GetProcAddress(handle, "PrintWindow");
-
- if ( pPrintWindow ) {
- pPrintWindow(window, memDC, (UINT) client_area);
- } else {
- php_error_docref(NULL, E_WARNING, "Windows API too old");
- goto clean;
- }
-
- FreeLibrary(handle);
+ PrintWindow(window, memDC, (UINT) client_area);
im = gdImageCreateTrueColor(Width, Height);
if (im) {
@@ -1953,7 +1936,6 @@ PHP_FUNCTION(imagegrabwindow)
}
}
-clean:
SelectObject(memDC,hOld);
DeleteObject(memBM);
DeleteDC(memDC);
diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c
index 30693da5cb..ea3c6cf408 100644
--- a/ext/gmp/gmp.c
+++ b/ext/gmp/gmp.c
@@ -1365,7 +1365,16 @@ ZEND_FUNCTION(gmp_fact)
RETURN_FALSE;
}
} else {
- if (zval_get_long(a_arg) < 0) {
+ /* Use convert_to_number first to detect getting non-integer */
+ convert_scalar_to_number(a_arg);
+ if (Z_TYPE_P(a_arg) != IS_LONG) {
+ convert_to_long(a_arg);
+ if (Z_LVAL_P(a_arg) >= 0) {
+ /* Only warn if we'll make it past the non-negative check */
+ php_error_docref(NULL, E_WARNING, "Number has to be an integer");
+ }
+ }
+ if (Z_LVAL_P(a_arg) < 0) {
php_error_docref(NULL, E_WARNING, "Number has to be greater than or equal to 0");
RETURN_FALSE;
}
diff --git a/ext/gmp/tests/gmp_fact.phpt b/ext/gmp/tests/gmp_fact.phpt
index 6afccaf936..5cb8089b49 100644
--- a/ext/gmp/tests/gmp_fact.phpt
+++ b/ext/gmp/tests/gmp_fact.phpt
@@ -38,6 +38,8 @@ string(1) "0"
Warning: gmp_fact(): Number has to be greater than or equal to 0 in %s on line %d
string(1) "0"
+
+Warning: gmp_fact(): Number has to be an integer in %s on line %d
string(1) "1"
string(19) "2432902008176640000"
string(65) "30414093201713378043612608166064768844377641568960512000000000000"
@@ -53,9 +55,13 @@ NULL
Warning: gmp_fact() expects exactly 1 parameter, 2 given in %s on line %d
NULL
+
+Warning: gmp_fact(): Number has to be an integer in %s on line %d
object(GMP)#%d (1) {
["num"]=>
string(1) "1"
}
+
+Warning: gmp_fact(): Number has to be an integer in %s on line %d
string(1) "1"
Done
diff --git a/ext/gmp/tests/gmp_sqrtrem.phpt b/ext/gmp/tests/gmp_sqrtrem.phpt
index 2fca463daa..d30bb2b295 100644
--- a/ext/gmp/tests/gmp_sqrtrem.phpt
+++ b/ext/gmp/tests/gmp_sqrtrem.phpt
@@ -6,8 +6,7 @@ gmp_sqrtrem() basic tests
<?php
$r = gmp_sqrtrem(-1);
-var_dump(gmp_strval($r[0]));
-var_dump(gmp_strval($r[1]));
+var_dump($r);
$r = gmp_sqrtrem("0");
var_dump(gmp_strval($r[0]));
@@ -44,8 +43,7 @@ var_dump(gmp_strval($r[1]));
$n = gmp_init(-1);
$r = gmp_sqrtrem($n);
-var_dump(gmp_strval($r[0]));
-var_dump(gmp_strval($r[1]));
+var_dump($r);
$n = gmp_init(1000001);
$r = gmp_sqrtrem($n);
@@ -59,11 +57,6 @@ echo "Done\n";
?>
--EXPECTF--
Warning: gmp_sqrtrem(): Number has to be greater than or equal to 0 in %s on line %d
-
-Warning: gmp_strval(): Unable to convert variable to GMP - wrong type in %s on line %d
-bool(false)
-
-Warning: gmp_strval(): Unable to convert variable to GMP - wrong type in %s on line %d
bool(false)
string(1) "0"
string(1) "0"
@@ -83,11 +76,6 @@ string(4) "1000"
string(1) "1"
Warning: gmp_sqrtrem(): Number has to be greater than or equal to 0 in %s on line %d
-
-Warning: gmp_strval(): Unable to convert variable to GMP - wrong type in %s on line %d
-bool(false)
-
-Warning: gmp_strval(): Unable to convert variable to GMP - wrong type in %s on line %d
bool(false)
string(4) "1000"
string(1) "1"
diff --git a/ext/interbase/ibase_query.c b/ext/interbase/ibase_query.c
index 37e59dd3a7..8923a8c55d 100644
--- a/ext/interbase/ibase_query.c
+++ b/ext/interbase/ibase_query.c
@@ -1109,11 +1109,7 @@ PHP_FUNCTION(ibase_query)
isc_db_handle db = 0;
isc_tr_handle trans = 0;
- if (PG(sql_safe_mode)) {
- _php_ibase_module_error("CREATE DATABASE is not allowed in SQL safe mode"
- );
-
- } else if (((l = INI_INT("ibase.max_links")) != -1) && (IBG(num_links) >= l)) {
+ if (((l = INI_INT("ibase.max_links")) != -1) && (IBG(num_links) >= l)) {
_php_ibase_module_error("CREATE DATABASE is not allowed: maximum link count "
"(" ZEND_LONG_FMT ") reached", l);
diff --git a/ext/interbase/interbase.c b/ext/interbase/interbase.c
index 531019b841..a4e51c27a6 100644
--- a/ext/interbase/interbase.c
+++ b/ext/interbase/interbase.c
@@ -902,7 +902,7 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) /*
}
/* restrict to the server/db in the .ini if in safe mode */
- if ((!len[DB] || PG(sql_safe_mode)) && (c = INI_STR("ibase.default_db"))) {
+ if (!len[DB] && (c = INI_STR("ibase.default_db"))) {
args[DB] = c;
len[DB] = strlen(c);
}
diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c
index a44a9dade1..e498c402b6 100644
--- a/ext/mbstring/mbstring.c
+++ b/ext/mbstring/mbstring.c
@@ -430,6 +430,21 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_check_encoding, 0, 0, 0)
ZEND_ARG_INFO(0, encoding)
ZEND_END_ARG_INFO()
+ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_scrub, 0, 0, 1)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, encoding)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_ord, 0, 0, 1)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, encoding)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_chr, 0, 0, 1)
+ ZEND_ARG_INFO(0, cp)
+ ZEND_ARG_INFO(0, encoding)
+ZEND_END_ARG_INFO()
+
ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_regex_encoding, 0, 0, 0)
ZEND_ARG_INFO(0, encoding)
ZEND_END_ARG_INFO()
@@ -555,6 +570,9 @@ const zend_function_entry mbstring_functions[] = {
PHP_FE(mb_send_mail, arginfo_mb_send_mail)
PHP_FE(mb_get_info, arginfo_mb_get_info)
PHP_FE(mb_check_encoding, arginfo_mb_check_encoding)
+ PHP_FE(mb_ord, arginfo_mb_ord)
+ PHP_FE(mb_chr, arginfo_mb_chr)
+ PHP_FE(mb_scrub, arginfo_mb_scrub)
#if HAVE_MBREGEX
PHP_MBREGEX_FUNCTION_ENTRIES
#endif
@@ -3130,6 +3148,31 @@ PHP_FUNCTION(mb_strimwidth)
}
/* }}} */
+
+/* See mbfl_no_encoding definition for list of unsupported encodings */
+static inline zend_bool php_mb_is_unsupported_no_encoding(enum mbfl_no_encoding no_enc)
+{
+ return ((no_enc >= mbfl_no_encoding_invalid && no_enc <= mbfl_no_encoding_qprint)
+ || (no_enc >= mbfl_no_encoding_utf7 && no_enc <= mbfl_no_encoding_utf7imap)
+ || (no_enc >= mbfl_no_encoding_jis && no_enc <= mbfl_no_encoding_2022jpms)
+ || (no_enc >= mbfl_no_encoding_cp50220 && no_enc <= mbfl_no_encoding_cp50222));
+}
+
+
+/* See mbfl_no_encoding definition for list of unicode encodings */
+static inline zend_bool php_mb_is_no_encoding_unicode(enum mbfl_no_encoding no_enc)
+{
+ return (no_enc >= mbfl_no_encoding_ucs4 && no_enc <= mbfl_no_encoding_utf8_sb);
+}
+
+
+/* See mbfl_no_encoding definition for list of UTF-8 encodings */
+static inline zend_bool php_mb_is_no_encoding_utf8(enum mbfl_no_encoding no_enc)
+{
+ return (no_enc >= mbfl_no_encoding_utf8 && no_enc <= mbfl_no_encoding_utf8_sb);
+}
+
+
/* {{{ MBSTRING_API char *php_mb_convert_encoding() */
MBSTRING_API char * php_mb_convert_encoding(const char *input, size_t length, const char *_to_encoding, const char *_from_encodings, size_t *output_len)
{
@@ -3200,7 +3243,28 @@ MBSTRING_API char * php_mb_convert_encoding(const char *input, size_t length, co
return NULL;
}
mbfl_buffer_converter_illegal_mode(convd, MBSTRG(current_filter_illegal_mode));
- mbfl_buffer_converter_illegal_substchar(convd, MBSTRG(current_filter_illegal_substchar));
+
+ if (string.no_encoding == MBSTRG(current_internal_encoding)->no_encoding) {
+ mbfl_buffer_converter_illegal_substchar(convd, MBSTRG(current_filter_illegal_substchar));
+ } else if (php_mb_is_no_encoding_unicode(string.no_encoding) && php_mb_is_no_encoding_unicode(MBSTRG(current_internal_encoding)->no_encoding)) {
+
+ if (php_mb_is_no_encoding_utf8(string.no_encoding)) {
+
+ if (MBSTRG(current_filter_illegal_substchar) > 0xd7ff &&
+ 0xe000 > MBSTRG(current_filter_illegal_substchar)
+ ) {
+ mbfl_buffer_converter_illegal_substchar(convd, 0x3f);
+ } else {
+ mbfl_buffer_converter_illegal_substchar(convd, MBSTRG(current_filter_illegal_substchar));
+ }
+
+ } else {
+ mbfl_buffer_converter_illegal_substchar(convd, MBSTRG(current_filter_illegal_substchar));
+ }
+
+ } else {
+ mbfl_buffer_converter_illegal_substchar(convd, 0x3f);
+ }
/* do it */
ret = mbfl_buffer_converter_feed_result(convd, &string, &result);
@@ -4745,6 +4809,342 @@ PHP_FUNCTION(mb_check_encoding)
}
/* }}} */
+
+static inline zend_long php_mb_ord(const char* str, size_t str_len, const char* enc)
+{
+ enum mbfl_no_encoding no_enc;
+ char* ret;
+ size_t ret_len;
+ const mbfl_encoding *encoding;
+ unsigned char char_len;
+ zend_long cp;
+
+ if (enc == NULL) {
+ no_enc = MBSTRG(current_internal_encoding)->no_encoding;
+ } else {
+ no_enc = mbfl_name2no_encoding(enc);
+
+ if (no_enc == mbfl_no_encoding_invalid) {
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", enc);
+ return -1;
+ }
+ }
+
+ if (php_mb_is_no_encoding_unicode(no_enc)) {
+
+ ret = php_mb_convert_encoding(str, str_len, "UCS-4BE", enc, &ret_len);
+
+ if (ret == NULL) {
+ return -1;
+ }
+
+ cp = (unsigned char) ret[0] << 24 | \
+ (unsigned char) ret[1] << 16 | \
+ (unsigned char) ret[2] << 8 | \
+ (unsigned char) ret[3];
+
+ efree(ret);
+
+ return cp;
+
+ } else if (php_mb_is_unsupported_no_encoding(no_enc)) {
+ php_error_docref(NULL, E_WARNING, "Unsupported encoding \"%s\"", enc);
+ return -1;
+ }
+
+ ret = php_mb_convert_encoding(str, str_len, enc, enc, &ret_len);
+
+ if (ret == NULL) {
+ return -1;
+ }
+
+ encoding = mbfl_no2encoding(no_enc);
+ char_len = php_mb_mbchar_bytes_ex(ret, encoding);
+
+ if (char_len == 1) {
+ cp = (unsigned char) ret[0];
+ } else if (char_len == 2) {
+ cp = ((unsigned char) ret[0] << 8) | \
+ (unsigned char) ret[1];
+ } else if (char_len == 3) {
+ cp = ((unsigned char) ret[0] << 16) | \
+ ((unsigned char) ret[1] << 8) | \
+ (unsigned char) ret[2];
+ } else {
+ cp = ((unsigned char) ret[0] << 24) | \
+ ((unsigned char) ret[1] << 16) | \
+ ((unsigned char) ret[2] << 8) | \
+ (unsigned char) ret[3];
+ }
+
+ efree(ret);
+
+ return cp;
+}
+
+
+/* {{{ proto bool mb_ord([string str[, string encoding]]) */
+PHP_FUNCTION(mb_ord)
+{
+ char* str;
+ size_t str_len;
+ char* enc = NULL;
+ size_t enc_len;
+ zend_long cp;
+
+#ifndef FAST_ZPP
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &str, &str_len, &enc, &enc_len) == FAILURE) {
+ return;
+ }
+#else
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STRING(str, str_len)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STRING(enc, enc_len)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+ cp = php_mb_ord(str, str_len, enc);
+
+ if (0 > cp) {
+ RETURN_FALSE;
+ }
+
+ RETURN_LONG(cp);
+}
+/* }}} */
+
+
+static inline char* php_mb_chr(zend_long cp, const char* enc, size_t *output_len)
+{
+ enum mbfl_no_encoding no_enc;
+ char* buf;
+ size_t buf_len;
+ char* ret;
+ size_t ret_len;
+
+ if (enc == NULL) {
+ no_enc = MBSTRG(current_internal_encoding)->no_encoding;
+ } else {
+ no_enc = mbfl_name2no_encoding(enc);
+ if (no_enc == mbfl_no_encoding_invalid) {
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", enc);
+ return NULL;
+ }
+ }
+
+ if (php_mb_is_no_encoding_utf8(no_enc)) {
+
+ if (0 > cp || cp > 0x10ffff || (cp > 0xd7ff && 0xe000 > cp)) {
+ if (php_mb_is_no_encoding_utf8(MBSTRG(current_internal_encoding)->no_encoding)) {
+ cp = MBSTRG(current_filter_illegal_substchar);
+ } else if (php_mb_is_no_encoding_unicode(MBSTRG(current_internal_encoding)->no_encoding)) {
+ if (0xd800 > MBSTRG(current_filter_illegal_substchar) || MBSTRG(current_filter_illegal_substchar) > 0xdfff) {
+ cp = MBSTRG(current_filter_illegal_substchar);
+ } else {
+ cp = 0x3f;
+ }
+ } else {
+ cp = 0x3f;
+ }
+ }
+
+ if (cp < 0x80) {
+ ret_len = 1;
+ ret = (char *) safe_emalloc(ret_len, 1, 1);
+ ret[0] = cp;
+ ret[1] = 0;
+ } else if (cp < 0x800) {
+ ret_len = 2;
+ ret = (char *) safe_emalloc(ret_len, 1, 1);
+ ret[0] = 0xc0 | (cp >> 6);
+ ret[1] = 0x80 | (cp & 0x3f);
+ ret[2] = 0;
+ } else if (cp < 0x10000) {
+ ret_len = 3;
+ ret = (char *) safe_emalloc(ret_len, 1, 1);
+ ret[0] = 0xe0 | (cp >> 12);
+ ret[1] = 0x80 | ((cp >> 6) & 0x3f);
+ ret[2] = 0x80 | (cp & 0x3f);
+ ret[3] = 0;
+ } else {
+ ret_len = 4;
+ ret = (char *) safe_emalloc(ret_len, 1, 1);
+ ret[0] = 0xf0 | (cp >> 18);
+ ret[1] = 0x80 | ((cp >> 12) & 0x3f);
+ ret[2] = 0x80 | ((cp >> 6) & 0x3f);
+ ret[3] = 0x80 | (cp & 0x3f);
+ ret[4] = 0;
+ }
+
+ if (output_len) {
+ *output_len = ret_len;
+ }
+
+ return ret;
+
+ } else if (php_mb_is_no_encoding_unicode(no_enc)) {
+
+ if (0 > cp || 0x10ffff < cp) {
+
+ if (php_mb_is_no_encoding_unicode(MBSTRG(current_internal_encoding)->no_encoding)) {
+ cp = MBSTRG(current_filter_illegal_substchar);
+ } else {
+ cp = 0x3f;
+ }
+
+ }
+
+ buf_len = 4;
+ buf = (char *) safe_emalloc(buf_len, 1, 1);
+ buf[0] = (cp >> 24) & 0xff;
+ buf[1] = (cp >> 16) & 0xff;
+ buf[2] = (cp >> 8) & 0xff;
+ buf[3] = cp & 0xff;
+ buf[4] = 0;
+
+ ret = php_mb_convert_encoding(buf, buf_len, enc, "UCS-4BE", &ret_len);
+ efree(buf);
+
+ if (output_len) {
+ *output_len = ret_len;
+ }
+
+ return ret;
+
+ } else if (php_mb_is_unsupported_no_encoding(no_enc)) {
+ php_error_docref(NULL, E_WARNING, "Unsupported encoding \"%s\"", enc);
+ return NULL;
+ }
+
+ if (0 > cp || cp > 0x100000000) {
+ if (no_enc == MBSTRG(current_internal_encoding)->no_encoding) {
+ cp = MBSTRG(current_filter_illegal_substchar);
+ } else {
+ cp = 0x3f;
+ }
+ }
+
+ if (cp < 0x100) {
+ buf_len = 1;
+ buf = (char *) safe_emalloc(buf_len, 1, 1);
+ buf[0] = cp;
+ buf[1] = 0;
+ } else if (cp < 0x10000) {
+ buf_len = 2;
+ buf = (char *) safe_emalloc(buf_len, 1, 1);
+ buf[0] = cp >> 8;
+ buf[1] = cp & 0xff;
+ buf[2] = 0;
+ } else if (cp < 0x1000000) {
+ buf_len = 3;
+ buf = (char *) safe_emalloc(buf_len, 1, 1);
+ buf[0] = cp >> 16;
+ buf[1] = (cp >> 8) & 0xff;
+ buf[2] = cp & 0xff;
+ buf[3] = 0;
+ } else {
+ buf_len = 4;
+ buf = (char *) safe_emalloc(buf_len, 1, 1);
+ buf[0] = cp >> 24;
+ buf[1] = (cp >> 16) & 0xff;
+ buf[2] = (cp >> 8) & 0xff;
+ buf[3] = cp & 0xff;
+ buf[4] = 0;
+ }
+
+ ret = php_mb_convert_encoding(buf, buf_len, enc, enc, &ret_len);
+ efree(buf);
+
+ if (output_len) {
+ *output_len = ret_len;
+ }
+
+ return ret;
+}
+
+
+/* {{{ proto bool mb_ord([int cp[, string encoding]]) */
+PHP_FUNCTION(mb_chr)
+{
+ zend_long cp;
+ char* enc = NULL;
+ size_t enc_len;
+ char* ret;
+ size_t ret_len;
+
+#ifndef FAST_ZPP
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|s", &cp, &enc, &enc_len) == FAILURE) {
+ return;
+ }
+#else
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_LONG(cp)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STRING(enc, enc_len)
+ ZEND_PARSE_PARAMETERS_END();
+#endif
+
+ ret = php_mb_chr(cp, enc, &ret_len);
+
+ if (ret == NULL) {
+ RETURN_FALSE;
+ }
+
+ RETVAL_STRING(ret);
+ efree(ret);
+}
+/* }}} */
+
+
+static inline char* php_mb_scrub(const char* str, size_t str_len, const char* enc)
+{
+ size_t ret_len;
+
+ return php_mb_convert_encoding(str, str_len, enc, enc, &ret_len);
+}
+
+
+/* {{{ proto bool mb_scrub([string str[, string encoding]]) */
+PHP_FUNCTION(mb_scrub)
+{
+ char* str;
+ size_t str_len;
+ char *enc = NULL;
+ size_t enc_len;
+ char *ret;
+
+#ifndef FAST_ZPP
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &str, &str_len, &enc, &enc_len) == FAILURE) {
+ return;
+ }
+#else
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STRING(str, str_len)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STRING(enc, enc_len)
+ZEND_PARSE_PARAMETERS_END();
+#endif
+
+ if (enc == NULL) {
+ enc = (char *) MBSTRG(current_internal_encoding)->name;
+ } else if (!mbfl_is_support_encoding(enc)) {
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", enc);
+ RETURN_FALSE;
+ }
+
+ ret = php_mb_scrub(str, str_len, enc);
+
+ if (ret == NULL) {
+ RETURN_FALSE;
+ }
+
+ RETVAL_STRING(ret);
+ efree(ret);
+}
+/* }}} */
+
+
/* {{{ php_mb_populate_current_detect_order_list */
static void php_mb_populate_current_detect_order_list(void)
{
diff --git a/ext/mbstring/mbstring.h b/ext/mbstring/mbstring.h
index 1283598cfb..9021a3a454 100644
--- a/ext/mbstring/mbstring.h
+++ b/ext/mbstring/mbstring.h
@@ -130,6 +130,10 @@ PHP_FUNCTION(mb_decode_numericentity);
PHP_FUNCTION(mb_send_mail);
PHP_FUNCTION(mb_get_info);
PHP_FUNCTION(mb_check_encoding);
+PHP_FUNCTION(mb_ord);
+PHP_FUNCTION(mb_chr);
+PHP_FUNCTION(mb_scrub);
+
MBSTRING_API char *php_mb_safe_strrchr_ex(const char *s, unsigned int c,
size_t nbytes, const mbfl_encoding *enc);
diff --git a/ext/mbstring/tests/bug69086.phpt b/ext/mbstring/tests/bug69086.phpt
new file mode 100644
index 0000000000..0540bcba78
--- /dev/null
+++ b/ext/mbstring/tests/bug69086.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Request #69086 (enhancement for mb_convert_encoding)
+--SKIPIF--
+<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
+--FILE--
+<?php
+mb_substitute_character(0xfffd);
+var_dump("?" === mb_convert_encoding("\x80", "Shift_JIS", "EUC-JP"));
+mb_internal_encoding("UCS-4BE");
+var_dump("\x00\x00\xff\xfd" === mb_convert_encoding("\x80", "UCS-4BE", "UTF-8"));
+mb_substitute_character(0xd800);
+var_dump("\x00\x00\x00\x3f" === mb_convert_encoding("\x80", "UCS-4BE", "UTF-8"));
+?>
+--EXPECT--
+bool(true)
+bool(true)
+bool(true) \ No newline at end of file
diff --git a/ext/mbstring/tests/mb_chr.phpt b/ext/mbstring/tests/mb_chr.phpt
new file mode 100644
index 0000000000..095ce90ae5
--- /dev/null
+++ b/ext/mbstring/tests/mb_chr.phpt
@@ -0,0 +1,59 @@
+--TEST--
+mb_chr()
+--SKIPIF--
+<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
+--FILE--
+<?php
+var_dump(
+ "\u{20bb7}" === mb_chr(0x20bb7),
+ "\x8f\xa1\xef" === mb_chr(0x8fa1ef, "EUC-JP-2004"),
+ "?" === mb_chr(0xd800)
+);
+
+mb_internal_encoding("UCS-4BE");
+mb_substitute_character(0xfffd);
+var_dump(
+ "\u{fffd}" === mb_chr(0xd800, "UTF-8")
+);
+mb_substitute_character(0xd800);
+var_dump(
+ "?" === mb_chr(0xd800, "UTF-8")
+);
+
+mb_internal_encoding("EUC-JP");
+mb_substitute_character(0xa4a2);
+var_dump(
+ "?" === mb_chr(0xd800, "UTF-8")
+);
+
+// Invalid
+var_dump(
+ mb_chr(0xd800, "typo"),
+ mb_chr(0xd800, "pass"),
+ mb_chr(0xd800, "jis"),
+ mb_chr(0xd800, "cp50222"),
+ mb_chr(0xd800, "utf-7")
+);
+?>
+--EXPECTF--
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: mb_chr(): Unknown encoding "typo" in %s on line 26
+
+Warning: mb_chr(): Unsupported encoding "pass" in %s on line 27
+
+Warning: mb_chr(): Unsupported encoding "jis" in %s on line 28
+
+Warning: mb_chr(): Unsupported encoding "cp50222" in %s on line 29
+
+Warning: mb_chr(): Unsupported encoding "utf-7" in %s on line 30
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
diff --git a/ext/mbstring/tests/mb_chr_ord.phpt b/ext/mbstring/tests/mb_chr_ord.phpt
new file mode 100644
index 0000000000..613f2e7f42
--- /dev/null
+++ b/ext/mbstring/tests/mb_chr_ord.phpt
@@ -0,0 +1,2062 @@
+--TEST--
+mb_chr() and mb_ord()
+--SKIPIF--
+<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
+--FILE--
+<?php
+ini_set('internal_encoding', 'utf-8');
+for($ch = 1; $ch < 80000; $ch++) {
+ if ($ch !== mb_ord(mb_chr($ch))) echo "ERROR($ch)\n";
+}
+echo 'OK';
+--EXPECTF--
+ERROR(55296)
+ERROR(55297)
+ERROR(55298)
+ERROR(55299)
+ERROR(55300)
+ERROR(55301)
+ERROR(55302)
+ERROR(55303)
+ERROR(55304)
+ERROR(55305)
+ERROR(55306)
+ERROR(55307)
+ERROR(55308)
+ERROR(55309)
+ERROR(55310)
+ERROR(55311)
+ERROR(55312)
+ERROR(55313)
+ERROR(55314)
+ERROR(55315)
+ERROR(55316)
+ERROR(55317)
+ERROR(55318)
+ERROR(55319)
+ERROR(55320)
+ERROR(55321)
+ERROR(55322)
+ERROR(55323)
+ERROR(55324)
+ERROR(55325)
+ERROR(55326)
+ERROR(55327)
+ERROR(55328)
+ERROR(55329)
+ERROR(55330)
+ERROR(55331)
+ERROR(55332)
+ERROR(55333)
+ERROR(55334)
+ERROR(55335)
+ERROR(55336)
+ERROR(55337)
+ERROR(55338)
+ERROR(55339)
+ERROR(55340)
+ERROR(55341)
+ERROR(55342)
+ERROR(55343)
+ERROR(55344)
+ERROR(55345)
+ERROR(55346)
+ERROR(55347)
+ERROR(55348)
+ERROR(55349)
+ERROR(55350)
+ERROR(55351)
+ERROR(55352)
+ERROR(55353)
+ERROR(55354)
+ERROR(55355)
+ERROR(55356)
+ERROR(55357)
+ERROR(55358)
+ERROR(55359)
+ERROR(55360)
+ERROR(55361)
+ERROR(55362)
+ERROR(55363)
+ERROR(55364)
+ERROR(55365)
+ERROR(55366)
+ERROR(55367)
+ERROR(55368)
+ERROR(55369)
+ERROR(55370)
+ERROR(55371)
+ERROR(55372)
+ERROR(55373)
+ERROR(55374)
+ERROR(55375)
+ERROR(55376)
+ERROR(55377)
+ERROR(55378)
+ERROR(55379)
+ERROR(55380)
+ERROR(55381)
+ERROR(55382)
+ERROR(55383)
+ERROR(55384)
+ERROR(55385)
+ERROR(55386)
+ERROR(55387)
+ERROR(55388)
+ERROR(55389)
+ERROR(55390)
+ERROR(55391)
+ERROR(55392)
+ERROR(55393)
+ERROR(55394)
+ERROR(55395)
+ERROR(55396)
+ERROR(55397)
+ERROR(55398)
+ERROR(55399)
+ERROR(55400)
+ERROR(55401)
+ERROR(55402)
+ERROR(55403)
+ERROR(55404)
+ERROR(55405)
+ERROR(55406)
+ERROR(55407)
+ERROR(55408)
+ERROR(55409)
+ERROR(55410)
+ERROR(55411)
+ERROR(55412)
+ERROR(55413)
+ERROR(55414)
+ERROR(55415)
+ERROR(55416)
+ERROR(55417)
+ERROR(55418)
+ERROR(55419)
+ERROR(55420)
+ERROR(55421)
+ERROR(55422)
+ERROR(55423)
+ERROR(55424)
+ERROR(55425)
+ERROR(55426)
+ERROR(55427)
+ERROR(55428)
+ERROR(55429)
+ERROR(55430)
+ERROR(55431)
+ERROR(55432)
+ERROR(55433)
+ERROR(55434)
+ERROR(55435)
+ERROR(55436)
+ERROR(55437)
+ERROR(55438)
+ERROR(55439)
+ERROR(55440)
+ERROR(55441)
+ERROR(55442)
+ERROR(55443)
+ERROR(55444)
+ERROR(55445)
+ERROR(55446)
+ERROR(55447)
+ERROR(55448)
+ERROR(55449)
+ERROR(55450)
+ERROR(55451)
+ERROR(55452)
+ERROR(55453)
+ERROR(55454)
+ERROR(55455)
+ERROR(55456)
+ERROR(55457)
+ERROR(55458)
+ERROR(55459)
+ERROR(55460)
+ERROR(55461)
+ERROR(55462)
+ERROR(55463)
+ERROR(55464)
+ERROR(55465)
+ERROR(55466)
+ERROR(55467)
+ERROR(55468)
+ERROR(55469)
+ERROR(55470)
+ERROR(55471)
+ERROR(55472)
+ERROR(55473)
+ERROR(55474)
+ERROR(55475)
+ERROR(55476)
+ERROR(55477)
+ERROR(55478)
+ERROR(55479)
+ERROR(55480)
+ERROR(55481)
+ERROR(55482)
+ERROR(55483)
+ERROR(55484)
+ERROR(55485)
+ERROR(55486)
+ERROR(55487)
+ERROR(55488)
+ERROR(55489)
+ERROR(55490)
+ERROR(55491)
+ERROR(55492)
+ERROR(55493)
+ERROR(55494)
+ERROR(55495)
+ERROR(55496)
+ERROR(55497)
+ERROR(55498)
+ERROR(55499)
+ERROR(55500)
+ERROR(55501)
+ERROR(55502)
+ERROR(55503)
+ERROR(55504)
+ERROR(55505)
+ERROR(55506)
+ERROR(55507)
+ERROR(55508)
+ERROR(55509)
+ERROR(55510)
+ERROR(55511)
+ERROR(55512)
+ERROR(55513)
+ERROR(55514)
+ERROR(55515)
+ERROR(55516)
+ERROR(55517)
+ERROR(55518)
+ERROR(55519)
+ERROR(55520)
+ERROR(55521)
+ERROR(55522)
+ERROR(55523)
+ERROR(55524)
+ERROR(55525)
+ERROR(55526)
+ERROR(55527)
+ERROR(55528)
+ERROR(55529)
+ERROR(55530)
+ERROR(55531)
+ERROR(55532)
+ERROR(55533)
+ERROR(55534)
+ERROR(55535)
+ERROR(55536)
+ERROR(55537)
+ERROR(55538)
+ERROR(55539)
+ERROR(55540)
+ERROR(55541)
+ERROR(55542)
+ERROR(55543)
+ERROR(55544)
+ERROR(55545)
+ERROR(55546)
+ERROR(55547)
+ERROR(55548)
+ERROR(55549)
+ERROR(55550)
+ERROR(55551)
+ERROR(55552)
+ERROR(55553)
+ERROR(55554)
+ERROR(55555)
+ERROR(55556)
+ERROR(55557)
+ERROR(55558)
+ERROR(55559)
+ERROR(55560)
+ERROR(55561)
+ERROR(55562)
+ERROR(55563)
+ERROR(55564)
+ERROR(55565)
+ERROR(55566)
+ERROR(55567)
+ERROR(55568)
+ERROR(55569)
+ERROR(55570)
+ERROR(55571)
+ERROR(55572)
+ERROR(55573)
+ERROR(55574)
+ERROR(55575)
+ERROR(55576)
+ERROR(55577)
+ERROR(55578)
+ERROR(55579)
+ERROR(55580)
+ERROR(55581)
+ERROR(55582)
+ERROR(55583)
+ERROR(55584)
+ERROR(55585)
+ERROR(55586)
+ERROR(55587)
+ERROR(55588)
+ERROR(55589)
+ERROR(55590)
+ERROR(55591)
+ERROR(55592)
+ERROR(55593)
+ERROR(55594)
+ERROR(55595)
+ERROR(55596)
+ERROR(55597)
+ERROR(55598)
+ERROR(55599)
+ERROR(55600)
+ERROR(55601)
+ERROR(55602)
+ERROR(55603)
+ERROR(55604)
+ERROR(55605)
+ERROR(55606)
+ERROR(55607)
+ERROR(55608)
+ERROR(55609)
+ERROR(55610)
+ERROR(55611)
+ERROR(55612)
+ERROR(55613)
+ERROR(55614)
+ERROR(55615)
+ERROR(55616)
+ERROR(55617)
+ERROR(55618)
+ERROR(55619)
+ERROR(55620)
+ERROR(55621)
+ERROR(55622)
+ERROR(55623)
+ERROR(55624)
+ERROR(55625)
+ERROR(55626)
+ERROR(55627)
+ERROR(55628)
+ERROR(55629)
+ERROR(55630)
+ERROR(55631)
+ERROR(55632)
+ERROR(55633)
+ERROR(55634)
+ERROR(55635)
+ERROR(55636)
+ERROR(55637)
+ERROR(55638)
+ERROR(55639)
+ERROR(55640)
+ERROR(55641)
+ERROR(55642)
+ERROR(55643)
+ERROR(55644)
+ERROR(55645)
+ERROR(55646)
+ERROR(55647)
+ERROR(55648)
+ERROR(55649)
+ERROR(55650)
+ERROR(55651)
+ERROR(55652)
+ERROR(55653)
+ERROR(55654)
+ERROR(55655)
+ERROR(55656)
+ERROR(55657)
+ERROR(55658)
+ERROR(55659)
+ERROR(55660)
+ERROR(55661)
+ERROR(55662)
+ERROR(55663)
+ERROR(55664)
+ERROR(55665)
+ERROR(55666)
+ERROR(55667)
+ERROR(55668)
+ERROR(55669)
+ERROR(55670)
+ERROR(55671)
+ERROR(55672)
+ERROR(55673)
+ERROR(55674)
+ERROR(55675)
+ERROR(55676)
+ERROR(55677)
+ERROR(55678)
+ERROR(55679)
+ERROR(55680)
+ERROR(55681)
+ERROR(55682)
+ERROR(55683)
+ERROR(55684)
+ERROR(55685)
+ERROR(55686)
+ERROR(55687)
+ERROR(55688)
+ERROR(55689)
+ERROR(55690)
+ERROR(55691)
+ERROR(55692)
+ERROR(55693)
+ERROR(55694)
+ERROR(55695)
+ERROR(55696)
+ERROR(55697)
+ERROR(55698)
+ERROR(55699)
+ERROR(55700)
+ERROR(55701)
+ERROR(55702)
+ERROR(55703)
+ERROR(55704)
+ERROR(55705)
+ERROR(55706)
+ERROR(55707)
+ERROR(55708)
+ERROR(55709)
+ERROR(55710)
+ERROR(55711)
+ERROR(55712)
+ERROR(55713)
+ERROR(55714)
+ERROR(55715)
+ERROR(55716)
+ERROR(55717)
+ERROR(55718)
+ERROR(55719)
+ERROR(55720)
+ERROR(55721)
+ERROR(55722)
+ERROR(55723)
+ERROR(55724)
+ERROR(55725)
+ERROR(55726)
+ERROR(55727)
+ERROR(55728)
+ERROR(55729)
+ERROR(55730)
+ERROR(55731)
+ERROR(55732)
+ERROR(55733)
+ERROR(55734)
+ERROR(55735)
+ERROR(55736)
+ERROR(55737)
+ERROR(55738)
+ERROR(55739)
+ERROR(55740)
+ERROR(55741)
+ERROR(55742)
+ERROR(55743)
+ERROR(55744)
+ERROR(55745)
+ERROR(55746)
+ERROR(55747)
+ERROR(55748)
+ERROR(55749)
+ERROR(55750)
+ERROR(55751)
+ERROR(55752)
+ERROR(55753)
+ERROR(55754)
+ERROR(55755)
+ERROR(55756)
+ERROR(55757)
+ERROR(55758)
+ERROR(55759)
+ERROR(55760)
+ERROR(55761)
+ERROR(55762)
+ERROR(55763)
+ERROR(55764)
+ERROR(55765)
+ERROR(55766)
+ERROR(55767)
+ERROR(55768)
+ERROR(55769)
+ERROR(55770)
+ERROR(55771)
+ERROR(55772)
+ERROR(55773)
+ERROR(55774)
+ERROR(55775)
+ERROR(55776)
+ERROR(55777)
+ERROR(55778)
+ERROR(55779)
+ERROR(55780)
+ERROR(55781)
+ERROR(55782)
+ERROR(55783)
+ERROR(55784)
+ERROR(55785)
+ERROR(55786)
+ERROR(55787)
+ERROR(55788)
+ERROR(55789)
+ERROR(55790)
+ERROR(55791)
+ERROR(55792)
+ERROR(55793)
+ERROR(55794)
+ERROR(55795)
+ERROR(55796)
+ERROR(55797)
+ERROR(55798)
+ERROR(55799)
+ERROR(55800)
+ERROR(55801)
+ERROR(55802)
+ERROR(55803)
+ERROR(55804)
+ERROR(55805)
+ERROR(55806)
+ERROR(55807)
+ERROR(55808)
+ERROR(55809)
+ERROR(55810)
+ERROR(55811)
+ERROR(55812)
+ERROR(55813)
+ERROR(55814)
+ERROR(55815)
+ERROR(55816)
+ERROR(55817)
+ERROR(55818)
+ERROR(55819)
+ERROR(55820)
+ERROR(55821)
+ERROR(55822)
+ERROR(55823)
+ERROR(55824)
+ERROR(55825)
+ERROR(55826)
+ERROR(55827)
+ERROR(55828)
+ERROR(55829)
+ERROR(55830)
+ERROR(55831)
+ERROR(55832)
+ERROR(55833)
+ERROR(55834)
+ERROR(55835)
+ERROR(55836)
+ERROR(55837)
+ERROR(55838)
+ERROR(55839)
+ERROR(55840)
+ERROR(55841)
+ERROR(55842)
+ERROR(55843)
+ERROR(55844)
+ERROR(55845)
+ERROR(55846)
+ERROR(55847)
+ERROR(55848)
+ERROR(55849)
+ERROR(55850)
+ERROR(55851)
+ERROR(55852)
+ERROR(55853)
+ERROR(55854)
+ERROR(55855)
+ERROR(55856)
+ERROR(55857)
+ERROR(55858)
+ERROR(55859)
+ERROR(55860)
+ERROR(55861)
+ERROR(55862)
+ERROR(55863)
+ERROR(55864)
+ERROR(55865)
+ERROR(55866)
+ERROR(55867)
+ERROR(55868)
+ERROR(55869)
+ERROR(55870)
+ERROR(55871)
+ERROR(55872)
+ERROR(55873)
+ERROR(55874)
+ERROR(55875)
+ERROR(55876)
+ERROR(55877)
+ERROR(55878)
+ERROR(55879)
+ERROR(55880)
+ERROR(55881)
+ERROR(55882)
+ERROR(55883)
+ERROR(55884)
+ERROR(55885)
+ERROR(55886)
+ERROR(55887)
+ERROR(55888)
+ERROR(55889)
+ERROR(55890)
+ERROR(55891)
+ERROR(55892)
+ERROR(55893)
+ERROR(55894)
+ERROR(55895)
+ERROR(55896)
+ERROR(55897)
+ERROR(55898)
+ERROR(55899)
+ERROR(55900)
+ERROR(55901)
+ERROR(55902)
+ERROR(55903)
+ERROR(55904)
+ERROR(55905)
+ERROR(55906)
+ERROR(55907)
+ERROR(55908)
+ERROR(55909)
+ERROR(55910)
+ERROR(55911)
+ERROR(55912)
+ERROR(55913)
+ERROR(55914)
+ERROR(55915)
+ERROR(55916)
+ERROR(55917)
+ERROR(55918)
+ERROR(55919)
+ERROR(55920)
+ERROR(55921)
+ERROR(55922)
+ERROR(55923)
+ERROR(55924)
+ERROR(55925)
+ERROR(55926)
+ERROR(55927)
+ERROR(55928)
+ERROR(55929)
+ERROR(55930)
+ERROR(55931)
+ERROR(55932)
+ERROR(55933)
+ERROR(55934)
+ERROR(55935)
+ERROR(55936)
+ERROR(55937)
+ERROR(55938)
+ERROR(55939)
+ERROR(55940)
+ERROR(55941)
+ERROR(55942)
+ERROR(55943)
+ERROR(55944)
+ERROR(55945)
+ERROR(55946)
+ERROR(55947)
+ERROR(55948)
+ERROR(55949)
+ERROR(55950)
+ERROR(55951)
+ERROR(55952)
+ERROR(55953)
+ERROR(55954)
+ERROR(55955)
+ERROR(55956)
+ERROR(55957)
+ERROR(55958)
+ERROR(55959)
+ERROR(55960)
+ERROR(55961)
+ERROR(55962)
+ERROR(55963)
+ERROR(55964)
+ERROR(55965)
+ERROR(55966)
+ERROR(55967)
+ERROR(55968)
+ERROR(55969)
+ERROR(55970)
+ERROR(55971)
+ERROR(55972)
+ERROR(55973)
+ERROR(55974)
+ERROR(55975)
+ERROR(55976)
+ERROR(55977)
+ERROR(55978)
+ERROR(55979)
+ERROR(55980)
+ERROR(55981)
+ERROR(55982)
+ERROR(55983)
+ERROR(55984)
+ERROR(55985)
+ERROR(55986)
+ERROR(55987)
+ERROR(55988)
+ERROR(55989)
+ERROR(55990)
+ERROR(55991)
+ERROR(55992)
+ERROR(55993)
+ERROR(55994)
+ERROR(55995)
+ERROR(55996)
+ERROR(55997)
+ERROR(55998)
+ERROR(55999)
+ERROR(56000)
+ERROR(56001)
+ERROR(56002)
+ERROR(56003)
+ERROR(56004)
+ERROR(56005)
+ERROR(56006)
+ERROR(56007)
+ERROR(56008)
+ERROR(56009)
+ERROR(56010)
+ERROR(56011)
+ERROR(56012)
+ERROR(56013)
+ERROR(56014)
+ERROR(56015)
+ERROR(56016)
+ERROR(56017)
+ERROR(56018)
+ERROR(56019)
+ERROR(56020)
+ERROR(56021)
+ERROR(56022)
+ERROR(56023)
+ERROR(56024)
+ERROR(56025)
+ERROR(56026)
+ERROR(56027)
+ERROR(56028)
+ERROR(56029)
+ERROR(56030)
+ERROR(56031)
+ERROR(56032)
+ERROR(56033)
+ERROR(56034)
+ERROR(56035)
+ERROR(56036)
+ERROR(56037)
+ERROR(56038)
+ERROR(56039)
+ERROR(56040)
+ERROR(56041)
+ERROR(56042)
+ERROR(56043)
+ERROR(56044)
+ERROR(56045)
+ERROR(56046)
+ERROR(56047)
+ERROR(56048)
+ERROR(56049)
+ERROR(56050)
+ERROR(56051)
+ERROR(56052)
+ERROR(56053)
+ERROR(56054)
+ERROR(56055)
+ERROR(56056)
+ERROR(56057)
+ERROR(56058)
+ERROR(56059)
+ERROR(56060)
+ERROR(56061)
+ERROR(56062)
+ERROR(56063)
+ERROR(56064)
+ERROR(56065)
+ERROR(56066)
+ERROR(56067)
+ERROR(56068)
+ERROR(56069)
+ERROR(56070)
+ERROR(56071)
+ERROR(56072)
+ERROR(56073)
+ERROR(56074)
+ERROR(56075)
+ERROR(56076)
+ERROR(56077)
+ERROR(56078)
+ERROR(56079)
+ERROR(56080)
+ERROR(56081)
+ERROR(56082)
+ERROR(56083)
+ERROR(56084)
+ERROR(56085)
+ERROR(56086)
+ERROR(56087)
+ERROR(56088)
+ERROR(56089)
+ERROR(56090)
+ERROR(56091)
+ERROR(56092)
+ERROR(56093)
+ERROR(56094)
+ERROR(56095)
+ERROR(56096)
+ERROR(56097)
+ERROR(56098)
+ERROR(56099)
+ERROR(56100)
+ERROR(56101)
+ERROR(56102)
+ERROR(56103)
+ERROR(56104)
+ERROR(56105)
+ERROR(56106)
+ERROR(56107)
+ERROR(56108)
+ERROR(56109)
+ERROR(56110)
+ERROR(56111)
+ERROR(56112)
+ERROR(56113)
+ERROR(56114)
+ERROR(56115)
+ERROR(56116)
+ERROR(56117)
+ERROR(56118)
+ERROR(56119)
+ERROR(56120)
+ERROR(56121)
+ERROR(56122)
+ERROR(56123)
+ERROR(56124)
+ERROR(56125)
+ERROR(56126)
+ERROR(56127)
+ERROR(56128)
+ERROR(56129)
+ERROR(56130)
+ERROR(56131)
+ERROR(56132)
+ERROR(56133)
+ERROR(56134)
+ERROR(56135)
+ERROR(56136)
+ERROR(56137)
+ERROR(56138)
+ERROR(56139)
+ERROR(56140)
+ERROR(56141)
+ERROR(56142)
+ERROR(56143)
+ERROR(56144)
+ERROR(56145)
+ERROR(56146)
+ERROR(56147)
+ERROR(56148)
+ERROR(56149)
+ERROR(56150)
+ERROR(56151)
+ERROR(56152)
+ERROR(56153)
+ERROR(56154)
+ERROR(56155)
+ERROR(56156)
+ERROR(56157)
+ERROR(56158)
+ERROR(56159)
+ERROR(56160)
+ERROR(56161)
+ERROR(56162)
+ERROR(56163)
+ERROR(56164)
+ERROR(56165)
+ERROR(56166)
+ERROR(56167)
+ERROR(56168)
+ERROR(56169)
+ERROR(56170)
+ERROR(56171)
+ERROR(56172)
+ERROR(56173)
+ERROR(56174)
+ERROR(56175)
+ERROR(56176)
+ERROR(56177)
+ERROR(56178)
+ERROR(56179)
+ERROR(56180)
+ERROR(56181)
+ERROR(56182)
+ERROR(56183)
+ERROR(56184)
+ERROR(56185)
+ERROR(56186)
+ERROR(56187)
+ERROR(56188)
+ERROR(56189)
+ERROR(56190)
+ERROR(56191)
+ERROR(56192)
+ERROR(56193)
+ERROR(56194)
+ERROR(56195)
+ERROR(56196)
+ERROR(56197)
+ERROR(56198)
+ERROR(56199)
+ERROR(56200)
+ERROR(56201)
+ERROR(56202)
+ERROR(56203)
+ERROR(56204)
+ERROR(56205)
+ERROR(56206)
+ERROR(56207)
+ERROR(56208)
+ERROR(56209)
+ERROR(56210)
+ERROR(56211)
+ERROR(56212)
+ERROR(56213)
+ERROR(56214)
+ERROR(56215)
+ERROR(56216)
+ERROR(56217)
+ERROR(56218)
+ERROR(56219)
+ERROR(56220)
+ERROR(56221)
+ERROR(56222)
+ERROR(56223)
+ERROR(56224)
+ERROR(56225)
+ERROR(56226)
+ERROR(56227)
+ERROR(56228)
+ERROR(56229)
+ERROR(56230)
+ERROR(56231)
+ERROR(56232)
+ERROR(56233)
+ERROR(56234)
+ERROR(56235)
+ERROR(56236)
+ERROR(56237)
+ERROR(56238)
+ERROR(56239)
+ERROR(56240)
+ERROR(56241)
+ERROR(56242)
+ERROR(56243)
+ERROR(56244)
+ERROR(56245)
+ERROR(56246)
+ERROR(56247)
+ERROR(56248)
+ERROR(56249)
+ERROR(56250)
+ERROR(56251)
+ERROR(56252)
+ERROR(56253)
+ERROR(56254)
+ERROR(56255)
+ERROR(56256)
+ERROR(56257)
+ERROR(56258)
+ERROR(56259)
+ERROR(56260)
+ERROR(56261)
+ERROR(56262)
+ERROR(56263)
+ERROR(56264)
+ERROR(56265)
+ERROR(56266)
+ERROR(56267)
+ERROR(56268)
+ERROR(56269)
+ERROR(56270)
+ERROR(56271)
+ERROR(56272)
+ERROR(56273)
+ERROR(56274)
+ERROR(56275)
+ERROR(56276)
+ERROR(56277)
+ERROR(56278)
+ERROR(56279)
+ERROR(56280)
+ERROR(56281)
+ERROR(56282)
+ERROR(56283)
+ERROR(56284)
+ERROR(56285)
+ERROR(56286)
+ERROR(56287)
+ERROR(56288)
+ERROR(56289)
+ERROR(56290)
+ERROR(56291)
+ERROR(56292)
+ERROR(56293)
+ERROR(56294)
+ERROR(56295)
+ERROR(56296)
+ERROR(56297)
+ERROR(56298)
+ERROR(56299)
+ERROR(56300)
+ERROR(56301)
+ERROR(56302)
+ERROR(56303)
+ERROR(56304)
+ERROR(56305)
+ERROR(56306)
+ERROR(56307)
+ERROR(56308)
+ERROR(56309)
+ERROR(56310)
+ERROR(56311)
+ERROR(56312)
+ERROR(56313)
+ERROR(56314)
+ERROR(56315)
+ERROR(56316)
+ERROR(56317)
+ERROR(56318)
+ERROR(56319)
+ERROR(56320)
+ERROR(56321)
+ERROR(56322)
+ERROR(56323)
+ERROR(56324)
+ERROR(56325)
+ERROR(56326)
+ERROR(56327)
+ERROR(56328)
+ERROR(56329)
+ERROR(56330)
+ERROR(56331)
+ERROR(56332)
+ERROR(56333)
+ERROR(56334)
+ERROR(56335)
+ERROR(56336)
+ERROR(56337)
+ERROR(56338)
+ERROR(56339)
+ERROR(56340)
+ERROR(56341)
+ERROR(56342)
+ERROR(56343)
+ERROR(56344)
+ERROR(56345)
+ERROR(56346)
+ERROR(56347)
+ERROR(56348)
+ERROR(56349)
+ERROR(56350)
+ERROR(56351)
+ERROR(56352)
+ERROR(56353)
+ERROR(56354)
+ERROR(56355)
+ERROR(56356)
+ERROR(56357)
+ERROR(56358)
+ERROR(56359)
+ERROR(56360)
+ERROR(56361)
+ERROR(56362)
+ERROR(56363)
+ERROR(56364)
+ERROR(56365)
+ERROR(56366)
+ERROR(56367)
+ERROR(56368)
+ERROR(56369)
+ERROR(56370)
+ERROR(56371)
+ERROR(56372)
+ERROR(56373)
+ERROR(56374)
+ERROR(56375)
+ERROR(56376)
+ERROR(56377)
+ERROR(56378)
+ERROR(56379)
+ERROR(56380)
+ERROR(56381)
+ERROR(56382)
+ERROR(56383)
+ERROR(56384)
+ERROR(56385)
+ERROR(56386)
+ERROR(56387)
+ERROR(56388)
+ERROR(56389)
+ERROR(56390)
+ERROR(56391)
+ERROR(56392)
+ERROR(56393)
+ERROR(56394)
+ERROR(56395)
+ERROR(56396)
+ERROR(56397)
+ERROR(56398)
+ERROR(56399)
+ERROR(56400)
+ERROR(56401)
+ERROR(56402)
+ERROR(56403)
+ERROR(56404)
+ERROR(56405)
+ERROR(56406)
+ERROR(56407)
+ERROR(56408)
+ERROR(56409)
+ERROR(56410)
+ERROR(56411)
+ERROR(56412)
+ERROR(56413)
+ERROR(56414)
+ERROR(56415)
+ERROR(56416)
+ERROR(56417)
+ERROR(56418)
+ERROR(56419)
+ERROR(56420)
+ERROR(56421)
+ERROR(56422)
+ERROR(56423)
+ERROR(56424)
+ERROR(56425)
+ERROR(56426)
+ERROR(56427)
+ERROR(56428)
+ERROR(56429)
+ERROR(56430)
+ERROR(56431)
+ERROR(56432)
+ERROR(56433)
+ERROR(56434)
+ERROR(56435)
+ERROR(56436)
+ERROR(56437)
+ERROR(56438)
+ERROR(56439)
+ERROR(56440)
+ERROR(56441)
+ERROR(56442)
+ERROR(56443)
+ERROR(56444)
+ERROR(56445)
+ERROR(56446)
+ERROR(56447)
+ERROR(56448)
+ERROR(56449)
+ERROR(56450)
+ERROR(56451)
+ERROR(56452)
+ERROR(56453)
+ERROR(56454)
+ERROR(56455)
+ERROR(56456)
+ERROR(56457)
+ERROR(56458)
+ERROR(56459)
+ERROR(56460)
+ERROR(56461)
+ERROR(56462)
+ERROR(56463)
+ERROR(56464)
+ERROR(56465)
+ERROR(56466)
+ERROR(56467)
+ERROR(56468)
+ERROR(56469)
+ERROR(56470)
+ERROR(56471)
+ERROR(56472)
+ERROR(56473)
+ERROR(56474)
+ERROR(56475)
+ERROR(56476)
+ERROR(56477)
+ERROR(56478)
+ERROR(56479)
+ERROR(56480)
+ERROR(56481)
+ERROR(56482)
+ERROR(56483)
+ERROR(56484)
+ERROR(56485)
+ERROR(56486)
+ERROR(56487)
+ERROR(56488)
+ERROR(56489)
+ERROR(56490)
+ERROR(56491)
+ERROR(56492)
+ERROR(56493)
+ERROR(56494)
+ERROR(56495)
+ERROR(56496)
+ERROR(56497)
+ERROR(56498)
+ERROR(56499)
+ERROR(56500)
+ERROR(56501)
+ERROR(56502)
+ERROR(56503)
+ERROR(56504)
+ERROR(56505)
+ERROR(56506)
+ERROR(56507)
+ERROR(56508)
+ERROR(56509)
+ERROR(56510)
+ERROR(56511)
+ERROR(56512)
+ERROR(56513)
+ERROR(56514)
+ERROR(56515)
+ERROR(56516)
+ERROR(56517)
+ERROR(56518)
+ERROR(56519)
+ERROR(56520)
+ERROR(56521)
+ERROR(56522)
+ERROR(56523)
+ERROR(56524)
+ERROR(56525)
+ERROR(56526)
+ERROR(56527)
+ERROR(56528)
+ERROR(56529)
+ERROR(56530)
+ERROR(56531)
+ERROR(56532)
+ERROR(56533)
+ERROR(56534)
+ERROR(56535)
+ERROR(56536)
+ERROR(56537)
+ERROR(56538)
+ERROR(56539)
+ERROR(56540)
+ERROR(56541)
+ERROR(56542)
+ERROR(56543)
+ERROR(56544)
+ERROR(56545)
+ERROR(56546)
+ERROR(56547)
+ERROR(56548)
+ERROR(56549)
+ERROR(56550)
+ERROR(56551)
+ERROR(56552)
+ERROR(56553)
+ERROR(56554)
+ERROR(56555)
+ERROR(56556)
+ERROR(56557)
+ERROR(56558)
+ERROR(56559)
+ERROR(56560)
+ERROR(56561)
+ERROR(56562)
+ERROR(56563)
+ERROR(56564)
+ERROR(56565)
+ERROR(56566)
+ERROR(56567)
+ERROR(56568)
+ERROR(56569)
+ERROR(56570)
+ERROR(56571)
+ERROR(56572)
+ERROR(56573)
+ERROR(56574)
+ERROR(56575)
+ERROR(56576)
+ERROR(56577)
+ERROR(56578)
+ERROR(56579)
+ERROR(56580)
+ERROR(56581)
+ERROR(56582)
+ERROR(56583)
+ERROR(56584)
+ERROR(56585)
+ERROR(56586)
+ERROR(56587)
+ERROR(56588)
+ERROR(56589)
+ERROR(56590)
+ERROR(56591)
+ERROR(56592)
+ERROR(56593)
+ERROR(56594)
+ERROR(56595)
+ERROR(56596)
+ERROR(56597)
+ERROR(56598)
+ERROR(56599)
+ERROR(56600)
+ERROR(56601)
+ERROR(56602)
+ERROR(56603)
+ERROR(56604)
+ERROR(56605)
+ERROR(56606)
+ERROR(56607)
+ERROR(56608)
+ERROR(56609)
+ERROR(56610)
+ERROR(56611)
+ERROR(56612)
+ERROR(56613)
+ERROR(56614)
+ERROR(56615)
+ERROR(56616)
+ERROR(56617)
+ERROR(56618)
+ERROR(56619)
+ERROR(56620)
+ERROR(56621)
+ERROR(56622)
+ERROR(56623)
+ERROR(56624)
+ERROR(56625)
+ERROR(56626)
+ERROR(56627)
+ERROR(56628)
+ERROR(56629)
+ERROR(56630)
+ERROR(56631)
+ERROR(56632)
+ERROR(56633)
+ERROR(56634)
+ERROR(56635)
+ERROR(56636)
+ERROR(56637)
+ERROR(56638)
+ERROR(56639)
+ERROR(56640)
+ERROR(56641)
+ERROR(56642)
+ERROR(56643)
+ERROR(56644)
+ERROR(56645)
+ERROR(56646)
+ERROR(56647)
+ERROR(56648)
+ERROR(56649)
+ERROR(56650)
+ERROR(56651)
+ERROR(56652)
+ERROR(56653)
+ERROR(56654)
+ERROR(56655)
+ERROR(56656)
+ERROR(56657)
+ERROR(56658)
+ERROR(56659)
+ERROR(56660)
+ERROR(56661)
+ERROR(56662)
+ERROR(56663)
+ERROR(56664)
+ERROR(56665)
+ERROR(56666)
+ERROR(56667)
+ERROR(56668)
+ERROR(56669)
+ERROR(56670)
+ERROR(56671)
+ERROR(56672)
+ERROR(56673)
+ERROR(56674)
+ERROR(56675)
+ERROR(56676)
+ERROR(56677)
+ERROR(56678)
+ERROR(56679)
+ERROR(56680)
+ERROR(56681)
+ERROR(56682)
+ERROR(56683)
+ERROR(56684)
+ERROR(56685)
+ERROR(56686)
+ERROR(56687)
+ERROR(56688)
+ERROR(56689)
+ERROR(56690)
+ERROR(56691)
+ERROR(56692)
+ERROR(56693)
+ERROR(56694)
+ERROR(56695)
+ERROR(56696)
+ERROR(56697)
+ERROR(56698)
+ERROR(56699)
+ERROR(56700)
+ERROR(56701)
+ERROR(56702)
+ERROR(56703)
+ERROR(56704)
+ERROR(56705)
+ERROR(56706)
+ERROR(56707)
+ERROR(56708)
+ERROR(56709)
+ERROR(56710)
+ERROR(56711)
+ERROR(56712)
+ERROR(56713)
+ERROR(56714)
+ERROR(56715)
+ERROR(56716)
+ERROR(56717)
+ERROR(56718)
+ERROR(56719)
+ERROR(56720)
+ERROR(56721)
+ERROR(56722)
+ERROR(56723)
+ERROR(56724)
+ERROR(56725)
+ERROR(56726)
+ERROR(56727)
+ERROR(56728)
+ERROR(56729)
+ERROR(56730)
+ERROR(56731)
+ERROR(56732)
+ERROR(56733)
+ERROR(56734)
+ERROR(56735)
+ERROR(56736)
+ERROR(56737)
+ERROR(56738)
+ERROR(56739)
+ERROR(56740)
+ERROR(56741)
+ERROR(56742)
+ERROR(56743)
+ERROR(56744)
+ERROR(56745)
+ERROR(56746)
+ERROR(56747)
+ERROR(56748)
+ERROR(56749)
+ERROR(56750)
+ERROR(56751)
+ERROR(56752)
+ERROR(56753)
+ERROR(56754)
+ERROR(56755)
+ERROR(56756)
+ERROR(56757)
+ERROR(56758)
+ERROR(56759)
+ERROR(56760)
+ERROR(56761)
+ERROR(56762)
+ERROR(56763)
+ERROR(56764)
+ERROR(56765)
+ERROR(56766)
+ERROR(56767)
+ERROR(56768)
+ERROR(56769)
+ERROR(56770)
+ERROR(56771)
+ERROR(56772)
+ERROR(56773)
+ERROR(56774)
+ERROR(56775)
+ERROR(56776)
+ERROR(56777)
+ERROR(56778)
+ERROR(56779)
+ERROR(56780)
+ERROR(56781)
+ERROR(56782)
+ERROR(56783)
+ERROR(56784)
+ERROR(56785)
+ERROR(56786)
+ERROR(56787)
+ERROR(56788)
+ERROR(56789)
+ERROR(56790)
+ERROR(56791)
+ERROR(56792)
+ERROR(56793)
+ERROR(56794)
+ERROR(56795)
+ERROR(56796)
+ERROR(56797)
+ERROR(56798)
+ERROR(56799)
+ERROR(56800)
+ERROR(56801)
+ERROR(56802)
+ERROR(56803)
+ERROR(56804)
+ERROR(56805)
+ERROR(56806)
+ERROR(56807)
+ERROR(56808)
+ERROR(56809)
+ERROR(56810)
+ERROR(56811)
+ERROR(56812)
+ERROR(56813)
+ERROR(56814)
+ERROR(56815)
+ERROR(56816)
+ERROR(56817)
+ERROR(56818)
+ERROR(56819)
+ERROR(56820)
+ERROR(56821)
+ERROR(56822)
+ERROR(56823)
+ERROR(56824)
+ERROR(56825)
+ERROR(56826)
+ERROR(56827)
+ERROR(56828)
+ERROR(56829)
+ERROR(56830)
+ERROR(56831)
+ERROR(56832)
+ERROR(56833)
+ERROR(56834)
+ERROR(56835)
+ERROR(56836)
+ERROR(56837)
+ERROR(56838)
+ERROR(56839)
+ERROR(56840)
+ERROR(56841)
+ERROR(56842)
+ERROR(56843)
+ERROR(56844)
+ERROR(56845)
+ERROR(56846)
+ERROR(56847)
+ERROR(56848)
+ERROR(56849)
+ERROR(56850)
+ERROR(56851)
+ERROR(56852)
+ERROR(56853)
+ERROR(56854)
+ERROR(56855)
+ERROR(56856)
+ERROR(56857)
+ERROR(56858)
+ERROR(56859)
+ERROR(56860)
+ERROR(56861)
+ERROR(56862)
+ERROR(56863)
+ERROR(56864)
+ERROR(56865)
+ERROR(56866)
+ERROR(56867)
+ERROR(56868)
+ERROR(56869)
+ERROR(56870)
+ERROR(56871)
+ERROR(56872)
+ERROR(56873)
+ERROR(56874)
+ERROR(56875)
+ERROR(56876)
+ERROR(56877)
+ERROR(56878)
+ERROR(56879)
+ERROR(56880)
+ERROR(56881)
+ERROR(56882)
+ERROR(56883)
+ERROR(56884)
+ERROR(56885)
+ERROR(56886)
+ERROR(56887)
+ERROR(56888)
+ERROR(56889)
+ERROR(56890)
+ERROR(56891)
+ERROR(56892)
+ERROR(56893)
+ERROR(56894)
+ERROR(56895)
+ERROR(56896)
+ERROR(56897)
+ERROR(56898)
+ERROR(56899)
+ERROR(56900)
+ERROR(56901)
+ERROR(56902)
+ERROR(56903)
+ERROR(56904)
+ERROR(56905)
+ERROR(56906)
+ERROR(56907)
+ERROR(56908)
+ERROR(56909)
+ERROR(56910)
+ERROR(56911)
+ERROR(56912)
+ERROR(56913)
+ERROR(56914)
+ERROR(56915)
+ERROR(56916)
+ERROR(56917)
+ERROR(56918)
+ERROR(56919)
+ERROR(56920)
+ERROR(56921)
+ERROR(56922)
+ERROR(56923)
+ERROR(56924)
+ERROR(56925)
+ERROR(56926)
+ERROR(56927)
+ERROR(56928)
+ERROR(56929)
+ERROR(56930)
+ERROR(56931)
+ERROR(56932)
+ERROR(56933)
+ERROR(56934)
+ERROR(56935)
+ERROR(56936)
+ERROR(56937)
+ERROR(56938)
+ERROR(56939)
+ERROR(56940)
+ERROR(56941)
+ERROR(56942)
+ERROR(56943)
+ERROR(56944)
+ERROR(56945)
+ERROR(56946)
+ERROR(56947)
+ERROR(56948)
+ERROR(56949)
+ERROR(56950)
+ERROR(56951)
+ERROR(56952)
+ERROR(56953)
+ERROR(56954)
+ERROR(56955)
+ERROR(56956)
+ERROR(56957)
+ERROR(56958)
+ERROR(56959)
+ERROR(56960)
+ERROR(56961)
+ERROR(56962)
+ERROR(56963)
+ERROR(56964)
+ERROR(56965)
+ERROR(56966)
+ERROR(56967)
+ERROR(56968)
+ERROR(56969)
+ERROR(56970)
+ERROR(56971)
+ERROR(56972)
+ERROR(56973)
+ERROR(56974)
+ERROR(56975)
+ERROR(56976)
+ERROR(56977)
+ERROR(56978)
+ERROR(56979)
+ERROR(56980)
+ERROR(56981)
+ERROR(56982)
+ERROR(56983)
+ERROR(56984)
+ERROR(56985)
+ERROR(56986)
+ERROR(56987)
+ERROR(56988)
+ERROR(56989)
+ERROR(56990)
+ERROR(56991)
+ERROR(56992)
+ERROR(56993)
+ERROR(56994)
+ERROR(56995)
+ERROR(56996)
+ERROR(56997)
+ERROR(56998)
+ERROR(56999)
+ERROR(57000)
+ERROR(57001)
+ERROR(57002)
+ERROR(57003)
+ERROR(57004)
+ERROR(57005)
+ERROR(57006)
+ERROR(57007)
+ERROR(57008)
+ERROR(57009)
+ERROR(57010)
+ERROR(57011)
+ERROR(57012)
+ERROR(57013)
+ERROR(57014)
+ERROR(57015)
+ERROR(57016)
+ERROR(57017)
+ERROR(57018)
+ERROR(57019)
+ERROR(57020)
+ERROR(57021)
+ERROR(57022)
+ERROR(57023)
+ERROR(57024)
+ERROR(57025)
+ERROR(57026)
+ERROR(57027)
+ERROR(57028)
+ERROR(57029)
+ERROR(57030)
+ERROR(57031)
+ERROR(57032)
+ERROR(57033)
+ERROR(57034)
+ERROR(57035)
+ERROR(57036)
+ERROR(57037)
+ERROR(57038)
+ERROR(57039)
+ERROR(57040)
+ERROR(57041)
+ERROR(57042)
+ERROR(57043)
+ERROR(57044)
+ERROR(57045)
+ERROR(57046)
+ERROR(57047)
+ERROR(57048)
+ERROR(57049)
+ERROR(57050)
+ERROR(57051)
+ERROR(57052)
+ERROR(57053)
+ERROR(57054)
+ERROR(57055)
+ERROR(57056)
+ERROR(57057)
+ERROR(57058)
+ERROR(57059)
+ERROR(57060)
+ERROR(57061)
+ERROR(57062)
+ERROR(57063)
+ERROR(57064)
+ERROR(57065)
+ERROR(57066)
+ERROR(57067)
+ERROR(57068)
+ERROR(57069)
+ERROR(57070)
+ERROR(57071)
+ERROR(57072)
+ERROR(57073)
+ERROR(57074)
+ERROR(57075)
+ERROR(57076)
+ERROR(57077)
+ERROR(57078)
+ERROR(57079)
+ERROR(57080)
+ERROR(57081)
+ERROR(57082)
+ERROR(57083)
+ERROR(57084)
+ERROR(57085)
+ERROR(57086)
+ERROR(57087)
+ERROR(57088)
+ERROR(57089)
+ERROR(57090)
+ERROR(57091)
+ERROR(57092)
+ERROR(57093)
+ERROR(57094)
+ERROR(57095)
+ERROR(57096)
+ERROR(57097)
+ERROR(57098)
+ERROR(57099)
+ERROR(57100)
+ERROR(57101)
+ERROR(57102)
+ERROR(57103)
+ERROR(57104)
+ERROR(57105)
+ERROR(57106)
+ERROR(57107)
+ERROR(57108)
+ERROR(57109)
+ERROR(57110)
+ERROR(57111)
+ERROR(57112)
+ERROR(57113)
+ERROR(57114)
+ERROR(57115)
+ERROR(57116)
+ERROR(57117)
+ERROR(57118)
+ERROR(57119)
+ERROR(57120)
+ERROR(57121)
+ERROR(57122)
+ERROR(57123)
+ERROR(57124)
+ERROR(57125)
+ERROR(57126)
+ERROR(57127)
+ERROR(57128)
+ERROR(57129)
+ERROR(57130)
+ERROR(57131)
+ERROR(57132)
+ERROR(57133)
+ERROR(57134)
+ERROR(57135)
+ERROR(57136)
+ERROR(57137)
+ERROR(57138)
+ERROR(57139)
+ERROR(57140)
+ERROR(57141)
+ERROR(57142)
+ERROR(57143)
+ERROR(57144)
+ERROR(57145)
+ERROR(57146)
+ERROR(57147)
+ERROR(57148)
+ERROR(57149)
+ERROR(57150)
+ERROR(57151)
+ERROR(57152)
+ERROR(57153)
+ERROR(57154)
+ERROR(57155)
+ERROR(57156)
+ERROR(57157)
+ERROR(57158)
+ERROR(57159)
+ERROR(57160)
+ERROR(57161)
+ERROR(57162)
+ERROR(57163)
+ERROR(57164)
+ERROR(57165)
+ERROR(57166)
+ERROR(57167)
+ERROR(57168)
+ERROR(57169)
+ERROR(57170)
+ERROR(57171)
+ERROR(57172)
+ERROR(57173)
+ERROR(57174)
+ERROR(57175)
+ERROR(57176)
+ERROR(57177)
+ERROR(57178)
+ERROR(57179)
+ERROR(57180)
+ERROR(57181)
+ERROR(57182)
+ERROR(57183)
+ERROR(57184)
+ERROR(57185)
+ERROR(57186)
+ERROR(57187)
+ERROR(57188)
+ERROR(57189)
+ERROR(57190)
+ERROR(57191)
+ERROR(57192)
+ERROR(57193)
+ERROR(57194)
+ERROR(57195)
+ERROR(57196)
+ERROR(57197)
+ERROR(57198)
+ERROR(57199)
+ERROR(57200)
+ERROR(57201)
+ERROR(57202)
+ERROR(57203)
+ERROR(57204)
+ERROR(57205)
+ERROR(57206)
+ERROR(57207)
+ERROR(57208)
+ERROR(57209)
+ERROR(57210)
+ERROR(57211)
+ERROR(57212)
+ERROR(57213)
+ERROR(57214)
+ERROR(57215)
+ERROR(57216)
+ERROR(57217)
+ERROR(57218)
+ERROR(57219)
+ERROR(57220)
+ERROR(57221)
+ERROR(57222)
+ERROR(57223)
+ERROR(57224)
+ERROR(57225)
+ERROR(57226)
+ERROR(57227)
+ERROR(57228)
+ERROR(57229)
+ERROR(57230)
+ERROR(57231)
+ERROR(57232)
+ERROR(57233)
+ERROR(57234)
+ERROR(57235)
+ERROR(57236)
+ERROR(57237)
+ERROR(57238)
+ERROR(57239)
+ERROR(57240)
+ERROR(57241)
+ERROR(57242)
+ERROR(57243)
+ERROR(57244)
+ERROR(57245)
+ERROR(57246)
+ERROR(57247)
+ERROR(57248)
+ERROR(57249)
+ERROR(57250)
+ERROR(57251)
+ERROR(57252)
+ERROR(57253)
+ERROR(57254)
+ERROR(57255)
+ERROR(57256)
+ERROR(57257)
+ERROR(57258)
+ERROR(57259)
+ERROR(57260)
+ERROR(57261)
+ERROR(57262)
+ERROR(57263)
+ERROR(57264)
+ERROR(57265)
+ERROR(57266)
+ERROR(57267)
+ERROR(57268)
+ERROR(57269)
+ERROR(57270)
+ERROR(57271)
+ERROR(57272)
+ERROR(57273)
+ERROR(57274)
+ERROR(57275)
+ERROR(57276)
+ERROR(57277)
+ERROR(57278)
+ERROR(57279)
+ERROR(57280)
+ERROR(57281)
+ERROR(57282)
+ERROR(57283)
+ERROR(57284)
+ERROR(57285)
+ERROR(57286)
+ERROR(57287)
+ERROR(57288)
+ERROR(57289)
+ERROR(57290)
+ERROR(57291)
+ERROR(57292)
+ERROR(57293)
+ERROR(57294)
+ERROR(57295)
+ERROR(57296)
+ERROR(57297)
+ERROR(57298)
+ERROR(57299)
+ERROR(57300)
+ERROR(57301)
+ERROR(57302)
+ERROR(57303)
+ERROR(57304)
+ERROR(57305)
+ERROR(57306)
+ERROR(57307)
+ERROR(57308)
+ERROR(57309)
+ERROR(57310)
+ERROR(57311)
+ERROR(57312)
+ERROR(57313)
+ERROR(57314)
+ERROR(57315)
+ERROR(57316)
+ERROR(57317)
+ERROR(57318)
+ERROR(57319)
+ERROR(57320)
+ERROR(57321)
+ERROR(57322)
+ERROR(57323)
+ERROR(57324)
+ERROR(57325)
+ERROR(57326)
+ERROR(57327)
+ERROR(57328)
+ERROR(57329)
+ERROR(57330)
+ERROR(57331)
+ERROR(57332)
+ERROR(57333)
+ERROR(57334)
+ERROR(57335)
+ERROR(57336)
+ERROR(57337)
+ERROR(57338)
+ERROR(57339)
+ERROR(57340)
+ERROR(57341)
+ERROR(57342)
+ERROR(57343)
+OK
+
diff --git a/ext/mbstring/tests/mb_ord.phpt b/ext/mbstring/tests/mb_ord.phpt
new file mode 100644
index 0000000000..e3f5343fd8
--- /dev/null
+++ b/ext/mbstring/tests/mb_ord.phpt
@@ -0,0 +1,40 @@
+--TEST--
+mb_ord()
+--SKIPIF--
+<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
+--FILE--
+<?php
+var_dump(
+ 0x20bb7 === mb_ord("\u{20bb7}"),
+ 0x3f === mb_ord("\u{d800}"),
+ 0x8fa1ef === mb_ord("\x8f\xa1\xef", "EUC-JP-2004")
+);
+
+// Invalid
+var_dump(
+ mb_ord("\u{d800}", "typo"),
+ mb_ord("\u{d800}", "pass"),
+ mb_ord("\u{d800}", "jis"),
+ mb_ord("\u{d800}", "cp50222"),
+ mb_ord("\u{d800}", "utf-7")
+);
+?>
+--EXPECTF--
+bool(true)
+bool(true)
+bool(true)
+
+Warning: mb_ord(): Unknown encoding "typo" %s 10
+
+Warning: mb_ord(): Unsupported encoding "pass" %s 11
+
+Warning: mb_ord(): Unsupported encoding "jis" %s 12
+
+Warning: mb_ord(): Unsupported encoding "cp50222" %s 13
+
+Warning: mb_ord(): Unsupported encoding "utf-7" %s 14
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
diff --git a/ext/mbstring/tests/mb_scrub.phpt b/ext/mbstring/tests/mb_scrub.phpt
new file mode 100644
index 0000000000..131e13d536
--- /dev/null
+++ b/ext/mbstring/tests/mb_scrub.phpt
@@ -0,0 +1,14 @@
+--TEST--
+mb_scrub()
+--SKIPIF--
+<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
+--FILE--
+<?php
+var_dump(
+ "?" === mb_scrub("\x80"),
+ "?" === mb_scrub("\x80", 'UTF-8')
+);
+?>
+--EXPECT--
+bool(true)
+bool(true)
diff --git a/ext/opcache/Optimizer/zend_ssa.c b/ext/opcache/Optimizer/zend_ssa.c
index b61a8dafa7..61bc146eb4 100644
--- a/ext/opcache/Optimizer/zend_ssa.c
+++ b/ext/opcache/Optimizer/zend_ssa.c
@@ -450,9 +450,8 @@ static void place_essa_pis(
if ((pi = add_pi(arena, op_array, dfg, ssa, j, bt, var))) {
pi_type_mask(pi, mask_for_type_check(type));
}
- if (type != IS_OBJECT && type != IS_RESOURCE) {
- /* is_object() and is_resource() may return false, even though the value is
- * an object/resource. */
+ if (type != IS_RESOURCE) {
+ /* is_resource() may return false for closed resources */
if ((pi = add_pi(arena, op_array, dfg, ssa, j, bf, var))) {
pi_not_type_mask(pi, mask_for_type_check(type));
}
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 9198530b1d..d441297350 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -64,7 +64,6 @@
#define timezone _timezone /* timezone is called _timezone in LibC */
#endif
-#define DEFAULT_KEY_LENGTH 512
#define MIN_KEY_LENGTH 384
#define OPENSSL_ALGO_SHA1 1
diff --git a/ext/openssl/tests/openssl_decrypt_ccm.phpt b/ext/openssl/tests/openssl_decrypt_ccm.phpt
index 2107fea1fb..2bf93629f0 100644
--- a/ext/openssl/tests/openssl_decrypt_ccm.phpt
+++ b/ext/openssl/tests/openssl_decrypt_ccm.phpt
@@ -22,13 +22,13 @@ foreach ($tests as $idx => $test) {
// no IV
var_dump(openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA,
- NULL, $test['tag'], $test['aad']));
+ NULL, $test['tag'], $test['aad']));
// failed because no AAD
var_dump(openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA,
- $test['iv'], $test['tag']));
+ $test['iv'], $test['tag']));
// failed because wrong tag
var_dump(openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA,
- $test['iv'], str_repeat('x', 10), $test['aad']));
+ $test['iv'], str_repeat('x', 10), $test['aad']));
?>
--EXPECTF--
diff --git a/ext/openssl/tests/openssl_decrypt_gcm.phpt b/ext/openssl/tests/openssl_decrypt_gcm.phpt
index d8c464346a..4637f6b316 100644
--- a/ext/openssl/tests/openssl_decrypt_gcm.phpt
+++ b/ext/openssl/tests/openssl_decrypt_gcm.phpt
@@ -22,13 +22,13 @@ foreach ($tests as $idx => $test) {
// no IV
var_dump(openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA,
- NULL, $test['tag'], $test['aad']));
+ NULL, $test['tag'], $test['aad']));
// failed because no AAD
var_dump(openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA,
- $test['iv'], $test['tag']));
+ $test['iv'], $test['tag']));
// failed because wrong tag
var_dump(openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA,
- $test['iv'], str_repeat('x', 16), $test['aad']));
+ $test['iv'], str_repeat('x', 16), $test['aad']));
?>
--EXPECTF--
diff --git a/ext/pdo/tests/pecl_bug_5217.phpt b/ext/pdo/tests/pecl_bug_5217.phpt
index 34de925e41..7fe2bf4af7 100644
--- a/ext/pdo/tests/pecl_bug_5217.phpt
+++ b/ext/pdo/tests/pecl_bug_5217.phpt
@@ -1,5 +1,5 @@
--TEST--
-PDO Common: PECL Bug #5217 (serialize/unserialze safety)
+PDO Common: PECL Bug #5217 (serialize/unserialize safety)
--SKIPIF--
<?php # vim:ft=php
if (!extension_loaded('pdo')) die('skip');
diff --git a/ext/pdo_mysql/tests/mysql_pdo_test.inc b/ext/pdo_mysql/tests/mysql_pdo_test.inc
index 7a97bb4630..4e953ed7e1 100644
--- a/ext/pdo_mysql/tests/mysql_pdo_test.inc
+++ b/ext/pdo_mysql/tests/mysql_pdo_test.inc
@@ -55,7 +55,7 @@ class MySQLPDOTest extends PDOTest {
strpos(PDO_MYSQL_TEST_DSN, ':') + 1,
strlen(PDO_MYSQL_TEST_DSN));
- // no real parser - any excotic setting can fool us
+ // no real parser - any exotic setting can fool us
$parts = explode(';', $dsn);
foreach ($parts as $k => $v) {
$tmp = explode('=', $v);
diff --git a/ext/standard/info.c b/ext/standard/info.c
index 982d4e461b..b62679528c 100644
--- a/ext/standard/info.c
+++ b/ext/standard/info.c
@@ -41,10 +41,7 @@
#include "php_string.h"
#ifdef PHP_WIN32
-typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO);
-typedef BOOL (WINAPI *PGPI)(DWORD, DWORD, DWORD, DWORD, PDWORD);
# include "winver.h"
-
#endif
#define SECTION(name) if (!sapi_module.phpinfo_as_text) { \
@@ -295,19 +292,12 @@ char* php_get_windows_name()
{
OSVERSIONINFOEX osvi = EG(windows_version_info);
SYSTEM_INFO si;
- PGNSI pGNSI;
- PGPI pGPI;
DWORD dwType;
char *major = NULL, *sub = NULL, *retval;
ZeroMemory(&si, sizeof(SYSTEM_INFO));
- pGNSI = (PGNSI) GetProcAddress(GetModuleHandle("kernel32.dll"), "GetNativeSystemInfo");
- if(NULL != pGNSI) {
- pGNSI(&si);
- } else {
- GetSystemInfo(&si);
- }
+ GetNativeSystemInfo(&si);
if (VER_PLATFORM_WIN32_NT==osvi.dwPlatformId && osvi.dwMajorVersion >= 10) {
if (osvi.dwMajorVersion == 10) {
@@ -380,8 +370,8 @@ char* php_get_windows_name()
major = "Unknown Windows version";
}
- pGPI = (PGPI) GetProcAddress(GetModuleHandle("kernel32.dll"), "GetProductInfo");
- pGPI(6, 0, 0, 0, &dwType);
+ /* No return value check, as it can only fail if the input parameters are broken (which we manually supply) */
+ GetProductInfo(6, 0, 0, 0, &dwType);
switch (dwType) {
case PRODUCT_ULTIMATE:
diff --git a/ext/standard/tests/general_functions/type.phpt b/ext/standard/tests/general_functions/type.phpt
index eb6f0672fe..df2dbaf461 100644
--- a/ext/standard/tests/general_functions/type.phpt
+++ b/ext/standard/tests/general_functions/type.phpt
@@ -63,7 +63,7 @@ string(6) "double"
string(4) "NULL"
string(7) "boolean"
string(6) "string"
-string(12) "unknown type"
+string(17) "resource (closed)"
string(8) "resource"
string(6) "object"
bool(true)
diff --git a/ext/standard/tests/serialize/serialization_objects_005.phpt b/ext/standard/tests/serialize/serialization_objects_005.phpt
index 35b1593879..9800168ca2 100644
--- a/ext/standard/tests/serialize/serialization_objects_005.phpt
+++ b/ext/standard/tests/serialize/serialization_objects_005.phpt
@@ -88,7 +88,7 @@ object(__PHP_Incomplete_Class)#%d (2) {
["p"]=>
int(1)
}
-bool(false)
+bool(true)
Notice: main(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in %s on line 43
NULL
@@ -117,4 +117,4 @@ Notice: main(): The script tried to execute a method or access a property of an
Notice: main(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in %s on line 57
NULL
-Fatal error: main(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in %s on line 59 \ No newline at end of file
+Fatal error: main(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in %s on line 59
diff --git a/ext/standard/type.c b/ext/standard/type.c
index 3f97bc8688..4e91b99360 100644
--- a/ext/standard/type.c
+++ b/ext/standard/type.c
@@ -59,17 +59,6 @@ PHP_FUNCTION(gettype)
case IS_OBJECT:
RETVAL_STRING("object");
- /*
- {
- char *result;
- int res_len;
-
- res_len = sizeof("object of type ")-1 + Z_OBJCE_P(arg)->name_length;
- spprintf(&result, 0, "object of type %s", Z_OBJCE_P(arg)->name);
- RETVAL_STRINGL(result, res_len);
- efree(result);
- }
- */
break;
case IS_RESOURCE:
@@ -78,8 +67,10 @@ PHP_FUNCTION(gettype)
if (type_name) {
RETVAL_STRING("resource");
- break;
+ } else {
+ RETVAL_STRING("resource (closed)");
}
+ break;
}
default:
@@ -226,13 +217,7 @@ static inline void php_is_type(INTERNAL_FUNCTION_PARAMETERS, int type)
#endif
if (Z_TYPE_P(arg) == type) {
- if (type == IS_OBJECT) {
- zend_class_entry *ce = Z_OBJCE_P(arg);
- if (ZSTR_LEN(ce->name) == sizeof(INCOMPLETE_CLASS) - 1
- && !memcmp(ZSTR_VAL(ce->name), INCOMPLETE_CLASS, sizeof(INCOMPLETE_CLASS) - 1)) {
- RETURN_FALSE;
- }
- } else if (type == IS_RESOURCE) {
+ if (type == IS_RESOURCE) {
const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(arg));
if (!type_name) {
RETURN_FALSE;
diff --git a/main/main.c b/main/main.c
index 0a1127176e..bb98f27071 100644
--- a/main/main.c
+++ b/main/main.c
@@ -546,7 +546,6 @@ PHP_INI_BEGIN()
STD_PHP_INI_BOOLEAN("register_argc_argv", "1", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, register_argc_argv, php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("auto_globals_jit", "1", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, auto_globals_jit, php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("short_open_tag", DEFAULT_SHORT_OPEN_TAG, PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, short_tags, zend_compiler_globals, compiler_globals)
- STD_PHP_INI_BOOLEAN("sql.safe_mode", "0", PHP_INI_SYSTEM, OnUpdateBool, sql_safe_mode, php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("track_errors", "0", PHP_INI_ALL, OnUpdateBool, track_errors, php_core_globals, core_globals)
STD_PHP_INI_ENTRY("unserialize_callback_func", NULL, PHP_INI_ALL, OnUpdateString, unserialize_callback_func, php_core_globals, core_globals)
@@ -2137,6 +2136,11 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
php_printf("\nwinsock.dll unusable. %d\n", WSAGetLastError());
return FAILURE;
}
+ /* Check that we actually got the requested WSA version */
+ if (LOBYTE(wsaData.wVersion) != 2 || HIBYTE(wsaData.wVersion) != 0) {
+ php_printf("\nwinsock.dll unusable. Requested version: %d.%d, got %d.%d", LOBYTE(wVersionRequested), HIBYTE(wVersionRequested), LOBYTE(wsaData.wVersion), HIBYTE(wsaData.wVersion));
+ return FAILURE;
+ }
#endif
le_index_ptr = zend_register_list_destructors_ex(NULL, NULL, "index pointer", 0);
@@ -2387,11 +2391,6 @@ void php_module_shutdown(void)
ts_free_worker_threads();
#endif
-#if defined(PHP_WIN32) || (defined(NETWARE) && defined(USE_WINSOCK))
- /*close winsock */
- WSACleanup();
-#endif
-
#ifdef PHP_WIN32
php_win32_free_rng_lock();
#endif
@@ -2400,6 +2399,11 @@ void php_module_shutdown(void)
zend_shutdown();
+#if defined(PHP_WIN32) || (defined(NETWARE) && defined(USE_WINSOCK))
+ /*close winsock */
+ WSACleanup();
+#endif
+
/* Destroys filter & transport registries too */
php_shutdown_stream_wrappers(module_number);
diff --git a/main/php.h b/main/php.h
index 8cc7851016..32ab59386f 100644
--- a/main/php.h
+++ b/main/php.h
@@ -26,7 +26,7 @@
#include <dmalloc.h>
#endif
-#define PHP_API_VERSION 20151012
+#define PHP_API_VERSION 20160731
#define PHP_HAVE_STREAMS
#define YYDEBUG 0
#define PHP_DEFAULT_CHARSET "UTF-8"
diff --git a/main/php_globals.h b/main/php_globals.h
index e50ea2ebfb..91bd100f7e 100644
--- a/main/php_globals.h
+++ b/main/php_globals.h
@@ -58,7 +58,6 @@ struct _php_core_globals {
zend_long output_buffering;
- zend_bool sql_safe_mode;
zend_bool enable_dl;
char *output_handler;
diff --git a/main/php_version.h b/main/php_version.h
index 4714e5dc4b..405e54a710 100644
--- a/main/php_version.h
+++ b/main/php_version.h
@@ -1,8 +1,8 @@
/* automatically generated by configure */
/* edit configure.in to change version number */
#define PHP_MAJOR_VERSION 7
-#define PHP_MINOR_VERSION 1
+#define PHP_MINOR_VERSION 2
#define PHP_RELEASE_VERSION 0
#define PHP_EXTRA_VERSION "-dev"
-#define PHP_VERSION "7.1.0-dev"
-#define PHP_VERSION_ID 70100
+#define PHP_VERSION "7.2.0-dev"
+#define PHP_VERSION_ID 70200
diff --git a/php.ini-development b/php.ini-development
index 7bb3e3d71b..eb8e8054b6 100644
--- a/php.ini-development
+++ b/php.ini-development
@@ -858,15 +858,15 @@ default_socket_timeout = 60
;
; For example, on Windows:
;
-; extension=msql.dll
+; extension=mysqli.dll
;
; ... or under UNIX:
;
-; extension=msql.so
+; extension=mysqli.so
;
; ... or with a path:
;
-; extension=/path/to/extension/msql.so
+; extension=/path/to/extension/mysqli.so
;
; If you only provide the name of the extension, PHP will look for it in its
; default extension directory.
@@ -1045,10 +1045,6 @@ mail.add_x_header = On
; Log mail to syslog (Event Log on Windows).
;mail.log = syslog
-[SQL]
-; http://php.net/sql.safe-mode
-sql.safe_mode = Off
-
[ODBC]
; http://php.net/odbc.default-db
;odbc.default_db = Not yet implemented
diff --git a/php.ini-production b/php.ini-production
index 6cf245f85e..1e0df55d8a 100644
--- a/php.ini-production
+++ b/php.ini-production
@@ -858,15 +858,15 @@ default_socket_timeout = 60
;
; For example, on Windows:
;
-; extension=msql.dll
+; extension=mysqli.dll
;
; ... or under UNIX:
;
-; extension=msql.so
+; extension=mysqli.so
;
; ... or with a path:
;
-; extension=/path/to/extension/msql.so
+; extension=/path/to/extension/mysqli.so
;
; If you only provide the name of the extension, PHP will look for it in its
; default extension directory.
@@ -1045,10 +1045,6 @@ mail.add_x_header = On
; Log mail to syslog (Event Log on Windows).
;mail.log = syslog
-[SQL]
-; http://php.net/sql.safe-mode
-sql.safe_mode = Off
-
[ODBC]
; http://php.net/odbc.default-db
;odbc.default_db = Not yet implemented
diff --git a/sapi/fpm/.gitignore b/sapi/fpm/.gitignore
new file mode 100644
index 0000000000..3f8c0913a4
--- /dev/null
+++ b/sapi/fpm/.gitignore
@@ -0,0 +1,4 @@
+php-fpm.8
+php-fpm.service
+status.html
+www.conf
diff --git a/win32/build/config.w32 b/win32/build/config.w32
index 58b1420b89..fa9ed62350 100644
--- a/win32/build/config.w32
+++ b/win32/build/config.w32
@@ -63,6 +63,9 @@ toolset_setup_common_cflags();
ARG_WITH('mp', 'Tell Visual Studio use up to [n,auto,disable] processes for compilation', 'auto');
var PHP_MP_DISABLED = true;
if (VS_TOOLSET && PHP_MP != 'disable') {
+ if(PHP_DEBUG == 'yes') {
+ STDOUT.WriteLine('WARNING: Debug builds cannot be built using multi processing');
+ } else {
// no from disable-all
if(PHP_MP == 'auto' || PHP_MP == 'no') {
ADD_FLAG('CFLAGS', ' /MP ');
@@ -75,6 +78,7 @@ if (VS_TOOLSET && PHP_MP != 'disable') {
STDOUT.WriteLine('WARNING: Invalid argument for MP: ' + PHP_MP);
}
}
+ }
}
if (!PHP_MP_DISABLED) {
diff --git a/win32/build/confutils.js b/win32/build/confutils.js
index 038692911c..e823a1d17d 100644
--- a/win32/build/confutils.js
+++ b/win32/build/confutils.js
@@ -103,7 +103,7 @@ var PHP_VERSION = 7;
var PHP_MINOR_VERSION = 1;
var PHP_RELEASE_VERSION = 0;
var PHP_EXTRA_VERSION = "";
-var PHP_VERSION_STRING = "7.1.0";
+var PHP_VERSION_STRING = "7.2.0";
/* Get version numbers and DEFINE as a string */
function get_version_numbers()
diff --git a/win32/dllmain.c b/win32/dllmain.c
index 37408f1e76..ab4f105528 100644
--- a/win32/dllmain.c
+++ b/win32/dllmain.c
@@ -40,11 +40,19 @@ BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID dummy)
switch (reason)
{
case DLL_PROCESS_ATTACH:
- ret = ret && php_win32_init_gettimeofday();
- if (!ret) {
- fprintf(stderr, "gettimeofday() initialization failed");
- return ret;
- }
+ /*
+ * We do not need to check the return value of php_win32_init_gettimeofday()
+ * because the symbol bare minimum symbol we need is always available on our
+ * lowest supported platform.
+ *
+ * On Windows 8 or greater, we use a more precise symbol to obtain the system
+ * time, which is dynamically. The fallback allows us to proper support
+ * Vista/7/Server 2003 R2/Server 2008/Server 2008 R2.
+ *
+ * Instead simply initialize the global in win32/time.c for gettimeofday()
+ * use later on
+ */
+ php_win32_init_gettimeofday();
ret = ret && php_win32_ioutil_init();
if (!ret) {
diff --git a/win32/ftok.c b/win32/ftok.c
index 842da78192..4c35017060 100644
--- a/win32/ftok.c
+++ b/win32/ftok.c
@@ -22,7 +22,7 @@
#include <sys/stat.h>
-PHPAPI key_t
+PHP_WIN32_IPC_API key_t
ftok(const char *pathname, int proj_id)
{
HANDLE fh;
diff --git a/win32/getrusage.c b/win32/getrusage.c
index d719bcde26..3267ac63ad 100644
--- a/win32/getrusage.c
+++ b/win32/getrusage.c
@@ -26,7 +26,7 @@
* and have been modified to work with PHP.
*/
-static void usage_to_timeval(FILETIME *ft, struct timeval *tv)
+static zend_always_inline void usage_to_timeval(FILETIME *ft, struct timeval *tv)
{
ULARGE_INTEGER time;
diff --git a/win32/ioutil.h b/win32/ioutil.h
index ea40db4c66..8745c3403a 100644
--- a/win32/ioutil.h
+++ b/win32/ioutil.h
@@ -447,7 +447,7 @@ __forceinline static char *php_win32_ioutil_getcwd(char *buf, int len)
/* If buf was NULL, the result has to be freed outside here. */
buf = tmp_bufa;
} else {
- if (tmp_bufa_len + 1 > len) {
+ if (tmp_bufa_len + 1 > (size_t)len) {
free(tmp_bufa);
SET_ERRNO_FROM_WIN32_CODE(ERROR_INSUFFICIENT_BUFFER);
return NULL;
diff --git a/win32/ipc.h b/win32/ipc.h
index cafcf4f85e..0d7cc47e8c 100644
--- a/win32/ipc.h
+++ b/win32/ipc.h
@@ -19,11 +19,15 @@
#ifndef PHP_WIN32_IPC_H
#define PHP_WIN32_IPC_H 1
-#include "php.h"
+#ifdef PHP_EXPORTS
+# define PHP_WIN32_IPC_API __declspec(dllexport)
+#else
+# define PHP_WIN32_IPC_API __declspec(dllimport)
+#endif
typedef int key_t;
-PHPAPI key_t ftok(const char *path, int id);
+PHP_WIN32_IPC_API key_t ftok(const char *path, int id);
#endif /* PHP_WIN32_IPC_H */
diff --git a/win32/time.c b/win32/time.c
index dfcc46a59b..a0ed1b344e 100644
--- a/win32/time.c
+++ b/win32/time.c
@@ -39,20 +39,21 @@ static zend_always_inline MyGetSystemTimeAsFileTime get_time_func(void)
/* Max possible resolution <1us, win8/server2012 */
timefunc = (MyGetSystemTimeAsFileTime)GetProcAddress(hMod, "GetSystemTimePreciseAsFileTime");
- if(!timefunc) {
- /* 100ns blocks since 01-Jan-1641 */
- timefunc = (MyGetSystemTimeAsFileTime)GetProcAddress(hMod, "GetSystemTimeAsFileTime");
- }
+ /* Lower the refcount */
+ FreeLibrary(hMod);
+ }
+
+ if(!timefunc) {
+ /* 100ns blocks since 01-Jan-1641 */
+ timefunc = (MyGetSystemTimeAsFileTime) GetSystemTimeAsFileTime;
}
return timefunc;
}
-BOOL php_win32_init_gettimeofday(void)
+void php_win32_init_gettimeofday(void)
{
timefunc = get_time_func();
-
- return (NULL != timefunc);
}
#endif
diff --git a/win32/time.h b/win32/time.h
index b46c1675ca..865e299aa9 100644
--- a/win32/time.h
+++ b/win32/time.h
@@ -55,7 +55,7 @@ PHPAPI int usleep(unsigned int useconds);
#ifdef PHP_EXPORTS
/* This symbols are needed only for the DllMain, but should not be exported
or be available when used with PHP binaries. */
-BOOL php_win32_init_gettimeofday(void);
+void php_win32_init_gettimeofday(void);
#endif
#endif