Compare commits

..
Author SHA1 Message Date
Stanislav Malyshev e961c76a0b 5.4.4 2012-06-12 21:54:23 -07:00
Stanislav Malyshev d939ce5d1b merge NEWS, add #61755 2012-06-12 11:59:02 -07:00
Stanislav Malyshev 4c3575fa02 merge NEWS entries 2012-06-06 23:25:40 -07:00
Stanislav Malyshev 10d2b26a76 fix test 2012-05-29 23:52:07 -07:00
Stanislav Malyshev e6bdd5bad4 fix test 2012-05-29 23:42:37 -07:00
Stanislav Malyshev 85585b2ebb 5.4.4 rc2 2012-05-29 23:18:57 -07:00
Stanislav Malyshev bc1c1beea5 fix CVE-2012-2143 2012-05-29 23:15:10 -07:00
Stanislav Malyshev 460f932ea9 add CVE 2012-05-28 18:59:31 -07:00
Stanislav Malyshev 523bf03cd8 fix unchecked emalloc 2012-05-28 18:59:10 -07:00
Stanislav Malyshev 9b3358599f update NEWS 2012-05-28 18:17:21 -07:00
Johannes Schlüter bb963a5f50 Fix bug #62146 com_dotnet cannot be built shared, tested by Anatoliy 2012-05-28 17:39:39 -07:00
Gustavo André dos Santos Lopes 78ff9ebb6b Fixed bug #62097
This fixes the fix for bug #54547 in 32-bit machines by accepting
float comparisons in 32-bit machines as long as the integer is
not larger than the mantissa.
2012-05-23 19:00:27 -05:00
Stanislav Malyshev 9ab21b15af update NEWS 2012-05-23 18:50:06 -05:00
Xinchen Hui 1a90173f27 Revert "Implemented FR #61602 Allow access to name of constant used as default value"
This reverts commit 054f3e3ce5.

See: http://news.php.net/php.cvs/69137 and the author confirmed.
Will commit later after the author fixed this then make a new PR.

Conflicts:

	ext/reflection/php_reflection.c
2012-05-23 18:48:49 -05:00
Xinchen Hui b233c19579 Fix typo while resolving conflicts 2012-05-23 18:45:21 -05:00
Xinchen Hui 0eb02b874d Revert "Implemented FR #61602 Allow access to name of constant used as default value"
This reverts commit 054f3e3ce5.

See: http://news.php.net/php.cvs/69137 and the author confirmed.
Will commit later after the author fixed this then make a new PR.

Conflicts:

	ext/reflection/php_reflection.c
2012-05-23 18:45:03 -05:00
Gustavo André dos Santos Lopes b595b775f7 Fixed bug #62082
This was a buffer overflow in internal function
get_icu_disp_value_src_php().
2012-05-23 18:25:27 -05:00
Stanislav Malyshev 169c9ac0c5 add news for new pg_ functions 2012-05-21 16:14:36 -07:00
Stanislav Malyshev ee66edb17a Revert "Update test to fix breakage caused by the previous commit."
This reverts commit 05c8d4766c.
Connected to revert 7bbd5521d2.
2012-05-15 23:28:00 -07:00
Stanislav Malyshev a624992809 fix test 2012-05-15 23:27:54 -07:00
Stanislav Malyshev 5bc82d4305 update NEWS 2012-05-15 22:43:06 -07:00
Stanislav Malyshev de26b5561f fd fix 2012-05-15 22:42:11 -07:00
Stanislav Malyshev 1fdece54d9 fix bug #61065 2012-05-15 22:42:03 -07:00
Stanislav Malyshev e6dc487a2b prepare for 5.4.4 2012-05-15 22:13:24 -07:00
713 changed files with 26820 additions and 12508 deletions

No files matched your search

