Compare commits

..
16 Commits
Author SHA1 Message Date
Johannes Schlüter e9354b5366 PHP 5.3.13 2012-05-08 11:22:27 +02:00
Stanislav Malyshev 46d9cc3de9 improve fix for CVE-2012-1823
(cherry picked from commit fc3ba0552f)
2012-05-08 11:15:23 +02:00
Johannes Schlüter 03cb63bc1d PHP 5.3.12 2012-05-03 15:54:59 +02:00
Rasmus Lerdorf 29300b1f9d Fix for CVE-2012-1823 2012-05-03 15:51:52 +02:00
Johannes Schlüter 704bbb3263 PHP 5.3.11 2012-04-25 00:13:15 +02:00
Johannes Schlüter b9562b3085 PHP 5.3.11RC2 2012-04-12 11:28:49 +02:00
Johannes Schlüter 1b444d85e0 Update NEWS 2012-04-12 11:21:19 +02:00
Anatoliy Belsky cf98706376 Bug #61566 Fileinfo ext\fileinfo\tests\finfo_file_002.phpt fails
This patch fixes the failure caused by the
posix lseek and read versions under windows in cdf_read() .
Additionally all the occurences of lseek and read
was replaced by _lseek and _reed for windows.
2012-04-12 11:12:10 +02:00
Anatoliy Belsky 56771b8648 Fix bug #61565 Fileinfo ext\fileinfo\tests\finfo_file_001.phpt fails 2012-04-12 11:11:58 +02:00
Gustavo André dos Santos Lopes 11b5738aef Disabled EOL conversions on certain tests 2012-04-12 11:10:16 +02:00
Yasuo Ohgaki aa45b5405e Fixed bug #60718 Complie problem with libpq (PostgreSQL 7.3 or less) 2012-04-12 11:08:46 +02:00
Derick Rethans 74c92f77c1 - Updated to version 2012.3 (2012c) 2012-04-12 11:08:37 +02:00
Johannes Schlüter 7ac36ec8e5 Cherry-pick 4cc74767
Headers: forbid \r and \n also after \0, allow CRLF followed by HT or SP and forbid \0. See bug #60227.

Conflicts:

	ext/standard/tests/general_functions/bug60227.phpt
	ext/standard/tests/general_functions/bug60227_1.phpt
	ext/standard/tests/general_functions/bug60227_2.phpt
	main/SAPI.c
2012-04-12 11:08:00 +02:00
Xinchen Hui 8ccf065577 Fixed bug #61650 (ini parser crashes when using ${xxxx} ini variables (without apache2)) 2012-04-12 11:04:39 +02:00
Gustavo André dos Santos Lopes a4e6394a06 Fixed bug in new stream_get_line() when using NUL as a delimiter.
This is the issue Derick spotted a few days ago..
2012-04-12 11:04:20 +02:00
Johannes Schlüter 9ad0b878d9 PHP 5.3.11RC1 2012-03-29 11:17:41 +02:00
348 changed files with 25959 additions and 8031 deletions

No files matched your search