+9 -63
View File
@@ -1,19 +1,6 @@
define set_ts
set $tsrm_ls = $arg0
end
document set_ts
set the ts resource, it is impossible for gdb to
call ts_resource_ex while no process is running,
but we could get the resource from the argument
of frame info.
end
define ____executor_globals
if basic_functions_module.zts
if !$tsrm_ls
set $tsrm_ls = ts_resource_ex(0, 0)
end
set $tsrm_ls = ts_resource_ex(0, 0)
set $eg = ((zend_executor_globals*) (*((void ***) $tsrm_ls))[executor_globals_id-1])
set $cg = ((zend_compiler_globals*) (*((void ***) $tsrm_ls))[compiler_globals_id-1])
else
@@ -51,53 +38,12 @@ define dump_bt
set $t = $arg0
while $t
printf "[%p] ", $t
set $fst = $t->function_state
if $fst.function->common.function_name
if $fst.arguments
set $count = (int)*($fst.arguments)
if $t->object
if $fst.function.common.scope
printf "%s->", $fst.function.common.scope->name
else
if !$eg
____executor_globals
end
set $known_class = 0
if $eg
set $handle = $t->object.value.obj.handle
set $handlers = $t->object.value.obj.handlers
set $zobj = (zend_object *)$eg.objects_store.object_buckets[$handle].bucket.obj.object
if $handlers->get_class_entry == &zend_std_object_get_class
set $known_class = 1
if $handlers.get_class_name
if $handlers.get_class_name != &zend_std_object_get_class_name
set $known_class = 0
end
end
if $known_class
printf "%s->", $zobj->ce.name
end
end
end
if !$known_class
printf "(Unknown)->"
end
end
else
if $fst.function.common.scope
printf "%s::", $fst.function.common.scope->name
end
end
printf "%s(", $fst.function->common.function_name
if $t->function_state.function->common.function_name
if $t->function_state.arguments
set $count = (int)*($t->function_state.arguments)
printf "%s(", $t->function_state.function->common.function_name
while $count > 0
set $zvalue = *(zval **)($fst.arguments - $count)
set $zvalue = *(zval **)($t->function_state.arguments - $count)
set $type = $zvalue->type
if $type == 0
printf "NULL"
@@ -127,7 +73,7 @@ define dump_bt
if $type == 7
printf "resource(#%d)", $zvalue->value.lval
end
if $type == 8
if $type == 8
printf "constant"
end
if $type == 9
@@ -143,7 +89,7 @@ define dump_bt
end
printf ") "
else
printf "%s() ", $fst.function->common.function_name
printf "%s() ", $t->function_state.function->common.function_name
end
else
printf "??? "
@@ -654,7 +600,7 @@ define zmemcheck
end
end
if $not_found
printf "no such block that begins at %p.\n", $aptr
printf "no such block that begins at %p.\n", $aptr
end
if $arg0 == 0
printf "-------------------------------------------------------------------------------\n"
-1
View File
@@ -15,7 +15,6 @@ ext/dba/libflatfile/flatfile.c ident
ext/dba/libcdb/cdb_make.c ident
ext/dba/libcdb/cdb.c ident
ext/filter/filter.c ident
ext/zip/php_zip.c ident
README.input_filter ident
run-tests.php ident
sapi/nsapi/nsapi.c ident
-10
View File
@@ -1,10 +0,0 @@
language: php
php:
# We only specify one version so we only get one worker
- 5.4
notifications:
email: false
script: exit 0
+3 -3
View File
@@ -2,11 +2,11 @@
PHP Coding Standards
========================
This file lists several standards that any programmer adding or changing
code in PHP should follow. Since this file was added at a very late
This file lists several standards that any programmer, adding or changing
code in PHP, should follow. Since this file was added at a very late
stage of the development of PHP v3.0, the code base does not (yet) fully
follow it, but it's going in that general direction. Since we are now
well into version 5 releases, many sections have been recoded to use
well into the version 4 releases, many sections have been recoded to use
these rules.
Code Implementation
+74 -128
View File
@@ -24,7 +24,6 @@ Installing PHP
+ Installing a PHP extension on Windows
+ Compiling shared PECL extensions with the pecl command
+ Compiling shared PECL extensions with phpize
+ php-config
+ Compiling PECL extensions statically into PHP
* Problems?
+ Read the FAQ
@@ -84,7 +83,7 @@ General Installation Considerations
With PHP you can also write desktop GUI applications using the PHP-GTK
extension. This is a completely different approach than writing web
pages, as you do not output any HTML, but manage windows and objects
within them. For more information about PHP-GTK, please » visit the
within them. For more information about PHP-GTK, please » visit the
site dedicated to this extension. PHP-GTK is not included in the
official PHP distribution.
@@ -93,9 +92,9 @@ General Installation Considerations
will also find information on the command line executable in the
following sections.
PHP source code and binary distributions for Windows can be found at
» http://www.php.net/downloads.php. We recommend you to choose a
» mirror nearest to you for downloading the distributions.
PHP source code and binary distributions for Windows can be found at »
http://www.php.net/downloads.php. We recommend you to choose a » mirror
nearest to you for downloading the distributions.
__________________________________________________________________
__________________________________________________________________
@@ -141,9 +140,9 @@ Table of Contents
* A web server
* Any module specific components (such as GD, PDF libs, etc.)
When building directly from Git sources or after custom modifications
When building directly from SVN sources or after custom modifications
you might also need:
* autoconf: 2.13+ (for PHP < 5.4.0), 2.59+ (for PHP >= 5.4.0)
* autoconf: 2.13
* automake: 1.4+
* libtool: 1.4.x+ (except 1.4.2)
* re2c: Version 0.13.4 or newer
@@ -376,12 +375,12 @@ Apache 2.x on Unix systems
For information on why, read the related FAQ entry on using Apache2
with a threaded MPM
The » Apache Documentation is the most authoritative source of
The » Apache Documentation is the most authoritative source of
information on the Apache 2.x server. More information about
installation options for Apache may be found there.
The most recent version of Apache HTTP Server may be obtained from
» Apache download site, and a fitting PHP version from the above
The most recent version of Apache HTTP Server may be obtained from »
Apache download site, and a fitting PHP version from the above
mentioned places. This quick guide covers only the basics to get
started with Apache 2.x and PHP. For more information read the » Apache
Documentation. The version numbers have been omitted here, to ensure
@@ -499,7 +498,7 @@ service httpd restart
This should not be undertaken without being aware of the consequences
of this decision, and having at least a fair understanding of the
implications. The Apache documentation regarding » MPM-Modules
implications. The Apache documentation regarding » MPM-Modules
discusses MPMs in a great deal more detail.
Note:
@@ -521,7 +520,7 @@ Lighttpd 1.4 on Unix systems
This section contains notes and hints specific to Lighttpd 1.4 installs
of PHP on Unix systems.
Please use the » Lighttpd trac to learn how to install Lighttpd
Please use the » Lighttpd trac to learn how to install Lighttpd
properly before continuing.
Fastcgi is the preferred SAPI to connect PHP and Lighttpd. Fastcgi is
@@ -628,15 +627,15 @@ Sun, iPlanet and Netscape servers on Sun Solaris
current web servers read the note about subrequests.
You can find more information about setting up PHP for the Netscape
Enterprise Server (NES) here:
» http://benoit.noss.free.fr/php/install-php4.html
Enterprise Server (NES) here: »
http://benoit.noss.free.fr/php/install-php4.html
To build PHP with Sun JSWS/Sun ONE WS/iPlanet/Netscape web servers,
enter the proper install directory for the --with-nsapi=[DIR] option.
The default directory is usually /opt/netscape/suitespot/. Please also
read /php-xxx-version/sapi/nsapi/nsapi-readme.txt.
1. Install the following packages from » http://www.sunfreeware.com/
1. Install the following packages from » http://www.sunfreeware.com/
or another download site:
+ autoconf-2.13
+ automake-1.4
@@ -838,7 +837,7 @@ Testing
Using Variables
Some server supplied environment variables are not defined in the
current » CGI/1.1 specification. Only the following variables are
current » CGI/1.1 specification. Only the following variables are
defined there: AUTH_TYPE, CONTENT_LENGTH, CONTENT_TYPE,
GATEWAY_INTERFACE, PATH_INFO, PATH_TRANSLATED, QUERY_STRING,
REMOTE_ADDR, REMOTE_HOST, REMOTE_IDENT, REMOTE_USER, REQUEST_METHOD,
@@ -856,20 +855,20 @@ HP-UX specific installation notes
There are two main options for installing PHP on HP-UX systems. Either
compile it, or install a pre-compiled binary.
Official pre-compiled packages are located here:
» http://software.hp.com/
Official pre-compiled packages are located here: »
http://software.hp.com/
Until this manual section is rewritten, the documentation about
compiling PHP (and related extensions) on HP-UX systems has been
removed. For now, consider reading the following external resource:
» Building Apache and PHP on HP-UX 11.11
removed. For now, consider reading the following external resource: »
Building Apache and PHP on HP-UX 11.11
__________________________________________________________________
__________________________________________________________________
OpenBSD installation notes
This section contains notes and hints specific to installing PHP on
» OpenBSD 3.6.
This section contains notes and hints specific to installing PHP on »
OpenBSD 3.6.
Using Binary Packages
@@ -901,12 +900,12 @@ Using Binary Packages
(install the PEAR libraries)
# pkg_add php4-pear-4.3.8.tgz
Read the » packages(7) manual page for more information about binary
Read the » packages(7) manual page for more information about binary
packages on OpenBSD.
Using Ports
You can also compile up PHP from source using the » ports tree.
You can also compile up PHP from source using the » ports tree.
However, this is only recommended for users familiar with OpenBSD. The
PHP 4 port is split into two sub-directories: core and extensions. The
extensions directory generates sub-packages for all of the supported
@@ -927,7 +926,7 @@ Common Problems
automatically installs into the correct chroot directories, so no
special modification is needed there. More information on the
OpenBSD Apache is available in the » OpenBSD FAQ.
* The OpenBSD 3.6 package for the » gd extension requires XFree86 to
* The OpenBSD 3.6 package for the » gd extension requires XFree86 to
be installed. If you do not wish to use some of the font features
that require X11, install the php4-gd-4.3.8-no_x11.tgz package
instead.
@@ -952,26 +951,18 @@ Required software
Solaris installs often lack C compilers and their related tools. Read
this FAQ for information on why using GNU versions for some of these
tools is necessary.
For unpacking the PHP distribution you need
* tar
* gzip or
* bzip2
For compiling PHP you need
tools is necessary. The required software is as follows:
* gcc (recommended, other C compilers may work)
* make
* GNU sed
For building extra extensions or hacking the code of PHP you might also
need
* flex (up to PHP 5.2)
* re2c
* flex
* bison
* m4
* autoconf
* automake
* perl
* gzip
* tar
* GNU sed
In addition, you will need to install (and possibly compile) any
additional software specific to your configuration, such as Oracle or
@@ -980,16 +971,14 @@ Required software
Using Packages
You can simplify the Solaris install process by using pkgadd to install
most of your needed components. The Image Packaging System (IPS) for
Solaris 11 Express also contains most of the required components for
installation using the pkg command.
most of your needed components.
__________________________________________________________________
__________________________________________________________________
Debian GNU/Linux installation notes
This section contains notes and hints specific to installing PHP on
» Debian GNU/Linux.
This section contains notes and hints specific to installing PHP on »
Debian GNU/Linux.
Warning
Unofficial builds from third-parties are not supported here. Any bugs
@@ -1216,7 +1205,6 @@ Table of Contents
* Installing a PHP extension on Windows
* Compiling shared PECL extensions with the pecl command
* Compiling shared PECL extensions with phpize
* php-config
* Compiling PECL extensions statically into PHP
__________________________________________________________________
@@ -1239,8 +1227,8 @@ Introduction to PECL Installations
To this php.ini file, or through the use of the dl() function.
When building PHP modules, it's important to have known-good versions
of the required tools (autoconf, automake, libtool, etc.) See the
» Anonymous Git Instructions for details on the required tools, and
of the required tools (autoconf, automake, libtool, etc.) See the »
Anonymous SVN Instructions for details on the required tools, and
required versions.
__________________________________________________________________
__________________________________________________________________
@@ -1259,7 +1247,7 @@ Downloading PECL extensions
the PECL web site are available for download and installation using
the » pecl command. Specific revisions may also be specified.
* SVN Most PECL extensions also reside in SVN. A web-based view may
be seen at » http://svn.php.net/viewvc/pecl/. To download straight
be seen at » http://svn.php.net/viewvc/pecl/. To download straight
from SVN, the following sequence of commands may be used:
$ svn checkout http://svn.php.net/repository/pecl/extname/trunk
extname
@@ -1291,7 +1279,7 @@ Where to find an extension?
PHP extensions are usually called "php_*.dll" (where the star
represents the name of the extension) and they are located under the
"PHP\ext" ("PHP\extensions" in PHP 4) folder.
"PHP\ext" ("PHP\extensions" in PHP4) folder.
PHP ships with the extensions most useful to the majority of
developers. They are called "core" extensions.
@@ -1377,7 +1365,7 @@ Resolving problems
Compiling shared PECL extensions with the pecl command
PECL makes it easy to create shared PHP extensions. Using the » pecl
PECL makes it easy to create shared PHP extensions. Using the » pecl
command, do the following:
$ pecl install extname
@@ -1436,51 +1424,6 @@ $ make
__________________________________________________________________
__________________________________________________________________
php-config
php-config is a simple shell script for obtaining information about the
installed PHP configuration.
When compiling extensions, if you have multiple PHP versions installed,
you may specify for which installation you'd like to build by using the
--with-php-config option during configuration, specifying the path of
the respective php-config script.
The list of command line options provided by the php-config script can
be queried anytime by running php-config with the -h switch:
Usage: /usr/local/bin/php-config [OPTION]
Options:
--prefix [...]
--includes [...]
--ldflags [...]
--libs [...]
--extension-dir [...]
--include-dir [...]
--php-binary [...]
--php-sapis [...]
--configure-options [...]
--version [...]
--vernum [...]
CAPTION: Command line options
Option Description
--prefix Directory prefix where PHP is installed, e.g. /usr/local
--includes List of -I options with all include files
--ldflags LD Flags which PHP was compiled with
--libs Extra libraries which PHP was compiled with
--extension-dir Directory where extensions are searched by default
--include-dir Directory prefix where header files are installed by
default
--php-binary Full path to php CLI or CGI binary
--php-sapis Show all SAPI modules available
--configure-options Configure options to recreate configuration of
current PHP installation
--version PHP version
--vernum PHP version as integer
__________________________________________________________________
__________________________________________________________________
Compiling PECL extensions statically into PHP
You might find that you need to build a PECL extension statically into
@@ -1542,11 +1485,11 @@ Other problems
If you are still stuck, someone on the PHP installation mailing list
may be able to help you. You should check out the archive first, in
case someone already answered someone else who had the same problem as
you. The archives are available from the support page on
» http://www.php.net/support.php. To subscribe to the PHP installation
mailing list, send an empty mail to
» php-install-subscribe@lists.php.net. The mailing list address is
» php-install@lists.php.net.
you. The archives are available from the support page on »
http://www.php.net/support.php. To subscribe to the PHP installation
mailing list, send an empty mail to »
php-install-subscribe@lists.php.net. The mailing list address is »
php-install@lists.php.net.
If you want to get help on the mailing list, please try to be precise
and give the necessary details about your environment (which operating
@@ -1561,11 +1504,11 @@ Bug reports
If you think you have found a bug in PHP, please report it. The PHP
developers probably don't know about it, and unless you report it,
chances are it won't be fixed. You can report bugs using the
bug-tracking system at » http://bugs.php.net/. Please do not send bug
bug-tracking system at » http://bugs.php.net/. Please do not send bug
reports in mailing list or personal letters. The bug system is also
suitable to submit feature requests.
Read the » How to report a bug document before submitting any bug
Read the » How to report a bug document before submitting any bug
reports!
__________________________________________________________________
__________________________________________________________________
@@ -1585,14 +1528,14 @@ The configuration file
The configuration file (php.ini) is read when PHP starts up. For the
server module versions of PHP, this happens only once when the web
server is started. For the CGI and CLI versions, it happens on every
server is started. For the CGI and CLI version, it happens on every
invocation.
php.ini is searched for in these locations (in order):
php.ini is searched in these locations (in order):
* SAPI module specific location (PHPIniDir directive in Apache 2, -c
command line option in CGI and CLI, php_ini parameter in NSAPI,
PHP_INI_PATH environment variable in THTTPD)
* The PHPRC environment variable. Before PHP 5.2.0, this was checked
* The PHPRC environment variable. Before PHP 5.2.0 this was checked
after the registry key mentioned below.
* As of PHP 5.2.0, the location of the php.ini file can be set for
different versions of PHP. The following registry keys are examined
@@ -1600,33 +1543,33 @@ The configuration file
[HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x.y] and
[HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x], where x, y and z mean the PHP
major, minor and release versions. If there is a value for
IniFilePath in any of these keys, the first one found will be used
as the location of the php.ini (Windows only).
IniFilePath in these keys, then the first one found will be used as
the location of the php.ini (Windows only).
* [HKEY_LOCAL_MACHINE\SOFTWARE\PHP], value of IniFilePath (Windows
only).
* Current working directory (except CLI).
* Current working directory (except CLI)
* The web server's directory (for SAPI modules), or directory of PHP
(otherwise in Windows).
(otherwise in Windows)
* Windows directory (C:\windows or C:\winnt) (for Windows), or
--with-config-file-path compile time option.
--with-config-file-path compile time option
If php-SAPI.ini exists (where SAPI is the SAPI in use, so, for example,
php-cli.ini or php-apache.ini), it is used instead of php.ini. The SAPI
name can be determined with php_sapi_name().
If php-SAPI.ini exists (where SAPI is used SAPI, so the filename is
e.g. php-cli.ini or php-apache.ini), it's used instead of php.ini. SAPI
name can be determined by php_sapi_name().
Note:
The Apache web server changes the directory to root at startup,
The Apache web server changes the directory to root at startup
causing PHP to attempt to read php.ini from the root filesystem if
it exists.
The php.ini directives handled by extensions are documented on the
respective pages of the extensions themselves. A list of the core
directives is available in the appendix. Not all PHP directives are
necessarily documented in this manual: for a complete list of
The php.ini directives handled by extensions are documented
respectively on the pages of the extensions themselves. The list of the
core directives is available in the appendix. Probably not all PHP
directives are documented in the manual though. For a complete list of
directives available in your PHP version, please read your well
commented php.ini file. Alternatively, you may find » the latest
php.ini from Git helpful too.
commented php.ini file. Alternatively, you may find the » the latest
php.ini from SVN helpful too.
Example #1 php.ini example
; any text on a line after an unquoted semicolon (;) is ignored
@@ -1692,13 +1635,12 @@ Where a configuration setting may be set
CAPTION: Definition of PHP_INI_* modes
Mode Meaning
PHP_INI_USER Entry can be set in user scripts (like with ini_set()) or
in the Windows registry. Since PHP 5.3, entry can be set in .user.ini
PHP_INI_PERDIR Entry can be set in php.ini, .htaccess, httpd.conf or
.user.ini (since PHP 5.3)
PHP_INI_SYSTEM Entry can be set in php.ini or httpd.conf
PHP_INI_ALL Entry can be set anywhere
Mode Value Meaning
PHP_INI_USER 1 Entry can be set in user scripts (like with ini_set())
or in the Windows registry
PHP_INI_PERDIR 6 Entry can be set in php.ini, .htaccess or httpd.conf
PHP_INI_SYSTEM 4 Entry can be set in php.ini or httpd.conf
PHP_INI_ALL 7 Entry can be set anywhere
__________________________________________________________________
__________________________________________________________________
@@ -1846,9 +1788,13 @@ Installation
each request to play in, further weaknesses are introduced into
PHP's system.
If you want to use a threaded MPM, look at a FastCGI
If you feel you have to use a threaded MPM, look at a FastCGI
configuration where PHP is running in its own memory space.
And finally, this warning against using a threaded MPM is not as
strong for Windows systems because most libraries on that
platform tend to be threadsafe.
Unix/Windows: Where should my php.ini file be located?
By default on Unix it should be in /usr/local/lib which is
<install-path>/lib. Most people will want to change this at
+33 -389
View File
@@ -1,300 +1,7 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
04 Oct 2012, PHP 5.4.8 RC1
- CLI server:
. Changed response to unknown HTTP method to 501 according to RFC.
(Niklas Lindgren).
. Support HTTP PATCH method. Patch by Niklas Lindgren, GitHub PR #190.
(Lars)
- Core:
. Added optional second argument for assert() to specify custom message. Patch
by Lonny Kapelushnik (lonny@lonnylot.com). (Lars)
. Support building PHP with the native client toolchain. (Stuart Langley)
. Added --offline option for tests. (Remi)
. Fixed bug #63162 (parse_url does not match password component). (husman)
. Fixed bug #63111 (is_callable() lies for abstract static method). (Dmitry)
. Fixed bug #63093 (Segfault while load extension failed in zts-build).
(Laruence)
. Fixed bug #62976 (Notice: could not be converted to int when comparing
some builtin classes). (Laruence)
. Fixed bug #62955 (Only one directive is loaded from "Per Directory Values"
Windows registry). (aserbulov at parallels dot com)
. Fixed bug #62907 (Double free when use traits). (Dmitry)
. Fixed bug #61767 (Shutdown functions not called in certain error
situation). (Dmitry)
. Fixed bug #60909 (custom error handler throwing Exception + fatal error
= no shutdown function). (Dmitry)
. Fixed bug #60723 (error_log error time has changed to UTC ignoring default
timezone). (Laruence)
- cURL:
. Fixed bug #62085 (file_get_contents a remote file by Curl wrapper will
cause cpu Soaring). (Pierrick)
- Date:
. Fixed bug #62896 ("DateTime->modify('+0 days')" modifies DateTime object)
(Lonny Kapelushnik)
. Fixed bug #62561 (DateTime add 'P1D' adds 25 hours). (Lonny Kapelushnik)
- DOM:
. Fixed bug #63015 (Incorrect arginfo for DOMErrorHandler). (Rob)
- FPM:
. Fixed bug #62954 (startup problems fpm / php-fpm). (fat)
. Fixed bug #62886 (PHP-FPM may segfault/hang on startup). (fat)
. Fixed bug #63085 (Systemd integration and daemonize). (remi, fat)
. Fixed bug #62947 (Unneccesary warnings on FPM). (fat)
. Fixed bug #62887 (Only /status?plain&full gives "last request cpu"). (fat)
. Fixed bug #62216 (Add PID to php-fpm init.d script). (fat)
- OpenSSL:
. Implemented FR #61421 (OpenSSL signature verification missing RMD160,
SHA224, SHA256, SHA384, SHA512). (Mark Jones)
- SOAP
. Fixed bug #50997 (SOAP Error when trying to submit 2nd Element of a choice).
(Dmitry)
- SPL:
. Bug #62987 (Assigning to ArrayObject[null][something] overrides all
undefined variables). (Laruence)
- mbstring:
. Allow passing null as a default value to mb_substr() and mb_strcut(). Patch
by Alexander Moskaliov via GitHub PR #133. (Lars)
- Filter extension:
. Bug #49510: Boolean validation fails with FILTER_NULL_ON_FAILURE with empty
string or false. (Lars)
- Sockets
. Fixed bug #63000 (MCAST_JOIN_GROUP on OSX is broken, merge of PR 185 by
Igor Wiedler). (Lars)
13 Sep 2012, PHP 5.4.7
- Core:
. Fixed bug (segfault while build with zts and GOTO vm-kind). (Laruence)
. Fixed bug #62844 (parse_url() does not recognize //). (Andrew Faulds).
. Fixed bug #62829 (stdint.h included on platform where HAVE_STDINT_H is not
set). (Felipe)
. Fixed bug #62763 (register_shutdown_function and extending class).
(Laruence)
. Fixed bug #62725 (Calling exit() in a shutdown function does not return
the exit value). (Laruence)
. Fixed bug #62744 (dangling pointers made by zend_disable_class). (Laruence)
. Fixed bug #62716 (munmap() is called with the incorrect length).
(slangley@google.com)
. Fixed bug #62358 (Segfault when using traits a lot). (Laruence)
. Fixed bug #62328 (implementing __toString and a cast to string fails)
(Laruence)
. Fixed bug #51363 (Fatal error raised by var_export() not caught by error
handler). (Lonny Kapelushnik)
. Fixed bug #40459 (Stat and Dir stream wrapper methods do not call
constructor). (Stas)
- CURL:
. Fixed bug #62912 (CURLINFO_PRIMARY_* AND CURLINFO_LOCAL_* not exposed).
(Pierrick)
. Fixed bug #62839 (curl_copy_handle segfault with CURLOPT_FILE). (Pierrick)
- Intl:
. Fixed Spoofchecker not being registered on ICU 49.1. (Gustavo)
. Fix bug #62933 (ext/intl compilation error on icu 3.4.1). (Gustavo)
. Fix bug #62915 (defective cloning in several intl classes). (Gustavo)
- Installation:
. Fixed bug #62460 (php binaries installed as binary.dSYM). (Reeze Xia)
- PCRE:
. Fixed bug #55856 (preg_replace should fail on trailing garbage).
(reg dot php at alf dot nu)
- PDO:
. Fixed bug #62685 (Wrong return datatype in PDO::inTransaction()). (Laruence)
- Reflection:
. Fixed bug #62892 (ReflectionClass::getTraitAliases crashes on importing
trait methods as private). (Felipe)
. Fixed bug #62715 (ReflectionParameter::isDefaultValueAvailable() wrong
result). (Laruence)
- Session:
. Fixed bug (segfault due to retval is not initialized). (Laruence)
. Fixed bug (segfault due to PS(mod_user_implemented) not be reseted
when close handler call exit). (Laruence)
- SOAP
. Fixed bug #50997 (SOAP Error when trying to submit 2nd Element of a choice).
(Dmitry)
- SPL:
. Fixed bug #62904 (Crash when cloning an object which inherits SplFixedArray)
(Laruence)
. Implemented FR #62840 (Add sort flag to ArrayObject::ksort). (Laruence)
- Standard:
. Fixed bug #62836 (Seg fault or broken object references on unserialize()).
(Laruence)
- FPM:
. Merged PR 121 by minitux to add support for slow request counting on PHP
FPM status page. (Lars)
16 Aug 2012, PHP 5.4.6
- CLI Server:
. Implemented FR #62700 (have the console output 'Listening on
http://localhost:8000'). (pascal.chevrel@free.fr)
- Core:
. Fixed bug #62661 (Interactive php-cli crashes if include() is used in
auto_prepend_file). (Laruence)
. Fixed bug #62653: (unset($array[$float]) causes a crash). (Nikita Popov,
Laruence)
. Fixed bug #62565 (Crashes due non-initialized internal properties_table).
(Felipe)
. Fixed bug #60194 (--with-zend-multibyte and --enable-debug reports LEAK
with run-test.php). (Laruence)
- CURL:
. Fixed bug #62499 (curl_setopt($ch, CURLOPT_COOKIEFILE, "") returns false).
(r.hampartsumyan@gmail.com, Laruence)
- DateTime:
. Fixed Bug #62500 (Segfault in DateInterval class when extended). (Laruence)
- Fileinfo:
. Fixed bug #61964 (finfo_open with directory causes invalid free).
(reeze.xia@gmail.com)
- Intl:
. Fixed bug #62564 (Extending MessageFormatter and adding property causes
crash). (Felipe)
- MySQLnd:
. Fixed bug #62594 (segfault in mysqlnd_res_meta::set_mode). (Laruence)
- readline:
. Fixed bug #62612 (readline extension compilation fails with
sapi/cli/cli.h: No such file). (Johannes)
- Reflection:
. Implemented FR #61602 (Allow access to name of constant used as default
value). (reeze.xia@gmail.com)
- SimpleXML:
. Implemented FR #55218 Get namespaces from current node. (Lonny)
- SPL:
. Fixed bug #62616 (ArrayIterator::count() from IteratorIterator instance
gives Segmentation fault). (Laruence, Gustavo)
. Fixed bug #61527 (ArrayIterator gives misleading notice on next() when
moved to the end). (reeze.xia@gmail.com)
- Streams:
. Fixed bug #62597 (segfault in php_stream_wrapper_log_error with ZTS build).
(Laruence)
- Zlib:
. Fixed bug #55544 (ob_gzhandler always conflicts with
zlib.output_compression). (Laruence)
19 Jul 2012, PHP 5.4.5
- Core:
. Fixed bug #62443 (Crypt SHA256/512 Segfaults With Malformed
Salt). (Anthony Ferrara)
. Fixed bug #62432 (ReflectionMethod random corrupt memory on high
concurrent). (Johannes)
. Fixed bug #62373 (serialize() generates wrong reference to the object).
(Moriyoshi)
. Fixed bug #62357 (compile failure: (S) Arguments missing for built-in
function __memcmp). (Laruence)
. Fixed bug #61998 (Using traits with method aliases appears to result in
crash during execution). (Dmitry)
. Fixed bug #51094 (parse_ini_file() with INI_SCANNER_RAW cuts a value that
includes a semi-colon). (Pierrick)
. Fixed potential overflow in _php_stream_scandir (CVE-2012-2688).
(Jason Powell, Stas)
- EXIF:
. Fixed information leak in ext exif (discovered by Martin Noga,
Matthew "j00ru" Jurczyk, Gynvael Coldwind)
- FPM:
. Fixed bug #62205 (php-fpm segfaults (null passed to strstr)). (fat)
. Fixed bug #62160 (Add process.priority to set nice(2) priorities). (fat)
. Fixed bug #62153 (when using unix sockets, multiples FPM instances
. Fixed bug #62033 (php-fpm exits with status 0 on some failures to start).
(fat)
. Fixed bug #61839 (Unable to cross-compile PHP with --enable-fpm). (fat)
. Fixed bug #61835 (php-fpm is not allowed to run as root). (fat)
. Fixed bug #61295 (php-fpm should not fail with commented 'user'
. Fixed bug #61218 (FPM drops connection while receiving some binary values
in FastCGI requests). (fat)
. Fixed bug #61045 (fpm don't send error log to fastcgi clients). (fat)
for non-root start). (fat)
. Fixed bug #61026 (FPM pools can listen on the same address). (fat)
can be launched without errors). (fat)
- Iconv:
. Fix bug #55042 (Erealloc in iconv.c unsafe). (Stas)
- Intl:
. Fixed bug #62083 (grapheme_extract() memory leaks). (Gustavo)
. ResourceBundle constructor now accepts NULL for the first two arguments.
(Gustavo)
. Fixed bug #62081 (IntlDateFormatter constructor leaks memory when called
twice). (Gustavo)
. Fixed bug #62070 (Collator::getSortKey() returns garbage). (Gustavo)
. Fixed bug #62017 (datefmt_create with incorrectly encoded timezone leaks
pattern). (Gustavo)
. Fixed bug #60785 (memory leak in IntlDateFormatter constructor). (Gustavo)
- JSON:
. Fixed bug #61359 (json_encode() calls too many reallocs). (Stas)
- libxml:
. Fixed bug #62266 (Custom extension segfaults during xmlParseFile with FPM
SAPI). (Gustavo)
- Phar:
. Fixed bug #62227 (Invalid phar stream path causes crash). (Felipe)
- Readline:
. Fixed bug #62186 (readline fails to compile - void function should not
return a value). (Johannes)
- Reflection:
. Fixed bug #62384 (Attempting to invoke a Closure more than once causes
segfault). (Felipe)
. Fixed bug #62202 (ReflectionParameter::getDefaultValue() memory leaks
with constant). (Laruence)
- Sockets:
. Fixed bug #62025 (__ss_family was changed on AIX 5.3). (Felipe)
- SPL:
. Fixed bug #62433 (Inconsistent behavior of RecursiveDirectoryIterator to
dot files). (Laruence)
. Fixed bug #62262 (RecursiveArrayIterator does not implement Countable).
(Nikita Popov)
- XML Writer:
. Fixed bug #62064 (memory leak in the XML Writer module).
(jean-pierre dot lozi at lip6 dot fr)
- Zip:
. Upgraded libzip to 0.10.1 (Anatoliy)
14 Jun 2012, PHP 5.4.4
- COM:
. Fixed bug #62146 com_dotnet cannot be built shared. (Johannes)
- CLI Server:
. Implemented FR #61977 (Need CLI web-server support for files with .htm &
svg extensions). (Sixd, Laruence)
@@ -304,6 +11,9 @@ PHP NEWS
. Fixed bug #61546 (functions related to current script failed when chdir()
in cli sapi). (Laruence, reeze.xia@gmail.com)
- COM:
. Fixed bug #62146 com_dotnet cannot be built shared. (Johannes)
- Core:
. Fixed missing bound check in iptcparse(). (chris at chiappa.net)
. Fixed CVE-2012-2143. (Solar Designer)
@@ -318,15 +28,12 @@ PHP NEWS
. Fixed bug #61827 (incorrect \e processing on Windows) (Anatoliy)
. Fixed bug #61782 (__clone/__destruct do not match other methods when checking
access controls). (Stas)
. Fixed bug #61764 ('I' unpacks n as signed if n > 2^31-1 on LP64). (Gustavo)
. Fixed bug #61761 ('Overriding' a private static method with a different
signature causes crash). (Laruence)
. Fixed bug #61730 (Segfault from array_walk modifying an array passed by
reference). (Laruence)
. Fixed bug #61728 (PHP crash when calling ob_start in request_shutdown
phase). (Laruence)
. Fixed bug #61713 (Logic error in charset detection for htmlentities).
(Anatoliy)
. Fixed bug #61660 (bin2hex(hex2bin($data)) != $data). (Nikita Popov)
. Fixed bug #61650 (ini parser crashes when using ${xxxx} ini variables
(without apache2)). (Laruence)
@@ -340,35 +47,31 @@ PHP NEWS
. Fixed bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction).
(Laruence)
- Fileinfo
. Fixed bug #61812 (Uninitialised value used in libmagic).
(Laruence, Gustavo)
. Fixed bug #61566 failure caused by the posix lseek and read versions
under windows in cdf_read(). (Anatoliy)
. Fixed bug #61565 where php_stream_open_wrapper_ex tries to open a
directory descriptor under windows. (Anatoliy)
- Intl
- Intl:
. Fixed bug #62082 (Memory corruption in internal function
get_icu_disp_value_src_php()). (Gustavo)
- Libxml:
. Fixed bug #61617 (Libxml tests failed(ht is already destroyed)).
(Laruence)
- PDO:
. Fixed bug #61755 (A parsing bug in the prepared statements can lead to
access violations). (Johannes)
- Phar:
. Fixed bug #61065 (Secunia SA44335, CVE-2012-2386). (Rasmus)
. Fix bug #61065 (Secunia SA44335, CVE-2012-2386). (Rasmus)
- Pgsql:
. Added pg_escape_identifier/pg_escape_literal. (Yasuo Ohgaki)
- Streams:
. Fixed bug #61961 (file_get_contents leaks when access empty file with
maxlen set). (Reeze)
- FPM
. Fixed bug #61812 (Uninitialised value used in libmagic).
(Laruence, Gustavo)
. Fixed bug #61565 where php_stream_open_wrapper_ex tries to open a
directory descriptor under windows. (Anatoliy)
. Fixed bug #61566 failure caused by the posix lseek and read versions
under windows in cdf_read(). (Anatoliy)
- Libxml:
. Fixed bug #61617 (Libxml tests failed(ht is already destroyed)).
(Laruence)
- Zlib:
. Fixed bug #61820 (using ob_gzhandler will complain about headers already
@@ -458,6 +161,23 @@ PHP NEWS
. Fixed bug #60948 (mysqlnd FTBFS when -Wformat-security is enabled).
(Johannes)
- Readline:
. Fixed bug #61088 (Memory leak in readline_callback_handler_install).
(Nikic, Laruence)
- Session
. Fixed bug #60634 (Segmentation fault when trying to die() in
SessionHandler::write()). (Ilia)
- SOAP
. Fixed bug #61423 (gzip compression fails). (Ilia)
. Fixed bug #60887 (SoapClient ignores user_agent option and sends no
User-Agent header). (carloschilazo at gmail dot com)
. Fixed bug #60842, #51775 (Chunked response parsing error when
chunksize length line is > 10 bytes). (Ilia)
. Fixed bug #49853 (Soap Client stream context header option ignored).
(Dmitry)
- PDO
. Fixed bug #61292 (Segfault while calling a method on an overloaded PDO
object). (Laruence)
@@ -475,29 +195,12 @@ PHP NEWS
. Fixed bug #61184 (Phar::webPhar() generates headers with trailing NUL
bytes). (Nikita Popov)
- Readline:
. Fixed bug #61088 (Memory leak in readline_callback_handler_install).
(Nikic, Laruence)
- Reflection:
. Implemented FR #61602 (Allow access to the name of constant
used as function/method parameter's default value). (reeze.xia@gmail.com)
. Fixed bug #60968 (Late static binding doesn't work with
ReflectionMethod::invokeArgs()). (Laruence)
- Session
. Fixed bug #60634 (Segmentation fault when trying to die() in
SessionHandler::write()). (Ilia)
- SOAP
. Fixed bug #61423 (gzip compression fails). (Ilia)
. Fixed bug #60887 (SoapClient ignores user_agent option and sends no
User-Agent header). (carloschilazo at gmail dot com)
. Fixed bug #60842, #51775 (Chunked response parsing error when
chunksize length line is > 10 bytes). (Ilia)
. Fixed bug #49853 (Soap Client stream context header option ignored).
(Dmitry)
- SPL:
. Fixed bug #61453 (SplObjectStorage does not identify objects correctly).
(Gustavo)
@@ -954,65 +657,6 @@ PHP NEWS
. Fixed bug #55544 (ob_gzhandler always conflicts with zlib.output_compression).
(Mike)
14 Jun 2012, PHP 5.3.14
- CLI SAPI:
. Fixed bug #61546 (functions related to current script failed when chdir()
in cli sapi). (Laruence, reeze.xia@gmail.com)
- CURL:
. Fixed bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction).
(Laruence)
- COM:
. Fixed bug #62146 com_dotnet cannot be built shared. (Johannes)
- Core:
. Fixed CVE-2012-2143. (Solar Designer)
. Fixed missing bound check in iptcparse(). (chris at chiappa.net)
. Fixed bug #62373 (serialize() generates wrong reference to the object).
(Moriyoshi)
. Fixed bug #62005 (unexpected behavior when incrementally assigning to a
member of a null object). (Laruence)
. Fixed bug #61991 (long overflow in realpath_cache_get()). (Anatoliy)
. Fixed bug #61764 ('I' unpacks n as signed if n > 2^31-1 on LP64). (Gustavo)
. Fixed bug #61730 (Segfault from array_walk modifying an array passed by
reference). (Laruence)
. Fixed bug #61713 (Logic error in charset detection for htmlentities).
(Anatoliy)
. Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename
set to null). (Anatoliy)
. Changed php://fd to be available only for CLI.
- Fileinfo:
. Fixed bug #61812 (Uninitialised value used in libmagic).
(Laruence, Gustavo)
- Iconv extension:
. Fixed a bug that iconv extension fails to link to the correct library
when another extension makes use of a library that links to the iconv
library. See https://bugs.gentoo.org/show_bug.cgi?id=364139 for detail.
(Moriyoshi)
- Intl:
. Fixed bug #62082 (Memory corruption in internal function
get_icu_disp_value_src_php()). (Gustavo)
- JSON
. Fixed bug #61537 (json_encode() incorrectly truncates/discards
information). (Adam)
- PDO:
. Fixed bug #61755 (A parsing bug in the prepared statements can lead to
access violations). (Johannes)
- Phar:
. Fix bug #61065 (Secunia SA44335). (Rasmus)
- Streams:
. Fixed bug #61961 (file_get_contents leaks when access empty file with
maxlen set). (Reeze)
08 May 2012, PHP 5.3.13
- CGI
. Improve fix for PHP-CGI query string parameter vulnerability, CVE-2012-2311.
+22 -15
View File
@@ -127,34 +127,33 @@ Rolling a stable release
2. Bump the version numbers in ``main/php_version.h``, ``configure.in`` and possibly ``NEWS``.
3. **Merge** all related sections in NEWS (f.e. merge the 5.4.1RC1 and 5.4.0 sections)
3. **Merge** all related sections in NEWS (f.e. merge the 4.4.1RC1 and 4.4.0 sections)
4. Commit those changes
5. run the "scripts/dev/credits" script in php-src and commit the changes in the
credits files in ext/standard.
6. tag the repository with the version f.e. "``git tag -s php-5.4.1``"
6. tag the repository with the version f.e. "``cvs tag php_4_4_1``"
(of course, you need to change that to the version you're rolling an RC for).
When making 5.X release, you need to tag the Zend directory separately!!
7. Bump up the version numbers in ``main/php_version.h``, ``configure.in`` and
possibly ``NEWS`` again, to the **next** version. F.e. if the release candidate
was "5.4.1RC1" then the new one should be "5.4.1RC2-dev" - regardless if we get
was "4.4.1RC1" then the new one should be "4.4.1RC2-dev" - regardless if we get
a new RC or not. This is to make sure ``version_compare()`` can correctly work.
8. Commit those changes
9. Log in onto the snaps box and go into the correct tree (f.e. the PHP-5.4
branch if you're rolling 5.5.x releases).
9. Log in onto the snaps box and go into the correct tree (f.e. the PHP_4_4
branch if you're rolling 4.4.x releases).
10. You do not have to update the tree, but of course you can with "``git pull
origin <branch>``".
10. You do not have to update the tree, but of course you can with "``cvs up -dP``".
11. run: ``./makedist php 5.4.1``, this will export the tree, create configure
11. run: ``./makedist php 4.4.1``, this will export the tree, create configure
and build two tarballs (one gz and one bz2).
12. Commit those two tarballs to Git (php-distributions.git)
12. Commit those two tarballs to CVS (phpweb/distributions)
13. Once the release has been tagged, contact the PHP Windows development team
(internals-win@lists.php.net) so that Windows binaries can be created. Once
@@ -172,9 +171,6 @@ Getting the stable release announced
a. ``php bin/bumpRelease 5`` (or ``php bin/bumpRelease 4`` for PHP4)
b. In case multiple PHP minor versions are in active development you have
to manually copy the old information to include/releases.inc
2. Edit ``phpweb/include/version.inc`` and change (X=major release number):
a. ``$PHP_X_VERSION`` to the correct version
@@ -191,7 +187,7 @@ Getting the stable release announced
f. if the windows builds aren't ready yet prefix the "windows" key with a dot (".windows")
3. Update the ChangeLog file for the given major version
f.e. ``ChangeLog-5.php`` from the NEWS file
f.e. ``ChangeLog-4.php`` from the NEWS file
a. go over the list and put every element on one line
@@ -211,9 +207,9 @@ f.e. ``ChangeLog-5.php`` from the NEWS file
V. ``s/FR #\([0-9]\+\)/FR <?php bugl(\1); ?>/``
4. ``cp releases/5_4_0.php releases/5_4_1.php``
4. ``cp releases/4_4_0.php releases/4_4_1.php``
5. ``git add releases/5_4_1.php``
5. ``cvs add releases/4_4_1.php``
6. Update the ``releases/*.php`` file with relevant data. The release
announcement file should list in detail:
@@ -236,6 +232,17 @@ to upgrade.
php-general@lists.php.net and internals@lists.php.net with a text similar to
http://news.php.net/php.internals/17222.
10. Update ``php-bugs-web/include/functions.php`` to include the new version
number, and remove the RC from there.
11. Update ``qaweb/include/release-qa.php``
- Update $QA_RELEASES with the appropriate information, which means bumping
the version number to an upcoming version.
Example: If PHP 5.3.7 is being released, then PHP 5.3.8 is the next QA version,
so replace 5.3.7 with 5.3.8 within $QA_RELEASES.
Re-releasing the same version (or -pl)
--------------------------------------
+10 -27
View File
@@ -37,9 +37,9 @@ PHP 5.4 UPGRADE NOTES
=============================
- PHP 5.4 now checks at compile time if /dev/urandom or /dev/arandom
are present. If either is available, session.entropy_file now
are present. If either is available, session.entropy_file now
defaults to that file and session.entropy_length defaults to 32.
This provides non-blocking entropy to session id generation. If you
This provides non-blocking entropy to session id generation. If you
do not want extra entropy for your session ids, add:
session.entropy_file=
@@ -89,9 +89,9 @@ PHP 5.4 UPGRADE NOTES
session.upload_progress.min_freq
- Added a zend.multibyte directive as a replacement of the PHP compile time
configuration option --enable-zend-multibyte. Now the Zend Engine always
configuration option --enable-zend-multibyte. Now the Zend Engine always
contains code for multibyte support, which can be enabled or disabled at
runtime. Note: It doesn't make a lot of sense to enable this option if
runtime. Note: It doesn't make a lot of sense to enable this option if
ext/mbstring is not enabled, because most functionality is implemented by
mbstrings callbacks.
@@ -107,7 +107,7 @@ PHP 5.4 UPGRADE NOTES
in a stream fashion (through php://input) without having it copied in memory
multiple times.
- Added windows_show_crt_warning. This directive shows the CRT warnings when
- Added windows_show_crt_warning. This directive shows the CRT warnings when
enabled. These warnings were displayed by default until now. It is disabled
by default.
@@ -162,7 +162,7 @@ PHP 5.4 UPGRADE NOTES
- Non-numeric string offsets, e.g. $a['foo'] where $a is a string, now
return false on isset() and true on empty(), and produce warning if
trying to use them. Offsets of types double, bool and null produce
trying to use them. Offsets of types double, bool and null produce
notice. Numeric strings ($a['2']) still work as before.
Note that offsets like '12.3' and '5 and a half' are considered
@@ -207,7 +207,7 @@ PHP 5.4 UPGRADE NOTES
- htmlentities() and htmlspecialchars() are stricter in the code units they
accept for the asian encodings. For Big5-HKSCS, the octets 0x80 and 0xFF are
rejected. For GB2312/EUC-CN, the octets 0x8E, 0x8F, 0xA0 and 0xFF are
rejected. For GB2312/EUC-CN, the octets 0x8E, 0x8F, 0xA0 and 0xFF are
rejected. For SJIS, the octets 0x80, 0xA0, 0xFD, 0xFE and 0xFF are rejected,
except maybe after a valid starting byte. For EUC-JP, the octets 0xA0 and
0xFF are rejected.
@@ -233,7 +233,7 @@ PHP 5.4 UPGRADE NOTES
checks on the validity of the entities. Numerical entities are checked for a
valid range (0 to 0x10FFFF); if the flag ENT_DISALLOWED is given, the
validity of such numerical entity in the target document type is also
checked. Named entities are checked for necessary existence in the target
checked. Named entities are checked for necessary existence in the target
document type instead of only checking whether they were constituted by
alphanumeric characters.
@@ -341,15 +341,6 @@ PHP 5.4 UPGRADE NOTES
- Since 5.4.4, "php://fd" stream syntax is available only in CLI build.
- Since 5.4.5, resourcebundle_create() accepts null for the first two arguments.
- Since 5.4.6, SimpleXMLElement::getDocNamespaces() has and extra parameter which
allows for toggling if the list of namespaces starts from the document root
or from the node you call the method on
- Since 5.4.7, ctor is always called when new user stream wrapper object is created.
Before, it was called only when stream_open was called.
==============================
5. Changes to existing classes
==============================
@@ -382,9 +373,6 @@ PHP 5.4 UPGRADE NOTES
- FilesystemIterator, GlobIterator and (Recursive)DirectoryIterator now use
the default stream context.
- Since 5.4.5, the constructor of ResourceBundle accepts NULL for the first two
arguments.
===========================
7. Deprecated Functionality
===========================
@@ -443,7 +431,7 @@ d. Removed hash algorithms
a. Extensions no longer maintained
- ext/sqlite is no longer part of the base distribution and has been moved
to PECL. Use sqlite3 or PDO_SQLITE instead.
to PECL. Use sqlite3 or PDO_SQLITE instead.
b. Extensions with changed behavior
@@ -497,7 +485,7 @@ b. Extensions with changed behavior
===========================
- A REQUEST_TIME_FLOAT value returns a floating point number indicating the
time with microsecond precision. All SAPIs providing this value should be
time with microsecond precision. All SAPIs providing this value should be
returning float and not time_t.
- apache_child_terminate(), getallheaders(), apache_request_headers()
@@ -520,11 +508,6 @@ b. Extensions with changed behavior
- is_link now works properly for symbolic links on Windows Vista
or later. Earlier systems do not support symbolic links.
- As of PHP 5.4.5 and above the COM extension isn't compiled statically in PHP
anymore but shared. It'll still be delivered with the standard PHP release but
must be activated manually with the "extension = php_com_dotnet.dll" directive
in php.ini.
==================
12. New in PHP 5.4
==================
+22097
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -4,7 +4,7 @@ dnl This file contains local autoconf functions.
AC_DEFUN([LIBZEND_BISON_CHECK],[
# we only support certain bison versions
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5 2.5.1"
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5"
# for standalone build of Zend Engine
test -z "$SED" && SED=sed
+7 -7
View File
@@ -62,17 +62,17 @@ print "\nDone\n";
?>
--EXPECTF--
Notice: String offset cast occurred in %s on line %d
Notice: String offset cast occured in %s on line %d
Notice: Uninitialized string offset: 0 in %s on line %d
Notice: Uninitialized string offset: 0 in %s on line %d
Notice: String offset cast occurred in %s on line %d
Notice: String offset cast occured in %s on line %d
Notice: Uninitialized string offset: %i in %s on line %d
Notice: String offset cast occurred in %s on line %d
Notice: String offset cast occured in %s on line %d
Notice: Uninitialized string offset: %i in %s on line %d
@@ -88,16 +88,16 @@ Notice: Uninitialized string offset: 4 in %s on line %d
Notice: Uninitialized string offset: 4 in %s on line %d
Notice: String offset cast occurred in %s on line %d
Notice: String offset cast occured in %s on line %d
Notice: Uninitialized string offset: 12 in %s on line %d
Notice: String offset cast occurred in %s on line %d
Notice: String offset cast occured in %s on line %d
Notice: Uninitialized string offset: 12 in %s on line %d
Notice: String offset cast occurred in %s on line %d
Notice: String offset cast occured in %s on line %d
Notice: String offset cast occurred in %s on line %d
Notice: String offset cast occured in %s on line %d
b
Done
-6
View File
@@ -13,10 +13,4 @@ function eh()
set_error_handler("eh");
$a = $empty($b);
--EXPECTF--
Warning: Uncaught exception 'Exception' with message 'error!' in %sbug51394.php:4
Stack trace:
#0 %sbug51394.php(9): eh(8, 'Undefined varia...', '%s', 9, Array)
#1 {main}
thrown in %sbug51394.php on line 4
Fatal error: Function name must be a string in %sbug51394.php on line 9
-6
View File
@@ -5,12 +5,6 @@ Bug #55509 (segfault on x86_64 using more than 2G memory)
if (PHP_INT_SIZE == 4) {
die('skip Not for 32-bits OS');
}
$zend_mm_enabled = getenv("USE_ZEND_ALLOC");
if ($zend_mm_enabled === "0") {
die("skip Zend MM disabled");
}
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
// check the available memory
if (PHP_OS == 'Linux') {
-24
View File
@@ -1,24 +0,0 @@
--TEST--
Bug #60909 (custom error handler throwing Exception + fatal error = no shutdown function).
--FILE--
<?php
register_shutdown_function(function(){echo("\n\n!!!shutdown!!!\n\n");});
set_error_handler(function($errno, $errstr, $errfile, $errline){
echo "error($errstr)";
throw new Exception("Foo");
});
require 'notfound.php';
--EXPECTF--
error(require(notfound.php): failed to open stream: No such file or directory)
Warning: Uncaught exception 'Exception' with message 'Foo' in %sbug60909_1.php:5
Stack trace:
#0 %sbug60909_1.php(8): {closure}(2, 'require(notfoun...', '%s', 8, Array)
#1 %sbug60909_1.php(8): require()
#2 {main}
thrown in %sbug60909_1.php on line 5
Fatal error: main(): Failed opening required 'notfound.php' (include_path='%s') in %sbug60909_1.php on line 8
!!!shutdown!!!
-20
View File
@@ -1,20 +0,0 @@
--TEST--
Bug #60909 (custom error handler throwing Exception + fatal error = no shutdown function).
--FILE--
<?php
register_shutdown_function(function(){echo("\n\n!!!shutdown!!!\n\n");});
set_error_handler(function($errno, $errstr, $errfile, $errline){throw new Exception("Foo");});
class Bad {
public function __toString() {
throw new Exception('Oops, I cannot do this');
}
}
$bad = new Bad();
echo "$bad";
--EXPECTF--
Fatal error: Method Bad::__toString() must not throw an exception in %sbug60909_2.php on line 0
!!!shutdown!!!
+1 -2
View File
@@ -14,6 +14,5 @@ class B extends A
}
?>
==DONE==
--EXPECTF--
==DONE==
Strict Standards: Declaration of B::test() should be compatible with A::test($a) in %sbug61761.php on line %d
-34
View File
@@ -1,34 +0,0 @@
--TEST--
Bug #61767 (Shutdown functions not called in certain error situation)
--FILE--
<?php
set_error_handler(function($code, $msg, $file = null, $line = null) {
echo "Error handler called ($msg)\n";
throw new \ErrorException($msg, $code, 0, $file, $line);
});
register_shutdown_function(function(){
echo "Shutting down\n";
print_r(error_get_last());
});
//$undefined = null; // defined variable does not cause problems
$undefined->foo();
--EXPECTF--
Error handler called (Undefined variable: undefined)
Warning: Uncaught exception 'ErrorException' with message 'Undefined variable: undefined' in %sbug61767.php:13
Stack trace:
#0 %sbug61767.php(13): {closure}(8, 'Undefined varia...', '%s', 13, Array)
#1 {main}
thrown in %sbug61767.php on line 13
Fatal error: Call to a member function foo() on a non-object in %sbug61767.php on line 13
Shutting down
Array
(
[type] => 1
[message] => Call to a member function foo() on a non-object
[file] => %sbug61767.php
[line] => 13
)
-32
View File
@@ -1,32 +0,0 @@
--TEST--
Bug #62358 (Segfault when using traits a lot)
--SKIPIF--
<?php
if (getenv("USE_ZEND_ALLOC") !== "0") {
die("skip Need Zend MM enabled");
}
?>
--FILE--
<?php
trait T {
public function foo() {
echo "from T";
}
}
interface I {
public function foo();
}
abstract class A implements I{
use T;
}
class B extends A {
public function foo($var) {
}
}
?>
--EXPECTF--
Strict Standards: Declaration of B::foo() should be compatible with A::foo() in %sbug62358.php on line %d
-33
View File
@@ -1,33 +0,0 @@
--TEST--
Bug #62653: unset($array[$float]) causes a crash
--FILE--
<?php
$array = array("5"=>"bar");
$foo = "10.0000"; // gettype($foo) = "string"
$foo /= 2; //Makes $foo = 5 but still gettype($foo) = "double"
unset($array[$foo]);
print_r($array);
$array = array("5"=>"bar");
$foo = "5";
unset($array[(float)$foo]);
print_r($array);
$array = array("5"=>"bar");
$foo = "10.0000";
$foo /= 2; //Makes $foo = 5 but still gettype($foo) = "double"
$name = "foo";
unset($array[$$name]);
print_r($array);
?>
--EXPECT--
Array
(
)
Array
(
)
Array
(
)
-11
View File
@@ -1,11 +0,0 @@
--TEST--
Bug #62680 (Function isset() throws fatal error on set array if non-existent key depth >= 3)
--FILE--
<?php
$array = array("");
var_dump(isset($array[0]["a"]["b"]));
var_dump(isset($array[0]["a"]["b"]["c"]));
?>
--EXPECT--
bool(false)
bool(false)
-23
View File
@@ -1,23 +0,0 @@
--TEST--
Bug #62763 (register_shutdown_function and extending class)
--FILE--
<?php
class test1 {
public function __construct() {
register_shutdown_function(array($this, 'shutdown'));
}
public function shutdown() {
exit(__METHOD__);
}
}
class test2 extends test1 {
public function __destruct() {
exit (__METHOD__);
}
}
new test1;
new test2;
?>
--EXPECT--
test1::shutdowntest2::__destruct
-21
View File
@@ -1,21 +0,0 @@
--TEST--
Bug #62892 (ReflectionClass::getTraitAliases crashes on importing trait methods as private)
--FILE--
<?php
trait myTrait {
public function run() {}
}
class myClass {
use myTrait {
MyTrait::run as private;
}
}
$class = new \ReflectionClass('myClass');
var_dump($class->getTraitAliases());
?>
--EXPECTF--
array(0) {
}
-22
View File
@@ -1,22 +0,0 @@
--TEST--
Bug #62907 (Double free when use traits)
--FILE--
<?php
function __autoload($name) {
if ($name == "B") {
eval ("abstract class B extends A { }");
} else if ($name == "A") {
eval ("abstract class A { use T { T::__construct as __asconstruct; }}");
} else if ($name == "T") {
eval ("trait T { public function __construct() { } }");
}
return TRUE;
}
class C extends B {
public function __construct() {
}
}
echo "okey";
--EXPECT--
okey
-20
View File
@@ -1,20 +0,0 @@
--TEST--
Bug #62956: "incompatible" signatures for private methods should not cause E_STRICT
--FILE--
<?php
class Base
{
private function test()
{}
}
class Extension extends Base
{
private function test($arg)
{}
}
?>
==DONE==
--EXPECT--
==DONE==
-36
View File
@@ -1,36 +0,0 @@
--TEST--
Bug #63111 (is_callable() lies for abstract static method)
--FILE--
<?php
abstract class Foo {
abstract static function bar();
}
interface MyInterface {
static function bar();
}
abstract class Bar {
static function foo() {
echo "ok\n";
}
}
var_dump(is_callable(array("Foo", "bar")));
var_dump(is_callable("Foo::bar"));
var_dump(is_callable(array("MyInterface", "bar")));
var_dump(is_callable("MyInterface::bar"));
var_dump(is_callable(array("Bar", "foo")));
var_dump(is_callable("Bar::foo"));
Bar::foo();
Foo::bar();
?>
--EXPECTF--
Strict Standards: Static function Foo::bar() should not be abstract in %sbug63111.php on line 3
bool(false)
bool(false)
bool(false)
bool(false)
bool(true)
bool(true)
ok
Fatal error: Cannot call abstract method Foo::bar() in %sbug63111.php on line 20
-12
View File
@@ -1,12 +0,0 @@
--TEST--
Bug #63173: Crash when invoking invalid array callback
--FILE--
<?php
// the important part here are the indexes 1 and 2
$callback = [1 => 0, 2 => 0];
$callback();
?>
--EXPECTF--
Fatal error: Array callback has to contain indices 0 and 1 in %s on line %d
+4 -4
View File
@@ -30,10 +30,10 @@ echo "Done\n";
--EXPECTF--
string(1) "i"
Notice: String offset cast occurred in %s on line %d
Notice: String offset cast occured in %s on line %d
string(1) "S"
Notice: String offset cast occurred in %s on line %d
Notice: String offset cast occured in %s on line %d
string(1) "S"
Warning: Illegal string offset 'run away' in %s on line %d
@@ -46,10 +46,10 @@ string(1) "o"
Notice: A non well formed numeric value encountered in %s on line %d
string(1) "r"
Notice: String offset cast occurred in %s on line %d
Notice: String offset cast occured in %s on line %d
string(1) "i"
Notice: String offset cast occurred in %s on line %d
Notice: String offset cast occured in %s on line %d
string(1) "S"
Warning: Illegal offset type in %s on line %d
-68
View File
@@ -1,68 +0,0 @@
--TEST--
Bug #61998 (Using traits with method aliases appears to result in crash during execution)
--FILE--
<?php
class Foo {
use T1 {
func as newFunc;
}
public function func() {
echo "From Foo\n";
}
}
trait T1 {
public function func() {
echo "From T1\n";
}
}
class Bar {
public function func() {
echo "From Bar\n";
}
public function func2() {
echo "From Bar\n";
}
public function func3() {
echo "From Bar\n";
}
use T1 {
func as newFunc;
func as func2;
}
use T2 {
func2 as newFunc2;
func2 as newFunc3;
func2 as func3;
}
}
trait T2 {
public function func2() {
echo "From T2\n";
}
}
$f = new Foo();
$f->newFunc(); //from T1
$f->func(); //from Foo
$b = new Bar();
$b->newFunc(); //from T1
$b->func(); //from Bar
$b->func2(); //from Bar
$b->newFunc2(); //from T2
$b->newFunc3(); //from T2
$b->func3(); //from Bar
--EXPECTF--
From T1
From Foo
From T1
From Bar
From Bar
From T2
From T2
From Bar
+6 -38
View File
@@ -258,9 +258,6 @@ ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_cop
{
TSRMLS_FETCH();
if (zend_std_cast_object_tostring(expr, expr_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
break;
}
if (Z_OBJ_HANDLER_P(expr, cast_object)) {
zval *val;
@@ -273,6 +270,12 @@ ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_cop
}
zval_ptr_dtor(&val);
}
/* Standard PHP objects */
if (Z_OBJ_HT_P(expr) == &std_object_handlers || !Z_OBJ_HANDLER_P(expr, cast_object)) {
if (zend_std_cast_object_tostring(expr, expr_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
break;
}
}
if (!Z_OBJ_HANDLER_P(expr, cast_object) && Z_OBJ_HANDLER_P(expr, get)) {
zval *z = Z_OBJ_HANDLER_P(expr, get)(expr TSRMLS_CC);
@@ -1028,29 +1031,6 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
zend_stack context_stack;
TSRMLS_FETCH();
/* Report about uncaught exception in case of fatal errors */
if (EG(exception)) {
switch (type) {
case E_CORE_ERROR:
case E_ERROR:
case E_RECOVERABLE_ERROR:
case E_PARSE:
case E_COMPILE_ERROR:
case E_USER_ERROR:
if (zend_is_executing(TSRMLS_C)) {
error_lineno = zend_get_executed_lineno(TSRMLS_C);
}
zend_exception_error(EG(exception), E_WARNING TSRMLS_CC);
EG(exception) = NULL;
if (zend_is_executing(TSRMLS_C) && EG(opline_ptr)) {
active_opline->lineno = error_lineno;
}
break;
default:
break;
}
}
/* Obtain relevant filename and lineno */
switch (type) {
case E_CORE_ERROR:
@@ -1281,7 +1261,6 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_co
zend_file_handle *file_handle;
zend_op_array *orig_op_array = EG(active_op_array);
zval **orig_retval_ptr_ptr = EG(return_value_ptr_ptr);
long orig_interactive = CG(interactive);
va_start(files, file_count);
for (i = 0; i < file_count; i++) {
@@ -1289,15 +1268,6 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_co
if (!file_handle) {
continue;
}
if (orig_interactive) {
if (file_handle->filename[0] != '-' || file_handle->filename[1]) {
CG(interactive) = 0;
} else {
CG(interactive) = 1;
}
}
EG(active_op_array) = zend_compile_file(file_handle, type TSRMLS_CC);
if (file_handle->opened_path) {
int dummy = 1;
@@ -1339,14 +1309,12 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_co
va_end(files);
EG(active_op_array) = orig_op_array;
EG(return_value_ptr_ptr) = orig_retval_ptr_ptr;
CG(interactive) = orig_interactive;
return FAILURE;
}
}
va_end(files);
EG(active_op_array) = orig_op_array;
EG(return_value_ptr_ptr) = orig_retval_ptr_ptr;
CG(interactive) = orig_interactive;
return SUCCESS;
}
+11 -22
View File
@@ -2265,9 +2265,7 @@ void module_destructor(zend_module_entry *module) /* {{{ */
/* Deinitilaise module globals */
if (module->globals_size) {
#ifdef ZTS
if (*module->globals_id_ptr) {
ts_free_id(*module->globals_id_ptr);
}
ts_free_id(*module->globals_id_ptr);
#else
if (module->globals_dtor) {
module->globals_dtor(module->globals_ptr TSRMLS_CC);
@@ -2533,9 +2531,6 @@ ZEND_API int zend_disable_function(char *function_name, uint function_name_lengt
}
/* }}} */
#ifdef ZEND_WIN32
#pragma optimize("", off)
#endif
static zend_object_value display_disabled_class(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
{
zend_object_value retval;
@@ -2544,9 +2539,6 @@ static zend_object_value display_disabled_class(zend_class_entry *class_type TSR
zend_error(E_WARNING, "%s() has been disabled for security reasons", class_type->name);
return retval;
}
#ifdef ZEND_WIN32
#pragma optimize("", on)
#endif
/* }}} */
static const zend_function_entry disabled_class_new[] = {
@@ -2555,15 +2547,16 @@ static const zend_function_entry disabled_class_new[] = {
ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_DC) /* {{{ */
{
zend_class_entry **disabled_class;
zend_class_entry disabled_class;
zend_str_tolower(class_name, class_name_length);
if (zend_hash_find(CG(class_table), class_name, class_name_length+1, (void **)&disabled_class)==FAILURE) {
if (zend_hash_del(CG(class_table), class_name, class_name_length+1)==FAILURE) {
return FAILURE;
}
INIT_CLASS_ENTRY_INIT_METHODS((**disabled_class), disabled_class_new, NULL, NULL, NULL, NULL, NULL);
(*disabled_class)->create_object = display_disabled_class;
zend_hash_clean(&((*disabled_class)->function_table));
INIT_OVERLOADED_CLASS_ENTRY_EX(disabled_class, class_name, class_name_length, disabled_class_new, NULL, NULL, NULL, NULL, NULL);
disabled_class.create_object = display_disabled_class;
disabled_class.name_length = class_name_length;
zend_register_internal_class(&disabled_class TSRMLS_CC);
return SUCCESS;
}
/* }}} */
@@ -2637,6 +2630,7 @@ static int zend_is_callable_check_class(const char *name, int name_len, zend_fca
}
/* }}} */
static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fcall_info_cache *fcc, int strict_class, char **error TSRMLS_DC) /* {{{ */
{
zend_class_entry *ce_org = fcc->calling_scope;
@@ -2659,9 +2653,11 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
/* Skip leading \ */
if (Z_STRVAL_P(callable)[0] == '\\') {
mlen = Z_STRLEN_P(callable) - 1;
mname = Z_STRVAL_P(callable) + 1;
lmname = zend_str_tolower_dup(Z_STRVAL_P(callable) + 1, mlen);
} else {
mlen = Z_STRLEN_P(callable);
mname = Z_STRVAL_P(callable);
lmname = zend_str_tolower_dup(Z_STRVAL_P(callable), mlen);
}
/* Check if function with given name exists.
@@ -2813,14 +2809,7 @@ get_function_via_handler:
if (retval) {
if (fcc->calling_scope && !call_via_handler) {
if (!fcc->object_ptr && (fcc->function_handler->common.fn_flags & ZEND_ACC_ABSTRACT)) {
if (error) {
zend_spprintf(error, 0, "cannot call abstract method %s::%s()", fcc->calling_scope->name, fcc->function_handler->common.function_name);
retval = 0;
} else {
zend_error(E_ERROR, "Cannot call abstract method %s::%s()", fcc->calling_scope->name, fcc->function_handler->common.function_name);
}
} else if (!fcc->object_ptr && !(fcc->function_handler->common.fn_flags & ZEND_ACC_STATIC)) {
if (!fcc->object_ptr && !(fcc->function_handler->common.fn_flags & ZEND_ACC_STATIC)) {
int severity;
char *verb;
if (fcc->function_handler->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
-5
View File
@@ -175,11 +175,6 @@ typedef struct _zend_fcall_info_cache {
class_container.name = zend_strndup(cl_name, _len); \
} \
class_container.name_length = _len; \
INIT_CLASS_ENTRY_INIT_METHODS(class_container, functions, handle_fcall, handle_propget, handle_propset, handle_propunset, handle_propisset) \
}
#define INIT_CLASS_ENTRY_INIT_METHODS(class_container, functions, handle_fcall, handle_propget, handle_propset, handle_propunset, handle_propisset) \
{ \
class_container.constructor = NULL; \
class_container.destructor = NULL; \
class_container.clone = NULL; \
+3 -3
View File
@@ -664,7 +664,7 @@ static void *_zend_mm_realloc_int(zend_mm_heap *heap, void *p, size_t size ZEND_
static inline unsigned int zend_mm_high_bit(size_t _size)
{
#if defined(__GNUC__) && (defined(__native_client__) || defined(i386))
#if defined(__GNUC__) && defined(i386)
unsigned int n;
__asm__("bsrl %1,%0\n\t" : "=r" (n) : "rm" (_size));
@@ -690,7 +690,7 @@ static inline unsigned int zend_mm_high_bit(size_t _size)
static inline unsigned int zend_mm_low_bit(size_t _size)
{
#if defined(__GNUC__) && (defined(__native_client__) || defined(i386))
#if defined(__GNUC__) && defined(i386)
unsigned int n;
__asm__("bsfl %1,%0\n\t" : "=r" (n) : "rm" (_size));
@@ -2454,7 +2454,7 @@ ZEND_API size_t _zend_mem_block_size(void *ptr TSRMLS_DC ZEND_FILE_LINE_DC ZEND_
return _zend_mm_block_size(AG(mm_heap), ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
}
#if defined(__GNUC__) && (defined(__native_client__) || defined(i386))
#if defined(__GNUC__) && defined(i386)
static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
{
+1 -1
View File
@@ -78,7 +78,7 @@ ZEND_METHOD(Closure, __invoke) /* {{{ */
/* {{{ proto Closure Closure::bind(Closure $old, object $to [, mixed $scope = "static" ] )
Create a closure from another one and bind to another object and scope */
ZEND_METHOD(Closure, bind)
ZEND_METHOD(Closure, bind) /* {{{ */
{
zval *newthis, *zclosure, *scope_arg = NULL;
zend_closure *closure;
+25 -35
View File
@@ -1685,7 +1685,7 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
zval key;
if (CG(current_namespace)) {
/* Prefix function name with current namespace name */
/* Prefix function name with current namespcae name */
znode tmp;
tmp.u.constant = *CG(current_namespace);
@@ -2935,11 +2935,6 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c
return 1;
}
/* If both methods are private do not enforce a signature */
if ((fe->common.fn_flags & ZEND_ACC_PRIVATE) && (proto->common.fn_flags & ZEND_ACC_PRIVATE)) {
return 1;
}
/* check number of arguments */
if (proto->common.required_num_args < fe->common.required_num_args
|| proto->common.num_args > fe->common.num_args) {
@@ -3624,7 +3619,6 @@ ZEND_API void zend_do_implement_trait(zend_class_entry *ce, zend_class_entry *tr
}
}
ce->traits[ce->num_traits++] = trait;
trait->refcount++;
}
}
/* }}} */
@@ -3717,7 +3711,7 @@ static int zend_traits_merge_functions(zend_function *fn TSRMLS_DC, int num_args
} else {
/* Add it to result function table */
if (zend_hash_quick_add(resulting_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h, fn, sizeof(zend_function), NULL)==FAILURE) {
zend_error(E_COMPILE_ERROR, "Trait method %s has not been applied, because failure occurred during updating resulting trait method table", fn->common.function_name);
zend_error(E_COMPILE_ERROR, "Trait method %s has not been applied, because failure occured during updating resulting trait method table", fn->common.function_name);
}
}
@@ -3806,12 +3800,9 @@ static int zend_traits_merge_functions_to_class(zend_function *fn TSRMLS_DC, int
if (prototype) {
do_inheritance_check_on_method(fn, prototype TSRMLS_CC);
}
/* one more thing: make sure we properly implement an abstract method */
if (existing_fn && existing_fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
prototype = fn->common.prototype;
do_inheritance_check_on_method(fn, existing_fn TSRMLS_CC);
fn->common.prototype = prototype;
}
/* delete inherited fn if the function to be added is not abstract */
@@ -3837,11 +3828,11 @@ static int zend_traits_merge_functions_to_class(zend_function *fn TSRMLS_DC, int
function_add_ref(&fn_copy);
if (zend_hash_quick_update(&ce->function_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h, &fn_copy, sizeof(zend_function), (void**)&fn_copy_p)==FAILURE) {
zend_error(E_COMPILE_ERROR, "Trait method %s has not been applied, because failure occurred during updating class method table", hash_key->arKey);
zend_error(E_COMPILE_ERROR, "Trait method %s has not been applied, because failure occured during updating class method table", hash_key->arKey);
}
zend_add_magic_methods(ce, hash_key->arKey, hash_key->nKeyLength, fn_copy_p TSRMLS_CC);
zend_function_dtor(fn);
} else {
zend_function_dtor(fn);
@@ -3878,10 +3869,10 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args,
&& (zend_binary_strcasecmp(aliases[i]->trait_method->method_name, aliases[i]->trait_method->mname_len, fn->common.function_name, fnname_len) == 0)) {
fn_copy = *fn;
function_add_ref(&fn_copy);
/* this function_name is never destroyed, because ZEND_ACC_ALIAS
flag is set */
/* this function_name is never destroyed, because its refcount
greater than 1, classes are always destoyed in reverse order
and trait is declared early than this class */
fn_copy.common.function_name = aliases[i]->alias;
fn_copy.common.fn_flags |= ZEND_ACC_ALIAS;
/* if it is 0, no modifieres has been changed */
if (aliases[i]->modifiers) {
@@ -3914,7 +3905,6 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args,
/* is not in hashtable, thus, function is not to be excluded */
fn_copy = *fn;
function_add_ref(&fn_copy);
fn_copy.common.fn_flags |= ZEND_ACC_ALIAS;
/* apply aliases which are not qualified by a class name, or which have not
* alias name, just setting visibility */
@@ -4034,9 +4024,9 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /*
/** And, ensure that the referenced method is resolvable, too. */
lcname = zend_str_tolower_dup(cur_method_ref->method_name,
cur_method_ref->mname_len);
cur_method_ref->mname_len);
method_exists = zend_hash_exists(&cur_method_ref->ce->function_table,
lcname, cur_method_ref->mname_len + 1);
lcname, cur_method_ref->mname_len + 1);
efree(lcname);
if (!method_exists) {
@@ -4086,14 +4076,14 @@ static void zend_do_traits_method_binding(zend_class_entry *ce TSRMLS_DC) /* {{{
size_t i;
/* prepare copies of trait function tables for combination */
function_tables = emalloc(sizeof(HashTable*) * ce->num_traits);
resulting_table = (HashTable *)emalloc(sizeof(HashTable));
function_tables = malloc(sizeof(HashTable*) * ce->num_traits);
resulting_table = (HashTable *) malloc(sizeof(HashTable));
/* TODO: revisit this start size, may be its not optimal */
zend_hash_init_ex(resulting_table, 10, NULL, NULL, 0, 0);
zend_hash_init_ex(resulting_table, 10, NULL, NULL, 1, 0);
for (i = 0; i < ce->num_traits; i++) {
function_tables[i] = (HashTable *)emalloc(sizeof(HashTable));
function_tables[i] = (HashTable *) malloc(sizeof(HashTable));
zend_hash_init_ex(function_tables[i], ce->traits[i]->function_table.nNumOfElements, NULL, NULL, 1, 0);
if (ce->trait_precedences) {
@@ -4126,14 +4116,14 @@ static void zend_do_traits_method_binding(zend_class_entry *ce TSRMLS_DC) /* {{{
for (i = 0; i < ce->num_traits; i++) {
/* zend_hash_destroy(function_tables[i]); */
zend_hash_graceful_destroy(function_tables[i]);
efree(function_tables[i]);
free(function_tables[i]);
}
efree(function_tables);
free(function_tables);
/* free temporary resulting table */
/* zend_hash_destroy(resulting_table); */
zend_hash_graceful_destroy(resulting_table);
efree(resulting_table);
free(resulting_table);
}
/* }}} */
@@ -5018,11 +5008,11 @@ void zend_do_begin_class_declaration(const znode *class_token, znode *class_name
opline->op2_type = IS_CONST;
if (doing_inheritance) {
/* Make sure a trait does not try to extend a class */
if ((new_class_entry->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) {
zend_error(E_COMPILE_ERROR, "A trait (%s) cannot extend a class. Traits can only be composed from other traits with the 'use' keyword. Error", new_class_entry->name);
}
/* Make sure a trait does not try to extend a class */
if ((new_class_entry->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) {
zend_error(E_COMPILE_ERROR, "A trait (%s) cannot extend a class. Traits can only be composed from other traits with the 'use' keyword. Error", new_class_entry->name);
}
opline->extended_value = parent_class_name->u.op.var;
opline->opcode = ZEND_DECLARE_INHERITED_CLASS;
} else {
@@ -6967,9 +6957,9 @@ void zend_do_use(znode *ns_name, znode *new_name, int is_global TSRMLS_DC) /* {{
lcname = zend_str_tolower_dup(Z_STRVAL_P(name), Z_STRLEN_P(name));
if (((Z_STRLEN_P(name) == sizeof("self")-1) &&
!memcmp(lcname, "self", sizeof("self")-1)) ||
((Z_STRLEN_P(name) == sizeof("parent")-1) &&
!memcmp(lcname, "parent", sizeof("parent")-1))) {
!memcmp(lcname, "self", sizeof("self")-1)) ||
((Z_STRLEN_P(name) == sizeof("parent")-1) &&
!memcmp(lcname, "parent", sizeof("parent")-1))) {
zend_error(E_COMPILE_ERROR, "Cannot use %s as %s because '%s' is a special class name", Z_STRVAL_P(ns), Z_STRVAL_P(name), Z_STRVAL_P(name));
}
-2
View File
@@ -207,8 +207,6 @@ typedef struct _zend_try_catch_element {
#define ZEND_ACC_RETURN_REFERENCE 0x4000000
#define ZEND_ACC_DONE_PASS_TWO 0x8000000
#define ZEND_ACC_ALIAS 0x10000000
char *zend_visibility_string(zend_uint fn_flags);
+2 -2
View File
@@ -29,8 +29,8 @@
#include "zend_vm.h"
#include "zend_dtrace.h"
static zend_class_entry *default_exception_ce;
static zend_class_entry *error_exception_ce;
zend_class_entry *default_exception_ce;
zend_class_entry *error_exception_ce;
static zend_object_handlers default_exception_handlers;
ZEND_API void (*zend_throw_exception_hook)(zval *ex TSRMLS_DC);
+2 -2
View File
@@ -1161,7 +1161,7 @@ convert_to_array:
case IS_DOUBLE:
case IS_NULL:
case IS_BOOL:
zend_error(E_NOTICE, "String offset cast occurred");
zend_error(E_NOTICE, "String offset cast occured");
break;
default:
zend_error(E_WARNING, "Illegal offset type");
@@ -1284,7 +1284,7 @@ static void zend_fetch_dimension_address_read(temp_variable *result, zval **cont
case IS_NULL:
case IS_BOOL:
if (type != BP_VAR_IS) {
zend_error(E_NOTICE, "String offset cast occurred");
zend_error(E_NOTICE, "String offset cast occured");
}
break;
default:
+1 -1
View File
@@ -330,7 +330,7 @@ END_EXTERN_C()
if (idx-1 > LONG_MAX) { /* overflow */ \
break; \
} \
idx = 0 - idx; \
idx = (ulong)(-(long)idx); \
} else if (idx > LONG_MAX) { /* overflow */ \
break; \
} \
+1507 -1545
View File
File diff suppressed because it is too large. Load diff
+6 -27
View File
@@ -347,7 +347,7 @@ DOLLAR_CURLY "${"
SECTION_RAW_CHARS [^\]\n\r]
SINGLE_QUOTED_CHARS [^']
RAW_VALUE_CHARS [^"\n\r;\000]
RAW_VALUE_CHARS [^\n\r;\000]
LITERAL_DOLLAR ("$"([^{\000]|("\\"{ANY_CHAR})))
VALUE_CHARS ([^$= \t\n\r;&|~()!"'\000]|{LITERAL_DOLLAR})
@@ -445,33 +445,12 @@ SECTION_VALUE_CHARS ([^$\n\r;"'\]\\]|("\\"{ANY_CHAR})|{LITERAL_DOLLAR})
return '=';
}
<ST_RAW>["] {
while (YYCURSOR < YYLIMIT) {
switch (*YYCURSOR++) {
case '\n':
SCNG(lineno)++;
break;
case '\r':
if (*YYCURSOR != '\n') {
SCNG(lineno)++;
}
break;
case '"':
yyleng = YYCURSOR - SCNG(yy_text) - 2;
SCNG(yy_text)++;
RETURN_TOKEN(TC_RAW, yytext, yyleng);
case '\\':
if (YYCURSOR < YYLIMIT) {
YYCURSOR++;
}
break;
}
}
yyleng = YYCURSOR - SCNG(yy_text);
RETURN_TOKEN(TC_RAW, yytext, yyleng);
}
<ST_RAW>{RAW_VALUE_CHARS}+ { /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
/* Eat leading and trailing double quotes */
if (yytext[0] == '"' && yytext[yyleng - 1] == '"') {
SCNG(yy_text)++;
yyleng = yyleng - 2;
}
RETURN_TOKEN(TC_RAW, yytext, yyleng);
}
+1 -1
View File
@@ -1,4 +1,4 @@
/* Generated by re2c 0.13.5 on Thu Jun 7 17:48:25 2012 */
/* Generated by re2c 0.13.5 on Fri Mar 2 11:49:21 2012 */
#line 3 "Zend/zend_ini_scanner_defs.h"
enum YYCONDTYPE {
+1 -1
View File
@@ -1191,7 +1191,7 @@ static YYSIZE_T zend_yytnamerr(char *yyres, const char *yystr)
if (LANG_SCNG(yy_text)[0] == 0 &&
LANG_SCNG(yy_leng) == 1 &&
memcmp(yystr, "\"end of file\"", sizeof("\"end of file\"") - 1) == 0) {
memcmp(yystr, ZEND_STRL("\"end of file\"")) == 0) {
yystpcpy(yyres, "end of file");
return sizeof("end of file")-1;
}
+1 -1
View File
@@ -168,7 +168,7 @@ ZEND_API const zend_encoding *zend_multibyte_get_script_encoding(TSRMLS_D)
ZEND_API int zend_multibyte_set_script_encoding(const zend_encoding **encoding_list, size_t encoding_list_size TSRMLS_DC)
{
if (CG(script_encoding_list)) {
free(CG(script_encoding_list));
efree(CG(script_encoding_list));
}
CG(script_encoding_list) = encoding_list;
CG(script_encoding_list_size) = encoding_list_size;
-1
View File
@@ -1490,7 +1490,6 @@ ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int ty
if (retval) {
zval_ptr_dtor(&retval);
}
EG(exception) = NULL;
zend_error_noreturn(E_ERROR, "Method %s::__toString() must not throw an exception", ce->name);
return FAILURE;
}
+1 -20
View File
@@ -215,12 +215,6 @@ ZEND_API int zend_cleanup_class_data(zend_class_entry **pce TSRMLS_DC)
void _destroy_zend_class_traits_info(zend_class_entry *ce)
{
if (ce->num_traits > 0 && ce->traits) {
size_t i;
for (i = 0; i < ce->num_traits; i++) {
if (ce->traits[i]) {
destroy_zend_class(&ce->traits[i]);
}
}
efree(ce->traits);
}
@@ -267,15 +261,6 @@ void _destroy_zend_class_traits_info(zend_class_entry *ce)
}
}
static int zend_clear_trait_method_name(zend_op_array *op_array TSRMLS_DC)
{
if (op_array->function_name && (op_array->fn_flags & ZEND_ACC_ALIAS) == 0) {
efree(op_array->function_name);
op_array->function_name = NULL;
}
return 0;
}
ZEND_API void destroy_zend_class(zend_class_entry **pce)
{
zend_class_entry *ce = *pce;
@@ -307,10 +292,6 @@ ZEND_API void destroy_zend_class(zend_class_entry **pce)
}
zend_hash_destroy(&ce->properties_info);
str_efree(ce->name);
if ((ce->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) {
TSRMLS_FETCH();
zend_hash_apply(&ce->function_table, (apply_func_t)zend_clear_trait_method_name TSRMLS_CC);
}
zend_hash_destroy(&ce->function_table);
zend_hash_destroy(&ce->constants_table);
if (ce->num_interfaces > 0 && ce->interfaces) {
@@ -400,7 +381,7 @@ ZEND_API void destroy_op_array(zend_op_array *op_array TSRMLS_DC)
}
efree(op_array->opcodes);
if (op_array->function_name && (op_array->fn_flags & ZEND_ACC_ALIAS) == 0) {
if (op_array->function_name) {
efree((char*)op_array->function_name);
}
if (op_array->doc_comment) {
+3 -7
View File
@@ -1519,9 +1519,6 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {
ret = compare_function(result, op1, op_free TSRMLS_CC);
zend_free_obj_get_result(op_free TSRMLS_CC);
return ret;
} else if (Z_TYPE_P(op1) == IS_OBJECT) {
ZVAL_LONG(result, 1);
return SUCCESS;
}
}
if (!converted) {
@@ -1608,8 +1605,7 @@ ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
&& (!memcmp(Z_STRVAL_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op1))));
break;
case IS_ARRAY:
Z_LVAL_P(result) = (Z_ARRVAL_P(op1) == Z_ARRVAL_P(op2) ||
zend_hash_compare(Z_ARRVAL_P(op1), Z_ARRVAL_P(op2), (compare_func_t) hash_zval_identical_function, 1 TSRMLS_CC)==0);
Z_LVAL_P(result) = zend_hash_compare(Z_ARRVAL_P(op1), Z_ARRVAL_P(op2), (compare_func_t) hash_zval_identical_function, 1 TSRMLS_CC)==0;
break;
case IS_OBJECT:
if (Z_OBJ_HT_P(op1) == Z_OBJ_HT_P(op2)) {
@@ -2101,13 +2097,13 @@ static int hash_zval_compare_function(const zval **z1, const zval **z2 TSRMLS_DC
ZEND_API int zend_compare_symbol_tables_i(HashTable *ht1, HashTable *ht2 TSRMLS_DC) /* {{{ */
{
return ht1 == ht2 ? 0 : zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC);
return zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC);
}
/* }}} */
ZEND_API void zend_compare_symbol_tables(zval *result, HashTable *ht1, HashTable *ht2 TSRMLS_DC) /* {{{ */
{
ZVAL_LONG(result, ht1 == ht2 ? 0 : zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC));
ZVAL_LONG(result, zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC));
}
/* }}} */
+1 -1
View File
@@ -79,7 +79,7 @@ static size_t zend_stream_stdio_fsizer(void *handle TSRMLS_DC) /* {{{ */
static void zend_stream_unmap(zend_stream *stream TSRMLS_DC) { /* {{{ */
#if HAVE_MMAP
if (stream->mmap.map) {
munmap(stream->mmap.map, stream->mmap.len + ZEND_MMAP_AHEAD);
munmap(stream->mmap.map, stream->mmap.len);
} else
#endif
if (stream->mmap.buf) {
-2
View File
@@ -23,14 +23,12 @@
#include "zend.h"
BEGIN_EXTERN_C()
ZEND_API extern const char *(*zend_new_interned_string)(const char *str, int len, int free_src TSRMLS_DC);
ZEND_API extern void (*zend_interned_strings_snapshot)(TSRMLS_D);
ZEND_API extern void (*zend_interned_strings_restore)(TSRMLS_D);
void zend_interned_strings_init(TSRMLS_D);
void zend_interned_strings_dtor(TSRMLS_D);
END_EXTERN_C()
#ifndef ZTS
+1 -6
View File
@@ -2412,10 +2412,6 @@ ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV)
zend_hash_index_find(Z_ARRVAL_P(function_name), 0, (void **) &obj);
zend_hash_index_find(Z_ARRVAL_P(function_name), 1, (void **) &method);
if (!obj || !method) {
zend_error_noreturn(E_ERROR, "Array callback has to contain indices 0 and 1");
}
if (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT) {
zend_error_noreturn(E_ERROR, "First array member is not a valid class name or object");
}
@@ -3951,8 +3947,7 @@ ZEND_VM_HANDLER(75, ZEND_UNSET_DIM, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
hval = zend_dval_to_lval(Z_DVAL_P(offset));
zend_hash_index_del(ht, hval);
break;
ZEND_VM_C_GOTO(num_index_dim);
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
+12 -40
View File
@@ -1256,10 +1256,6 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPCODE
zend_hash_index_find(Z_ARRVAL_P(function_name), 0, (void **) &obj);
zend_hash_index_find(Z_ARRVAL_P(function_name), 1, (void **) &method);
if (!obj || !method) {
zend_error_noreturn(E_ERROR, "Array callback has to contain indices 0 and 1");
}
if (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT) {
zend_error_noreturn(E_ERROR, "First array member is not a valid class name or object");
}
@@ -1562,10 +1558,6 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER(ZEND_OPCODE_H
zend_hash_index_find(Z_ARRVAL_P(function_name), 0, (void **) &obj);
zend_hash_index_find(Z_ARRVAL_P(function_name), 1, (void **) &method);
if (!obj || !method) {
zend_error_noreturn(E_ERROR, "Array callback has to contain indices 0 and 1");
}
if (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT) {
zend_error_noreturn(E_ERROR, "First array member is not a valid class name or object");
}
@@ -1730,10 +1722,6 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER(ZEND_OPCODE_H
zend_hash_index_find(Z_ARRVAL_P(function_name), 0, (void **) &obj);
zend_hash_index_find(Z_ARRVAL_P(function_name), 1, (void **) &method);
if (!obj || !method) {
zend_error_noreturn(E_ERROR, "Array callback has to contain indices 0 and 1");
}
if (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT) {
zend_error_noreturn(E_ERROR, "First array member is not a valid class name or object");
}
@@ -1931,10 +1919,6 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER(ZEND_OPCODE_HA
zend_hash_index_find(Z_ARRVAL_P(function_name), 0, (void **) &obj);
zend_hash_index_find(Z_ARRVAL_P(function_name), 1, (void **) &method);
if (!obj || !method) {
zend_error_noreturn(E_ERROR, "Array callback has to contain indices 0 and 1");
}
if (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT) {
zend_error_noreturn(E_ERROR, "First array member is not a valid class name or object");
}
@@ -13933,8 +13917,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
hval = zend_dval_to_lval(Z_DVAL_P(offset));
zend_hash_index_del(ht, hval);
break;
goto num_index_dim;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
@@ -15936,8 +15919,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLE
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
hval = zend_dval_to_lval(Z_DVAL_P(offset));
zend_hash_index_del(ht, hval);
break;
goto num_index_dim;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
@@ -18149,8 +18131,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
hval = zend_dval_to_lval(Z_DVAL_P(offset));
zend_hash_index_del(ht, hval);
break;
goto num_index_dim;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
@@ -21185,8 +21166,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
hval = zend_dval_to_lval(Z_DVAL_P(offset));
zend_hash_index_del(ht, hval);
break;
goto num_index_dim;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
@@ -22524,8 +22504,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_H
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
hval = zend_dval_to_lval(Z_DVAL_P(offset));
zend_hash_index_del(ht, hval);
break;
goto num_index_dim;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
@@ -23683,8 +23662,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HAN
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
hval = zend_dval_to_lval(Z_DVAL_P(offset));
zend_hash_index_del(ht, hval);
break;
goto num_index_dim;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
@@ -24842,8 +24820,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HAN
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
hval = zend_dval_to_lval(Z_DVAL_P(offset));
zend_hash_index_del(ht, hval);
break;
goto num_index_dim;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
@@ -26267,8 +26244,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HAND
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
hval = zend_dval_to_lval(Z_DVAL_P(offset));
zend_hash_index_del(ht, hval);
break;
goto num_index_dim;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
@@ -29522,8 +29498,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
hval = zend_dval_to_lval(Z_DVAL_P(offset));
zend_hash_index_del(ht, hval);
break;
goto num_index_dim;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
@@ -31396,8 +31371,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
hval = zend_dval_to_lval(Z_DVAL_P(offset));
zend_hash_index_del(ht, hval);
break;
goto num_index_dim;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
@@ -33479,8 +33453,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
hval = zend_dval_to_lval(Z_DVAL_P(offset));
zend_hash_index_del(ht, hval);
break;
goto num_index_dim;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
@@ -36246,8 +36219,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
hval = zend_dval_to_lval(Z_DVAL_P(offset));
zend_hash_index_del(ht, hval);
break;
goto num_index_dim;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
+1 -1
View File
@@ -5,8 +5,8 @@ ZEND_API void {%EXECUTOR_NAME%}(zend_op_array *op_array TSRMLS_DC)
DCL_OPLINE
zend_execute_data *execute_data;
zend_bool nested = 0;
zend_bool original_in_execution = EG(in_execution);
{%HELPER_VARS%}
{%EXECUTION_STATUS%}
{%INTERNAL_LABELS%}
-7
View File
@@ -927,13 +927,6 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name,
skip_blanks($f, $m[1], $m[3]."\n");
}
break;
case "EXECUTION_STATUS":
if ($kind != ZEND_VM_KIND_GOTO) {
out($f, $m[1] . "zend_bool original_in_execution = EG(in_execution);\n");
} else {
out($f, $m[1] . "zend_bool original_in_execution = op_array? EG(in_execution) : 0;\n");
}
break;
case "INTERNAL_LABELS":
if ($kind == ZEND_VM_KIND_GOTO) {
// Emit array of labels of opcode handlers and code for
+2 -2
View File
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=5
PHP_MINOR_VERSION=4
PHP_RELEASE_VERSION=8
PHP_EXTRA_VERSION="RC1"
PHP_RELEASE_VERSION=4
PHP_EXTRA_VERSION=""
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
+6 -16
View File
@@ -713,14 +713,6 @@ PHP_MINIT_FUNCTION(curl)
#if LIBCURL_VERSION_NUM >= 0x071202
REGISTER_CURL_CONSTANT(CURLINFO_REDIRECT_URL);
#endif
#if LIBCURL_VERSION_NUM >= 0x071300 /* 7.19.0 */
REGISTER_CURL_CONSTANT(CURLINFO_PRIMARY_IP);
#endif
#if LIBCURL_VERSION_NUM >= 0x071500 /* 7.21.0 */
REGISTER_CURL_CONSTANT(CURLINFO_PRIMARY_PORT);
REGISTER_CURL_CONSTANT(CURLINFO_LOCAL_IP);
REGISTER_CURL_CONSTANT(CURLINFO_LOCAL_PORT);
#endif
/* cURL protocol constants (curl_version) */
@@ -1614,9 +1606,9 @@ PHP_FUNCTION(curl_copy_handle)
dupch->uses = 0;
ch->uses++;
if (ch->handlers->write->stream) {
Z_ADDREF_P(ch->handlers->write->stream);
Z_ADDREF_P(dupch->handlers->write->stream);
dupch->handlers->write->stream = ch->handlers->write->stream;
}
dupch->handlers->write->stream = ch->handlers->write->stream;
dupch->handlers->write->method = ch->handlers->write->method;
dupch->handlers->write->type = ch->handlers->write->type;
if (ch->handlers->read->stream) {
@@ -2185,7 +2177,7 @@ string_copy:
convert_to_string_ex(zvalue);
if (Z_STRLEN_PP(zvalue) && php_check_open_basedir(Z_STRVAL_PP(zvalue) TSRMLS_CC)) {
if (!Z_STRLEN_PP(zvalue) || php_check_open_basedir(Z_STRVAL_PP(zvalue) TSRMLS_CC)) {
RETVAL_FALSE;
return 1;
}
@@ -2455,8 +2447,6 @@ PHP_FUNCTION(curl_getinfo)
create_certinfo(ci, listcode TSRMLS_CC);
CAAZ("certinfo", listcode);
}
#endif
#if LIBCURL_VERSION_NUM >= 0x071300 /* 7.19.0 */
if (curl_easy_getinfo(ch->cp, CURLINFO_PRIMARY_IP, &s_code) == CURLE_OK) {
CAAS("primary_ip", s_code);
}
@@ -2483,10 +2473,10 @@ PHP_FUNCTION(curl_getinfo)
} else {
switch (option) {
/* string variable types */
#if LIBCURL_VERSION_NUM >= 0x071300 /* 7.19.0 */
#if LIBCURL_VERSION_NUM >= 0x071500
case CURLINFO_PRIMARY_IP:
#endif
#if LIBCURL_VERSION_NUM >= 0x071500 /* 7.21.0 */
#if LIBCURL_VERSION_NUM >= 0x071500
case CURLINFO_LOCAL_IP:
#endif
case CURLINFO_PRIVATE:
@@ -2506,7 +2496,7 @@ PHP_FUNCTION(curl_getinfo)
break;
}
/* Long variable types */
#if LIBCURL_VERSION_NUM >= 0x071500 /* 7.21.0 */
#if LIBCURL_VERSION_NUM >= 0x071500
case CURLINFO_PRIMARY_PORT:
case CURLINFO_LOCAL_PORT:
#endif
-3
View File
@@ -191,9 +191,6 @@ PHP_FUNCTION(curl_multi_select)
FD_ZERO(&exceptfds);
curl_multi_fdset(mh->multi, &readfds, &writefds, &exceptfds, &maxfd);
if (maxfd == -1) {
RETURN_LONG(-1);
}
RETURN_LONG(select(maxfd + 1, &readfds, &writefds, &exceptfds, &to));
}
/* }}} */
-4
View File
@@ -162,10 +162,6 @@ static size_t php_curl_stream_read(php_stream *stream, char *buf, size_t count T
}
do {
FD_ZERO(&curlstream->readfds);
FD_ZERO(&curlstream->writefds);
FD_ZERO(&curlstream->excfds);
/* get the descriptors from curl */
curl_multi_fdset(curlstream->multi, &curlstream->readfds, &curlstream->writefds, &curlstream->excfds, &curlstream->maxfd);
-25
View File
@@ -1,25 +0,0 @@
--TEST--
Bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction)
--SKIPIF--
<?php if (!extension_loaded("curl")) print "skip";
if(substr(PHP_OS, 0, 3) != 'WIN' )
die("skip Not Valid for Linux");
?>
--INI--
open_basedir="c:/tmp"
--FILE--
<?php
$ch = curl_init();
var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, ""));
var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, "c:/tmp/foo"));
var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, "c:/xxx/bar"));
curl_close($ch);
?>
--EXPECTF--
%a
Warning: curl_setopt(): open_basedir restriction in effect. File(c:/tmp/foo) is not within the allowed path(s): (c:/tmp) in %sbug61948-win32.php on line %d
bool(false)
Warning: curl_setopt(): open_basedir restriction in effect. File(c:/xxx/bar) is not within the allowed path(s): (c:/tmp) in %sbug61948-win32.php on line %d
bool(false)
+2 -5
View File
@@ -1,10 +1,7 @@
--TEST--
Bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction)
--SKIPIF--
<?php if (!extension_loaded("curl")) print "skip";
if(substr(PHP_OS, 0, 3) == 'WIN' )
die("skip Not Valid for Windows");
?>
<?php if (!extension_loaded("curl")) print "skip"; ?>
--INI--
open_basedir="/tmp"
--FILE--
@@ -16,7 +13,7 @@ open_basedir="/tmp"
curl_close($ch);
?>
--EXPECTF--
bool(true)
bool(false)
bool(true)
Warning: curl_setopt(): open_basedir restriction in effect. File(/xxx/bar) is not within the allowed path(s): (/tmp) in %sbug61948.php on line %d
-18
View File
@@ -1,18 +0,0 @@
--TEST--
Bug #62839 (curl_copy_handle segfault with CURLOPT_FILE)
--SKIPIF--
<?php if (!extension_loaded("curl")) print "skip";
?>
--FILE--
<?php
$curl = curl_init();
$fd = tmpfile();
curl_setopt($curl, CURLOPT_FILE, $fd);
curl_copy_handle($curl);
echo 'DONE!';
?>
--EXPECTF--
DONE!
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2012 The PHP Group |
| Copyright (c) 1997-2010 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2012 The PHP Group |
| Copyright (c) 1997-2010 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2012 The PHP Group |
| Copyright (c) 1997-2010 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+50 -52
View File
@@ -1,10 +1,10 @@
/* Generated by re2c 0.13.5 on Sun Sep 30 20:14:42 2012 */
/* Generated by re2c 0.13.5 on Mon Dec 5 22:02:27 2011 */
#line 1 "ext/date/lib/parse_date.re"
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2012 The PHP Group |
| Copyright (c) 1997-2010 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -995,7 +995,7 @@ std:
}
yy2:
YYDEBUG(2, *YYCURSOR);
#line 1083 "ext/date/lib/parse_date.re"
#line 1082 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("firstdayof | lastdayof");
TIMELIB_INIT;
@@ -1034,7 +1034,7 @@ yy3:
}
yy4:
YYDEBUG(4, *YYCURSOR);
#line 1677 "ext/date/lib/parse_date.re"
#line 1676 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("tzcorrection | tz");
@@ -1358,7 +1358,7 @@ yy12:
if (yych <= '9') goto yy1385;
yy13:
YYDEBUG(13, *YYCURSOR);
#line 1772 "ext/date/lib/parse_date.re"
#line 1771 "ext/date/lib/parse_date.re"
{
add_error(s, "Unexpected character");
goto std;
@@ -2420,7 +2420,7 @@ yy49:
if (yych <= '9') goto yy55;
yy50:
YYDEBUG(50, *YYCURSOR);
#line 1761 "ext/date/lib/parse_date.re"
#line 1760 "ext/date/lib/parse_date.re"
{
goto std;
}
@@ -2433,7 +2433,7 @@ yy52:
YYDEBUG(52, *YYCURSOR);
++YYCURSOR;
YYDEBUG(53, *YYCURSOR);
#line 1766 "ext/date/lib/parse_date.re"
#line 1765 "ext/date/lib/parse_date.re"
{
s->pos = cursor; s->line++;
goto std;
@@ -2825,7 +2825,7 @@ yy72:
if (yych == 's') goto yy74;
yy73:
YYDEBUG(73, *YYCURSOR);
#line 1745 "ext/date/lib/parse_date.re"
#line 1744 "ext/date/lib/parse_date.re"
{
timelib_ull i;
DEBUG_OUTPUT("relative");
@@ -3602,7 +3602,7 @@ yy166:
}
yy167:
YYDEBUG(167, *YYCURSOR);
#line 1608 "ext/date/lib/parse_date.re"
#line 1607 "ext/date/lib/parse_date.re"
{
const timelib_relunit* relunit;
DEBUG_OUTPUT("daytext");
@@ -4139,7 +4139,7 @@ yy193:
}
yy194:
YYDEBUG(194, *YYCURSOR);
#line 1667 "ext/date/lib/parse_date.re"
#line 1666 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("monthtext");
TIMELIB_INIT;
@@ -4199,7 +4199,7 @@ yy198:
}
yy199:
YYDEBUG(199, *YYCURSOR);
#line 1413 "ext/date/lib/parse_date.re"
#line 1412 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datetextual | datenoyear");
@@ -4481,7 +4481,7 @@ yy222:
}
yy223:
YYDEBUG(223, *YYCURSOR);
#line 1715 "ext/date/lib/parse_date.re"
#line 1714 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz");
@@ -5208,7 +5208,7 @@ yy278:
YYDEBUG(278, *YYCURSOR);
++YYCURSOR;
YYDEBUG(279, *YYCURSOR);
#line 1691 "ext/date/lib/parse_date.re"
#line 1690 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("dateshortwithtimeshort12 | dateshortwithtimelong12");
TIMELIB_INIT;
@@ -5409,7 +5409,7 @@ yy294:
++YYCURSOR;
yy295:
YYDEBUG(295, *YYCURSOR);
#line 1385 "ext/date/lib/parse_date.re"
#line 1384 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datenoday");
@@ -6642,7 +6642,7 @@ yy362:
if (yych <= '9') goto yy365;
yy364:
YYDEBUG(364, *YYCURSOR);
#line 1529 "ext/date/lib/parse_date.re"
#line 1528 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pgtextshort");
@@ -7293,7 +7293,7 @@ yy392:
}
yy393:
YYDEBUG(393, *YYCURSOR);
#line 1587 "ext/date/lib/parse_date.re"
#line 1586 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("ago");
TIMELIB_INIT;
@@ -9063,7 +9063,7 @@ yy454:
++YYCURSOR;
yy455:
YYDEBUG(455, *YYCURSOR);
#line 1290 "ext/date/lib/parse_date.re"
#line 1289 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("iso8601date4 | iso8601date2 | iso8601dateslash | dateslash");
TIMELIB_INIT;
@@ -9634,7 +9634,7 @@ yy475:
}
yy476:
YYDEBUG(476, *YYCURSOR);
#line 1427 "ext/date/lib/parse_date.re"
#line 1426 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datenoyearrev");
TIMELIB_INIT;
@@ -9786,7 +9786,7 @@ yy488:
YYDEBUG(488, *YYCURSOR);
++YYCURSOR;
YYDEBUG(489, *YYCURSOR);
#line 1145 "ext/date/lib/parse_date.re"
#line 1144 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("timetiny12 | timeshort12 | timelong12");
TIMELIB_INIT;
@@ -9815,7 +9815,7 @@ yy490:
}
yy491:
YYDEBUG(491, *YYCURSOR);
#line 1182 "ext/date/lib/parse_date.re"
#line 1181 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("timeshort24 | timelong24 | iso8601long");
@@ -10150,7 +10150,7 @@ yy523:
YYDEBUG(523, *YYCURSOR);
++YYCURSOR;
YYDEBUG(524, *YYCURSOR);
#line 1162 "ext/date/lib/parse_date.re"
#line 1161 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("mssqltime");
TIMELIB_INIT;
@@ -10275,7 +10275,7 @@ yy534:
if (yych <= '9') goto yy541;
yy535:
YYDEBUG(535, *YYCURSOR);
#line 1344 "ext/date/lib/parse_date.re"
#line 1343 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datefull");
@@ -11026,7 +11026,7 @@ yy605:
YYDEBUG(606, *YYCURSOR);
++YYCURSOR;
YYDEBUG(607, *YYCURSOR);
#line 1359 "ext/date/lib/parse_date.re"
#line 1358 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("pointed date YYYY");
TIMELIB_INIT;
@@ -11073,7 +11073,7 @@ yy611:
if (yych <= '9') goto yy605;
yy612:
YYDEBUG(612, *YYCURSOR);
#line 1371 "ext/date/lib/parse_date.re"
#line 1370 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pointed date YY");
@@ -11727,7 +11727,7 @@ yy656:
}
yy657:
YYDEBUG(657, *YYCURSOR);
#line 1330 "ext/date/lib/parse_date.re"
#line 1329 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("gnudateshort");
@@ -11846,7 +11846,7 @@ yy666:
}
yy667:
YYDEBUG(667, *YYCURSOR);
#line 1274 "ext/date/lib/parse_date.re"
#line 1273 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("americanshort | american");
@@ -12094,7 +12094,7 @@ yy700:
if (yych <= ':') goto yy704;
yy701:
YYDEBUG(701, *YYCURSOR);
#line 1557 "ext/date/lib/parse_date.re"
#line 1556 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("clf");
@@ -12666,7 +12666,7 @@ yy763:
}
yy764:
YYDEBUG(764, *YYCURSOR);
#line 1302 "ext/date/lib/parse_date.re"
#line 1301 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("iso8601date2");
@@ -12718,7 +12718,7 @@ yy771:
YYDEBUG(771, *YYCURSOR);
++YYCURSOR;
YYDEBUG(772, *YYCURSOR);
#line 1543 "ext/date/lib/parse_date.re"
#line 1542 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pgtextreverse");
@@ -12869,7 +12869,7 @@ yy783:
}
yy784:
YYDEBUG(784, *YYCURSOR);
#line 1578 "ext/date/lib/parse_date.re"
#line 1577 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("year4");
TIMELIB_INIT;
@@ -13028,7 +13028,7 @@ yy793:
}
yy794:
YYDEBUG(794, *YYCURSOR);
#line 1399 "ext/date/lib/parse_date.re"
#line 1398 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datenodayrev");
@@ -13256,7 +13256,7 @@ yy814:
if (yych <= '7') goto yy817;
yy815:
YYDEBUG(815, *YYCURSOR);
#line 1510 "ext/date/lib/parse_date.re"
#line 1509 "ext/date/lib/parse_date.re"
{
timelib_sll w, d;
DEBUG_OUTPUT("isoweek");
@@ -13284,7 +13284,7 @@ yy817:
YYDEBUG(817, *YYCURSOR);
++YYCURSOR;
YYDEBUG(818, *YYCURSOR);
#line 1491 "ext/date/lib/parse_date.re"
#line 1490 "ext/date/lib/parse_date.re"
{
timelib_sll w, d;
DEBUG_OUTPUT("isoweekday");
@@ -13366,7 +13366,7 @@ yy821:
}
yy822:
YYDEBUG(822, *YYCURSOR);
#line 1477 "ext/date/lib/parse_date.re"
#line 1476 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pgydotd");
@@ -13482,7 +13482,7 @@ yy842:
++YYCURSOR;
yy843:
YYDEBUG(843, *YYCURSOR);
#line 1451 "ext/date/lib/parse_date.re"
#line 1450 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("xmlrpc | xmlrpcnocolon | soap | wddx | exif");
@@ -13769,7 +13769,7 @@ yy848:
}
yy849:
YYDEBUG(849, *YYCURSOR);
#line 1439 "ext/date/lib/parse_date.re"
#line 1438 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datenocolon");
TIMELIB_INIT;
@@ -14700,7 +14700,7 @@ yy973:
if (yych <= '9') goto yy996;
yy974:
YYDEBUG(974, *YYCURSOR);
#line 1316 "ext/date/lib/parse_date.re"
#line 1315 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("gnudateshorter");
@@ -15722,7 +15722,7 @@ yy1066:
}
yy1068:
YYDEBUG(1068, *YYCURSOR);
#line 1208 "ext/date/lib/parse_date.re"
#line 1207 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("gnunocolon");
TIMELIB_INIT;
@@ -15836,7 +15836,7 @@ yy1075:
}
yy1076:
YYDEBUG(1076, *YYCURSOR);
#line 1254 "ext/date/lib/parse_date.re"
#line 1253 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("iso8601nocolon");
@@ -16753,7 +16753,7 @@ yy1117:
}
yy1118:
YYDEBUG(1118, *YYCURSOR);
#line 1650 "ext/date/lib/parse_date.re"
#line 1649 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
@@ -16820,7 +16820,7 @@ yy1126:
YYDEBUG(1126, *YYCURSOR);
++YYCURSOR;
YYDEBUG(1127, *YYCURSOR);
#line 1123 "ext/date/lib/parse_date.re"
#line 1122 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
@@ -16949,7 +16949,7 @@ yy1141:
}
yy1142:
YYDEBUG(1142, *YYCURSOR);
#line 1626 "ext/date/lib/parse_date.re"
#line 1625 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
@@ -19649,7 +19649,7 @@ yy1294:
goto yy1298;
yy1295:
YYDEBUG(1295, *YYCURSOR);
#line 1100 "ext/date/lib/parse_date.re"
#line 1099 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("backof | frontof");
TIMELIB_INIT;
@@ -21382,12 +21382,11 @@ yy1387:
s->time->is_localtime = 1;
s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
s->time->z = 0;
s->time->dst = 0;
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 21391 "ext/date/lib/parse_date.c"
#line 21390 "ext/date/lib/parse_date.c"
yy1388:
YYDEBUG(1388, *YYCURSOR);
yych = *++YYCURSOR;
@@ -21834,7 +21833,7 @@ yy1417:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 21838 "ext/date/lib/parse_date.c"
#line 21837 "ext/date/lib/parse_date.c"
yy1418:
YYDEBUG(1418, *YYCURSOR);
yych = *++YYCURSOR;
@@ -21878,7 +21877,7 @@ yy1420:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 21882 "ext/date/lib/parse_date.c"
#line 21881 "ext/date/lib/parse_date.c"
yy1421:
YYDEBUG(1421, *YYCURSOR);
yych = *++YYCURSOR;
@@ -23898,7 +23897,7 @@ yy1500:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 23902 "ext/date/lib/parse_date.c"
#line 23901 "ext/date/lib/parse_date.c"
yy1501:
YYDEBUG(1501, *YYCURSOR);
yych = *++YYCURSOR;
@@ -24048,7 +24047,7 @@ yy1508:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 24052 "ext/date/lib/parse_date.c"
#line 24051 "ext/date/lib/parse_date.c"
yy1509:
YYDEBUG(1509, *YYCURSOR);
yyaccept = 0;
@@ -24592,7 +24591,7 @@ yy1531:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 24596 "ext/date/lib/parse_date.c"
#line 24595 "ext/date/lib/parse_date.c"
yy1532:
YYDEBUG(1532, *YYCURSOR);
yyaccept = 0;
@@ -24765,7 +24764,7 @@ yy1537:
goto yy1531;
}
}
#line 1776 "ext/date/lib/parse_date.re"
#line 1775 "ext/date/lib/parse_date.re"
}
@@ -25071,7 +25070,6 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
s->time->is_localtime = 1;
s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
s->time->z = 0;
s->time->dst = 0;
break;
case 'e': /* timezone */
+1 -3
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2012 The PHP Group |
| Copyright (c) 1997-2010 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -1073,7 +1073,6 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
s->time->is_localtime = 1;
s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
s->time->z = 0;
s->time->dst = 0;
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
@@ -2078,7 +2077,6 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
s->time->is_localtime = 1;
s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
s->time->z = 0;
s->time->dst = 0;
break;
case 'e': /* timezone */
+1 -1
View File
@@ -4,7 +4,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2012 The PHP Group |
| Copyright (c) 1997-2010 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2012 The PHP Group |
| Copyright (c) 1997-2010 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2012 The PHP Group |
| Copyright (c) 1997-2010 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2012 The PHP Group |
| Copyright (c) 1997-2010 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2012 The PHP Group |
| Copyright (c) 1997-2010 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2012 The PHP Group |
| Copyright (c) 1997-2010 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2012 The PHP Group |
| Copyright (c) 1997-2010 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2012 The PHP Group |
| Copyright (c) 1997-2010 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
-19
View File
@@ -3430,19 +3430,10 @@ zval *date_interval_read_property(zval *object, zval *member, int type, const ze
zval_copy_ctor(&tmp_member);
convert_to_string(&tmp_member);
member = &tmp_member;
key = NULL;
}
obj = (php_interval_obj *)zend_objects_get_address(object TSRMLS_CC);
if (!obj->initialized) {
retval = (zend_get_std_object_handlers())->read_property(object, member, type, key TSRMLS_CC);
if (member == &tmp_member) {
zval_dtor(member);
}
return retval;
}
#define GET_VALUE_FROM_STRUCT(n,m) \
if (strcmp(Z_STRVAL_P(member), m) == 0) { \
value = obj->diff->n; \
@@ -3491,19 +3482,9 @@ void date_interval_write_property(zval *object, zval *member, zval *value, const
zval_copy_ctor(&tmp_member);
convert_to_string(&tmp_member);
member = &tmp_member;
key = NULL;
}
obj = (php_interval_obj *)zend_objects_get_address(object TSRMLS_CC);
if (!obj->initialized) {
(zend_get_std_object_handlers())->write_property(object, member, value, key TSRMLS_CC);
if (member == &tmp_member) {
zval_dtor(member);
}
return;
}
#define SET_VALUE_FROM_STRUCT(n,m) \
if (strcmp(Z_STRVAL_P(member), m) == 0) { \
if (value->type != IS_LONG) { \
-28
View File
@@ -1,28 +0,0 @@
--TEST--
Bug #62500 (Segfault in DateInterval class when extended)
--INI--
date.timezone=GMT
--FILE--
<?php
class Crasher extends DateInterval {
public $foo;
public function __construct($time_spec) {
var_dump($this->foo);
$this->foo = 3;
var_dump($this->foo);
var_dump($this->{2});
parent::__construct($time_spec);
}
}
try {
$c = new Crasher('blah');
} catch (Exception $e) {
var_dump($e->getMessage());
}
--EXPECTF--
NULL
int(3)
Notice: Undefined property: Crasher::$2 in %sbug62500.php on line %d
NULL
string(%s) "DateInterval::__construct(): Unknown or bad format (blah)"
-16
View File
@@ -1,16 +0,0 @@
--TEST--
Bug #62561 Unixtimestamp may take on local times DST flag (this test will only be valid during EDT)
--FILE--
<?php
$tz = new DateTimeZone('America/New_York');
$ts = new DateTime('@1341115200', $tz);
$int = new DateInterval('P1D');
$dayFromTs = new DateTime('@1341115200', new DateTimeZone('America/New_York'));
$dayFromTs->add($int);
echo 'ts: '.$ts->format('Y-m-d H:i:s')."\n";
echo 'day from ts: '.$dayFromTs->format('Y-m-d H:i:s')."\n";
?>
--EXPECT--
ts: 2012-07-01 04:00:00
day from ts: 2012-07-02 04:00:00
-36
View File
@@ -1,36 +0,0 @@
--TEST--
Bug #62852 (Unserialize invalid DateTime causes crash)
--INI--
date.timezone=GMT
--XFAIL--
bug is not fixed yet
--FILE--
<?php
$s1 = 'O:8:"DateTime":3:{s:4:"date";s:20:"10007-06-07 03:51:49";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}';
$s2 = 'O:3:"Foo":3:{s:4:"date";s:20:"10007-06-07 03:51:49";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}';
global $foo;
class Foo extends DateTime {
function __wakeup() {
global $foo;
$foo = $this;
parent::__wakeup();
}
}
// Old test case
try {
unserialize( $s1 );
} catch ( Exception $e ) {}
// My test case
try {
unserialize( $s2 );
} catch ( Exception $e ) {}
var_dump( $foo );
echo "okey";
?>
--EXPECTF--
okey
-40
View File
@@ -1,40 +0,0 @@
--TEST--
Bug #62896 Unixtimestamp may take on local times DST flag (this test will only be valid during CEST)
--FILE--
<?php
$tz = new DateTimeZone('Europe/Berlin');
echo "FROM TIMESTAMP, NO TZ:\n";
$date = new DateTime('@'.strtotime('2012-08-22 00:00:00 CEST'));
echo $date->format('Y-m-d H:i:s T').' (offset '.$date->getOffset().")\n";
$date->modify('+0 days');
echo $date->format('Y-m-d H:i:s T').' (offset '.$date->getOffset().")\n";
echo "FROM TIMESTAMP, WITH TZ:\n";
$date = new DateTime('@'.strtotime('2012-08-22 00:00:00 CEST'));
$date->setTimezone($tz);
echo $date->format('Y-m-d H:i:s T').' (offset '.$date->getOffset().")\n";
$date->modify('+0 days');
echo $date->format('Y-m-d H:i:s T').' (offset '.$date->getOffset().")\n";
echo "FROM STRING:\n";
$date = new DateTime('2012-08-22 00:00:00 CEST', $tz);
echo $date->format('Y-m-d H:i:s T').' (offset '.$date->getOffset().")\n";
$date->modify('+0 days');
echo $date->format('Y-m-d H:i:s T').' (offset '.$date->getOffset().")\n";
--EXPECT--
FROM TIMESTAMP, NO TZ:
2012-08-21 22:00:00 GMT+0000 (offset 0)
2012-08-21 22:00:00 GMT+0000 (offset 0)
FROM TIMESTAMP, WITH TZ:
2012-08-22 00:00:00 CEST (offset 7200)
2012-08-22 00:00:00 CEST (offset 7200)
FROM STRING:
2012-08-22 00:00:00 CEST (offset 7200)
2012-08-22 00:00:00 CEST (offset 7200)
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2012 The PHP Group |
| Copyright (c) 1997-2010 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2012 The PHP Group |
| Copyright (c) 1997-2010 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2012 The PHP Group |
| Copyright (c) 1997-2010 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2012 The PHP Group |
| Copyright (c) 1997-2010 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2012 The PHP Group |
| Copyright (c) 1997-2010 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2012 The PHP Group |
| Copyright (c) 1997-2010 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2012 The PHP Group |
| Copyright (c) 1997-2010 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2012 The PHP Group |
| Copyright (c) 1997-2010 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2012 The PHP Group |
| Copyright (c) 1997-2010 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2012 The PHP Group |
| Copyright (c) 1997-2010 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
-4
View File
@@ -205,11 +205,7 @@ int dom_documenttype_internal_subset_read(dom_object *obj, zval **retval TSRMLS_
if (buff != NULL) {
xmlNodeDumpOutput (buff, NULL, (xmlNodePtr) intsubset, 0, 0, NULL);
xmlOutputBufferFlush(buff);
#ifdef LIBXML2_NEW_BUFFER
ZVAL_STRINGL(*retval, xmlOutputBufferGetContent(buff), xmlOutputBufferGetSize(buff), 1);
#else
ZVAL_STRINGL(*retval, buff->buffer->content, buff->buffer->use, 1);
#endif
(void)xmlOutputBufferClose(buff);
return SUCCESS;
}
+1 -1
View File
@@ -29,7 +29,7 @@
/* {{{ arginfo */
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_domerrorhandler_handle_error, 0, 0, 1)
ZEND_ARG_OBJ_INFO(0, error, DOMDomError, 0)
ZEND_ARG_OBJ_INFO(0, error, DOMError, 0)
ZEND_END_ARG_INFO();
/* }}} */
+2 -2
View File
@@ -832,7 +832,7 @@ PHP_FUNCTION(dom_element_set_attribute_ns)
}
if (errorcode == 0 && is_xmlns == 0) {
xmlSetNsProp(elemp, nsptr, (xmlChar *)localname, (xmlChar *)value);
attr = xmlSetNsProp(elemp, nsptr, (xmlChar *)localname, (xmlChar *)value);
}
} else {
name_valid = xmlValidateName((xmlChar *) localname, 0);
@@ -844,7 +844,7 @@ PHP_FUNCTION(dom_element_set_attribute_ns)
if (attr != NULL && attr->type != XML_ATTRIBUTE_DECL) {
node_list_unlink(attr->children TSRMLS_CC);
}
xmlSetProp(elemp, (xmlChar *)localname, (xmlChar *)value);
attr = xmlSetProp(elemp, (xmlChar *)localname, (xmlChar *)value);
}
}
}
-8
View File
@@ -1895,17 +1895,9 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
RETVAL_FALSE;
} else {
if (mode == 0) {
#ifdef LIBXML2_NEW_BUFFER
ret = xmlOutputBufferGetSize(buf);
#else
ret = buf->buffer->use;
#endif
if (ret > 0) {
#ifdef LIBXML2_NEW_BUFFER
RETVAL_STRINGL((char *) xmlOutputBufferGetContent(buf), ret, 1);
#else
RETVAL_STRINGL((char *) buf->buffer->content, ret, 1);
#endif
} else {
RETVAL_EMPTY_STRING();
}
+1 -8
View File
@@ -216,7 +216,7 @@ static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs,
if (Z_TYPE(handler) == IS_STRING) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call handler %s()", Z_STRVAL_P(&handler));
}
/* retval is == NULL, when an exception occurred, don't report anything, because PHP itself will handle that */
/* retval is == NULL, when an exception occured, don't report anything, because PHP itself will handle that */
} else if (retval == NULL) {
} else {
if (retval->type == IS_OBJECT && instanceof_function( Z_OBJCE_P(retval), dom_node_class_entry TSRMLS_CC)) {
@@ -321,7 +321,6 @@ int dom_xpath_document_read(dom_object *obj, zval **retval TSRMLS_DC)
xmlDoc *docp = NULL;
xmlXPathContextPtr ctx;
int ret;
zval *tmp;
ctx = (xmlXPathContextPtr) obj->ptr;
@@ -330,16 +329,10 @@ int dom_xpath_document_read(dom_object *obj, zval **retval TSRMLS_DC)
}
ALLOC_ZVAL(*retval);
tmp = *retval;
if (NULL == (*retval = php_dom_create_object((xmlNodePtr) docp, &ret, *retval, obj TSRMLS_CC))) {
FREE_ZVAL(tmp);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object");
return FAILURE;
}
if (tmp != *retval) {
FREE_ZVAL(tmp);
}
return SUCCESS;
}
/* }}} */
+2 -1
View File
@@ -730,7 +730,6 @@ PHP_FUNCTION(enchant_dict_quick_check)
if (sugg) {
zval_dtor(sugg);
array_init(sugg);
}
PHP_ENCHANT_GET_DICT;
@@ -744,6 +743,8 @@ PHP_FUNCTION(enchant_dict_quick_check)
RETURN_FALSE;
}
array_init(sugg);
suggs = enchant_dict_suggest(pdict->pdict, word, wordlen, &n_sugg_st);
memcpy(&n_sugg, &n_sugg_st, sizeof(n_sugg));
if (suggs && n_sugg) {
+1 -5
View File
@@ -3254,7 +3254,7 @@ static void exif_process_APP12(image_info_type *ImageInfo, char *buffer, size_t
if ((l1 = php_strnlen(buffer+2, length-2)) > 0) {
exif_iif_add_tag(ImageInfo, SECTION_APP12, "Company", TAG_NONE, TAG_FMT_STRING, l1, buffer+2 TSRMLS_CC);
if (length > 2+l1+1) {
l2 = php_strnlen(buffer+2+l1+1, length-2-l1-1);
l2 = php_strnlen(buffer+2+l1+1, length-2-l1+1);
exif_iif_add_tag(ImageInfo, SECTION_APP12, "Info", TAG_NONE, TAG_FMT_STRING, l2, buffer+2+l1+1 TSRMLS_CC);
}
}
@@ -3404,10 +3404,6 @@ static int exif_scan_JPEG_header(image_info_type *ImageInfo TSRMLS_DC)
case M_SOF13:
case M_SOF14:
case M_SOF15:
if ((itemlen - 2) < 6) {
return FALSE;
}
exif_process_SOFn(Data, marker, &sof_info);
ImageInfo->Width = sof_info.width;
ImageInfo->Height = sof_info.height;
+1 -1
View File
@@ -12,7 +12,7 @@ var_dump(exif_read_data($infile));
?>
===DONE===
--EXPECTF--
Warning: exif_read_data(bug60150.jpg): Process tag(x9003=DateTimeOri): Illegal pointer offset(%s) in %s on line %d
Warning: exif_read_data(bug60150.jpg): Process tag(x9003=DateTimeOri): Illegal pointer offset(x%x + x%x = x%x > x%x) in %s on line %d
Warning: exif_read_data(bug60150.jpg): Error reading from file: got=x%x(=%d) != itemlen-%d=x%x(=%d) in %s on line %d
+1 -1
View File
@@ -270,7 +270,7 @@ ZEND_GET_MODULE(fileinfo)
PHP_MINFO_FUNCTION(fileinfo)
{
php_info_print_table_start();
php_info_print_table_row(2, "fileinfo support", "enabled");
php_info_print_table_header(2, "fileinfo support", "enabled");
php_info_print_table_row(2, "version", PHP_FILEINFO_VERSION);
php_info_print_table_end();
}
+122 -145
View File
@@ -1,6 +1,6 @@
diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
--- libmagic.origin/apprentice.c 2012-09-11 11:09:26.000000000 +0800
+++ libmagic/apprentice.c 2012-09-11 11:36:51.000000000 +0800
diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
--- libmagic.orig/apprentice.c 2012-04-22 19:30:43.182305355 +0800
+++ libmagic/apprentice.c 2012-04-22 19:28:57.346309536 +0800
@@ -29,6 +29,8 @@
* apprentice - make one pass through /etc/magic, learning its secrets.
*/
@@ -271,9 +271,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
+ size_t lineno = 0;
+
+ php_stream *stream;
- FILE *f = fopen(ms->file = fn, "r");
- if (f == NULL) {
+
+ TSRMLS_FETCH();
+
+#if PHP_API_VERSION < 20100412
@@ -281,7 +279,9 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
+#else
+ stream = php_stream_open_wrapper((char *)fn, "rb", REPORT_ERRORS, NULL);
+#endif
+
- FILE *f = fopen(ms->file = fn, "r");
- if (f == NULL) {
+ if (stream == NULL) {
if (errno != ENOENT)
file_error(ms, errno, "cannot read magic file `%s'",
@@ -312,18 +312,14 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
}
/*
@@ -754,23 +753,19 @@
apprentice_load(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp,
const char *fn, int action)
{
- int errs = 0;
+ int errs = 0;
@@ -757,20 +756,16 @@
int errs = 0;
struct magic_entry *marray;
uint32_t marraycount, i, mentrycount = 0, starttest;
- size_t slen, files = 0, maxfiles = 0;
- char **filearr = NULL, *mfn;
+ size_t files = 0, maxfiles = 0;
+ char **filearr = NULL;
+ char **filearr = NULL, mfn[MAXPATHLEN];
struct stat st;
DIR *dir;
struct dirent *d;
@@ -341,7 +337,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
marraycount = 0;
/* print silly verbose header for USG compat. */
@@ -778,14 +773,18 @@
@@ -778,14 +773,16 @@
(void)fprintf(stderr, "%s\n", usg_hdr);
/* load directory or file */
@@ -349,8 +345,6 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
+ /* FIXME: Read file names and sort them to prevent
+ non-determinism. See Debian bug #488562. */
+ if (php_sys_stat(fn, &st) == 0 && S_ISDIR(st.st_mode)) {
+ int mflen;
+ char mfn[MAXPATHLEN];
dir = opendir(fn);
if (!dir) {
errs++;
@@ -358,11 +352,11 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
}
while ((d = readdir(dir)) != NULL) {
- if (asprintf(&mfn, "%s/%s", fn, d->d_name) < 0) {
+ if ((mflen = snprintf(mfn, sizeof(mfn), "%s/%s", fn, d->d_name)) < 0) {
+ if (snprintf(mfn, sizeof(mfn), "%s/%s", fn, d->d_name) < 0) {
file_oomem(ms,
strlen(fn) + strlen(d->d_name) + 2);
errs++;
@@ -793,7 +792,6 @@
@@ -793,7 +790,6 @@
goto out;
}
if (stat(mfn, &st) == -1 || !S_ISREG(st.st_mode)) {
@@ -370,7 +364,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
continue;
}
if (files >= maxfiles) {
@@ -803,20 +801,19 @@
@@ -803,7 +799,6 @@
if ((filearr = CAST(char **,
realloc(filearr, mlen))) == NULL) {
file_oomem(ms, mlen);
@@ -378,22 +372,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
closedir(dir);
errs++;
goto out;
}
}
- filearr[files++] = mfn;
+ filearr[files++] = estrndup(mfn, (mflen > sizeof(mfn) - 1)? sizeof(mfn) - 1: mflen);
}
closedir(dir);
qsort(filearr, files, sizeof(*filearr), cmpstrp);
for (i = 0; i < files; i++) {
load_1(ms, action, filearr[i], &errs, &marray,
&marraycount);
- free(filearr[i]);
+ efree(filearr[i]);
}
free(filearr);
} else
@@ -882,12 +879,7 @@
@@ -882,12 +877,7 @@
for (i = 0; i < marraycount; i++)
mentrycount += marray[i].cont_count;
@@ -407,31 +386,18 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
mentrycount = 0;
for (i = 0; i < marraycount; i++) {
@@ -896,9 +888,14 @@
mentrycount += marray[i].cont_count;
@@ -897,8 +887,8 @@
}
out:
- for (i = 0; i < marraycount; i++)
for (i = 0; i < marraycount; i++)
- free(marray[i].mp);
- free(marray);
+ for (i = 0; i < marraycount; i++) {
+ if (marray[i].mp) {
+ efree(marray[i].mp);
+ }
+ }
+ if (marray) {
+ efree(marray);
+ }
+ efree(marray[i].mp);
+ efree(marray);
if (errs) {
*magicp = NULL;
*nmagicp = 0;
@@ -1175,14 +1172,13 @@
return -1;
}
me = &(*mentryp)[*nmentryp - 1];
+ if (me->mp == NULL) {
+ return -1;
+ }
@@ -1178,11 +1168,7 @@
if (me->cont_count == me->max_count) {
struct magic *nm;
size_t cnt = me->max_count + ALLOC_CHUNK;
@@ -444,7 +410,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
me->mp = m = nm;
me->max_count = CAST(uint32_t, cnt);
}
@@ -1194,23 +1190,13 @@
@@ -1194,23 +1180,13 @@
struct magic_entry *mp;
maxmagic += ALLOC_INCR;
@@ -471,18 +437,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
me->mp = m;
me->max_count = ALLOC_CHUNK;
} else
@@ -1353,6 +1339,10 @@
if (m->type == FILE_INVALID) {
if (ms->flags & MAGIC_CHECK)
file_magwarn(ms, "type `%s' invalid", l);
+ if (me->mp) {
+ efree(me->mp);
+ me->mp = NULL;
+ }
return -1;
}
@@ -1361,7 +1351,7 @@
@@ -1361,7 +1337,7 @@
m->mask_op = 0;
if (*l == '~') {
@@ -491,7 +446,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
m->mask_op |= FILE_OPINVERSE;
else if (ms->flags & MAGIC_CHECK)
file_magwarn(ms, "'~' invalid for string types");
@@ -1370,7 +1360,7 @@
@@ -1370,7 +1346,7 @@
m->str_range = 0;
m->str_flags = m->type == FILE_PSTRING ? PSTRING_1_LE : 0;
if ((op = get_op(*l)) != -1) {
@@ -500,7 +455,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
uint64_t val;
++l;
m->mask_op |= op;
@@ -1558,11 +1548,6 @@
@@ -1558,11 +1534,6 @@
if (check_format(ms, m) == -1)
return -1;
}
@@ -512,7 +467,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
m->mimetype[0] = '\0'; /* initialise MIME type to none */
if (m->cont_level == 0)
++(*nmentryp); /* make room for next */
@@ -2195,56 +2180,69 @@
@@ -2195,56 +2166,68 @@
/*
* handle a compiled file.
@@ -587,7 +542,6 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
+ mm = emalloc((size_t)st.sb.st_size);
+ if (php_stream_read(stream, mm, (size_t)st.sb.st_size) != (size_t)st.sb.st_size) {
file_badread(ms);
+ ret = 1;
goto error1;
}
-#define RET 1
@@ -605,7 +559,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
ptr = (uint32_t *)(void *)*magicp;
if (*ptr != MAGICNO) {
if (swap4(*ptr) != MAGICNO) {
@@ -2259,35 +2257,55 @@
@@ -2259,35 +2242,55 @@
else
version = ptr[1];
if (version != VERSIONNO) {
@@ -677,7 +631,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
return -1;
}
@@ -2301,42 +2319,49 @@
@@ -2301,42 +2304,49 @@
apprentice_compile(struct magic_set *ms, struct magic **magicp,
uint32_t *nmagicp, const char *fn)
{
@@ -685,10 +639,10 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
char *dbname;
int rv = -1;
+ php_stream *stream;
+
+ TSRMLS_FETCH();
- dbname = mkdbname(ms, fn, 1);
+ TSRMLS_FETCH();
+
+ dbname = mkdbname(ms, fn, 0);
if (dbname == NULL)
@@ -738,7 +692,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
return rv;
}
@@ -2349,6 +2374,7 @@
@@ -2349,6 +2359,7 @@
{
const char *p, *q;
char *buf;
@@ -746,7 +700,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
if (strip) {
if ((p = strrchr(fn, '/')) != NULL)
@@ -2370,14 +2396,14 @@
@@ -2370,14 +2381,14 @@
q++;
/* Compatibility with old code that looked in .mime */
if (ms->flags & MAGIC_MIME) {
@@ -765,7 +719,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
/* Compatibility with old code that looked in .mime */
if (strstr(p, ".mime") != NULL)
@@ -2467,7 +2493,7 @@
@@ -2467,7 +2478,7 @@
m->offset = swap4((uint32_t)m->offset);
m->in_offset = swap4((uint32_t)m->in_offset);
m->lineno = swap4((uint32_t)m->lineno);
@@ -774,9 +728,9 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
m->str_range = swap4(m->str_range);
m->str_flags = swap4(m->str_flags);
}
diff -u libmagic.origin/ascmagic.c libmagic/ascmagic.c
--- libmagic.origin/ascmagic.c 2012-09-11 11:09:26.000000000 +0800
+++ libmagic/ascmagic.c 2012-09-11 11:33:55.000000000 +0800
diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
--- libmagic.orig/ascmagic.c 2012-04-22 19:30:43.182305355 +0800
+++ libmagic/ascmagic.c 2012-04-22 19:28:57.330309533 +0800
@@ -139,10 +139,8 @@
/* malloc size is a conservative overestimate; could be
improved, or at least realloced after conversion. */
@@ -800,9 +754,9 @@ diff -u libmagic.origin/ascmagic.c libmagic/ascmagic.c
return rv;
}
diff -u libmagic.origin/cdf.c libmagic/cdf.c
--- libmagic.origin/cdf.c 2012-09-11 11:09:26.000000000 +0800
+++ libmagic/cdf.c 2012-09-11 11:33:55.000000000 +0800
diff -u libmagic.orig/cdf.c libmagic/cdf.c
--- libmagic.orig/cdf.c 2012-04-22 19:30:43.182305355 +0800
+++ libmagic/cdf.c 2012-04-22 19:28:57.370309531 +0800
@@ -43,7 +43,17 @@
#include <err.h>
#endif
@@ -864,9 +818,9 @@ diff -u libmagic.origin/cdf.c libmagic/cdf.c
cdf_print_elapsed_time(buf, sizeof(buf), tp);
(void)fprintf(stderr, "timestamp %s\n", buf);
} else {
diff -u libmagic.origin/cdf.h libmagic/cdf.h
--- libmagic.origin/cdf.h 2012-09-11 11:09:26.000000000 +0800
+++ libmagic/cdf.h 2012-09-11 11:33:55.000000000 +0800
diff -u libmagic.orig/cdf.h libmagic/cdf.h
--- libmagic.orig/cdf.h 2012-04-22 19:30:43.182305355 +0800
+++ libmagic/cdf.h 2012-04-22 19:28:57.370309531 +0800
@@ -35,7 +35,7 @@
#ifndef _H_CDF_
#define _H_CDF_
@@ -902,9 +856,9 @@ diff -u libmagic.origin/cdf.h libmagic/cdf.h
int cdf_read_header(const cdf_info_t *, cdf_header_t *);
void cdf_swap_header(cdf_header_t *);
void cdf_unpack_header(cdf_header_t *, char *);
diff -u libmagic.origin/cdf_time.c libmagic/cdf_time.c
--- libmagic.origin/cdf_time.c 2012-09-11 11:09:26.000000000 +0800
+++ libmagic/cdf_time.c 2012-09-11 11:33:55.000000000 +0800
diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
--- libmagic.orig/cdf_time.c 2012-04-22 19:30:43.182305355 +0800
+++ libmagic/cdf_time.c 2012-04-22 19:28:57.326309537 +0800
@@ -96,7 +96,7 @@
}
@@ -961,9 +915,9 @@ diff -u libmagic.origin/cdf_time.c libmagic/cdf_time.c
static const cdf_timestamp_t tst = 0x01A5E403C2D59C00ULL;
static const char *ref = "Sat Apr 23 01:30:00 1977";
char *p, *q;
diff -u libmagic.origin/compress.c libmagic/compress.c
--- libmagic.origin/compress.c 2012-09-11 11:09:26.000000000 +0800
+++ libmagic/compress.c 2012-09-11 11:33:55.000000000 +0800
diff -u libmagic.orig/compress.c libmagic/compress.c
--- libmagic.orig/compress.c 2012-04-22 19:30:43.182305355 +0800
+++ libmagic/compress.c 2012-04-22 19:28:57.314309548 +0800
@@ -32,6 +32,7 @@
* uncompress(method, old, n, newch) - uncompress old into new,
* using method, return sizeof new
@@ -1124,10 +1078,9 @@ diff -u libmagic.origin/compress.c libmagic/compress.c
}
-#endif
+#endif /* if PHP_FILEINFO_UNCOMPRESS */
Only in libmagic: diff
diff -u libmagic.origin/file.h libmagic/file.h
--- libmagic.origin/file.h 2012-09-11 11:09:26.000000000 +0800
+++ libmagic/file.h 2012-09-11 11:33:55.000000000 +0800
diff -u libmagic.orig/file.h libmagic/file.h
--- libmagic.orig/file.h 2012-04-22 19:30:43.186305188 +0800
+++ libmagic/file.h 2012-04-22 19:49:58.922256776 +0800
@@ -33,11 +33,9 @@
#ifndef __file_h__
#define __file_h__
@@ -1298,9 +1251,9 @@ diff -u libmagic.origin/file.h libmagic/file.h
+#endif
+
#endif /* __file_h__ */
diff -u libmagic.origin/fsmagic.c libmagic/fsmagic.c
--- libmagic.origin/fsmagic.c 2012-09-11 11:09:26.000000000 +0800
+++ libmagic/fsmagic.c 2012-09-11 11:33:55.000000000 +0800
diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
--- libmagic.orig/fsmagic.c 2012-04-22 19:30:43.186305188 +0800
+++ libmagic/fsmagic.c 2012-04-22 19:28:57.298309521 +0800
@@ -59,27 +59,21 @@
# define minor(dev) ((dev) & 0xff)
#endif
@@ -1511,10 +1464,10 @@ diff -u libmagic.origin/fsmagic.c libmagic/fsmagic.c
-#else
- if (file_printf(ms, "block special") == -1)
- return -1;
-#endif
#endif
- }
- return 1;
#endif
-#endif
- /* TODO add code to handle V7 MUX and Blit MUX files */
+
#ifdef S_IFIFO
@@ -1623,9 +1576,9 @@ diff -u libmagic.origin/fsmagic.c libmagic/fsmagic.c
}
/*
diff -u libmagic.origin/funcs.c libmagic/funcs.c
--- libmagic.origin/funcs.c 2012-09-11 11:09:26.000000000 +0800
+++ libmagic/funcs.c 2012-09-11 11:33:55.000000000 +0800
diff -u libmagic.orig/funcs.c libmagic/funcs.c
--- libmagic.orig/funcs.c 2012-04-22 19:30:43.186305188 +0800
+++ libmagic/funcs.c 2012-04-22 19:28:57.370309531 +0800
@@ -41,52 +41,42 @@
#if defined(HAVE_WCTYPE_H)
#include <wctype.h>
@@ -1919,9 +1872,11 @@ diff -u libmagic.origin/funcs.c libmagic/funcs.c
+ return rep_cnt;
}
+
diff -u libmagic.origin/magic.c libmagic/magic.c
--- libmagic.origin/magic.c 2012-09-11 11:09:26.000000000 +0800
+++ libmagic/magic.c 2012-09-11 11:33:55.000000000 +0800
Only in libmagic.orig: funcs.c.orig
Only in libmagic.orig: funcs.c.rej
diff -u libmagic.orig/magic.c libmagic/magic.c
--- libmagic.orig/magic.c 2012-04-22 19:30:43.186305188 +0800
+++ libmagic/magic.c 2012-04-22 19:28:57.370309531 +0800
@@ -25,11 +25,6 @@
* SUCH DAMAGE.
*/
@@ -2297,9 +2252,9 @@ diff -u libmagic.origin/magic.c libmagic/magic.c
public const char *
magic_error(struct magic_set *ms)
diff -u libmagic.origin/magic.h libmagic/magic.h
--- libmagic.origin/magic.h 2012-09-11 11:09:26.000000000 +0800
+++ libmagic/magic.h 2012-09-11 11:33:55.000000000 +0800
diff -u libmagic.orig/magic.h libmagic/magic.h
--- libmagic.orig/magic.h 2012-04-22 19:30:43.190305058 +0800
+++ libmagic/magic.h 2012-04-22 19:28:57.326309537 +0800
@@ -85,6 +85,7 @@
const char *magic_getpath(const char *, int);
@@ -2316,20 +2271,20 @@ diff -u libmagic.origin/magic.h libmagic/magic.h
int magic_list(magic_t, const char *);
int magic_errno(magic_t);
diff -u libmagic.origin/print.c libmagic/print.c
--- libmagic.origin/print.c 2012-09-11 11:09:26.000000000 +0800
+++ libmagic/print.c 2012-09-11 11:33:55.000000000 +0800
diff -u libmagic.orig/print.c libmagic/print.c
--- libmagic.orig/print.c 2012-04-22 19:30:43.190305058 +0800
+++ libmagic/print.c 2012-04-22 19:28:57.326309537 +0800
@@ -29,6 +29,9 @@
* print.c - debugging printout routines
*/
+#define _GNU_SOURCE
+#include "php.h"
+#include "main/snprintf.h"
+
#include "file.h"
#ifndef lint
@@ -46,174 +49,21 @@
@@ -45,174 +48,21 @@
#define SZOF(a) (sizeof(a) / sizeof(a[0]))
@@ -2511,9 +2466,9 @@ diff -u libmagic.origin/print.c libmagic/print.c
}
protected const char *
diff -u libmagic.origin/readcdf.c libmagic/readcdf.c
--- libmagic.origin/readcdf.c 2012-09-11 11:09:26.000000000 +0800
+++ libmagic/readcdf.c 2012-09-11 11:33:55.000000000 +0800
diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
--- libmagic.orig/readcdf.c 2012-04-22 19:30:43.190305058 +0800
+++ libmagic/readcdf.c 2012-04-22 19:28:57.326309537 +0800
@@ -30,7 +30,11 @@
#endif
@@ -2559,9 +2514,9 @@ diff -u libmagic.origin/readcdf.c libmagic/readcdf.c
c = cdf_ctime(&ts.tv_sec);
if ((ec = strchr(c, '\n')) != NULL)
*ec = '\0';
diff -u libmagic.origin/readelf.c libmagic/readelf.c
--- libmagic.origin/readelf.c 2012-09-11 11:09:26.000000000 +0800
+++ libmagic/readelf.c 2012-09-11 11:33:55.000000000 +0800
diff -u libmagic.orig/readelf.c libmagic/readelf.c
--- libmagic.orig/readelf.c 2012-04-22 19:30:43.190305058 +0800
+++ libmagic/readelf.c 2012-04-22 19:28:57.378309534 +0800
@@ -49,7 +49,7 @@
off_t, int *, int);
private int doshn(struct magic_set *, int, int, int, off_t, int, size_t,
@@ -2716,9 +2671,9 @@ diff -u libmagic.origin/readelf.c libmagic/readelf.c
fd = file_pipe2file(ms, fd, buf, nbytes);
if (fstat(fd, &st) == -1) {
diff -u libmagic.origin/softmagic.c libmagic/softmagic.c
--- libmagic.origin/softmagic.c 2012-09-11 11:09:26.000000000 +0800
+++ libmagic/softmagic.c 2012-09-11 11:33:55.000000000 +0800
diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
--- libmagic.orig/softmagic.c 2012-04-22 19:30:43.194304945 +0800
+++ libmagic/softmagic.c 2012-04-22 19:28:57.286309597 +0800
@@ -41,6 +41,11 @@
#include <stdlib.h>
#include <time.h>
@@ -2905,7 +2860,7 @@ diff -u libmagic.origin/softmagic.c libmagic/softmagic.c
}
}
@@ -1669,6 +1642,42 @@
@@ -1669,6 +1642,65 @@
return file_strncmp(a, b, len, flags);
}
@@ -2921,6 +2876,29 @@ diff -u libmagic.origin/softmagic.c libmagic/softmagic.c
+
+ for (i=0; i<Z_STRLEN_P(pattern); i++, j++) {
+ switch (Z_STRVAL_P(pattern)[i]) {
+ case '?':
+ t[j] = '.';
+ break;
+ case '*':
+ t[j++] = '.';
+ t[j] = '*';
+ break;
+ case '.':
+ t[j++] = '\\';
+ t[j] = '.';
+ break;
+ case '\\':
+ t[j++] = '\\';
+ t[j] = '\\';
+ break;
+ case '(':
+ t[j++] = '\\';
+ t[j] = '(';
+ break;
+ case ')':
+ t[j++] = '\\';
+ t[j] = ')';
+ break;
+ case '~':
+ t[j++] = '\\';
+ t[j] = '~';
@@ -2948,7 +2926,7 @@ diff -u libmagic.origin/softmagic.c libmagic/softmagic.c
private int
magiccheck(struct magic_set *ms, struct magic *m)
{
@@ -1825,67 +1834,163 @@
@@ -1825,67 +1857,163 @@
break;
}
case FILE_REGEX: {
@@ -2959,23 +2937,6 @@ diff -u libmagic.origin/softmagic.c libmagic/softmagic.c
- if (ms->search.s == NULL)
- return 0;
-
- l = 0;
- rc = regcomp(&rx, m->value.s,
- REG_EXTENDED|REG_NEWLINE|
- ((m->str_flags & STRING_IGNORE_CASE) ? REG_ICASE : 0));
- if (rc) {
- (void)regerror(rc, &rx, errmsg, sizeof(errmsg));
- file_magerror(ms, "regex error %d, (%s)",
- rc, errmsg);
- v = (uint64_t)-1;
- }
- else {
- regmatch_t pmatch[1];
-#ifndef REG_STARTEND
-#define REG_STARTEND 0
- size_t l = ms->search.s_len - 1;
- char c = ms->search.s[l];
- ((char *)(intptr_t)ms->search.s)[l] = '\0';
+ zval *pattern;
+ int options = 0;
+ pcre_cache_entry *pce;
@@ -2992,7 +2953,23 @@ diff -u libmagic.origin/softmagic.c libmagic/softmagic.c
+
+ convert_libmagic_pattern(pattern, options);
+
+ l = v = 0;
l = 0;
- rc = regcomp(&rx, m->value.s,
- REG_EXTENDED|REG_NEWLINE|
- ((m->str_flags & STRING_IGNORE_CASE) ? REG_ICASE : 0));
- if (rc) {
- (void)regerror(rc, &rx, errmsg, sizeof(errmsg));
- file_magerror(ms, "regex error %d, (%s)",
- rc, errmsg);
- v = (uint64_t)-1;
- }
- else {
- regmatch_t pmatch[1];
-#ifndef REG_STARTEND
-#define REG_STARTEND 0
- size_t l = ms->search.s_len - 1;
- char c = ms->search.s[l];
- ((char *)(intptr_t)ms->search.s)[l] = '\0';
+#if (PHP_MAJOR_VERSION < 6)
+ if ((pce = pcre_get_compiled_regex_cache(Z_STRVAL_P(pattern), Z_STRLEN_P(pattern) TSRMLS_CC)) == NULL) {
#else
+8 -23
View File
@@ -753,11 +753,11 @@ private int
apprentice_load(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp,
const char *fn, int action)
{
int errs = 0;
int errs = 0;
struct magic_entry *marray;
uint32_t marraycount, i, mentrycount = 0, starttest;
size_t files = 0, maxfiles = 0;
char **filearr = NULL;
char **filearr = NULL, mfn[MAXPATHLEN];
struct stat st;
DIR *dir;
struct dirent *d;
@@ -776,15 +776,13 @@ apprentice_load(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp,
/* FIXME: Read file names and sort them to prevent
non-determinism. See Debian bug #488562. */
if (php_sys_stat(fn, &st) == 0 && S_ISDIR(st.st_mode)) {
int mflen;
char mfn[MAXPATHLEN];
dir = opendir(fn);
if (!dir) {
errs++;
goto out;
}
while ((d = readdir(dir)) != NULL) {
if ((mflen = snprintf(mfn, sizeof(mfn), "%s/%s", fn, d->d_name)) < 0) {
if (snprintf(mfn, sizeof(mfn), "%s/%s", fn, d->d_name) < 0) {
file_oomem(ms,
strlen(fn) + strlen(d->d_name) + 2);
errs++;
@@ -806,14 +804,14 @@ apprentice_load(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp,
goto out;
}
}
filearr[files++] = estrndup(mfn, (mflen > sizeof(mfn) - 1)? sizeof(mfn) - 1: mflen);
filearr[files++] = mfn;
}
closedir(dir);
qsort(filearr, files, sizeof(*filearr), cmpstrp);
for (i = 0; i < files; i++) {
load_1(ms, action, filearr[i], &errs, &marray,
&marraycount);
efree(filearr[i]);
free(filearr[i]);
}
free(filearr);
} else
@@ -888,14 +886,9 @@ apprentice_load(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp,
mentrycount += marray[i].cont_count;
}
out:
for (i = 0; i < marraycount; i++) {
if (marray[i].mp) {
efree(marray[i].mp);
}
}
if (marray) {
efree(marray);
}
for (i = 0; i < marraycount; i++)
efree(marray[i].mp);
efree(marray);
if (errs) {
*magicp = NULL;
*nmagicp = 0;
@@ -1172,9 +1165,6 @@ parse(struct magic_set *ms, struct magic_entry **mentryp, uint32_t *nmentryp,
return -1;
}
me = &(*mentryp)[*nmentryp - 1];
if (me->mp == NULL) {
return -1;
}
if (me->cont_count == me->max_count) {
struct magic *nm;
size_t cnt = me->max_count + ALLOC_CHUNK;
@@ -1339,10 +1329,6 @@ parse(struct magic_set *ms, struct magic_entry **mentryp, uint32_t *nmentryp,
if (m->type == FILE_INVALID) {
if (ms->flags & MAGIC_CHECK)
file_magwarn(ms, "type `%s' invalid", l);
if (me->mp) {
efree(me->mp);
me->mp = NULL;
}
return -1;
}
@@ -2233,7 +2219,6 @@ apprentice_map(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp,
mm = emalloc((size_t)st.sb.st_size);
if (php_stream_read(stream, mm, (size_t)st.sb.st_size) != (size_t)st.sb.st_size) {
file_badread(ms);
ret = 1;
goto error1;
}
ret = 1;
+24 -1
View File
@@ -1654,6 +1654,29 @@ convert_libmagic_pattern(zval *pattern, int options)
for (i=0; i<Z_STRLEN_P(pattern); i++, j++) {
switch (Z_STRVAL_P(pattern)[i]) {
case '?':
t[j] = '.';
break;
case '*':
t[j++] = '.';
t[j] = '*';
break;
case '.':
t[j++] = '\\';
t[j] = '.';
break;
case '\\':
t[j++] = '\\';
t[j] = '\\';
break;
case '(':
t[j++] = '\\';
t[j] = '(';
break;
case ')':
t[j++] = '\\';
t[j] = ')';
break;
case '~':
t[j++] = '\\';
t[j] = '~';
@@ -1850,7 +1873,7 @@ magiccheck(struct magic_set *ms, struct magic *m)
convert_libmagic_pattern(pattern, options);
l = v = 0;
l = 0;
#if (PHP_MAJOR_VERSION < 6)
if ((pce = pcre_get_compiled_regex_cache(Z_STRVAL_P(pattern), Z_STRLEN_P(pattern) TSRMLS_CC)) == NULL) {
#else
-69
View File
@@ -1,69 +0,0 @@
--TEST--
Bug #61964 (finfo_open with directory cause invalid free)
--SKIPIF--
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
--FILE--
<?php
$magic_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'magic';
$ret = @finfo_open(FILEINFO_NONE, $magic_file . ".non-exits");
var_dump($ret);
$dir = __DIR__ . "/test-folder";
@mkdir($dir);
$magic_file_copy = $dir . "/magic.copy";
$magic_file_copy2 = $magic_file_copy . "2";
copy($magic_file, $magic_file_copy);
copy($magic_file, $magic_file_copy2);
$ret = finfo_open(FILEINFO_NONE, $dir);
var_dump($ret);
$ret = @finfo_open(FILEINFO_NONE, $dir);
var_dump($ret);
$ret = @finfo_open(FILEINFO_NONE, $dir. "/non-exits-dir");
var_dump($ret);
// write some test files to test folder
file_put_contents($dir . "/test1.txt", "string\n> Core\n> Me");
file_put_contents($dir . "/test2.txt", "a\nb\n");
@mkdir($dir . "/test-inner-folder");
finfo_open(FILEINFO_NONE, $dir);
echo "DONE: testing dir with files\n";
rmdir($dir . "/test-inner-folder");
unlink($dir . "/test1.txt");
unlink($dir . "/test2.txt");
unlink($magic_file_copy);
unlink($magic_file_copy2);
rmdir($dir);
?>
===DONE===
--EXPECTF--
bool(false)
resource(%d) of type (file_info)
resource(%d) of type (file_info)
bool(false)
Notice: finfo_open(): Warning: offset `string' invalid in %sbug61964.php on line %d
Notice: finfo_open(): Warning: offset ` Core' invalid in %sbug61964.php on line %d
Notice: finfo_open(): Warning: type `Core' invalid in %sbug61964.php on line %d
Notice: finfo_open(): Warning: offset `a' invalid in %sbug61964.php on line %d
Notice: finfo_open(): Warning: type `a' invalid in %sbug61964.php on line %d
Notice: finfo_open(): Warning: offset `b' invalid in %sbug61964.php on line %d
Notice: finfo_open(): Warning: type `b' invalid in %sbug61964.php on line %d
Warning: finfo_open(): Failed to load magic database at '%stest-folder'. in %sbug61964.php on line %d
DONE: testing dir with files
===DONE===
Loaded 100 of 713 files, more files were not shown because too many files have changed in this diff. Show more