-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
-130
View File
@@ -1,135 +1,5 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
19 Jul 2012, PHP 5.3.15
- Zend Engine:
. Fixed bug #51094 (parse_ini_file() with INI_SCANNER_RAW cuts a value that
includes a semi-colon). (Pierrick)
- COM:
. Fixed bug #62146 com_dotnet cannot be built shared. (Johannes)
- Core:
. Fixed potential overflow in _php_stream_scandir, CVE-2012-2688. (Jason
Powell, Stas)
. Fixed bug #62432 (ReflectionMethod random corrupt memory on high
concurrent). (Johannes)
. Fixed bug #62443 (Crypt SHA256/512 Segfaults With Malformed
Salt). (Anthony Ferrara)
- Fileinfo:
. Fixed magic file regex support. (Felipe)
- FPM:
. Fixed bug #61045 (fpm don't send error log to fastcgi clients). (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'
for non-root start). (fat)
. Fixed bug #61026 (FPM pools can listen on the same address). (fat)
. Fixed bug #62033 (php-fpm exits with status 0 on some failures to start).
(fat)
. Fixed bug #62153 (when using unix sockets, multiples FPM instances
can be launched without errors). (fat)
. Fixed bug #62160 (Add process.priority to set nice(2) priorities). (fat)
. Fixed bug #61218 (FPM drops connection while receiving some binary values
in FastCGI requests). (fat)
. Fixed bug #62205 (php-fpm segfaults (null passed to strstr)). (fat)
- Intl:
. Fixed bug #62083 (grapheme_extract() memory leaks). (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:
. Reverted fix for bug #61537. (Johannes)
- Phar:
. Fixed bug #62227 (Invalid phar stream path causes crash). (Felipe)
- 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)
- SPL:
. Fixed bug #62262 (RecursiveArrayIterator does not implement Countable).
(Nikita Popov)
- SQLite:
. Fixed open_basedir bypass, CVE-2012-3365. (Johannes, reported by Yury
Maryshev)
- 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.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.
-124
View File
@@ -1,124 +0,0 @@
====================
Git Commit Rules
====================
This is the first file you should be reading when contributing code via Git.
We'll assume you're basically familiar with Git, but feel free to post
your questions on the mailing list. Please have a look at
http://git-scm.com/ for more detailed information on Git.
PHP is developed through the efforts of a large number of people.
Collaboration is a Good Thing(tm), and Git lets us do this. Thus, following
some basic rules with regards to Git usage will::
a. Make everybody happier, especially those responsible for maintaining
Git itself.
b. Keep the changes consistently well documented and easily trackable.
c. Prevent some of those 'Oops' moments.
d. Increase the general level of good will on planet Earth.
Having said that, here are the organizational rules::
1. Respect other people working on the project.
2. Discuss any significant changes on the list before committing and get
confirmation from the release manager for the given branch.
3. Look at EXTENSIONS file to see who is the primary maintainer of
the code you want to contribute to.
4. If you "strongly disagree" about something another person did, don't
start fighting publicly - take it up in private email.
5. If you don't know how to do something, ask first!
6. Test your changes before committing them. We mean it. Really.
To do so use "make test".
7. For development use the --enable-maintainer-zts switch to ensure your
code handles TSRM correctly and doesn't break for those who need that.
Currently we have the following branches in use::
master The active development branch.
PHP-5.4 Is used to release the PHP 5.4.x series. It still allows for
larger enhancements.
PHP-5.3 Is used to release the PHP 5.3.x series. This is current
stable version and is open for bugfixes only.
PHP-5.2 Is used to release the PHP 5.2.x series. It is closed for
changes now.
PHP-5.1 This branch is closed.
PHP-4.4 This branch is closed.
The next few rules are more of a technical nature::
1. All changes should first go to the lowest branch (i.e. 5.3) and then
get merged up to all other branches. If a change is not needed for
later branches (i.e. fixes for features which where dropped from later
branches) an empty merge should be done.
2. All news updates intended for public viewing, such as new features,
bug fixes, improvements, etc., should go into the NEWS file of the
*first* to be released version with the given change. In other words
any NEWS file change only needs to done in one branch.
3. Do not commit multiple file and dump all messages in one commit. If you
modified several unrelated files, commit each group separately and
provide a nice commit message for each one. See example below.
4. Do write your commit message in such a way that it makes sense even
without the corresponding diff. One should be able to look at it, and
immediately know what was modified. Definitely include the function name
in the message as shown below.
5. In your commit messages, keep each line shorter than 80 characters. And
try to align your lines vertically, if they wrap. It looks bad otherwise.
6. If you modified a function that is callable from PHP, prepend PHP to
the function name as shown below.
The format of the commit messages is pretty simple.
<max 79 characters short description>\n
\n
<long description, 79 chars per line>
\n
An Example from the git project (commit 2b34e486bc):
pack-objects: Fix compilation with NO_PTHREDS
It looks like commit 99fb6e04 (pack-objects: convert to use
parse_options(), 2012-02-01) moved the #ifdef NO_PTHREDS around but
hasn't noticed that the 'arg' variable no longer is available.
If you fix some bugs, you should note the bug ID numbers in your
commit message. Bug ID should be prefixed by "#" for easier access to
bug report when developers are browsing CVS via LXR or Bonsai.
Example::
Fixed bug #14016 (pgsql notice handler double free crash bug.)
When you change the NEWS file for a bug fix, then please keep the bugs
sorted in decreasing order under the fixed version.
You can use OpenGrok (http://lxr.php.net/) and gitweb (http://git.php.net/)
to look at PHP Git repository in various ways.
For further information on the process and further details please refer to
https://wiki.php.net/vcs/gitworkflow and https://wiki.php.net/vcs/gitfaq
Happy hacking,
PHP Team
+146
View File
@@ -0,0 +1,146 @@
====================
SVN Commit Rules
====================
This is the first file you should be reading after you get your SVN account.
We'll assume you're basically familiar with SVN, but feel free to post
your questions on the mailing list. Please have a look at
http://svnbook.red-bean.com/ for more detailed information on SVN.
PHP is developed through the efforts of a large number of people.
Collaboration is a Good Thing(tm), and SVN lets us do this. Thus, following
some basic rules with regards to SVN usage will::
a. Make everybody happier, especially those responsible for maintaining
the SVN itself.
b. Keep the changes consistently well documented and easily trackable.
c. Prevent some of those 'Oops' moments.
d. Increase the general level of good will on planet Earth.
Having said that, here are the organizational rules::
1. Respect other people working on the project.
2. Discuss any significant changes on the list before committing and get
confirmation from the release manager for the given branch.
3. Look at EXTENSIONS file to see who is the primary maintainer of
the code you want to contribute to.
4. If you "strongly disagree" about something another person did, don't
start fighting publicly - take it up in private email.
5. If you don't know how to do something, ask first!
6. Test your changes before committing them. We mean it. Really.
To do so use "make test".
7. For development use the --enable-maintainer-zts switch to ensure your
code handles TSRM correctly and doesn't break for those who need that.
Currently we have the following branches in use::
trunk Will become PHP 6.0. This CVS branch is for active development.
branches/PHP_5_3 Is used to release the PHP 5.3.x series. It still allows for
larger enhancements.
branches/PHP_5_2 Is used to release the PHP 5.2.x series. Only bugfixes are permitted
on this branch (Consult the releasemaster prior to commit).
branches/PHP_5_1 This branch is closed.
branches/PHP_4_4 This branch is closed.
The next few rules are more of a technical nature::
1. All changes should first go to trunk and then get merged from trunk
(aka MFH'ed) to all other relevant branches.
2. DO NOT TOUCH ChangeLog! It is automagically updated from the commit
messages every day. Woe be to those who attempt to mess with it.
3. All news updates intended for public viewing, such as new features,
bug fixes, improvements, etc., should go into the NEWS file of the
*first* to be released version with the given change. In other words
any NEWS file change only needs to done in one branch.
NB! Lines, starting with @ will go automagically into NEWS file, but
this is NOT recommended, though. Please, add news entries directly to
NEWS file and don't forget to keep them adjusted and sorted.
4. Do not commit multiple file and dump all messages in one commit. If you
modified several unrelated files, commit each group separately and
provide a nice commit message for each one. See example below.
5. Do write your commit message in such a way that it makes sense even
without the corresponding diff. One should be able to look at it, and
immediately know what was modified. Definitely include the function name
in the message as shown below.
6. In your commit messages, keep each line shorter than 80 characters. And
try to align your lines vertically, if they wrap. It looks bad otherwise.
7. If you modified a function that is callable from PHP, prepend PHP to
the function name as shown below.
The format of the commit messages is pretty simple.
Use a - to start a new item in your commit message.
If a line begins with #, it is taken to be a comment and will not appear
in the ChangeLog. Everything else goes into the ChangeLog.
It is important to note that if your comment or news logline spans multiple
lines, you have to put # at the beginning of **every** such line.
Example. Say you modified two files, datetime.c and string.c. In datetime.c you
added a new format option for the date() function, and in string.c you fixed a
memory leak in php_trim(). Don't commit both of these at once. Commit them
separately and try to make sure your commit messages look something like the
following.
For datetime.c::
- Added new 'K' format modifier to date() for printing out number of days
until New Year's Eve.
For string.c::
- Fixed a memory leak in php_trim() resulting from improper use of zval_dtor().
#- Man, that thing was leaking all over the place!
The # lines will be omitted from the ChangeLog automagically.
Use the [DOC] tag in your log message whenever you feel that your changes
imply a documentation modification. The php-doc team will automatically
get notified about your commit through the php-doc mailing list.
If you fix some bugs, you should note the bug ID numbers in your
commit message. Bug ID should be prefixed by "#" for easier access to
bug report when developers are browsing CVS via LXR or Bonsai.
Example::
Fixed bug #14016 (pgsql notice handler double free crash bug.)
If you don't see your messages in ChangeLog right away, don't worry!
These files are updated once a day, so your stuff will not show up until
somewhat later.
When you change the NEWS file for a bug fix, then please keep the bugs
sorted in decreasing order under the fixed version.
You can use LXR (http://lxr.php.net/) and Bonsai (http://bonsai.php.net/)
to look at PHP SVN repository in various ways.
To receive daily updates to ChangeLog and NEWS, send an empty message to
php-cvs-daily-subscribe@lists.php.net.
Happy hacking,
PHP Team
+112
View File
@@ -0,0 +1,112 @@
Using PHP 5 with the Zeus Web Server
-----------------------------------
Zeus fully supports running PHP in combination with our
webserver. There are three different interfaces that can be used to
enable PHP:
* CGI
* ISAPI
* FastCGI
Of the three, we recommend using FastCGI, which has been tested and
benchmarked as providing the best performance and reliability.
Full details of how to install PHP are available from our
website, at:
http://support.zeus.com/products/php.html
If you have any problems, please check the support site for more
up-to-date information and advice.
Quick guide to installing CGI/FastCGI with Zeus
-----------------------------------------------
Step 1 - Compile PHP as FastCGI.
Compile as follows:
./configure --enable-fastcgi
make
Note that PHP has many options to the configure script -
e.g. --with-mysql. You will probably want to select your usual options
before compiling; the above is just a bare minimum, for illustration.
After compilation finishes, you will be left with an executable
program called 'php'. Copy this into your document root, under a
dedicated FastCGI directory (e.g. $DOCROOT/fcgi-bin/php)
Step 2 - configure Zeus
Four stages:
- enable FastCGI
- configure FastCGI
- setup alias for FastCGI
- setup alias for PHP
1) Using the admin server, go to the 'module configuration' page for
your virtual server, and ensure that 'fastcgi' is enabled (select the
tickbox to the left).
2) While we can run FastCGI's locally, there are known problems with
some OS's (specifically, the communication between web server and
FastCGI happens over a unix domain socket, and some OS's have trouble
sustaining high connection rates over these sockets). So instead, we
are going to set up the PHP FastCGI to run 'remotely' over localhost
(this uses TCP sockets, which do not suffer this problem). Go to the
'fastcgi configuration' page, and under 'add remote fastcgi':
Add Remote FastCGI
Docroot path /fcgi-bin/php
Remote machine localhost:8002
The first entry is where you saved PHP, above.
The second entry is localhost:<any unused port>
We will start the FastCGI listening on this port shortly.
Click 'update' to commit these changes.
3) Go to the path mapping module and add an alias for FastCGI:
Add Alias
Docroot path /fcgi-bin
Filesystem directory /path/to/docroot/fcgi-bin
Alias type fastcgi
Click 'update' to commit these changes
4) Also on the path mapping module, add a handler for PHP:
Add handler
File extension php
Handler /fcgi-bin/php
Click 'update' to commit these changes
Finally restart your virtual server for these changes to take effect.
Step 3 - start PHP as a FastCGI runner
When you start PHP, it will pre-fork a given number of child processes
to handle incoming PHP requests. Each process will handle a given
number of requests before exiting (and being replaced by a newly
forked process). You can control these two parameters by setting the
following environment variables BEFORE starting the FastCGI runner:
PHP_FCGI_CHILDREN - the number of child processes to pre-fork. This
variable MUST be set, if not then the PHP will not run as a FastCGI.
We recommend a value of 8 for a fairly busy site. If you have many,
long-running PHP scripts, then you may need to increase this further.
PHP_FCGI_MAX_REQUESTS - the number of requests each PHP child process
handles before exiting. If not set, defaults to 500.
To start the FastCGI runner, execute '$ZEUSHOME/web/bin/fcgirunner
8002 $DOCROOT/fcgi-bin/php'. Substitute the appropriate values for
$ZEUSHOME and $DOCROOT; also substitute for 8002 the port you chose,
above.
To stop the runner (e.g. to experiment with the above environment
variables) you will need to manually stop and running PHP
processes. (Use 'ps' and 'kill'). As it is PHP which is forking lots
of children and not the runner, Zeus unfortunately cannot keep track
of what processes are running, sorry. A typical command line may look
like 'ps -efl | grep $DOCROOT/fcgi-bin/php | grep -v grep | awk
'{print $4}' | xargs kill'
-5
View File
@@ -479,11 +479,6 @@ UPGRADE NOTES - PHP 5.3
- Firebird and SNMP support are no longer available on Windows. Firebird support
may be reintroduced in the future.
- As of PHP 5.3.15 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.
=====================
11.1 New in PHP 5.3.4
=====================
+22097
View File
File diff suppressed because it is too large. Load diff
-15
View File
@@ -1,15 +0,0 @@
--TEST--
Bug #62005 (unexpected behavior when incrementally assigning to a member of a null object)
--FILE--
<?php
function add_points($player, $points) {
$player->energy += $points;
print_r($player);
}
add_points(NULL, 2);
--EXPECTF--
Strict Standards: Creating default object from empty value in %sbug62005.php on line %d
stdClass Object
(
[energy] => 2
)
+1 -1
View File
@@ -1336,7 +1336,7 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
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);
+2 -1
View File
@@ -432,10 +432,11 @@ static inline void make_real_object(zval **object_ptr TSRMLS_DC)
|| (Z_TYPE_PP(object_ptr) == IS_BOOL && Z_LVAL_PP(object_ptr) == 0)
|| (Z_TYPE_PP(object_ptr) == IS_STRING && Z_STRLEN_PP(object_ptr) == 0)
) {
zend_error(E_STRICT, "Creating default object from empty value");
SEPARATE_ZVAL_IF_NOT_REF(object_ptr);
zval_dtor(*object_ptr);
object_init(*object_ptr);
zend_error(E_STRICT, "Creating default object from empty value");
}
}
+1 -1
View File
@@ -331,7 +331,7 @@ END_EXTERN_C()
if (idx-1 > LONG_MAX) { /* overflow */ \
break; \
} \
idx = -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:37:03 2012 */
/* Generated by re2c 0.13.5 on Sat Feb 25 22:07:14 2012 */
#line 3 "Zend/zend_ini_scanner_defs.h"
enum YYCONDTYPE {
+1 -1
View File
@@ -127,7 +127,7 @@ ZEND_API zval *zend_user_it_new_iterator(zend_class_entry *ce, zval *object TSRM
}
/* }}} */
/* {{{ zend_user_it_invalidate_current */
/* {{{ zend_user_it_dtor */
ZEND_API void zend_user_it_invalidate_current(zend_object_iterator *_iter TSRMLS_DC)
{
zend_user_iterator *iter = (zend_user_iterator*)_iter;
+3 -4
View File
@@ -1575,8 +1575,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)) {
@@ -2030,13 +2029,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));
}
/* }}} */
-6
View File
@@ -2438,12 +2438,7 @@ AC_DEFUN([PHP_SETUP_ICONV], [
dnl
dnl Check libc first if no path is provided in --with-iconv
dnl
if test "$PHP_ICONV" = "yes"; then
dnl Reset LIBS temporarily as it may have already been included
dnl -liconv in.
LIBS_save="$LIBS"
LIBS=
AC_CHECK_FUNC(iconv, [
found_iconv=yes
],[
@@ -2453,7 +2448,6 @@ AC_DEFUN([PHP_SETUP_ICONV], [
found_iconv=yes
])
])
LIBS="$LIBS_save"
fi
dnl
+2 -2
View File
@@ -31,7 +31,7 @@ dnl Basic autoconf + automake initialization, generation of config.nice.
dnl -------------------------------------------------------------------------
AC_PREREQ(2.13)
AC_INIT(README.GIT-RULES)
AC_INIT(README.SVN-RULES)
PHP_CONFIG_NICE(config.nice)
@@ -41,7 +41,7 @@ AC_CONFIG_HEADER(main/php_config.h)
PHP_MAJOR_VERSION=5
PHP_MINOR_VERSION=3
PHP_RELEASE_VERSION=15
PHP_RELEASE_VERSION=13
PHP_EXTRA_VERSION=""
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
-25
View File
@@ -2,34 +2,9 @@
unixtojd()
--SKIPIF--
<?php include 'skipif.inc'; ?>
--ENV--
TZ=UTC
--FILE--
<?php
// this line has no impact on test output on Windows
putenv('TZ=UTC');
// getenv('TZ') returns 'UTC' here
// putenv (basic_functions.c) does call tzset() when the env var being put is 'TZ'
// -adding a call direct to GetEnvironmentVariableA just before tzset() is called to check the value of 'TZ' returns 'UTC'
// putting a call to date_default_timezone_set() here doesn't help
//
// on Windows, the only thing that gets this test to pass is to put TZ=UTC in --ENV-- section
// -since putenv() is written to call tzset() when env var is TZ, I assume that putenv("TZ=UTC") is intended to work
// and should work on all platforms(including Windows).
// easter_date.phpt passes
// -doesn't use --ENV-- section
// -uses --INI-- section with date.timezone=UTC
// -uses putenv('TZ=UTC')
// date.timezone=UTC
// -if ommitted from easter_date.phpt, outputs DATE_TZ_ERRMSG warning
// -easter_date() calls mktime() and localtime()
// -whereas unixtojd(1000000000) calls localtime(1000000000)
// -if ommitted from unixtojd.phpt, does NOT output DATE_TZ_ERRMSG
//
// unixtojd() calls php_localtime_r() which for Pacific timezone systems, returns a time -8 hours
// -this incorrect localtime is passed to the julian date conversion (GregorianToSDN) function which works (probably correctly)
// but returns -1 day from expected because its input is -1 from expected
echo unixtojd(40000). "\n";
echo unixtojd(1000000000). "\n";
echo unixtojd(1152459009). "\n";
+3 -3
View File
@@ -42,7 +42,7 @@ void php_com_throw_exception(HRESULT code, char *message TSRMLS_DC)
}
}
PHP_COM_DOTNET_API void php_com_wrap_dispatch(zval *z, IDispatch *disp,
PHPAPI void php_com_wrap_dispatch(zval *z, IDispatch *disp,
int codepage TSRMLS_DC)
{
php_com_dotnet_object *obj;
@@ -65,7 +65,7 @@ PHP_COM_DOTNET_API void php_com_wrap_dispatch(zval *z, IDispatch *disp,
z->value.obj.handlers = &php_com_object_handlers;
}
PHP_COM_DOTNET_API void php_com_wrap_variant(zval *z, VARIANT *v,
PHPAPI void php_com_wrap_variant(zval *z, VARIANT *v,
int codepage TSRMLS_DC)
{
php_com_dotnet_object *obj;
@@ -92,7 +92,7 @@ PHP_COM_DOTNET_API void php_com_wrap_variant(zval *z, VARIANT *v,
/* this is a convenience function for fetching a particular
* element from a (possibly multi-dimensional) safe array */
PHP_COM_DOTNET_API int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC)
PHPAPI int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC)
{
UINT dims;
LONG lbound, ubound;
+2 -2
View File
@@ -30,7 +30,7 @@
#include "php_com_dotnet_internal.h"
PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string, uint string_len, int codepage TSRMLS_DC)
PHPAPI OLECHAR *php_com_string_to_olestring(char *string, uint string_len, int codepage TSRMLS_DC)
{
OLECHAR *olestring = NULL;
DWORD flags = codepage == CP_UTF8 ? 0 : MB_PRECOMPOSED | MB_ERR_INVALID_CHARS;
@@ -65,7 +65,7 @@ PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string, uint strin
return olestring;
}
PHP_COM_DOTNET_API char *php_com_olestring_to_string(OLECHAR *olestring, uint *string_len, int codepage TSRMLS_DC)
PHPAPI char *php_com_olestring_to_string(OLECHAR *olestring, uint *string_len, int codepage TSRMLS_DC)
{
char *string;
uint length = 0;
+1 -1
View File
@@ -271,7 +271,7 @@ static void istream_destructor(php_istream *stm)
}
/* }}} */
PHP_COM_DOTNET_API IStream *php_com_wrapper_export_stream(php_stream *stream TSRMLS_DC)
PHPAPI IStream *php_com_wrapper_export_stream(php_stream *stream TSRMLS_DC)
{
php_istream *stm = (php_istream*)CoTaskMemAlloc(sizeof(*stm));
+3 -3
View File
@@ -35,7 +35,7 @@
* b) a CLSID, major, minor e.g. "{00000200-0000-0010-8000-00AA006D2EA4},2,0"
* c) a Type Library name e.g. "Microsoft OLE DB ActiveX Data Objects 1.0 Library"
*/
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC)
PHPAPI ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC)
{
ITypeLib *TL = NULL;
char *strtok_buf, *major, *minor;
@@ -153,7 +153,7 @@ PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codep
}
/* Given a type-library, merge it into the current engine state */
PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode, int codepage TSRMLS_DC)
PHPAPI int php_com_import_typelib(ITypeLib *TL, int mode, int codepage TSRMLS_DC)
{
int i, j, interfaces;
TYPEKIND pTKind;
@@ -224,7 +224,7 @@ void php_com_typelibrary_dtor(void *pDest)
ITypeLib_Release(*Lib);
}
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib_via_cache(char *search_string,
PHPAPI ITypeLib *php_com_load_typelib_via_cache(char *search_string,
int codepage, int *cached TSRMLS_DC)
{
ITypeLib **TLp;
+3 -3
View File
@@ -98,7 +98,7 @@ bogus:
}
}
PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC)
PHPAPI void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC)
{
OLECHAR *olestring;
php_com_dotnet_object *obj;
@@ -166,7 +166,7 @@ PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codep
}
}
PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC)
PHPAPI int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC)
{
OLECHAR *olestring = NULL;
int ret = SUCCESS;
@@ -258,7 +258,7 @@ PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepa
}
PHP_COM_DOTNET_API int php_com_copy_variant(VARIANT *dstvar, VARIANT *srcvar TSRMLS_DC)
PHPAPI int php_com_copy_variant(VARIANT *dstvar, VARIANT *srcvar TSRMLS_DC)
{
int ret = SUCCESS;
+2 -2
View File
@@ -586,7 +586,7 @@ static void disp_destructor(php_dispatchex *disp)
CoTaskMemFree(disp);
}
PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid,
PHPAPI IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid,
HashTable *id_to_name TSRMLS_DC)
{
php_dispatchex *disp = disp_constructor(val TSRMLS_CC);
@@ -625,7 +625,7 @@ PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *si
return (IDispatch*)disp;
}
PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC)
PHPAPI IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC)
{
php_dispatchex *disp = NULL;
-8
View File
@@ -28,14 +28,6 @@ extern zend_module_entry com_dotnet_module_entry;
#include "TSRM.h"
#endif
#ifdef PHP_WIN32
# define PHP_COM_DOTNET_API __declspec(dllexport)
#elif defined(__GNUC__) && __GNUC__ >= 4
# define PHP_COM_DOTNET_API __attribute__ ((visibility("default")))
#else
# define PHP_COM_DOTNET_API
#endif
PHP_MINIT_FUNCTION(com_dotnet);
PHP_MSHUTDOWN_FUNCTION(com_dotnet);
PHP_RINIT_FUNCTION(com_dotnet);
+14 -14
View File
@@ -87,9 +87,9 @@ zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *objec
int php_com_saproxy_create(zval *com_object, zval *proxy_out, zval *index TSRMLS_DC);
/* com_olechar.c */
PHP_COM_DOTNET_API char *php_com_olestring_to_string(OLECHAR *olestring,
PHPAPI char *php_com_olestring_to_string(OLECHAR *olestring,
uint *string_len, int codepage TSRMLS_DC);
PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string,
PHPAPI OLECHAR *php_com_string_to_olestring(char *string,
uint string_len, int codepage TSRMLS_DC);
@@ -115,8 +115,8 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, char *name, int namelen,
/* com_wrapper.c */
int php_com_wrapper_minit(INIT_FUNC_ARGS);
PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid, HashTable *id_to_name TSRMLS_DC);
PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC);
PHPAPI IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid, HashTable *id_to_name TSRMLS_DC);
PHPAPI IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC);
/* com_persist.c */
int php_com_persist_minit(INIT_FUNC_ARGS);
@@ -150,10 +150,10 @@ PHP_FUNCTION(variant_get_type);
PHP_FUNCTION(variant_set_type);
PHP_FUNCTION(variant_cast);
PHP_COM_DOTNET_API void php_com_variant_from_zval_with_type(VARIANT *v, zval *z, VARTYPE type, int codepage TSRMLS_DC);
PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC);
PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC);
PHP_COM_DOTNET_API int php_com_copy_variant(VARIANT *dst, VARIANT *src TSRMLS_DC);
PHPAPI void php_com_variant_from_zval_with_type(VARIANT *v, zval *z, VARTYPE type, int codepage TSRMLS_DC);
PHPAPI void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC);
PHPAPI int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC);
PHPAPI int php_com_copy_variant(VARIANT *dst, VARIANT *src TSRMLS_DC);
/* com_dotnet.c */
PHP_FUNCTION(com_dotnet_create_instance);
@@ -162,17 +162,17 @@ void php_com_dotnet_mshutdown(TSRMLS_D);
/* com_misc.c */
void php_com_throw_exception(HRESULT code, char *message TSRMLS_DC);
PHP_COM_DOTNET_API void php_com_wrap_dispatch(zval *z, IDispatch *disp,
PHPAPI void php_com_wrap_dispatch(zval *z, IDispatch *disp,
int codepage TSRMLS_DC);
PHP_COM_DOTNET_API void php_com_wrap_variant(zval *z, VARIANT *v,
PHPAPI void php_com_wrap_variant(zval *z, VARIANT *v,
int codepage TSRMLS_DC);
PHP_COM_DOTNET_API int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC);
PHPAPI int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC);
/* com_typeinfo.c */
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib_via_cache(char *search_string,
PHPAPI ITypeLib *php_com_load_typelib_via_cache(char *search_string,
int codepage, int *cached TSRMLS_DC);
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC);
PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode,
PHPAPI ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC);
PHPAPI int php_com_import_typelib(ITypeLib *TL, int mode,
int codepage TSRMLS_DC);
void php_com_typelibrary_dtor(void *pDest);
ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj, char *dispname, int sink TSRMLS_DC);
-14
View File
@@ -3,23 +3,9 @@ Bug #49192 (PHP crashes when GC invoked on COM object)
--SKIPIF--
<?php
if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present"; ?>
--XFAIL--
1
--FILE--
<?php
// this test fails to load ADO
//
// a change in windows longhorn x64(affecting vista, 7, 8, 2008, 2008r2) broke ADO.
//
// there is a fix available, but user has to install it.
// given that ADO was deprecated a long time ago in favor of newer APIs,
// I don't think its worth the trouble of making the user install the fix to
// get an accurate test run. its better to just not run the test or expect it to fail.
//
// see: http://support.microsoft.com/kb/2517589
// see: http://www.infoq.com/news/2011/10/ADO-Win7
$dbConnection = new Com('ADODB.Connection');
var_dump(gc_collect_cycles());
?>
+1 -1
View File
@@ -2167,7 +2167,7 @@ string_copy:
convert_to_string_ex(zvalue);
if (!Z_STRLEN_PP(zvalue) || php_check_open_basedir(Z_STRVAL_PP(zvalue) TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(Z_STRVAL_PP(zvalue), "rb+", CHECKUID_CHECK_MODE_PARAM))) {
if (php_check_open_basedir(Z_STRVAL_PP(zvalue) TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(Z_STRVAL_PP(zvalue), "rb+", CHECKUID_CHECK_MODE_PARAM))) {
RETVAL_FALSE;
return 1;
}
-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)
-23
View File
@@ -1,23 +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 Windows");
?>
--INI--
open_basedir="/tmp"
--FILE--
<?php
$ch = curl_init();
var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, ""));
var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/foo"));
var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, "/xxx/bar"));
curl_close($ch);
?>
--EXPECTF--
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
bool(false)
+4 -4
View File
@@ -2035,7 +2035,7 @@ static inline zend_object_value date_object_new_date_ex(zend_class_entry *class_
}
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_property_ctor, (void *) &tmp, sizeof(zval *));
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) date_object_free_storage_date, NULL TSRMLS_CC);
retval.handlers = &date_object_handlers_date;
@@ -2159,7 +2159,7 @@ static inline zend_object_value date_object_new_timezone_ex(zend_class_entry *cl
}
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_property_ctor, (void *) &tmp, sizeof(zval *));
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) date_object_free_storage_timezone, NULL TSRMLS_CC);
retval.handlers = &date_object_handlers_timezone;
@@ -2215,7 +2215,7 @@ static inline zend_object_value date_object_new_interval_ex(zend_class_entry *cl
}
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_property_ctor, (void *) &tmp, sizeof(zval *));
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) date_object_free_storage_interval, NULL TSRMLS_CC);
retval.handlers = &date_object_handlers_interval;
@@ -2291,7 +2291,7 @@ static inline zend_object_value date_object_new_period_ex(zend_class_entry *clas
}
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_property_ctor, (void *) &tmp, sizeof(zval *));
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) date_object_free_storage_period, NULL TSRMLS_CC);
retval.handlers = &date_object_handlers_period;
+3 -5
View File
@@ -11,7 +11,6 @@ date.timezone=UTC
$d = new DateTime('@100000000000');
var_dump($d->format('Y-m-d H:i:s U'));
var_dump($d->getTimestamp());
var_dump($d->format('U'));
$d->setTimestamp(100000000000);
var_dump($d->format('Y-m-d H:i:s U'));
@@ -22,8 +21,7 @@ var_dump($i->format('%s'));
?>
--EXPECT--
string(32) "5138-11-16 09:46:40 100000000000"
bool(false)
int(100000000000)
string(32) "5138-11-16 09:46:40 100000000000"
int(100000000000)
string(12) "100000000000"
string(30) "2008-07-11 04:56:32 1215752192"
int(1215752192)
string(10) "1215752192"
@@ -1,24 +0,0 @@
--TEST--
date_default_timezone_get() function [1]
--SKIPIF--
<?php
if(substr(PHP_OS, 0, 3) != 'WIN') die("skip skip on non windows");
?>
--INI--
date.timezone=
--FILE--
<?php
putenv('TZ=');
echo date_default_timezone_get(), "\n";
echo date('e'), "\n";
/* The behaviour on windows is to select an arbitrary timezone name from the current system settings.
This gives no chance to hardcode the timezone name, for instance for UTC+1 it could choose
from the multiple names like Europe/Berlin or Europe/Paris . For this reason the test is
parametrized so there is no hardcoded timezone data.*/
?>
--EXPECTF--
Warning: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected '%s' for '%s' instead in %sdate_default_timezone_get-1-win32.php on line 3
%s
Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected '%s' for '%s' instead in %sdate_default_timezone_get-1-win32.php on line 4
%s
@@ -1,9 +1,5 @@
--TEST--
date_default_timezone_get() function [1]
--SKIPIF--
<?php
if(substr(PHP_OS, 0, 3) == 'WIN') die("skip on windows");
?>
--INI--
date.timezone=
--FILE--
@@ -1,20 +0,0 @@
--TEST--
date_default_timezone_get() function [2]
--SKIPIF--
<?php
if(substr(PHP_OS, 0, 3) != 'WIN') die("skip on non windows");
?>
--INI--
date.timezone=
--FILE--
<?php
putenv('TZ=');
echo date_default_timezone_get(), "\n";
/* The behaviour on windows is to select an arbitrary timezone name from the current system settings.
This gives no chance to hardcode the timezone name, for instance for UTC+1 it could choose
from the multiple names like Europe/Berlin or Europe/Paris . For this reason the test is
parametrized so there is no hardcoded timezone data.*/
?>
--EXPECTF--
Warning: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected '%s' for '%s' instead in %sdate_default_timezone_get-2-win32.php on line 3
%s
@@ -1,9 +1,5 @@
--TEST--
date_default_timezone_get() function [2]
--SKIPIF--
<?php
if(substr(PHP_OS, 0, 3) == 'WIN') die("skip on windows");
?>
--INI--
date.timezone=
--FILE--
@@ -12,7 +12,7 @@ require_once('skipif.inc');
require_once('dom_test.inc');
chdir(__DIR__);
chdir(__DIR__ . "/../examples");
$XMLStringGood = file_get_contents('note.xml');
$dom = new DOMDocument;
+7 -19
View File
@@ -63,24 +63,12 @@ echo "\n";
$ents = $dtd->entities;
$length = $ents->length;
echo "Length: ".$length."\n";
$xkeys = array();
foreach ($ents AS $key=>$node) {
$xkeys[] = "Key: $key Name: ".$node->nodeName."\n";
}
sort($xkeys); // fix inconsistent output ordering (bug #61810)
foreach ($xkeys as $key => $node) {
echo $node;
echo "Key: $key Name: ".$node->nodeName."\n";
}
echo "\n";
$xkeys = array();
for($x=0; $x < $length; $x++) {
$xkeys[] = "Index: ".$ents->item($x)->nodeName."\n";
}
sort($xkeys); // fix inconsistent output ordering (bug #61810)
foreach ($xkeys as $key => $node) {
echo $node;
echo "Index $x: ".$ents->item($x)->nodeName."\n";
}
echo "\n";
@@ -99,13 +87,13 @@ Index 0: GIF (image/gif) (-)
NULL
Length: 3
Key: myimage Name: myimage
Key: rdf Name: rdf
Key: test Name: test
Key: rdf Name: rdf
Key: myimage Name: myimage
Index: myimage
Index: rdf
Index: test
Index 0: test
Index 1: rdf
Index 2: myimage
NULL
NULL
-6
View File
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<!ELEMENT note (to,from,heading,body)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT heading (#PCDATA)>
<!ELEMENT body (#PCDATA)>
-8
View File
@@ -1,8 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE note SYSTEM "note.dtd">
<note>
<to>PHP User Group</to>
<from>Shane</from>
<heading>Reminder</heading>
<body>Don't forget the meeting tonight!</body>
</note>
+1 -5
View File
@@ -3278,7 +3278,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);
}
}
@@ -3428,10 +3428,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
@@ -104,7 +104,7 @@ PHP_FILEINFO_API zend_object_value finfo_objects_new(zend_class_entry *class_typ
memset(intern, 0, sizeof(struct finfo_object));
zend_object_std_init(&intern->zo, class_type TSRMLS_CC);
zend_hash_copy(intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_property_ctor,(void *) &tmp, sizeof(zval *));
zend_hash_copy(intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref,(void *) &tmp, sizeof(zval *));
intern->ptr = NULL;
+97 -212
View File
@@ -1,6 +1,6 @@
diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
--- libmagic.orig/apprentice.c 2012-05-29 14:40:41.710960045 +0200
+++ libmagic/apprentice.c 2012-04-22 18:57:16.215980866 +0200
--- libmagic.orig/apprentice.c 2012-03-28 12:00:34.017709605 +0200
+++ libmagic/apprentice.c 2012-03-28 01:53:04.283305402 +0200
@@ -29,6 +29,8 @@
* apprentice - make one pass through /etc/magic, learning its secrets.
*/
@@ -729,8 +729,8 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
m->str_flags = swap4(m->str_flags);
}
diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
--- libmagic.orig/ascmagic.c 2012-05-29 14:40:41.710960045 +0200
+++ libmagic/ascmagic.c 2012-04-22 18:57:16.215980866 +0200
--- libmagic.orig/ascmagic.c 2012-03-28 12:00:34.017709605 +0200
+++ libmagic/ascmagic.c 2012-03-28 01:53:04.287303117 +0200
@@ -139,10 +139,8 @@
/* malloc size is a conservative overestimate; could be
improved, or at least realloced after conversion. */
@@ -754,9 +754,10 @@ diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
return rv;
}
Only in libmagic.orig: asprintf.c
diff -u libmagic.orig/cdf.c libmagic/cdf.c
--- libmagic.orig/cdf.c 2012-05-29 14:40:41.710960045 +0200
+++ libmagic/cdf.c 2012-04-22 18:57:16.219978162 +0200
--- libmagic.orig/cdf.c 2012-03-28 12:00:34.012709598 +0200
+++ libmagic/cdf.c 2012-03-28 01:53:04.299331601 +0200
@@ -43,7 +43,17 @@
#include <err.h>
#endif
@@ -775,19 +776,6 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
#include <string.h>
#include <time.h>
#include <ctype.h>
@@ -296,10 +306,10 @@
if (info->i_fd == -1)
return -1;
- if (lseek(info->i_fd, off, SEEK_SET) == (off_t)-1)
+ if (FINFO_LSEEK_FUNC(info->i_fd, off, SEEK_SET) == (off_t)-1)
return -1;
- if (read(info->i_fd, buf, len) != (ssize_t)len)
+ if (FINFO_READ_FUNC(info->i_fd, buf, len) != (ssize_t)len)
return -1;
return (ssize_t)len;
@@ -1135,7 +1145,7 @@
cdf_directory_t *d;
char name[__arraycount(d->d_name)];
@@ -819,8 +807,8 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
(void)fprintf(stderr, "timestamp %s\n", buf);
} else {
diff -u libmagic.orig/cdf.h libmagic/cdf.h
--- libmagic.orig/cdf.h 2012-05-29 14:40:41.710960045 +0200
+++ libmagic/cdf.h 2012-04-22 18:57:16.219978162 +0200
--- libmagic.orig/cdf.h 2012-03-28 12:00:34.017709605 +0200
+++ libmagic/cdf.h 2012-03-28 01:53:04.299331601 +0200
@@ -35,7 +35,7 @@
#ifndef _H_CDF_
#define _H_CDF_
@@ -857,8 +845,8 @@ diff -u libmagic.orig/cdf.h libmagic/cdf.h
void cdf_swap_header(cdf_header_t *);
void cdf_unpack_header(cdf_header_t *, char *);
diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
--- libmagic.orig/cdf_time.c 2012-05-29 14:40:41.710960045 +0200
+++ libmagic/cdf_time.c 2012-04-22 18:57:16.219978162 +0200
--- libmagic.orig/cdf_time.c 2012-03-28 12:00:34.017709605 +0200
+++ libmagic/cdf_time.c 2012-03-28 01:53:04.299331601 +0200
@@ -96,7 +96,7 @@
}
@@ -916,8 +904,8 @@ diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
static const char *ref = "Sat Apr 23 01:30:00 1977";
char *p, *q;
diff -u libmagic.orig/compress.c libmagic/compress.c
--- libmagic.orig/compress.c 2012-05-29 14:40:41.710960045 +0200
+++ libmagic/compress.c 2012-04-22 18:57:16.219978162 +0200
--- libmagic.orig/compress.c 2012-03-28 12:00:34.012709598 +0200
+++ libmagic/compress.c 2012-03-28 01:53:04.299331601 +0200
@@ -32,6 +32,7 @@
* uncompress(method, old, n, newch) - uncompress old into new,
* using method, return sizeof new
@@ -1002,23 +990,7 @@ diff -u libmagic.orig/compress.c libmagic/compress.c
for (cnt = 0;; cnt++) {
fd_set check;
struct timeval tout = {0, 100 * 1000};
@@ -218,7 +224,7 @@
nocheck:
do
- switch ((rv = read(fd, buf, n))) {
+ switch ((rv = FINFO_READ_FUNC(fd, buf, n))) {
case -1:
if (errno == EINTR)
continue;
@@ -295,13 +301,14 @@
return -1;
}
(void)close(tfd);
- if (lseek(fd, (off_t)0, SEEK_SET) == (off_t)-1) {
+ if (FINFO_LSEEK_FUNC(fd, (off_t)0, SEEK_SET) == (off_t)-1) {
file_badseek(ms);
return -1;
@@ -301,7 +307,8 @@
}
return fd;
}
@@ -1039,15 +1011,6 @@ diff -u libmagic.orig/compress.c libmagic/compress.c
/* XXX: const castaway, via strchr */
z.next_in = (Bytef *)strchr((const char *)old + data_start,
@@ -400,7 +405,7 @@
(void) close(0);
if (fd != -1) {
(void) dup(fd);
- (void) lseek(0, (off_t)0, SEEK_SET);
+ (void) FINFO_LSEEK_FUNC(0, (off_t)0, SEEK_SET);
} else {
(void) dup(fdin[0]);
(void) close(fdin[0]);
@@ -465,20 +470,14 @@
fdin[1] = -1;
}
@@ -1078,9 +1041,11 @@ diff -u libmagic.orig/compress.c libmagic/compress.c
}
-#endif
+#endif /* if PHP_FILEINFO_UNCOMPRESS */
Only in libmagic: config.h
Only in libmagic.orig: file.c
diff -u libmagic.orig/file.h libmagic/file.h
--- libmagic.orig/file.h 2012-05-29 14:40:41.710960045 +0200
+++ libmagic/file.h 2012-04-22 18:57:16.219978162 +0200
--- libmagic.orig/file.h 2012-03-28 12:00:34.017709605 +0200
+++ libmagic/file.h 2012-03-28 01:53:04.304322598 +0200
@@ -33,11 +33,9 @@
#ifndef __file_h__
#define __file_h__
@@ -1200,13 +1165,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
protected void file_showstr(FILE *, const char *, size_t);
protected size_t file_mbswidth(const char *);
protected const char *file_getbuffer(struct magic_set *);
@@ -438,16 +434,14 @@
size_t *);
protected size_t file_pstring_length_size(const struct magic *);
protected size_t file_pstring_get_length(const struct magic *, const char *);
+protected size_t file_printedlen(const struct magic_set *ms);
#ifdef __EMX__
protected int file_os2_apptype(struct magic_set *, const char *, const void *,
@@ -443,11 +439,8 @@
size_t);
#endif /* __EMX__ */
@@ -1218,7 +1177,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
#ifndef HAVE_STRERROR
extern int sys_nerr;
@@ -460,17 +454,10 @@
@@ -460,17 +453,10 @@
#define strtoul(a, b, c) strtol(a, b, c)
#endif
@@ -1238,22 +1197,10 @@ diff -u libmagic.orig/file.h libmagic/file.h
size_t strlcat(char *dst, const char *src, size_t siz);
#endif
#ifndef HAVE_GETLINE
@@ -500,4 +487,12 @@
#define FILE_RCSID(id)
#endif
+#ifdef PHP_WIN32
+#define FINFO_LSEEK_FUNC _lseek
+#define FINFO_READ_FUNC _read
+#else
+#define FINFO_LSEEK_FUNC lseek
+#define FINFO_READ_FUNC read
+#endif
+
#endif /* __file_h__ */
Only in libmagic.orig: file_opts.h
diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
--- libmagic.orig/fsmagic.c 2012-05-29 14:40:41.710960045 +0200
+++ libmagic/fsmagic.c 2012-04-22 18:57:16.219978162 +0200
--- libmagic.orig/fsmagic.c 2012-03-28 12:00:34.012709598 +0200
+++ libmagic/fsmagic.c 2012-03-28 01:53:04.304322598 +0200
@@ -59,27 +59,21 @@
# define minor(dev) ((dev) & 0xff)
#endif
@@ -1464,10 +1411,10 @@ diff -u libmagic.orig/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
@@ -1577,8 +1524,8 @@ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
/*
diff -u libmagic.orig/funcs.c libmagic/funcs.c
--- libmagic.orig/funcs.c 2012-05-29 14:40:41.710960045 +0200
+++ libmagic/funcs.c 2012-04-22 18:57:16.219978162 +0200
--- libmagic.orig/funcs.c 2012-03-28 12:00:34.012709598 +0200
+++ libmagic/funcs.c 2012-03-28 11:49:56.089607390 +0200
@@ -41,52 +41,42 @@
#if defined(HAVE_WCTYPE_H)
#include <wctype.h>
@@ -1816,7 +1763,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
+ pcre_cache_entry *pce;
+ char *res;
+ zval *repl;
+ int res_len, rep_cnt = 0;
+ int res_len, rep_cnt;
+ TSRMLS_FETCH();
+
+ MAKE_STD_ZVAL(patt);
@@ -1872,9 +1819,12 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
+ return rep_cnt;
}
+
Only in libmagic.orig: getline.c
Only in libmagic.orig: getopt_long.c
Only in libmagic: LICENSE
diff -u libmagic.orig/magic.c libmagic/magic.c
--- libmagic.orig/magic.c 2012-05-29 14:40:41.710960045 +0200
+++ libmagic/magic.c 2012-04-22 18:57:16.219978162 +0200
--- libmagic.orig/magic.c 2012-03-28 12:00:34.012709598 +0200
+++ libmagic/magic.c 2012-03-28 11:42:50.404750579 +0200
@@ -25,11 +25,6 @@
* SUCH DAMAGE.
*/
@@ -2251,8 +2201,8 @@ diff -u libmagic.orig/magic.c libmagic/magic.c
public const char *
magic_error(struct magic_set *ms)
diff -u libmagic.orig/magic.h libmagic/magic.h
--- libmagic.orig/magic.h 2012-05-29 14:40:41.710960045 +0200
+++ libmagic/magic.h 2012-04-22 18:57:16.219978162 +0200
--- libmagic.orig/magic.h 2012-03-28 12:00:34.017709605 +0200
+++ libmagic/magic.h 2012-03-28 01:53:04.304322598 +0200
@@ -85,6 +85,7 @@
const char *magic_getpath(const char *, int);
@@ -2269,9 +2219,14 @@ diff -u libmagic.orig/magic.h libmagic/magic.h
int magic_list(magic_t, const char *);
int magic_errno(magic_t);
Only in libmagic.orig: Makefile.am
Only in libmagic.orig: Makefile.in
Only in libmagic.orig: mygetopt.h
Only in libmagic: names.h
Only in libmagic: patchlevel.h
diff -u libmagic.orig/print.c libmagic/print.c
--- libmagic.orig/print.c 2012-05-29 14:40:41.710960045 +0200
+++ libmagic/print.c 2012-05-29 14:34:03.770376387 +0200
--- libmagic.orig/print.c 2012-03-28 12:00:34.017709605 +0200
+++ libmagic/print.c 2012-03-28 01:53:04.304322598 +0200
@@ -29,6 +29,9 @@
* print.c - debugging printout routines
*/
@@ -2465,8 +2420,8 @@ diff -u libmagic.orig/print.c libmagic/print.c
protected const char *
diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
--- libmagic.orig/readcdf.c 2012-05-29 14:40:41.710960045 +0200
+++ libmagic/readcdf.c 2012-04-22 18:57:16.219978162 +0200
--- libmagic.orig/readcdf.c 2012-03-28 12:00:34.012709598 +0200
+++ libmagic/readcdf.c 2012-03-28 01:53:04.304322598 +0200
@@ -30,7 +30,11 @@
#endif
@@ -2513,8 +2468,8 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
if ((ec = strchr(c, '\n')) != NULL)
*ec = '\0';
diff -u libmagic.orig/readelf.c libmagic/readelf.c
--- libmagic.orig/readelf.c 2012-05-29 14:40:41.710960045 +0200
+++ libmagic/readelf.c 2012-04-22 18:57:16.219978162 +0200
--- libmagic.orig/readelf.c 2012-03-28 12:00:34.017709605 +0200
+++ libmagic/readelf.c 2012-03-28 01:53:04.308322618 +0200
@@ -49,7 +49,7 @@
off_t, int *, int);
private int doshn(struct magic_set *, int, int, int, off_t, int, size_t,
@@ -2524,34 +2479,6 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
int, size_t, int *);
#define ELF_ALIGN(a) ((((a) + align - 1) / align) * align)
@@ -309,11 +309,11 @@
* Loop through all the program headers.
*/
for ( ; num; num--) {
- if (lseek(fd, off, SEEK_SET) == (off_t)-1) {
+ if (FINFO_LSEEK_FUNC(fd, off, SEEK_SET) == (off_t)-1) {
file_badseek(ms);
return -1;
}
- if (read(fd, xph_addr, xph_sizeof) == -1) {
+ if (FINFO_READ_FUNC(fd, xph_addr, xph_sizeof) == -1) {
file_badread(ms);
return -1;
}
@@ -331,11 +331,11 @@
* This is a PT_NOTE section; loop through all the notes
* in the section.
*/
- if (lseek(fd, xph_offset, SEEK_SET) == (off_t)-1) {
+ if (FINFO_LSEEK_FUNC(fd, xph_offset, SEEK_SET) == (off_t)-1) {
file_badseek(ms);
return -1;
}
- bufsize = read(fd, nbuf,
+ bufsize = FINFO_READ_FUNC(fd, nbuf,
((xph_filesz < sizeof(nbuf)) ? xph_filesz : sizeof(nbuf)));
if (bufsize == -1) {
file_badread(ms);
@@ -357,7 +357,7 @@
#endif
@@ -2569,20 +2496,6 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
(void)memcpy(xnh_addr, &nbuf[offset], xnh_sizeof);
offset += xnh_sizeof;
@@ -859,11 +858,11 @@
}
for ( ; num; num--) {
- if (lseek(fd, off, SEEK_SET) == (off_t)-1) {
+ if (FINFO_LSEEK_FUNC(fd, off, SEEK_SET) == (off_t)-1) {
file_badseek(ms);
return -1;
}
- if (read(fd, xsh_addr, xsh_sizeof) == -1) {
+ if (FINFO_READ_FUNC(fd, xsh_addr, xsh_sizeof) == -1) {
file_badread(ms);
return -1;
}
@@ -888,20 +887,16 @@
/* Things we can determine when we seek */
switch (xsh_type) {
@@ -2592,24 +2505,22 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
- " for note");
- return -1;
- }
- if ((noff = lseek(fd, (off_t)xsh_offset, SEEK_SET)) ==
+ nbuf = emalloc((size_t)xsh_size);
+ if ((noff = FINFO_LSEEK_FUNC(fd, (off_t)xsh_offset, SEEK_SET)) ==
if ((noff = lseek(fd, (off_t)xsh_offset, SEEK_SET)) ==
(off_t)-1) {
file_badread(ms);
- free(nbuf);
+ efree(nbuf);
return -1;
}
- if (read(fd, nbuf, (size_t)xsh_size) !=
+ if (FINFO_READ_FUNC(fd, nbuf, (size_t)xsh_size) !=
if (read(fd, nbuf, (size_t)xsh_size) !=
(ssize_t)xsh_size) {
- free(nbuf);
+ efree(nbuf);
file_badread(ms);
return -1;
}
@@ -916,10 +911,10 @@
@@ -916,7 +911,7 @@
if (noff == 0)
break;
}
@@ -2617,61 +2528,10 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
+ efree(nbuf);
break;
case SHT_SUNW_cap:
- if (lseek(fd, (off_t)xsh_offset, SEEK_SET) ==
+ if (FINFO_LSEEK_FUNC(fd, (off_t)xsh_offset, SEEK_SET) ==
(off_t)-1) {
file_badseek(ms);
return -1;
@@ -932,7 +927,7 @@
MAX(sizeof cap32, sizeof cap64)];
if ((coff += xcap_sizeof) > (off_t)xsh_size)
break;
- if (read(fd, cbuf, (size_t)xcap_sizeof) !=
+ if (FINFO_READ_FUNC(fd, cbuf, (size_t)xcap_sizeof) !=
(ssize_t)xcap_sizeof) {
file_badread(ms);
return -1;
@@ -1051,12 +1046,12 @@
}
for ( ; num; num--) {
- if (lseek(fd, off, SEEK_SET) == (off_t)-1) {
+ if (FINFO_LSEEK_FUNC(fd, off, SEEK_SET) == (off_t)-1) {
file_badseek(ms);
return -1;
}
- if (read(fd, xph_addr, xph_sizeof) == -1) {
+ if (FINFO_READ_FUNC(fd, xph_addr, xph_sizeof) == -1) {
file_badread(ms);
return -1;
}
@@ -1095,11 +1090,11 @@
* This is a PT_NOTE section; loop through all the notes
* in the section.
*/
- if (lseek(fd, xph_offset, SEEK_SET) == (off_t)-1) {
+ if (FINFO_LSEEK_FUNC(fd, xph_offset, SEEK_SET) == (off_t)-1) {
file_badseek(ms);
return -1;
}
- bufsize = read(fd, nbuf, ((xph_filesz < sizeof(nbuf)) ?
+ bufsize = FINFO_READ_FUNC(fd, nbuf, ((xph_filesz < sizeof(nbuf)) ?
xph_filesz : sizeof(nbuf)));
if (bufsize == -1) {
file_badread(ms);
@@ -1161,7 +1156,7 @@
/*
* If we cannot seek, it must be a pipe, socket or fifo.
*/
- if((lseek(fd, (off_t)0, SEEK_SET) == (off_t)-1) && (errno == ESPIPE))
+ if((FINFO_LSEEK_FUNC(fd, (off_t)0, SEEK_SET) == (off_t)-1) && (errno == ESPIPE))
fd = file_pipe2file(ms, fd, buf, nbytes);
if (fstat(fd, &st) == -1) {
if (lseek(fd, (off_t)xsh_offset, SEEK_SET) ==
diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
--- libmagic.orig/softmagic.c 2012-05-29 14:40:41.710960045 +0200
+++ libmagic/softmagic.c 2012-05-29 14:34:31.900417647 +0200
--- libmagic.orig/softmagic.c 2012-03-28 12:00:34.012709598 +0200
+++ libmagic/softmagic.c 2012-03-28 01:53:04.308322618 +0200
@@ -41,6 +41,11 @@
#include <stdlib.h>
#include <time.h>
@@ -2858,7 +2718,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
}
}
@@ -1669,6 +1642,42 @@
@@ -1669,6 +1642,65 @@
return file_strncmp(a, b, len, flags);
}
@@ -2874,6 +2734,29 @@ diff -u libmagic.orig/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] = '~';
@@ -2901,7 +2784,7 @@ diff -u libmagic.orig/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: {
@@ -2912,23 +2795,6 @@ diff -u libmagic.orig/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;
@@ -2945,7 +2811,23 @@ diff -u libmagic.orig/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
@@ -3117,3 +2999,6 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
default:
file_magerror(ms, "invalid type %d in magiccheck()", m->type);
return -1;
Only in libmagic.orig: strlcat.c
Only in libmagic.orig: strlcpy.c
Only in libmagic.orig: vasprintf.c
-1
View File
@@ -434,7 +434,6 @@ protected int file_looks_utf8(const unsigned char *, size_t, unichar *,
size_t *);
protected size_t file_pstring_length_size(const struct magic *);
protected size_t file_pstring_get_length(const struct magic *, const char *);
protected size_t file_printedlen(const struct magic_set *ms);
#ifdef __EMX__
protected int file_os2_apptype(struct magic_set *, const char *, const void *,
size_t);
+1 -1
View File
@@ -438,7 +438,7 @@ file_replace(struct magic_set *ms, const char *pat, const char *rep)
pcre_cache_entry *pce;
char *res;
zval *repl;
int res_len, rep_cnt = 0;
int res_len, rep_cnt;
TSRMLS_FETCH();
MAKE_STD_ZVAL(patt);
+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
+1 -3
View File
@@ -18,11 +18,9 @@ ksort($results);
var_dump($results);
?>
--EXPECTF--
array(7) {
array(6) {
["%s/resources/dir.zip"]=>
string(15) "application/zip"
["%s/resources/test.awk"]=>
string(10) "text/plain"
["%s/resources/test.bmp"]=>
string(14) "image/x-ms-bmp"
["%s/resources/test.gif"]=>
@@ -1,36 +0,0 @@
--TEST--
Test finfo_file() function : regex rules
--SKIPIF--
<?php require_once(dirname(__FILE__) . '/skipif.inc');
if (substr(PHP_OS, 0, 3) != 'WIN') {
die('skip.. only for Windows');
}
?>
--FILE--
<?php
/**
* Works with the unix file command:
* $ file -m magic resources/test.awk
* resources/test.awk: awk script, ASCII text
*/
$magicFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'magic';
$finfo = finfo_open( FILEINFO_MIME, $magicFile );
echo "*** Testing finfo_file() : regex rules ***\n";
// Calling finfo_file() with all possible arguments
$file = __DIR__ . '/resources/test.awk';
var_dump( finfo_file( $finfo, $file ) );
var_dump( finfo_file( $finfo, $file, FILEINFO_CONTINUE ) );
// Windows uses libfileinfo 1.0.5-dev
// this may be causing the slightly different output from the first
// finfo_file() call
?>
===DONE===
--EXPECTF--
*** Testing finfo_file() : regex rules ***
string(10) "text/plain"
string(22) "awk script, ASCII text"
===DONE===
-32
View File
@@ -1,32 +0,0 @@
--TEST--
Test finfo_file() function : regex rules
--SKIPIF--
<?php require_once(dirname(__FILE__) . '/skipif.inc');
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip.. only for Non Windows Systems');
}
?>
--FILE--
<?php
/**
* Works with the unix file command:
* $ file -m magic resources/test.awk
* resources/test.awk: awk script, ASCII text
*/
$magicFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'magic';
$finfo = finfo_open( FILEINFO_MIME, $magicFile );
echo "*** Testing finfo_file() : regex rules ***\n";
// Calling finfo_file() with all possible arguments
$file = __DIR__ . '/resources/test.awk';
var_dump( finfo_file( $finfo, $file ) );
var_dump( finfo_file( $finfo, $file, FILEINFO_CONTINUE ) );
?>
===DONE===
--EXPECTF--
*** Testing finfo_file() : regex rules ***
string(28) "text/plain; charset=us-ascii"
string(22) "awk script, ASCII text"
===DONE===
+19 -1
View File
@@ -14,10 +14,28 @@ var_dump(finfo_open(FILEINFO_MIME, '/foo/bar/inexistent'));
?>
--EXPECTF--
Warning: finfo_open(): Failed to load magic database at ''. in %s on line %d
Warning: finfo_open() expects parameter 2 to be a valid path, string given in %s on line %d
bool(false)
resource(%d) of type (file_info)
resource(%d) of type (file_info)
Warning: finfo_open(%s123): failed to open stream: No such file or directory in %s on line %d
Warning: finfo_open(%s123): failed to open stream: No such file or directory in %s on line %d
Warning: finfo_open(): Failed to load magic database at '%s123'. in %s on line %d
bool(false)
Warning: finfo_open(%s1): failed to open stream: No such file or directory in %s on line %d
Warning: finfo_open(%s1): failed to open stream: No such file or directory in %s on line %d
Warning: finfo_open(): Failed to load magic database at '%s1'. in %s on line %d
bool(false)
Warning: finfo_open(%sinexistent): failed to open stream: No such file or directory in %s on line %d
Warning: finfo_open(%sinexistent): failed to open stream: No such file or directory in %s on line %d
Warning: finfo_open(): Failed to load magic database at '%sinexistent'. in %s on line %d
bool(false)
@@ -1,46 +0,0 @@
--TEST--
Test finfo_open() function : error functionality
--SKIPIF--
<?php require_once(dirname(__FILE__) . '/skipif.inc');
if(substr(PHP_OS, 0, 3) != 'WIN' )
die("skip Not Valid for Linux");
?>
--FILE--
<?php
/* Prototype : resource finfo_open([int options [, string arg]])
* Description: Create a new fileinfo resource.
* Source code: ext/fileinfo/fileinfo.c
* Alias to functions:
*/
$magicFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'magic';
echo "*** Testing finfo_open() : error functionality ***\n";
var_dump( finfo_open( FILEINFO_MIME, 'foobarfile' ) );
var_dump( finfo_open( array(), $magicFile ) );
var_dump( finfo_open( FILEINFO_MIME, $magicFile, 'extraArg' ) );
var_dump( finfo_open( PHP_INT_MAX - 1, $magicFile ) );
var_dump( finfo_open( 'foobar' ) );
var_dump( new finfo('foobar') );
?>
===DONE===
--EXPECTF--
*** Testing finfo_open() : error functionality ***
bool(false)
Warning: finfo_open() expects parameter 1 to be long, array given in %s on line %d
bool(false)
Warning: finfo_open() expects at most 2 parameters, 3 given in %s on line %d
bool(false)
resource(%d) of type (file_info)
Warning: finfo_open() expects parameter 1 to be long, %unicode_string_optional% given in %s on line %d
bool(false)
Warning: finfo::finfo() expects parameter 1 to be long, %unicode_string_optional% given in %s on line %d
NULL
===DONE===
+9 -6
View File
@@ -1,10 +1,7 @@
--TEST--
Test finfo_open() function : error functionality
--SKIPIF--
<?php require_once(dirname(__FILE__) . '/skipif.inc');
if(substr(PHP_OS, 0, 3) == 'WIN' )
die("skip Not Valid for Windows");
?>
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
--FILE--
<?php
/* Prototype : resource finfo_open([int options [, string arg]])
@@ -29,6 +26,12 @@ var_dump( new finfo('foobar') );
===DONE===
--EXPECTF--
*** Testing finfo_open() : error functionality ***
Warning: finfo_open(%sfoobarfile): failed to open stream: No such file or directory in %s on line %d
Warning: finfo_open(%sfoobarfile): failed to open stream: No such file or directory in %s on line %d
Warning: finfo_open(): Failed to load magic database at '%sfoobarfile'. in %s on line %d
bool(false)
Warning: finfo_open() expects parameter 1 to be long, array given in %s on line %d
@@ -40,9 +43,9 @@ bool(false)
Notice: finfo_open(): Warning: using regular magic file `%s' in %s on line %d
resource(%d) of type (file_info)
Warning: finfo_open() expects parameter 1 to be long, %unicode_string_optional% given in %s on line %d
Warning: finfo_open() expects parameter 1 to be long, string given in %s on line %d
bool(false)
Warning: finfo::finfo() expects parameter 1 to be long, %unicode_string_optional% given in %s on line %d
Warning: finfo::finfo() expects parameter 1 to be long, string given in %s on line %d
NULL
===DONE===
-1
View File
@@ -1 +0,0 @@
BEGIN { print "START" }
+1 -7
View File
@@ -1,13 +1,7 @@
--TEST--
Bug #52209 (INPUT_ENV returns NULL for set variables (CLI))
--SKIPIF--
<?php
/* This test makes no sense on windows as an empty variable
would never show up in the "set" list. Which means, it's
always undefined in PHP. */
if(substr(PHP_OS, 0, 3) == "WIN") die("skip Not for Windows");
if (!extension_loaded("filter") || !empty($_ENV['PWD'])) die("skip");
?>
<?php if (!extension_loaded("filter") || !empty($_ENV['PWD'])) die("skip"); ?>
--INI--
variables_order=GPCSE
--FILE--
+4 -16
View File
@@ -10,22 +10,10 @@ Bug #48555 (ImageFTBBox() differs from previous versions for texts with new line
$cwd = dirname(__FILE__);
$font = "$cwd/Tuffy.ttf";
$box = ImageFTBBox(14, 0, $font, "Text without line-break");
//echo 'Top without line-break: ' . $box[7] . "\n";
$without_line_break = $box[7];
echo 'Top without line-break: ' . $box[7] . "\n";
$box = ImageFTBBox(14, 0, $font, "Text with\nline-break\none more");
//echo 'Top with line-break: ' . $box[7] . "\n";
$with_line_break = $box[7];
var_dump($without_line_break);
var_dump($with_line_break);
if ($with_line_break==$without_line_break) {
echo "with line break == without line break".PHP_EOL;
} else {
echo "with line break != without line break".PHP_EOL;
}
echo 'Top with line-break: ' . $box[7] . "\n";
?>
--EXPECTF--
int(-%d)
int(-%d)
with line break == without line break
Top without line-break: -14
Top with line-break: -14
-90
View File
@@ -1,90 +0,0 @@
--TEST--
gmp_gcdext() basic tests
--SKIPIF--
<?php if (!extension_loaded("gmp")) print "skip";
if(substr(PHP_OS, 0, 3) != 'WIN' ) {
die('skip windows only test');
}
?>
--FILE--
<?php
$n = gmp_init("34293864345");
$n1 = gmp_init("23434293864345");
$a = array(
array(123,45),
array(4341,9734),
array(23487,333),
array(-234234,-123123),
array(-100,-2234),
array(345,"34587345"),
array(345,"0"),
array("345556456",345873),
array("34545345556456","323432445873"),
array($n, $n1),
);
foreach ($a as $val) {
$r = gmp_gcdext($val[0],$val[1]);
var_dump(gmp_strval($r['g']));
var_dump(gmp_strval($r['s']));
var_dump(gmp_strval($r['t']));
}
var_dump(gmp_gcdext($val[0],array()));
var_dump(gmp_gcdext(array(),array()));
var_dump(gmp_gcdext(array(),array(),1));
var_dump(gmp_gcdext(array()));
var_dump(gmp_gcdext());
echo "Done\n";
?>
--EXPECTF--
string(1) "3"
string(2) "41"
string(4) "-112"
string(1) "1"
string(4) "-805"
string(3) "359"
string(1) "3"
string(2) "32"
string(5) "-2257"
string(4) "3003"
string(3) "-10"
string(2) "19"
string(1) "2"
string(2) "67"
string(2) "-3"
string(2) "15"
string(7) "-601519"
string(1) "6"
string(3) "345"
string(1) "1"
string(1) "0"
string(1) "1"
string(5) "84319"
string(9) "-84241831"
string(1) "1"
string(12) "167180205823"
string(15) "-17856272782919"
string(3) "195"
string(15) "-23387298979862"
string(11) "34225091793"
Warning: gmp_gcdext(): Unable to convert variable to GMP - wrong type in %s on line %d
bool(false)
Warning: gmp_gcdext(): Unable to convert variable to GMP - wrong type in %s on line %d
bool(false)
Warning: gmp_gcdext() expects exactly 2 parameters, 3 given in %s on line %d
NULL
Warning: gmp_gcdext() expects exactly 2 parameters, 1 given in %s on line %d
NULL
Warning: gmp_gcdext() expects exactly 2 parameters, 0 given in %s on line %d
NULL
Done
+1 -5
View File
@@ -1,11 +1,7 @@
--TEST--
gmp_gcdext() basic tests
--SKIPIF--
<?php if (!extension_loaded("gmp")) print "skip";
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip.. only for Non Windows Systems');
}
?>
<?php if (!extension_loaded("gmp")) print "skip"; ?>
--FILE--
<?php
-45
View File
@@ -1,45 +0,0 @@
--TEST--
gmp_nextprime()
--SKIPIF--
<?php if (!extension_loaded("gmp")) print "skip";
if(substr(PHP_OS, 0, 3) != 'WIN' ) {
die('skip windows only test');
}
?>
--FILE--
<?php
$n = gmp_nextprime(-1);
var_dump(gmp_strval($n));
$n = gmp_nextprime(0);
var_dump(gmp_strval($n));
$n = gmp_nextprime(-1000);
var_dump(gmp_strval($n));
$n = gmp_nextprime(1000);
var_dump(gmp_strval($n));
$n = gmp_nextprime(100000);
var_dump(gmp_strval($n));
$n = gmp_nextprime(array());
var_dump(gmp_strval($n));
$n = gmp_nextprime("");
var_dump(gmp_strval($n));
$n = gmp_nextprime(new stdclass());
var_dump(gmp_strval($n));
echo "Done\n";
?>
--EXPECTF--
string(1) "2"
string(1) "2"
string(4) "-997"
string(4) "1009"
string(6) "100003"
Warning: gmp_nextprime(): Unable to convert variable to GMP - wrong type in %s on line %d
string(1) "0"
string(1) "0"
Warning: gmp_nextprime(): Unable to convert variable to GMP - wrong type in %s on line %d
string(1) "0"
Done
+1 -5
View File
@@ -1,11 +1,7 @@
--TEST--
gmp_nextprime()
--SKIPIF--
<?php if (!extension_loaded("gmp")) print "skip";
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip.. only for Non Windows Systems');
}
?>
<?php if (!extension_loaded("gmp")) print "skip"; ?>
--FILE--
<?php
+2 -2
View File
@@ -322,8 +322,8 @@ query_loop:
}
result += 2;
*(result+line_len) = 0;
snprintf(heap_p, heap_buf_size - (heap_p - heap_buf), "%s\n", result);
heap_p += line_len +1;
snprintf(heap_p, heap_buf_size - (heap_buf - heap_p), "%s\n", result);
heap_p += line_len +2;
goto query_loop; /* repeat until result is exhausted */
case isc_info_svc_server_version:
+1 -3
View File
@@ -594,8 +594,6 @@ PHP_FUNCTION( collator_get_sort_key )
RETURN_FALSE;
}
/* ucol_getSortKey is exception in that the key length includes the
* NUL terminator*/
key_len = ucol_getSortKey(co->ucoll, ustr, ustr_len, key, 0);
if(!key_len) {
efree( ustr );
@@ -607,7 +605,7 @@ PHP_FUNCTION( collator_get_sort_key )
if(!key_len) {
RETURN_FALSE;
}
RETURN_STRINGL((char *)key, key_len - 1, 0);
RETURN_STRINGL((char *)key, key_len, 0);
}
/* }}} */
+20 -64
View File
@@ -99,46 +99,17 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
}
INTL_CHECK_LOCALE_LEN_OBJ(locale_len, return_value);
if (calendar != UCAL_TRADITIONAL && calendar != UCAL_GREGORIAN) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_create: "
"invalid value for calendar type; it must be one of "
"IntlDateFormatter::TRADITIONAL (locale's default calendar) "
"or IntlDateFormatter::GREGORIAN", 0 TSRMLS_CC);
goto error;
}
DATE_FORMAT_METHOD_FETCH_OBJECT;
if (DATE_FORMAT_OBJECT(dfo) != NULL) {
intl_errors_set(INTL_DATA_ERROR_P(dfo), U_ILLEGAL_ARGUMENT_ERROR,
"datefmt_create: cannot call constructor twice", 0 TSRMLS_CC);
return;
}
/* Convert pattern (if specified) to UTF-16. */
if( pattern_str && pattern_str_len>0 ){
intl_convert_utf8_to_utf16(&svalue, &slength,
pattern_str, pattern_str_len, &INTL_DATA_ERROR_CODE(dfo));
if (U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
/* object construction -> only set global error */
intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create: "
"error converting pattern to UTF-16", 0 TSRMLS_CC);
goto error;
}
intl_convert_utf8_to_utf16(&svalue, &slength, pattern_str, pattern_str_len, &INTL_DATA_ERROR_CODE(dfo));
INTL_CTOR_CHECK_STATUS(dfo, "datefmt_create: error converting pattern to UTF-16");
}
/* resources allocated from now on */
/* Convert pattern (if specified) to UTF-16. */
if( timezone_str && timezone_str_len >0 ){
intl_convert_utf8_to_utf16(&timezone_utf16, &timezone_utf16_len,
timezone_str, timezone_str_len, &INTL_DATA_ERROR_CODE(dfo));
if (U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create: "
"error converting timezone_str to UTF-16", 0 TSRMLS_CC);
goto error;
}
intl_convert_utf8_to_utf16(&timezone_utf16, &timezone_utf16_len, timezone_str, timezone_str_len, &INTL_DATA_ERROR_CODE(dfo));
INTL_CTOR_CHECK_STATUS(dfo, "datefmt_create: error converting timezone_str to UTF-16" );
}
if(locale_len == 0) {
@@ -151,24 +122,24 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
DATE_FORMAT_OBJECT(dfo) = udat_open(time_type, date_type, locale, timezone_utf16, timezone_utf16_len, svalue, slength, &INTL_DATA_ERROR_CODE(dfo));
}
if (!U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
if (calendar != UCAL_TRADITIONAL) {
ucal_obj = ucal_open(timezone_utf16, timezone_utf16_len, locale,
calendar, &INTL_DATA_ERROR_CODE(dfo));
if (!U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
udat_setCalendar(DATE_FORMAT_OBJECT(dfo), ucal_obj);
ucal_close(ucal_obj);
} else {
intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create"
": error opening calendar", 0 TSRMLS_CC);
goto error;
}
/* Set the calendar if passed */
if(!U_FAILURE(INTL_DATA_ERROR_CODE(dfo)) && calendar) {
ucal_obj = ucal_open( timezone_utf16, timezone_utf16_len, locale, calendar, &INTL_DATA_ERROR_CODE(dfo) );
if(!U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
udat_setCalendar( DATE_FORMAT_OBJECT(dfo), ucal_obj );
}
} else {
intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create: date "
"formatter creation failed", 0 TSRMLS_CC);
goto error;
}
if(svalue)
{
efree(svalue);
}
if(timezone_utf16)
{
efree(timezone_utf16);
}
INTL_CTOR_CHECK_STATUS(dfo, "datefmt_create: date formatter creation failed");
/* Set the class variables */
dfo->date_type = date_type;
@@ -177,19 +148,6 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
if( timezone_str && timezone_str_len > 0){
dfo->timezone_id = estrndup( timezone_str, timezone_str_len);
}
error:
if (svalue) {
efree(svalue);
}
if (timezone_utf16) {
efree(timezone_utf16);
}
if (U_FAILURE(intl_error_get_code(NULL TSRMLS_CC))) {
/* free_object handles partially constructed instances fine */
zval_dtor(return_value);
RETVAL_NULL();
}
}
/* }}} */
@@ -211,8 +169,6 @@ PHP_FUNCTION( datefmt_create )
*/
PHP_METHOD( IntlDateFormatter, __construct )
{
/* return_value param is being changed, therefore we will always return
* NULL here */
return_value = getThis();
datefmt_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU);
}
+3 -2
View File
@@ -83,10 +83,11 @@ PHP_FUNCTION( numfmt_parse )
break;
case FORMAT_TYPE_INT64:
val64 = unum_parseInt64(FORMATTER_OBJECT(nfo), sstr, sstr_len, position_p, &INTL_DATA_ERROR_CODE(nfo));
if(val64 > LONG_MAX || val64 < LONG_MIN) {
if(val64 > LONG_MAX || val64 < -LONG_MAX) {
RETVAL_DOUBLE(val64);
} else {
RETVAL_LONG((long)val64);
val32 = (int32_t)val64;
RETVAL_LONG(val32);
}
break;
case FORMAT_TYPE_DOUBLE:
-1
View File
@@ -818,7 +818,6 @@ PHP_FUNCTION(grapheme_extract)
}
else {
/* initialize next */
zval_dtor(next);
ZVAL_LONG(next, lstart);
}
}
+3 -4
View File
@@ -527,7 +527,7 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME
/* Get the disp_value for the given locale */
do{
disp_name = erealloc( disp_name , buflen * sizeof(UChar) );
disp_name = erealloc( disp_name , buflen );
disp_name_len = buflen;
if( strcmp(tag_name , LOC_LANG_TAG)==0 ){
@@ -542,7 +542,6 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME
buflen = uloc_getDisplayName ( mod_loc_name , disp_loc_name , disp_name , disp_name_len , &status);
}
/* U_STRING_NOT_TERMINATED_WARNING is admissible here; don't look for it */
if( U_FAILURE( status ) )
{
if( status == U_BUFFER_OVERFLOW_ERROR )
@@ -1563,11 +1562,11 @@ PHP_FUNCTION(locale_lookup)
/* }}} */
/* {{{ proto string Locale::acceptFromHttp(string $http_accept)
* Tries to find out best available locale based on HTTP �Accept-Language� header
* Tries to find out best available locale based on HTTP “Accept-Language” header
*/
/* }}} */
/* {{{ proto string locale_accept_from_http(string $http_accept)
* Tries to find out best available locale based on HTTP �Accept-Language� header
* Tries to find out best available locale based on HTTP “Accept-Language” header
*/
PHP_FUNCTION(locale_accept_from_http)
{
-6
View File
@@ -64,15 +64,9 @@ static void msgfmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
locale = INTL_G(default_locale);
}
#ifdef MSG_FORMAT_QUOTE_APOS
if(msgformat_fix_quotes(&spattern, &spattern_len, &INTL_DATA_ERROR_CODE(mfo)) != SUCCESS) {
INTL_CTOR_CHECK_STATUS(mfo, "msgfmt_create: error converting pattern to quote-friendly format");
}
#endif
if ((mfo)->mf_data.orig_format) {
msgformat_data_free(&mfo->mf_data TSRMLS_CC);
}
(mfo)->mf_data.orig_format = estrndup(pattern, pattern_len);
(mfo)->mf_data.orig_format_len = pattern_len;
-2
View File
@@ -82,13 +82,11 @@ PHP_FUNCTION( msgfmt_set_pattern )
intl_convert_utf8_to_utf16(&spattern, &spattern_len, value, value_len, &INTL_DATA_ERROR_CODE(mfo));
INTL_METHOD_CHECK_STATUS(mfo, "Error converting pattern to UTF-16" );
#ifdef MSG_FORMAT_QUOTE_APOS
if(msgformat_fix_quotes(&spattern, &spattern_len, &INTL_DATA_ERROR_CODE(mfo)) != SUCCESS) {
intl_error_set( NULL, U_INVALID_FORMAT_ERROR,
"msgfmt_set_pattern: error converting pattern to quote-friendly format", 0 TSRMLS_CC );
RETURN_FALSE;
}
#endif
/* TODO: add parse error information */
umsg_applyPattern(MSG_FORMAT_OBJECT(mfo), spattern, spattern_len, NULL, &INTL_DATA_ERROR_CODE(mfo));
+3 -9
View File
@@ -19,11 +19,9 @@
#include <php.h>
#include <unicode/uconfig.h>
#include "../intl_common.h"
#include "../intl_error.h"
#include "../intl_data.h"
#include "intl_common.h"
#include "intl_error.h"
#include "intl_data.h"
#include "msgformat_data.h"
typedef struct {
@@ -40,8 +38,4 @@ extern zend_class_entry *MessageFormatter_ce_ptr;
#define MSG_FORMAT_METHOD_FETCH_OBJECT INTL_METHOD_FETCH_OBJECT(MessageFormatter, mfo)
#define MSG_FORMAT_OBJECT(mfo) (mfo)->mf_data.umsgf
#if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM < 48
# define MSG_FORMAT_QUOTE_APOS 1
#endif
#endif // #ifndef MSG_FORMAT_CLASS_H
-4
View File
@@ -21,8 +21,6 @@
#include <unicode/ustring.h>
#include "msgformat_data.h"
#include "msgformat_class.h"
/* {{{ void msgformat_data_init( msgformat_data* mf_data )
* Initialize internals of msgformat_data.
*/
@@ -71,7 +69,6 @@ msgformat_data* msgformat_data_create( TSRMLS_D )
}
/* }}} */
#ifdef MSG_FORMAT_QUOTE_APOS
int msgformat_fix_quotes(UChar **spattern, uint32_t *spattern_len, UErrorCode *ec)
{
if(*spattern && *spattern_len && u_strchr(*spattern, (UChar)'\'')) {
@@ -89,7 +86,6 @@ int msgformat_fix_quotes(UChar **spattern, uint32_t *spattern_len, UErrorCode *e
}
return SUCCESS;
}
#endif
/*
+2 -5
View File
@@ -19,10 +19,10 @@
#include <php.h>
#include "../intl_error.h"
#include <unicode/umsg.h>
#include "intl_error.h"
typedef struct {
// error hangling
intl_error error;
@@ -36,9 +36,6 @@ typedef struct {
msgformat_data* msgformat_data_create( TSRMLS_D );
void msgformat_data_init( msgformat_data* mf_data TSRMLS_DC );
void msgformat_data_free( msgformat_data* mf_data TSRMLS_DC );
#ifdef MSG_FORMAT_QUOTE_APOS
int msgformat_fix_quotes(UChar **spattern, uint32_t *spattern_len, UErrorCode *ec);
#endif
#endif // MSG_FORMAT_DATA_H
-2
View File
@@ -154,13 +154,11 @@ PHP_FUNCTION( msgfmt_format_message )
slocale = INTL_G(default_locale);
}
#ifdef MSG_FORMAT_QUOTE_APOS
if(msgformat_fix_quotes(&spattern, &spattern_len, &INTL_DATA_ERROR_CODE(mfo)) != SUCCESS) {
intl_error_set( NULL, U_INVALID_FORMAT_ERROR,
"msgfmt_format_message: error converting pattern to quote-friendly format", 0 TSRMLS_CC );
RETURN_FALSE;
}
#endif
/* Create an ICU message formatter. */
MSG_FORMAT_OBJECT(mfo) = umsg_open(spattern, spattern_len, slocale, NULL, &INTL_DATA_ERROR_CODE(mfo));
-2
View File
@@ -129,13 +129,11 @@ PHP_FUNCTION( msgfmt_parse_message )
slocale = INTL_G(default_locale);
}
#ifdef MSG_FORMAT_QUOTE_APOS
if(msgformat_fix_quotes(&spattern, &spattern_len, &INTL_DATA_ERROR_CODE(mfo)) != SUCCESS) {
intl_error_set( NULL, U_INVALID_FORMAT_ERROR,
"msgfmt_parse_message: error converting pattern to quote-friendly format", 0 TSRMLS_CC );
RETURN_FALSE;
}
#endif
/* Create an ICU message formatter. */
MSG_FORMAT_OBJECT(mfo) = umsg_open(spattern, spattern_len, slocale, NULL, &INTL_DATA_ERROR_CODE(mfo));
@@ -427,8 +427,6 @@ void resourcebundle_register_class( TSRMLS_D )
ResourceBundle_object_handlers.clone_obj = NULL; /* ICU ResourceBundle has no clone implementation */
ResourceBundle_object_handlers.read_dimension = resourcebundle_array_get;
ResourceBundle_object_handlers.count_elements = resourcebundle_array_count;
zend_class_implements(ResourceBundle_ce_ptr TSRMLS_CC, 1, zend_ce_traversable);
}
/* }}} */
-21
View File
@@ -1,21 +0,0 @@
--TEST--
Bug#59597 NumberFormatter::parse() with TYPE_INT64 results in a 32 bit integer
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
<?php echo PHP_INT_SIZE == 8 ? "skip 32-bit only" : "OK"; ?>
--FILE--
<?php
$formatter = new \NumberFormatter('en', \NumberFormatter::DECIMAL);
$value = $formatter->parse('2147483647', \NumberFormatter::TYPE_INT32);
var_dump($value);
$formatter = new \NumberFormatter('en', \NumberFormatter::DECIMAL);
$value = $formatter->parse('2147483650', \NumberFormatter::TYPE_INT64);
var_dump($value);
?>
--EXPECT--
int(2147483647)
float(2147483650)
-21
View File
@@ -1,21 +0,0 @@
--TEST--
Bug#59597 NumberFormatter::parse() with TYPE_INT64 results in a 32 bit integer
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
<?php echo PHP_INT_SIZE != 8 ? "skip 64-bit only" : "OK"; ?>
--FILE--
<?php
$formatter = new \NumberFormatter('en', \NumberFormatter::DECIMAL);
$value = $formatter->parse('2147483647', \NumberFormatter::TYPE_INT32);
var_dump($value);
$formatter = new \NumberFormatter('en', \NumberFormatter::DECIMAL);
$value = $formatter->parse('2147483650', \NumberFormatter::TYPE_INT64);
var_dump($value);
?>
--EXPECTREGEX--
int(2147483647)
int(2147483650)
-22
View File
@@ -1,22 +0,0 @@
--TEST--
Bug #62017: datefmt_create with incorrectly encoded timezone leaks pattern
--SKIPIF--
<?php
if (!extension_loaded('intl'))
die('skip intl extension not enabled');
--FILE--
<?php
ini_set('intl.error_level', E_WARNING);
var_dump(
datefmt_create('', IntlDateFormatter::NONE, IntlDateFormatter::NONE, "\xFF",
IntlDateFormatter::GREGORIAN, 'a'));
var_dump(
new IntlDateFormatter('', IntlDateFormatter::NONE, IntlDateFormatter::NONE, "Europe/Lisbon",
IntlDateFormatter::GREGORIAN, "\x80"));
--EXPECTF--
Warning: datefmt_create(): datefmt_create: error converting timezone_str to UTF-16 in %s on line %d
NULL
Warning: IntlDateFormatter::__construct(): datefmt_create: error converting pattern to UTF-16 in %s on line %d
NULL
-16
View File
@@ -1,16 +0,0 @@
--TEST--
Bug #62070: Collator::getSortKey() returns garbage
--SKIPIF--
<?php
if (!extension_loaded('intl'))
die('skip intl extension not enabled');
--FILE--
<?php
$s1 = 'Hello';
$coll = collator_create('en_US');
$res = collator_get_sort_key($coll, $s1);
echo urlencode($res);
--EXPECT--
5%2F%3D%3DC%01%09%01%8F%08
-14
View File
@@ -1,14 +0,0 @@
--TEST--
Bug #62081: IntlDateFormatter leaks memory if called twice
--SKIPIF--
<?php
if (!extension_loaded('intl'))
die('skip intl extension not enabled');
--FILE--
<?php
ini_set('intl.error_level', E_WARNING);
$x = new IntlDateFormatter(1,1,1,1,1);
var_dump($x->__construct(1,1,1,1,1));
--EXPECTF--
Warning: IntlDateFormatter::__construct(): datefmt_create: cannot call constructor twice in %s on line %d
NULL
-15
View File
@@ -1,15 +0,0 @@
--TEST--
Bug #62082: Memory corruption in internal get_icu_disp_value_src_php()
--SKIPIF--
<?php
if (!extension_loaded('intl'))
die('skip intl extension not enabled');
--FILE--
<?php
var_dump(locale_get_display_name(str_repeat("a", 300), null));
var_dump(locale_get_display_name(str_repeat("a", 512), null));
var_dump(locale_get_display_name(str_repeat("a", 600), null));
--EXPECT--
string(300) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
string(512) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
string(600) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
-12
View File
@@ -1,12 +0,0 @@
--TEST--
Bug #62083: grapheme_extract() leaks memory
--SKIPIF--
<?php
if (!extension_loaded('intl'))
die('skip intl extension not enabled');
--FILE--
<?php
$arr1 = array();
var_dump(grapheme_extract(-1, -1, -1,-1, $arr1));
--EXPECT--
bool(false)
+36 -35
View File
@@ -2,7 +2,8 @@
collator_get_sort_key()
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
<?php if(version_compare(INTL_ICU_VERSION, '4.8') < 0) print 'skip ICU >= 4.8 only'; ?>
--XFAIL--
Sort keys are not fixed, comparing them to fixed strings doesn't work.
--FILE--
<?php
@@ -17,8 +18,8 @@ function sort_arrays( $locale, $data )
foreach($data as $value) {
$res_val = ut_coll_get_sort_key( $coll, $value );
$res_str .= "source: ".$value."\n".
"key: ".bin2hex($res_val)."\n";
$res_str .= "source: ".urlencode($value)."\n".
"key: ".urlencode($res_val)."\n";
}
return $res_str;
@@ -57,42 +58,42 @@ ut_run();
?>
--EXPECT--
source: abc
key: 27292b01070107
key: %29%2B-%01%07%01%07%00
source: abd
key: 27292d01070107
key: %29%2B%2F%01%07%01%07%00
source: aaa
key: 27272701070107
source: аа
key: 5c0a0a01060106
source: а
key: 5c0a01050105
key: %29%29%29%01%07%01%07%00
source: %D0%B0%D0%B0
key: _++%01%06%01%06%00
source: %D0%B0
key: _+%01%05%01%05%00
source: z
key: 5901050105
source:
key: 0101
source:
key: 0101
key: %5B%01%05%01%05%00
source:
key: %01%01%00
source:
key: %01%01%00
source: 3
key: 1801050105
key: %26%80%01%05%01%05%00
source: y
key: 5701050105
key: Y%01%05%01%05%00
source: i
key: 3701050105
key: 9%01%05%01%05%00
source: k
key: 3b01050105
source: абг
key: 5c0a161a01070107
source: абв
key: 5c0a161801070107
source: жжж
key: 5c3a3a3a01070107
source: эюя
key: 5d3b3f4501070107
source: абг
key: 5c0a161a01070107
source: абв
key: 5c0a161801070107
source: жжж
key: 5c3a3a3a01070107
source: эюя
key: 5d3b3f4501070107
key: %3D%01%05%01%05%00
source: %D0%B0%D0%B1%D0%B3
key: _+%2C0%01%07%01%07%00
source: %D0%B0%D0%B1%D0%B2
key: _+%2C.%01%07%01%07%00
source: %D0%B6%D0%B6%D0%B6
key: _LLL%01%07%01%07%00
source: %D1%8D%D1%8E%D1%8F
key: %60%05%09%0B%01%07%01%07%00
source: %D0%B0%D0%B1%D0%B3
key: _+%2C0%01%07%01%07%00
source: %D0%B0%D0%B1%D0%B2
key: _+%2C.%01%07%01%07%00
source: %D0%B6%D0%B6%D0%B6
key: _LLL%01%07%01%07%00
source: %D1%8D%D1%8E%D1%8F
key: %60%05%09%0B%01%07%01%07%00
-45
View File
@@ -1,45 +0,0 @@
--TEST--
IntlDateFormatter, calendars and time zone
--INI--
date.timezone=Atlantic/Azores
--SKIPIF--
<?php
if (!extension_loaded('intl'))
die('skip intl extension not enabled');
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
$fmt1 = new IntlDateFormatter('en_US',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'GMT+05:12',
IntlDateFormatter::TRADITIONAL);
$fmt2 = new IntlDateFormatter('en_US',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'GMT+05:12',
IntlDateFormatter::GREGORIAN);
$fmt3 = new IntlDateFormatter('en_US@calendar=hebrew',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'GMT+05:12',
IntlDateFormatter::TRADITIONAL);
var_dump($fmt1->format(strtotime('2012-01-01 00:00:00 +0000')));
var_dump($fmt2->format(strtotime('2012-01-01 00:00:00 +0000')));
var_dump($fmt3->format(strtotime('2012-01-01 00:00:00 +0000')));
new IntlDateFormatter('en_US@calendar=hebrew',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'GMT+05:12',
-1);
?>
==DONE==
--EXPECTF--
string(44) "Sunday, January 1, 2012 5:12:00 AM GMT+05:12"
string(44) "Sunday, January 1, 2012 5:12:00 AM GMT+05:12"
string(42) "Sunday, Tevet 6, 5772 5:12:00 AM GMT+05:12"
Warning: IntlDateFormatter::__construct(): datefmt_create: invalid value for calendar type; it must be one of IntlDateFormatter::TRADITIONAL (locale's default calendar) or IntlDateFormatter::GREGORIAN in %s on line %d
==DONE==
@@ -1,8 +1,8 @@
--TEST--
numfmt_get/set_attribute()
numfmt_get/set_attribute() icu < 4.2
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
<?php if(version_compare(INTL_ICU_VERSION, '4.2', '<') != 1) print 'skip for ICU 4.4+'; ?>
<?php if(version_compare(INTL_ICU_VERSION, '4.2', '<') != 1) print 'skip'; ?>
--FILE--
<?php
@@ -29,7 +29,7 @@ function ut_main()
'ROUNDING_MODE' => array( NumberFormatter::ROUNDING_MODE, 1, 12345.123456 ),
'ROUNDING_INCREMENT' => array( NumberFormatter::ROUNDING_INCREMENT, (float)2, 12345.123456 ),
'FORMAT_WIDTH' => array( NumberFormatter::FORMAT_WIDTH, 27, 12345.123456 ),
'PADDING_POSITION' => array( NumberFormatter::PADDING_POSITION, 2, 12345.123456 ),
'PADDING_POSITION' => array( NumberFormatter::PADDING_POSITION, 21, 12345.123456 ),
'SECONDARY_GROUPING_SIZE' => array( NumberFormatter::SECONDARY_GROUPING_SIZE, 2, 12345.123456 ),
'SIGNIFICANT_DIGITS_USED' => array( NumberFormatter::SIGNIFICANT_DIGITS_USED, 1, 12345.123456 ),
'MIN_SIGNIFICANT_DIGITS' => array( NumberFormatter::MIN_SIGNIFICANT_DIGITS, 3, 1 ),
@@ -159,7 +159,7 @@ Setting attribute: ok
New attribute value: 1 ; Format result: '0,012,345.12345' ; Parse result: 12345.12345
Attribute ROUNDING_INCREMENT
Old attribute value: 0 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346
Old attribute value: 1.0E-5 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346
Setting attribute: ok
New attribute value: 2 ; Format result: '0,012,346.00000' ; Parse result: 12346
@@ -171,7 +171,7 @@ New attribute value: 27 ; Format result: '************0,012,345.12346' ; Parse
Attribute PADDING_POSITION
Old attribute value: 0 ; Format result: '************0,012,345.12346' ; Parse result: 12345.12346
Setting attribute: ok
New attribute value: 2 ; Format result: '0,012,345.12346************' ; Parse result: 12345.12346
New attribute value: 21 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346
Attribute SECONDARY_GROUPING_SIZE
Old attribute value: 0 ; Format result: '************0,012,345.12346' ; Parse result: 12345.12346
@@ -0,0 +1,194 @@
--TEST--
numfmt_get/set_attribute() icu >= 4.8
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
<?php if(version_compare(INTL_ICU_VERSION, '4.8') < 0) print 'skip'; ?>
--FILE--
<?php
/*
* Get/set various number formatting attributes.
*/
function ut_main()
{
// attr_name => array( attr, value )
$attributes = array(
'PARSE_INT_ONLY' => array( NumberFormatter::PARSE_INT_ONLY, 1, 12345.123456 ),
'GROUPING_USED' => array( NumberFormatter::GROUPING_USED, 0, 12345.123456 ),
'DECIMAL_ALWAYS_SHOWN' => array( NumberFormatter::DECIMAL_ALWAYS_SHOWN, 1, 12345 ),
'MAX_INTEGER_DIGITS' => array( NumberFormatter::MAX_INTEGER_DIGITS, 2, 12345.123456 ),
'MIN_INTEGER_DIGITS' => array( NumberFormatter::MIN_INTEGER_DIGITS, 20, 12345.123456 ),
'INTEGER_DIGITS' => array( NumberFormatter::INTEGER_DIGITS, 7, 12345.123456 ),
'MAX_FRACTION_DIGITS' => array( NumberFormatter::MAX_FRACTION_DIGITS, 2, 12345.123456 ),
'MIN_FRACTION_DIGITS' => array( NumberFormatter::MIN_FRACTION_DIGITS, 20, 12345.123456 ),
'FRACTION_DIGITS' => array( NumberFormatter::FRACTION_DIGITS, 5, 12345.123456 ),
'MULTIPLIER' => array( NumberFormatter::MULTIPLIER, 2, 12345.123456 ),
'GROUPING_SIZE' => array( NumberFormatter::GROUPING_SIZE, 2, 12345.123456 ),
'ROUNDING_MODE' => array( NumberFormatter::ROUNDING_MODE, 1, 12345.123456 ),
'ROUNDING_INCREMENT' => array( NumberFormatter::ROUNDING_INCREMENT, (float)2, 12345.123456 ),
'FORMAT_WIDTH' => array( NumberFormatter::FORMAT_WIDTH, 27, 12345.123456 ),
'PADDING_POSITION' => array( NumberFormatter::PADDING_POSITION, 21, 12345.123456 ),
'SECONDARY_GROUPING_SIZE' => array( NumberFormatter::SECONDARY_GROUPING_SIZE, 2, 12345.123456 ),
'SIGNIFICANT_DIGITS_USED' => array( NumberFormatter::SIGNIFICANT_DIGITS_USED, 1, 12345.123456 ),
'MIN_SIGNIFICANT_DIGITS' => array( NumberFormatter::MIN_SIGNIFICANT_DIGITS, 3, 1 ),
'MAX_SIGNIFICANT_DIGITS' => array( NumberFormatter::MAX_SIGNIFICANT_DIGITS, 4, 12345.123456 ),
// 'LENIENT_PARSE' => array( NumberFormatter::LENIENT_PARSE, 2, 12345.123456 )
);
$res_str = '';
$fmt = ut_nfmt_create( "en_US", NumberFormatter::DECIMAL );
foreach( $attributes as $attr_name => $args )
{
list( $attr, $new_val, $number ) = $args;
$res_str .= "\nAttribute $attr_name\n";
// Get original value of the attribute.
$orig_val = ut_nfmt_get_attribute( $fmt, $attr );
// Format the number using the original attribute value.
$rc = ut_nfmt_format( $fmt, $number );
$ps = ut_nfmt_parse( $fmt, $rc );
$res_str .= sprintf( "Old attribute value: %s ; Format result: %s ; Parse result: %s\n",
dump( $orig_val ),
dump( $rc ),
dump( $ps ) );
// Set new attribute value.
$rc = ut_nfmt_set_attribute( $fmt, $attr, $new_val );
if( $rc )
$res_str .= "Setting attribute: ok\n";
else
$res_str .= sprintf( "Setting attribute failed: %s\n", ut_nfmt_get_error_message( $fmt ) );
// Format the number using the new value.
$rc = ut_nfmt_format( $fmt, $number );
// Get current value of the attribute and check if it equals $new_val.
$attr_val_check = ut_nfmt_get_attribute( $fmt, $attr );
if( $attr_val_check !== $new_val )
$res_str .= "ERROR: New $attr_name attribute value has not been set correctly.\n";
$ps = ut_nfmt_parse( $fmt, $rc );
$res_str .= sprintf( "New attribute value: %s ; Format result: %s ; Parse result: %s\n",
dump( $new_val ),
dump( $rc ),
dump( $ps ) );
// Restore original attribute of the value
if( $attr != NumberFormatter::INTEGER_DIGITS && $attr != NumberFormatter::FRACTION_DIGITS
&& $attr != NumberFormatter::FORMAT_WIDTH && $attr != NumberFormatter::SIGNIFICANT_DIGITS_USED )
ut_nfmt_set_attribute( $fmt, $attr, $orig_val );
}
return $res_str;
}
include_once( 'ut_common.inc' );
// Run the test
ut_run();
?>
--EXPECT--
Attribute PARSE_INT_ONLY
Old attribute value: 0 ; Format result: '12,345.123' ; Parse result: 12345.123
Setting attribute: ok
New attribute value: 1 ; Format result: '12,345.123' ; Parse result: 12345
Attribute GROUPING_USED
Old attribute value: 1 ; Format result: '12,345.123' ; Parse result: 12345.123
Setting attribute: ok
New attribute value: 0 ; Format result: '12345.123' ; Parse result: 12345.123
Attribute DECIMAL_ALWAYS_SHOWN
Old attribute value: 0 ; Format result: '12,345' ; Parse result: 12345
Setting attribute: ok
New attribute value: 1 ; Format result: '12,345.' ; Parse result: 12345
Attribute MAX_INTEGER_DIGITS
Old attribute value: 309 ; Format result: '12,345.123' ; Parse result: 12345.123
Setting attribute: ok
New attribute value: 2 ; Format result: '45.123' ; Parse result: 45.123
Attribute MIN_INTEGER_DIGITS
Old attribute value: 1 ; Format result: '12,345.123' ; Parse result: 12345.123
Setting attribute: ok
New attribute value: 20 ; Format result: '00,000,000,000,000,012,345.123' ; Parse result: 12345.123
Attribute INTEGER_DIGITS
Old attribute value: 1 ; Format result: '12,345.123' ; Parse result: 12345.123
Setting attribute: ok
New attribute value: 7 ; Format result: '0,012,345.123' ; Parse result: 12345.123
Attribute MAX_FRACTION_DIGITS
Old attribute value: 3 ; Format result: '0,012,345.123' ; Parse result: 12345.123
Setting attribute: ok
New attribute value: 2 ; Format result: '0,012,345.12' ; Parse result: 12345.12
Attribute MIN_FRACTION_DIGITS
Old attribute value: 0 ; Format result: '0,012,345.123' ; Parse result: 12345.123
Setting attribute: ok
New attribute value: 20 ; Format result: '0,012,345.12345600000000000000' ; Parse result: 12345.123456
Attribute FRACTION_DIGITS
Old attribute value: 0 ; Format result: '0,012,345.123456' ; Parse result: 12345.123456
Setting attribute: ok
New attribute value: 5 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346
Attribute MULTIPLIER
Old attribute value: 1 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346
Setting attribute: ok
New attribute value: 2 ; Format result: '0,024,690.24691' ; Parse result: 12345.123455
Attribute GROUPING_SIZE
Old attribute value: 3 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346
Setting attribute: ok
New attribute value: 2 ; Format result: '0,01,23,45.12346' ; Parse result: 12345.12346
Attribute ROUNDING_MODE
Old attribute value: 4 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346
Setting attribute: ok
New attribute value: 1 ; Format result: '0,012,345.12345' ; Parse result: 12345.12345
Attribute ROUNDING_INCREMENT
Old attribute value: 0 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346
Setting attribute: ok
New attribute value: 2 ; Format result: '0,012,346.00000' ; Parse result: 12346
Attribute FORMAT_WIDTH
Old attribute value: 0 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346
Setting attribute: ok
New attribute value: 27 ; Format result: '************0,012,345.12346' ; Parse result: 12345.12346
Attribute PADDING_POSITION
Old attribute value: 0 ; Format result: '************0,012,345.12346' ; Parse result: 12345.12346
Setting attribute: ok
New attribute value: 21 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346
Attribute SECONDARY_GROUPING_SIZE
Old attribute value: 0 ; Format result: '************0,012,345.12346' ; Parse result: 12345.12346
Setting attribute: ok
New attribute value: 2 ; Format result: '************00,12,345.12346' ; Parse result: 12345.12346
Attribute SIGNIFICANT_DIGITS_USED
Old attribute value: 0 ; Format result: '************0,012,345.12346' ; Parse result: 12345.12346
Setting attribute: ok
New attribute value: 1 ; Format result: '*******************12,345.1' ; Parse result: 12345.1
Attribute MIN_SIGNIFICANT_DIGITS
Old attribute value: 1 ; Format result: '**************************1' ; Parse result: 1
Setting attribute: ok
New attribute value: 3 ; Format result: '***********************1.00' ; Parse result: 1
Attribute MAX_SIGNIFICANT_DIGITS
Old attribute value: 6 ; Format result: '*******************12,345.1' ; Parse result: 12345.1
Setting attribute: ok
New attribute value: 4 ; Format result: '*********************12,350' ; Parse result: 12350
@@ -1,23 +0,0 @@
--TEST--
Bug #55610: ResourceBundle does not implement Traversable
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
--FILE--
<?php
include "resourcebundle.inc";
$r = new ResourceBundle( 'es', BUNDLE );
var_dump($r instanceof Traversable);
var_dump(iterator_to_array($r->get('testarray')));
?>
--EXPECTF--
bool(true)
array(3) {
[0]=>
string(8) "cadena 1"
[1]=>
string(8) "cadena 2"
[2]=>
string(8) "cadena 3"
}
-7
View File
@@ -6,13 +6,6 @@ Patrick Allaert <patrickallaert@php.net>
--SKIPIF--
<?php require_once('skipif.inc'); ?>
<?php if (!function_exists("ldap_sasl_bind")) die("skip LDAP extension not compiled with SASL support"); ?>
<?php
require "connect.inc";
$link = fsockopen($host, $port);
if (!$link) {
die("skip no server listening");
}
?>
--FILE--
<?php
require "connect.inc";
@@ -5,16 +5,6 @@ Patrick Allaert <patrickallaert@php.net>
# Belgian PHP Testfest 2009
--SKIPIF--
<?php require_once('skipif.inc'); ?>
<?php
if (!function_exists("ldap_set_rebind_proc")) {
die("skip ldap_set_rebind_proc() does not exist");
}
require "connect.inc";
$link = fsockopen($host, $port);
if (!$link) {
die("skip no server listening");
}
?>
--FILE--
<?php
require "connect.inc";
+1 -2
View File
@@ -666,8 +666,7 @@ static int php_libxml_post_deactivate()
xmlOutputBufferCreateFilenameDefault(NULL);
if (LIBXML(stream_context)) {
/* the steam_context resource will be released by resource list destructor */
efree(LIBXML(stream_context));
zval_ptr_dtor(&LIBXML(stream_context));
LIBXML(stream_context) = NULL;
}
smart_str_free(&LIBXML(error_buffer));
+2 -4
View File
@@ -4,19 +4,17 @@ Bug #61367: open_basedir bypass in libxml RSHUTDOWN: read test
<?php if(!extension_loaded('dom')) echo 'skip'; ?>
--INI--
open_basedir=.
; Suppress spurious "Trying to get property of non-object" notices
error_reporting=E_ALL & ~E_NOTICE
--FILE--
<?php
/*
* Note: Using error_reporting=E_ALL & ~E_NOTICE to supress "Trying to get property of non-object" notices.
*/
class StreamExploiter {
public function stream_close ( ) {
$doc = new DOMDocument;
$doc->resolveExternals = true;
$doc->substituteEntities = true;
$dir = htmlspecialchars(dirname(getcwd()));
$dir = str_replace('\\', '/', $dir); // fix for windows
$doc->loadXML( <<<XML
<!DOCTYPE doc [
<!ENTITY file SYSTEM "file:///$dir/bad">
+2
View File
@@ -4,6 +4,8 @@ Bug #61367: open_basedir bypass in libxml RSHUTDOWN: write test
<?php if(!extension_loaded('dom')) echo 'skip'; ?>
--INI--
open_basedir=.
; Suppress spurious "Trying to get property of non-object" notices
error_reporting=E_ALL & ~E_NOTICE
--FILE--
<?php
-3
View File
@@ -2,9 +2,6 @@
Bug #52681 (mb_send_mail() appends an extra MIME-Version header)
--SKIPIF--
<?php
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip.. Not valid for Windows');
}
if (!function_exists("mb_send_mail") || !mb_language("neutral")) {
die("skip mb_send_mail() not available");
}
-3
View File
@@ -2,9 +2,6 @@
mb_send_mail() test 1 (lang=neutral)
--SKIPIF--
<?php
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip.. Not valid for Windows');
}
if (!function_exists("mb_send_mail") || !mb_language("neutral")) {
die("skip mb_send_mail() not available");
}
-3
View File
@@ -2,9 +2,6 @@
mb_send_mail() test 2 (lang=Japanese)
--SKIPIF--
<?php
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip.. Not valid for Windows');
}
if (!function_exists("mb_send_mail") || !mb_language("japanese")) {
die("skip mb_send_mail() not available");
}
-3
View File
@@ -2,9 +2,6 @@
mb_send_mail() test 3 (lang=English)
--SKIPIF--
<?php
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip.. Not valid for Windows');
}
if (!function_exists("mb_send_mail") || !mb_language("english")) {
die("skip mb_send_mail() not available");
}
-3
View File
@@ -2,9 +2,6 @@
mb_send_mail() test 4 (lang=German)
--SKIPIF--
<?php
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip.. Not valid for Windows');
}
if (!function_exists("mb_send_mail") || !mb_language("german")) {
die("skip mb_send_mail() not available");
}
-3
View File
@@ -2,9 +2,6 @@
mb_send_mail() test 5 (lang=Simplified Chinese)
--SKIPIF--
<?php
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip.. Not valid for Windows');
}
if (!function_exists("mb_send_mail") || !mb_language("Simplified Chinese")) {
die("skip mb_send_mail() not available");
}
-3
View File
@@ -2,9 +2,6 @@
mb_send_mail() test 6 (lang=Traditional Chinese)
--SKIPIF--
<?php
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip.. Not valid for Windows');
}
if (!function_exists("mb_send_mail") || !mb_language("Traditional Chinese")) {
die("skip mb_send_mail() not available");
}
-3
View File
@@ -2,9 +2,6 @@
mb_send_mail() test 7 (lang=Korean)
--SKIPIF--
<?php
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip.. Not valid for Windows');
}
if (!function_exists("mb_send_mail") || !mb_language("Korean")) {
die("skip mb_send_mail() not available");
}
-40
View File
@@ -1,40 +0,0 @@
--TEST--
Bug #62046 mysqli@mysqlnd can't iterate over stored sets after call to mysqli_stmt_reset()
--SKIPIF--
<?php
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
?>
--FILE--
<?php
require_once("connect.inc");
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
printf("[001] Connect failed, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
}
if (FALSE === ($stmt = $link->prepare('SELECT 42'))) {
printf("[002] Prepare failed, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
}
if (FALSE === $stmt->execute()) {
printf("[003] Execute failed, [%d] %s\n", $stmt->errorno, $stmt->error);
}
if (FALSE === $stmt->store_result()) {
printf("[004] store_result failed, [%d] %s\n", $stmt->errorno, $stmt->error);
}
$one = NULL;
if (FALSE === $stmt->bind_result($one)) {
printf("[005] bind_result failed, [%d] %s\n", $stmt->errorno, $stmt->error);
}
if (FALSE === $stmt->reset()) {
printf("[006] bind_result failed, [%d] %s\n", $stmt->errorno, $stmt->error);
}
while ($stmt->fetch()) {
var_dump($one);
}
$stmt->close();
$link->close();
echo "done!";
?>
--EXPECT--
int(42)
done!
Loaded 100 of 348 files, more files were not shown because too many files have changed in this diff. Show more