mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-12 03:30:50 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d005ed9681 | ||
|
|
b7f033bd5d | ||
|
|
29b4532f61 | ||
|
|
f12f3abe8e | ||
|
|
82dd6b94f2 | ||
|
|
5a186a3e0a | ||
|
|
ba30c78d5c | ||
|
|
cd14de94d2 | ||
|
|
cb361ed27e | ||
|
|
8280393828 | ||
|
|
39612afc72 | ||
|
|
9ad97cd489 | ||
|
|
8c61758dc7 | ||
|
|
9d62807190 | ||
|
|
2b9f5ac252 | ||
|
|
7f69f07fc1 | ||
|
|
dcea4ec698 | ||
|
|
2874696a5a | ||
|
|
f3d18add08 | ||
|
|
f4dc2240a0 | ||
|
|
bab33f7e05 | ||
|
|
72aacbf735 | ||
|
|
87198989cd | ||
|
|
4134ebec8e | ||
|
|
76fd13f742 | ||
|
|
29f1aa2618 | ||
|
|
cf39c3d638 | ||
|
|
1a5c460ea2 | ||
|
|
5f5ff92bc0 | ||
|
|
24f36934ad | ||
|
|
473d66553d | ||
|
|
6b4971a29b | ||
|
|
36b759d1dd | ||
|
|
3f99ba6351 | ||
|
|
cdedee3fa1 | ||
|
|
143ec70638 | ||
|
|
503d39d925 | ||
|
|
ac538e5e16 | ||
|
|
bff1a96a0f | ||
|
|
2df95b1354 | ||
|
|
0ad81ac18a | ||
|
|
9d95a1a7d1 | ||
|
|
e9b128c1bf | ||
|
|
b27f6826d4 | ||
|
|
b33824bfea | ||
|
|
ac28283beb | ||
|
|
22d7002462 | ||
|
|
fc7fe62e3b | ||
|
|
c9243344a0 | ||
|
|
a188693a27 | ||
|
|
d3dae9a616 | ||
|
|
80fe5461a9 | ||
|
|
1e2f72d6b6 | ||
|
|
82a7ec72de | ||
|
|
ae4f8b2ab0 | ||
|
|
4ed133c4e2 | ||
|
|
c932d532c8 | ||
|
|
c6d977dd39 | ||
|
|
930183f961 | ||
|
|
2743c3aac8 | ||
|
|
aa042d0c35 | ||
|
|
a831499b4a | ||
|
|
6184753fab | ||
|
|
6e505f4969 | ||
|
|
4f87f26d06 | ||
|
|
0cd77475e0 | ||
|
|
18f17818a6 | ||
|
|
47d66a0b4e | ||
|
|
6e89818f2f | ||
|
|
3bbe5931bc | ||
|
|
a5c524f1be | ||
|
|
3c5e229212 | ||
|
|
b90b551228 | ||
|
|
ec4019e8f6 | ||
|
|
cabf38af6d | ||
|
|
963c1be38d | ||
|
|
cb8d1fc7f9 | ||
|
|
f718684a6c | ||
|
|
e59143e896 | ||
|
|
6f73a0c00f | ||
|
|
7d3fa7d8b6 | ||
|
|
a93a462dce | ||
|
|
e4f9619fad | ||
|
|
b80d73ce15 | ||
|
|
82b0e8be99 | ||
|
|
25e8fcc88f | ||
|
|
c793a65690 | ||
|
|
8d86597d73 | ||
|
|
3626db6142 | ||
|
|
5f137d080a | ||
|
|
626d96ab6d | ||
|
|
f17f596b27 | ||
|
|
a03f0943ca | ||
|
|
d24f31c65e | ||
|
|
d60e168a7a | ||
|
|
9ca7910661 | ||
|
|
ea75b1b5db | ||
|
|
3d0aca80f2 | ||
|
|
e55f08a5ae | ||
|
|
a85e71e655 | ||
|
|
5753b74fab | ||
|
|
47ac4f8670 | ||
|
|
6f1a762fab | ||
|
|
1e942dde24 | ||
|
|
ce9169e360 | ||
|
|
1c32b97bc3 | ||
|
|
cb13f8318b | ||
|
|
48ea95188e | ||
|
|
d884ec15e9 | ||
|
|
146b933ab4 | ||
|
|
c069b5f571 | ||
|
|
2ab080da2d | ||
|
|
017145bc57 | ||
|
|
4ed18d5955 | ||
|
|
3b4d2647f9 | ||
|
|
e3a4b87e89 | ||
|
|
0625d5ce67 | ||
|
|
4590070f31 | ||
|
|
5129892788 | ||
|
|
4395f70207 | ||
|
|
35872e101b | ||
|
|
fd8f454520 | ||
|
|
d69b3d8f59 | ||
|
|
f7c87fcc8c | ||
|
|
0a974f14d1 | ||
|
|
d9e2dc8084 | ||
|
|
f3aca8bc4d | ||
|
|
f14ed5bce0 | ||
|
|
7da3315015 | ||
|
|
c10d7e1afc | ||
|
|
2bd23530d8 | ||
|
|
02409669e4 | ||
|
|
8ca04e51aa | ||
|
|
cb17c99511 | ||
|
|
e2aba1cf9e | ||
|
|
3550f3d0aa | ||
|
|
e37fdbb2f2 | ||
|
|
ae5e70afac | ||
|
|
bafe0e5399 | ||
|
|
ef3d813d2c | ||
|
|
1d7b6970f2 | ||
|
|
8e79724c6f | ||
|
|
fd616ba50f | ||
|
|
4cab45946c | ||
|
|
29b2522df1 | ||
|
|
42e8f3ca28 | ||
|
|
979194351d | ||
|
|
9776504c5b | ||
|
|
515092917d | ||
|
|
1fbcfc9bdb | ||
|
|
9126909c08 | ||
|
|
9909c4d4c4 | ||
|
|
b8c8a04a85 | ||
|
|
96a53f6715 | ||
|
|
f9000fde98 | ||
|
|
f00d796b7e | ||
|
|
7b92a22772 | ||
|
|
5a8b0ca8fa | ||
|
|
c28ab73d73 | ||
|
|
063e10b275 | ||
|
|
8aebe0f1e7 | ||
|
|
9b6aa268a3 | ||
|
|
024972e3b9 | ||
|
|
a1bf38e075 | ||
|
|
7c9bb87edd | ||
|
|
bd20c79423 | ||
|
|
25f924abf6 | ||
|
|
f8efdc2b4b | ||
|
|
b8d4a6939e | ||
|
|
1b4103c09d | ||
|
|
83ced9124e | ||
|
|
476924ec3d | ||
|
|
ba984582db | ||
|
|
da3886de6d | ||
|
|
5027fa79d7 | ||
|
|
2c23004a1e | ||
|
|
e7a00a2566 | ||
|
|
f51b8d8820 | ||
|
|
b8941a73cc | ||
|
|
97637b2a4c | ||
|
|
4749457a49 | ||
|
|
29281dee49 | ||
|
|
c7b58e4967 | ||
|
|
3380de9774 | ||
|
|
3cd13204bb | ||
|
|
629965abe2 | ||
|
|
cc91fbe986 | ||
|
|
3363e04fb4 | ||
|
|
b963249456 | ||
|
|
a015fa83a7 | ||
|
|
1dc7d0da08 | ||
|
|
2b9d42433f | ||
|
|
99afc6dc11 | ||
|
|
c091819f40 |
No files matched your search
+12
-3
@@ -10,7 +10,7 @@ all: $(all_targets)
|
||||
@echo "Build complete."
|
||||
@echo "Don't forget to run 'make test'."
|
||||
@echo
|
||||
|
||||
|
||||
build-modules: $(PHP_MODULES) $(PHP_ZEND_EX)
|
||||
|
||||
build-binaries: $(PHP_BINARIES)
|
||||
@@ -115,10 +115,19 @@ clean:
|
||||
find . -name \*.la -o -name \*.a | xargs rm -f
|
||||
find . -name \*.so | xargs rm -f
|
||||
find . -name .libs -a -type d|xargs rm -rf
|
||||
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(OVERALL_TARGET) modules/* libs/*
|
||||
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(SAPI_CGI_PATH) $(SAPI_MILTER_PATH) $(SAPI_LITESPEED_PATH) $(SAPI_FPM_PATH) $(OVERALL_TARGET) modules/* libs/*
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h stamp-h sapi/apache/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp
|
||||
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h main/internal_functions_cli.c main/internal_functions.c stamp-h sapi/apache/libphp$(PHP_MAJOR_VERSION).module sapi/apache_hooks/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp Zend/zend_dtrace_gen.h Zend/zend_dtrace_gen.h.bak Zend/zend_config.h TSRM/tsrm_config.h
|
||||
rm -f php5.spec main/build-defs.h scripts/phpize
|
||||
rm -f ext/date/lib/timelib_config.h ext/mbstring/oniguruma/config.h ext/mbstring/libmbfl/config.h ext/mysqlnd/php_mysqlnd_config.h
|
||||
rm -f scripts/man1/phpize.1 scripts/php-config scripts/man1/php-config.1 sapi/cli/php.1 sapi/cgi/php-cgi.1 ext/phar/phar.1 ext/phar/phar.phar.1
|
||||
rm -f sapi/fpm/php-fpm.conf sapi/fpm/init.d.php-fpm sapi/fpm/php-fpm.service sapi/fpm/php-fpm.8 sapi/fpm/status.html
|
||||
rm -f ext/iconv/php_have_bsd_iconv.h ext/iconv/php_have_glibc_iconv.h ext/iconv/php_have_ibm_iconv.h ext/iconv/php_have_iconv.h ext/iconv/php_have_libiconv.h ext/iconv/php_iconv_aliased_libiconv.h ext/iconv/php_iconv_supports_errno.h ext/iconv/php_php_iconv_h_path.h ext/iconv/php_php_iconv_impl.h
|
||||
rm -f ext/phar/phar.phar ext/phar/phar.php
|
||||
if test "$(srcdir)" != "$(builddir)"; then \
|
||||
rm -f ext/phar/phar/phar.inc; \
|
||||
fi
|
||||
$(EGREP) define'.*include/php' $(top_srcdir)/configure | $(SED) 's/.*>//'|xargs rm -f
|
||||
|
||||
.PHONY: all clean install distclean test
|
||||
|
||||
@@ -1,6 +1,78 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? 2013, PHP 5.5.2
|
||||
22 Aug 2013, PHP 5.5.3
|
||||
|
||||
- Openssl:
|
||||
. Fixed UMR in fix for CVE-2013-4248.
|
||||
|
||||
15 Aug 2013, PHP 5.5.2
|
||||
|
||||
- Core:
|
||||
. Fixed bug #65372 (Segfault in gc_zval_possible_root when return reference
|
||||
fails). (Laruence)
|
||||
. Fixed value of FILTER_SANITIZE_FULL_SPECIAL_CHARS constant (previously was
|
||||
erroneously set to FILTER_SANITIZE_SPECIAL_CHARS value). (Andrey
|
||||
avp200681 gmail com).
|
||||
. Fixed bug #65304 (Use of max int in array_sum). (Laruence)
|
||||
. Fixed bug #65291 (get_defined_constants() causes PHP to crash in a very
|
||||
limited case). (Arpad)
|
||||
. Fixed bug #62691 (solaris sed has no -i switch). (Chris Jones)
|
||||
. Fixed bug #61345 (CGI mode - make install don't work). (Michael Heimpold)
|
||||
. Fixed bug #61268 (--enable-dtrace leads make to clobber
|
||||
Zend/zend_dtrace.d) (Chris Jones)
|
||||
|
||||
- DOM:
|
||||
. Added flags option to DOMDocument::schemaValidate() and
|
||||
DOMDocument::schemaValidateSource(). Added LIBXML_SCHEMA_CREATE flag.
|
||||
(Chris Wright)
|
||||
|
||||
- OPcache:
|
||||
. Added opcache.restrict_api configuration directive that may limit
|
||||
usage of OPcache API functions only to particular script(s). (Dmitry)
|
||||
. Added support for glob symbols in blacklist entries (?, *, **).
|
||||
(Terry Elison, Dmitry)
|
||||
. Fixed bug #65338 (Enabling both php_opcache and php_wincache AVs on
|
||||
shutdown). (Dmitry)
|
||||
|
||||
- Openssl:
|
||||
. Fixed handling null bytes in subjectAltName (CVE-2013-4248).
|
||||
(Christian Heimes)
|
||||
|
||||
- PDO_mysql:
|
||||
. Fixed bug #65299 (pdo mysql parsing errors). (Johannes)
|
||||
|
||||
- Pgsql:
|
||||
. Fixed bug #62978 (Disallow possible SQL injections with pg_select()/pg_update()
|
||||
/pg_delete()/pg_insert()). (Yasuo)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #65028 (Phar::buildFromDirectory creates corrupt archives for
|
||||
some specific contents). (Stas)
|
||||
|
||||
- Sessions:
|
||||
. Implemented strict sessions RFC (https://wiki.php.net/rfc/strict_sessions)
|
||||
which protects against session fixation attacks and session collisions.
|
||||
(CVE-2011-4718). (Yasuo Ohgaki)
|
||||
. Fixed possible buffer overflow under Windows. Note: Not a security fix.
|
||||
(Yasuo)
|
||||
. Changed session.auto_start to PHP_INI_PERDIR. (Yasuo)
|
||||
|
||||
- SOAP:
|
||||
. Fixed bug #65018 (SoapHeader problems with SoapServer). (Dmitry)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #65328 (Segfault when getting SplStack object Value). (Laruence)
|
||||
. Added RecursiveTreeIterator setPostfix and getPostifx methods. (Joshua
|
||||
Thijssen)
|
||||
. Fixed bug #61697 (spl_autoload_functions returns lambda functions
|
||||
incorrectly). (Laruence)
|
||||
|
||||
- Streams:
|
||||
. Fixed bug #65268 (select() implementation uses outdated tick API). (Anatol)
|
||||
|
||||
- Pgsql:
|
||||
. Fixed bug #65336 (pg_escape_literal/identifier() scilently returns false).
|
||||
(Yasuo)
|
||||
|
||||
18 Jul 2013, PHP 5.5.1
|
||||
|
||||
|
||||
+5
-3
@@ -625,7 +625,7 @@ TSRM_API int shmget(int key, int size, int flags)
|
||||
shm->info = info_handle;
|
||||
shm->descriptor = MapViewOfFileEx(shm->info, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL);
|
||||
|
||||
if (created) {
|
||||
if (NULL != shm->descriptor && created) {
|
||||
shm->descriptor->shm_perm.key = key;
|
||||
shm->descriptor->shm_segsz = size;
|
||||
shm->descriptor->shm_ctime = time(NULL);
|
||||
@@ -639,8 +639,10 @@ TSRM_API int shmget(int key, int size, int flags)
|
||||
shm->descriptor->shm_perm.mode = shm->descriptor->shm_perm.seq = 0;
|
||||
}
|
||||
|
||||
if (shm->descriptor->shm_perm.key != key || size > shm->descriptor->shm_segsz ) {
|
||||
CloseHandle(shm->segment);
|
||||
if (NULL != shm->descriptor && (shm->descriptor->shm_perm.key != key || size > shm->descriptor->shm_segsz)) {
|
||||
if (NULL != shm->segment) {
|
||||
CloseHandle(shm->segment);
|
||||
}
|
||||
UnmapViewOfFile(shm->descriptor);
|
||||
CloseHandle(shm->info);
|
||||
return -1;
|
||||
|
||||
@@ -179,6 +179,13 @@ PHP 5.5 UPGRADE NOTES
|
||||
- Functions in the socket extension now do not emit warnings when the
|
||||
errno is EAGAIN, EWOULDBLOCK or EINPROGRESS.
|
||||
|
||||
- Since 5.5.2, spl_autoload_functions() returns different names for
|
||||
different lambda functions registered via spl_autoload_register().
|
||||
|
||||
- Since 5.5.3, DOMDocument::schemaValidateSource() and
|
||||
DOMDocument::schemaValidate() accept flag parameter. Only flag
|
||||
available now is LIBXML_SCHEMA_CREATE. Default is 0.
|
||||
|
||||
========================================
|
||||
5. New Functions
|
||||
========================================
|
||||
@@ -297,6 +304,8 @@ PHP 5.5 UPGRADE NOTES
|
||||
- SPL:
|
||||
- SplFixedArray::__wakeup()
|
||||
- SplDoublyLinkedList::add()
|
||||
- RecursiveTreeIterator::getPostfix() (5.5.2)
|
||||
- RecursiveTreeIterator::setPostfix() (5.5.2)
|
||||
|
||||
- Zend OPcache:
|
||||
- opcache_get_configuration()
|
||||
@@ -397,12 +406,21 @@ None
|
||||
- Added intl.use_exceptions INI directive, which controls what
|
||||
happens when global errors are set together with intl.error_level.
|
||||
|
||||
- MSSQL:
|
||||
- mssql.compatability_mode renamed to mssql.compatibility_mode in 5.5.2,
|
||||
old directive still supported for BC reasons.
|
||||
|
||||
- mysqlnd:
|
||||
- Added mysqlnd.sha256_server_public_key INI PERDIR setting that
|
||||
affects all APIs which use(are built) for mysqlnd. This allows
|
||||
ext/mysqli to be used with the new auth protocol, although at
|
||||
coarser level.
|
||||
|
||||
- Sessions:
|
||||
- Added session.use_strict_mode in 5.5.3, which prevents session
|
||||
fixation attacks and session collisions.
|
||||
See also https://wiki.php.net/rfc/strict_sessions
|
||||
|
||||
- Zend OPcache (See http://php.net/manual/en/book.opcache.php)
|
||||
- Added the following directives:
|
||||
- opcache.enable (default "1")
|
||||
|
||||
+10
-10
@@ -1,10 +1,10 @@
|
||||
--TEST--
|
||||
test of larger than 8kb text file being parsed by require statement
|
||||
--FILE--
|
||||
<?php
|
||||
file_put_contents('test.php',str_repeat('passed, ',1024));
|
||||
require('test.php');
|
||||
unlink('test.php');
|
||||
?>
|
||||
--EXPECT--
|
||||
passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed,Line truncated
|
||||
--TEST--
|
||||
test of larger than 8kb text file being parsed by require statement
|
||||
--FILE--
|
||||
<?php
|
||||
file_put_contents('test.php',str_repeat('passed, ',1024));
|
||||
require('./test.php');
|
||||
unlink('test.php');
|
||||
?>
|
||||
--EXPECT--
|
||||
passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed,Line truncated
|
||||
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
Bug #65291 - get_defined_constants() causes PHP to crash in a very limited case.
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
trait TestTrait
|
||||
{
|
||||
public static function testStaticFunction()
|
||||
{
|
||||
return __CLASS__;
|
||||
}
|
||||
}
|
||||
class Tester
|
||||
{
|
||||
use TestTrait;
|
||||
}
|
||||
|
||||
$foo = Tester::testStaticFunction();
|
||||
get_defined_constants();
|
||||
get_defined_constants(true);
|
||||
|
||||
echo $foo;
|
||||
?>
|
||||
--EXPECT--
|
||||
Tester
|
||||
@@ -0,0 +1,40 @@
|
||||
--TEST--
|
||||
Bug #65372 (Segfault in gc_zval_possible_root when return reference fails)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class ParentClass
|
||||
{
|
||||
private static $_OBJECTS;
|
||||
|
||||
public static function Get()
|
||||
{
|
||||
self::$_OBJECTS[1] = new ChildClass();
|
||||
return self::$_OBJECTS[1];
|
||||
}
|
||||
}
|
||||
|
||||
class ChildClass extends ParentClass
|
||||
{
|
||||
public $Manager;
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$this->Manager = $this;
|
||||
}
|
||||
|
||||
public static function &GetCurrent()
|
||||
{
|
||||
return ChildClass::Get();
|
||||
}
|
||||
|
||||
public static function &Get()
|
||||
{
|
||||
return parent::Get();
|
||||
}
|
||||
}
|
||||
|
||||
$staff = ChildClass::GetCurrent();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Only variable references should be returned by reference in %sbug65372.php on line 30
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Overridding Conflicting Methods should not result in a notice/warning about collisions
|
||||
Overriding Conflicting Methods should not result in a notice/warning about collisions
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL);
|
||||
|
||||
+1
-1
@@ -1098,7 +1098,7 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
|
||||
if(DTRACE_ERROR_ENABLED()) {
|
||||
char *dtrace_error_buffer;
|
||||
zend_vspprintf(&dtrace_error_buffer, 0, format, args);
|
||||
DTRACE_ERROR(dtrace_error_buffer, error_filename, error_lineno);
|
||||
DTRACE_ERROR(dtrace_error_buffer, (char *)error_filename, error_lineno);
|
||||
efree(dtrace_error_buffer);
|
||||
}
|
||||
#endif /* HAVE_DTRACE */
|
||||
|
||||
@@ -1911,6 +1911,11 @@ static int add_constant_info(zend_constant *constant, void *arg TSRMLS_DC)
|
||||
zval *name_array = (zval *)arg;
|
||||
zval *const_val;
|
||||
|
||||
if (!constant->name) {
|
||||
/* skip special constants */
|
||||
return 0;
|
||||
}
|
||||
|
||||
MAKE_STD_ZVAL(const_val);
|
||||
*const_val = constant->value;
|
||||
zval_copy_ctor(const_val);
|
||||
@@ -1978,11 +1983,16 @@ ZEND_FUNCTION(get_defined_constants)
|
||||
while (zend_hash_get_current_data_ex(EG(zend_constants), (void **) &val, &pos) != FAILURE) {
|
||||
zval *const_val;
|
||||
|
||||
if (!val->name) {
|
||||
/* skip special constants */
|
||||
goto next_constant;
|
||||
}
|
||||
|
||||
if (val->module_number == PHP_USER_CONSTANT) {
|
||||
module_number = i;
|
||||
} else if (val->module_number > i || val->module_number < 0) {
|
||||
/* should not happen */
|
||||
goto bad_module_id;
|
||||
goto next_constant;
|
||||
} else {
|
||||
module_number = val->module_number;
|
||||
}
|
||||
@@ -1999,7 +2009,7 @@ ZEND_FUNCTION(get_defined_constants)
|
||||
INIT_PZVAL(const_val);
|
||||
|
||||
add_assoc_zval_ex(modules[module_number], val->name, val->name_len, const_val);
|
||||
bad_module_id:
|
||||
next_constant:
|
||||
zend_hash_move_forward_ex(EG(zend_constants), &pos);
|
||||
}
|
||||
efree(module_names);
|
||||
@@ -2371,7 +2381,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
|
||||
MAKE_STD_ZVAL(arg_array);
|
||||
array_init(arg_array);
|
||||
|
||||
/* include_filename always points to the last filename of the last last called-fuction.
|
||||
/* include_filename always points to the last filename of the last last called-function.
|
||||
if we have called include in the frame above - this is the file we have included.
|
||||
*/
|
||||
|
||||
|
||||
+3
-3
@@ -1734,7 +1734,7 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
|
||||
}
|
||||
|
||||
{
|
||||
/* Push a seperator to the switch stack */
|
||||
/* Push a separator to the switch stack */
|
||||
zend_switch_entry switch_entry;
|
||||
|
||||
switch_entry.cond.op_type = IS_UNUSED;
|
||||
@@ -1828,7 +1828,7 @@ void zend_do_end_function_declaration(const znode *function_token TSRMLS_DC) /*
|
||||
CG(active_op_array) = function_token->u.op_array;
|
||||
|
||||
|
||||
/* Pop the switch and foreach seperators */
|
||||
/* Pop the switch and foreach separators */
|
||||
zend_stack_del_top(&CG(switch_cond_stack));
|
||||
zend_stack_del_top(&CG(foreach_copy_stack));
|
||||
}
|
||||
@@ -2671,7 +2671,7 @@ static int generate_free_foreach_copy(const zend_op *foreach_copy TSRMLS_DC) /*
|
||||
{
|
||||
zend_op *opline;
|
||||
|
||||
/* If we reach the seperator then stop applying the stack */
|
||||
/* If we reach the separator then stop applying the stack */
|
||||
if (foreach_copy->result_type == IS_UNUSED && foreach_copy->op1_type == IS_UNUSED) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
+11
-11
@@ -24,7 +24,7 @@
|
||||
|
||||
#ifdef HAVE_DTRACE
|
||||
/* PHP DTrace probes {{{ */
|
||||
static inline char *dtrace_get_executed_filename(TSRMLS_D)
|
||||
static inline const char *dtrace_get_executed_filename(TSRMLS_D)
|
||||
{
|
||||
if (EG(current_execute_data) && EG(current_execute_data)->op_array) {
|
||||
return EG(current_execute_data)->op_array->filename;
|
||||
@@ -36,9 +36,9 @@ static inline char *dtrace_get_executed_filename(TSRMLS_D)
|
||||
ZEND_API zend_op_array *dtrace_compile_file(zend_file_handle *file_handle, int type TSRMLS_DC)
|
||||
{
|
||||
zend_op_array *res;
|
||||
DTRACE_COMPILE_FILE_ENTRY(file_handle->opened_path, file_handle->filename);
|
||||
DTRACE_COMPILE_FILE_ENTRY(file_handle->opened_path, (char *)file_handle->filename);
|
||||
res = compile_file(file_handle, type TSRMLS_CC);
|
||||
DTRACE_COMPILE_FILE_RETURN(file_handle->opened_path, file_handle->filename);
|
||||
DTRACE_COMPILE_FILE_RETURN(file_handle->opened_path, (char *)file_handle->filename);
|
||||
|
||||
return res;
|
||||
}
|
||||
@@ -47,7 +47,7 @@ ZEND_API zend_op_array *dtrace_compile_file(zend_file_handle *file_handle, int t
|
||||
ZEND_API void dtrace_execute_ex(zend_execute_data *execute_data TSRMLS_DC)
|
||||
{
|
||||
int lineno;
|
||||
char *scope, *filename, *funcname, *classname;
|
||||
const char *scope, *filename, *funcname, *classname;
|
||||
scope = filename = funcname = classname = NULL;
|
||||
|
||||
/* we need filename and lineno for both execute and function probes */
|
||||
@@ -65,41 +65,41 @@ ZEND_API void dtrace_execute_ex(zend_execute_data *execute_data TSRMLS_DC)
|
||||
}
|
||||
|
||||
if (DTRACE_EXECUTE_ENTRY_ENABLED()) {
|
||||
DTRACE_EXECUTE_ENTRY(filename, lineno);
|
||||
DTRACE_EXECUTE_ENTRY((char *)filename, lineno);
|
||||
}
|
||||
|
||||
if (DTRACE_FUNCTION_ENTRY_ENABLED() && funcname != NULL) {
|
||||
DTRACE_FUNCTION_ENTRY(funcname, filename, lineno, classname, scope);
|
||||
DTRACE_FUNCTION_ENTRY((char *)funcname, (char *)filename, lineno, (char *)classname, (char *)scope);
|
||||
}
|
||||
|
||||
execute_ex(execute_data TSRMLS_CC);
|
||||
|
||||
if (DTRACE_FUNCTION_RETURN_ENABLED() && funcname != NULL) {
|
||||
DTRACE_FUNCTION_RETURN(funcname, filename, lineno, classname, scope);
|
||||
DTRACE_FUNCTION_RETURN((char *)funcname, (char *)filename, lineno, (char *)classname, (char *)scope);
|
||||
}
|
||||
|
||||
if (DTRACE_EXECUTE_RETURN_ENABLED()) {
|
||||
DTRACE_EXECUTE_RETURN(filename, lineno);
|
||||
DTRACE_EXECUTE_RETURN((char *)filename, lineno);
|
||||
}
|
||||
}
|
||||
|
||||
ZEND_API void dtrace_execute_internal(zend_execute_data *execute_data_ptr, zend_fcall_info *fci, int return_value_used TSRMLS_DC)
|
||||
{
|
||||
int lineno;
|
||||
char *filename;
|
||||
const char *filename;
|
||||
if (DTRACE_EXECUTE_ENTRY_ENABLED() || DTRACE_EXECUTE_RETURN_ENABLED()) {
|
||||
filename = dtrace_get_executed_filename(TSRMLS_C);
|
||||
lineno = zend_get_executed_lineno(TSRMLS_C);
|
||||
}
|
||||
|
||||
if (DTRACE_EXECUTE_ENTRY_ENABLED()) {
|
||||
DTRACE_EXECUTE_ENTRY(filename, lineno);
|
||||
DTRACE_EXECUTE_ENTRY((char *)filename, lineno);
|
||||
}
|
||||
|
||||
execute_internal(execute_data_ptr, fci, return_value_used TSRMLS_CC);
|
||||
|
||||
if (DTRACE_EXECUTE_RETURN_ENABLED()) {
|
||||
DTRACE_EXECUTE_RETURN(filename, lineno);
|
||||
DTRACE_EXECUTE_RETURN((char *)filename, lineno);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -85,12 +85,12 @@ void zend_throw_exception_internal(zval *exception TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
#ifdef HAVE_DTRACE
|
||||
if (DTRACE_EXCEPTION_THROWN_ENABLED()) {
|
||||
char *classname;
|
||||
int name_len;
|
||||
const char *classname;
|
||||
zend_uint name_len;
|
||||
|
||||
if (exception != NULL) {
|
||||
zend_get_object_classname(exception, &classname, &name_len TSRMLS_CC);
|
||||
DTRACE_EXCEPTION_THROWN(classname);
|
||||
DTRACE_EXCEPTION_THROWN((char *)classname);
|
||||
} else {
|
||||
DTRACE_EXCEPTION_THROWN(NULL);
|
||||
}
|
||||
|
||||
@@ -1054,7 +1054,7 @@ ZEND_API int zend_lookup_class_ex(const char *name, int name_length, const zend_
|
||||
}
|
||||
|
||||
/* The compiler is not-reentrant. Make sure we __autoload() only during run-time
|
||||
* (doesn't impact fuctionality of __autoload()
|
||||
* (doesn't impact functionality of __autoload()
|
||||
*/
|
||||
if (!use_autoload || zend_is_compiling(TSRMLS_C)) {
|
||||
if (!key) {
|
||||
|
||||
+1
-1
@@ -302,7 +302,7 @@ struct _zend_php_scanner_globals {
|
||||
unsigned char *script_filtered;
|
||||
size_t script_filtered_size;
|
||||
|
||||
/* input/ouput filters */
|
||||
/* input/output filters */
|
||||
zend_encoding_filter input_filter;
|
||||
zend_encoding_filter output_filter;
|
||||
const zend_encoding *script_encoding;
|
||||
|
||||
+2
-2
@@ -1168,7 +1168,7 @@ ZEND_API int zend_hash_get_current_key_ex(const HashTable *ht, char **str_index,
|
||||
return HASH_KEY_IS_LONG;
|
||||
}
|
||||
}
|
||||
return HASH_KEY_NON_EXISTANT;
|
||||
return HASH_KEY_NON_EXISTENT;
|
||||
}
|
||||
|
||||
ZEND_API void zend_hash_get_current_key_zval_ex(const HashTable *ht, zval *key, HashPosition *pos) {
|
||||
@@ -1205,7 +1205,7 @@ ZEND_API int zend_hash_get_current_key_type_ex(HashTable *ht, HashPosition *pos)
|
||||
return HASH_KEY_IS_LONG;
|
||||
}
|
||||
}
|
||||
return HASH_KEY_NON_EXISTANT;
|
||||
return HASH_KEY_NON_EXISTENT;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+3
-2
@@ -27,7 +27,8 @@
|
||||
|
||||
#define HASH_KEY_IS_STRING 1
|
||||
#define HASH_KEY_IS_LONG 2
|
||||
#define HASH_KEY_NON_EXISTANT 3
|
||||
#define HASH_KEY_NON_EXISTENT 3
|
||||
#define HASH_KEY_NON_EXISTANT HASH_KEY_NON_EXISTENT /* Keeping old define (with typo) for backward compatibility */
|
||||
|
||||
#define HASH_UPDATE (1<<0)
|
||||
#define HASH_ADD (1<<1)
|
||||
@@ -172,7 +173,7 @@ ZEND_API ulong zend_hash_next_free_element(const HashTable *ht);
|
||||
|
||||
/* traversing */
|
||||
#define zend_hash_has_more_elements_ex(ht, pos) \
|
||||
(zend_hash_get_current_key_type_ex(ht, pos) == HASH_KEY_NON_EXISTANT ? FAILURE : SUCCESS)
|
||||
(zend_hash_get_current_key_type_ex(ht, pos) == HASH_KEY_NON_EXISTENT ? FAILURE : SUCCESS)
|
||||
ZEND_API int zend_hash_move_forward_ex(HashTable *ht, HashPosition *pos);
|
||||
ZEND_API int zend_hash_move_backwards_ex(HashTable *ht, HashPosition *pos);
|
||||
ZEND_API int zend_hash_get_current_key_ex(const HashTable *ht, char **str_index, uint *str_length, ulong *num_index, zend_bool duplicate, HashPosition *pos);
|
||||
|
||||
@@ -45,7 +45,7 @@ typedef struct _zend_lex_state {
|
||||
unsigned char *script_filtered;
|
||||
size_t script_filtered_size;
|
||||
|
||||
/* input/ouput filters */
|
||||
/* input/output filters */
|
||||
zend_encoding_filter input_filter;
|
||||
zend_encoding_filter output_filter;
|
||||
const zend_encoding *script_encoding;
|
||||
|
||||
+8
-5
@@ -2920,9 +2920,12 @@ ZEND_VM_HANDLER(111, ZEND_RETURN_BY_REF, CONST|TMP|VAR|CV, ANY)
|
||||
} else if (EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr) {
|
||||
zend_error(E_NOTICE, "Only variable references should be returned by reference");
|
||||
if (EG(return_value_ptr_ptr)) {
|
||||
retval_ptr = *retval_ptr_ptr;
|
||||
*EG(return_value_ptr_ptr) = retval_ptr;
|
||||
Z_ADDREF_P(retval_ptr);
|
||||
zval *ret;
|
||||
|
||||
ALLOC_ZVAL(ret);
|
||||
INIT_PZVAL_COPY(ret, *retval_ptr_ptr);
|
||||
zval_copy_ctor(ret);
|
||||
*EG(return_value_ptr_ptr) = ret;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -3007,7 +3010,7 @@ ZEND_VM_HANDLER(107, ZEND_CATCH, CONST, CV)
|
||||
|
||||
#ifdef HAVE_DTRACE
|
||||
if (DTRACE_EXCEPTION_CAUGHT_ENABLED()) {
|
||||
DTRACE_EXCEPTION_CAUGHT(ce->name);
|
||||
DTRACE_EXCEPTION_CAUGHT((char *)ce->name);
|
||||
}
|
||||
#endif /* HAVE_DTRACE */
|
||||
|
||||
@@ -4211,7 +4214,7 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY)
|
||||
zend_uchar key_type;
|
||||
|
||||
key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL);
|
||||
if (key_type != HASH_KEY_NON_EXISTANT &&
|
||||
if (key_type != HASH_KEY_NON_EXISTENT &&
|
||||
(key_type == HASH_KEY_IS_LONG ||
|
||||
zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) == SUCCESS)) {
|
||||
break;
|
||||
|
||||
+29
-17
@@ -2410,9 +2410,12 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CONST_HANDLER(ZEND_OPCODE_HAND
|
||||
} else if (EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr) {
|
||||
zend_error(E_NOTICE, "Only variable references should be returned by reference");
|
||||
if (EG(return_value_ptr_ptr)) {
|
||||
retval_ptr = *retval_ptr_ptr;
|
||||
*EG(return_value_ptr_ptr) = retval_ptr;
|
||||
Z_ADDREF_P(retval_ptr);
|
||||
zval *ret;
|
||||
|
||||
ALLOC_ZVAL(ret);
|
||||
INIT_PZVAL_COPY(ret, *retval_ptr_ptr);
|
||||
zval_copy_ctor(ret);
|
||||
*EG(return_value_ptr_ptr) = ret;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -2880,7 +2883,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
|
||||
zend_uchar key_type;
|
||||
|
||||
key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL);
|
||||
if (key_type != HASH_KEY_NON_EXISTANT &&
|
||||
if (key_type != HASH_KEY_NON_EXISTENT &&
|
||||
(key_type == HASH_KEY_IS_LONG ||
|
||||
zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) == SUCCESS)) {
|
||||
break;
|
||||
@@ -7118,7 +7121,7 @@ static int ZEND_FASTCALL ZEND_CATCH_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_A
|
||||
|
||||
#ifdef HAVE_DTRACE
|
||||
if (DTRACE_EXCEPTION_CAUGHT_ENABLED()) {
|
||||
DTRACE_EXCEPTION_CAUGHT(ce->name);
|
||||
DTRACE_EXCEPTION_CAUGHT((char *)ce->name);
|
||||
}
|
||||
#endif /* HAVE_DTRACE */
|
||||
|
||||
@@ -7735,9 +7738,12 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLE
|
||||
} else if (EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr) {
|
||||
zend_error(E_NOTICE, "Only variable references should be returned by reference");
|
||||
if (EG(return_value_ptr_ptr)) {
|
||||
retval_ptr = *retval_ptr_ptr;
|
||||
*EG(return_value_ptr_ptr) = retval_ptr;
|
||||
Z_ADDREF_P(retval_ptr);
|
||||
zval *ret;
|
||||
|
||||
ALLOC_ZVAL(ret);
|
||||
INIT_PZVAL_COPY(ret, *retval_ptr_ptr);
|
||||
zval_copy_ctor(ret);
|
||||
*EG(return_value_ptr_ptr) = ret;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -8206,7 +8212,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
|
||||
zend_uchar key_type;
|
||||
|
||||
key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL);
|
||||
if (key_type != HASH_KEY_NON_EXISTANT &&
|
||||
if (key_type != HASH_KEY_NON_EXISTENT &&
|
||||
(key_type == HASH_KEY_IS_LONG ||
|
||||
zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) == SUCCESS)) {
|
||||
break;
|
||||
@@ -12961,9 +12967,12 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLE
|
||||
} else if (EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr) {
|
||||
zend_error(E_NOTICE, "Only variable references should be returned by reference");
|
||||
if (EG(return_value_ptr_ptr)) {
|
||||
retval_ptr = *retval_ptr_ptr;
|
||||
*EG(return_value_ptr_ptr) = retval_ptr;
|
||||
Z_ADDREF_P(retval_ptr);
|
||||
zval *ret;
|
||||
|
||||
ALLOC_ZVAL(ret);
|
||||
INIT_PZVAL_COPY(ret, *retval_ptr_ptr);
|
||||
zval_copy_ctor(ret);
|
||||
*EG(return_value_ptr_ptr) = ret;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -13544,7 +13553,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
|
||||
zend_uchar key_type;
|
||||
|
||||
key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL);
|
||||
if (key_type != HASH_KEY_NON_EXISTANT &&
|
||||
if (key_type != HASH_KEY_NON_EXISTENT &&
|
||||
(key_type == HASH_KEY_IS_LONG ||
|
||||
zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) == SUCCESS)) {
|
||||
break;
|
||||
@@ -30605,9 +30614,12 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER
|
||||
} else if (EX_T(opline->op1.var).var.ptr_ptr == &EX_T(opline->op1.var).var.ptr) {
|
||||
zend_error(E_NOTICE, "Only variable references should be returned by reference");
|
||||
if (EG(return_value_ptr_ptr)) {
|
||||
retval_ptr = *retval_ptr_ptr;
|
||||
*EG(return_value_ptr_ptr) = retval_ptr;
|
||||
Z_ADDREF_P(retval_ptr);
|
||||
zval *ret;
|
||||
|
||||
ALLOC_ZVAL(ret);
|
||||
INIT_PZVAL_COPY(ret, *retval_ptr_ptr);
|
||||
zval_copy_ctor(ret);
|
||||
*EG(return_value_ptr_ptr) = ret;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -31175,7 +31187,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
|
||||
zend_uchar key_type;
|
||||
|
||||
key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL);
|
||||
if (key_type != HASH_KEY_NON_EXISTANT &&
|
||||
if (key_type != HASH_KEY_NON_EXISTENT &&
|
||||
(key_type == HASH_KEY_IS_LONG ||
|
||||
zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) == SUCCESS)) {
|
||||
break;
|
||||
|
||||
+5
-1
@@ -2962,10 +2962,14 @@ dnl DTrace objects
|
||||
esac
|
||||
|
||||
dnl Generate Makefile.objects entries
|
||||
dnl The empty $ac_provsrc command stops an implicit circular dependency
|
||||
dnl in GNU Make which causes the .d file to be overwritten (Bug 61268)
|
||||
cat>>Makefile.objects<<EOF
|
||||
|
||||
$abs_srcdir/$ac_provsrc:;
|
||||
|
||||
$ac_bdir[$]ac_hdrobj: $abs_srcdir/$ac_provsrc
|
||||
CFLAGS="\$(CFLAGS_CLEAN)" dtrace -h -C -s $ac_srcdir[$]ac_provsrc -o \$[]@ && \$(SED) -ibak 's,PHP_,DTRACE_,g' \$[]@
|
||||
CFLAGS="\$(CFLAGS_CLEAN)" dtrace -h -C -s $ac_srcdir[$]ac_provsrc -o \$[]@.bak && \$(SED) 's,PHP_,DTRACE_,g' \$[]@.bak > \$[]@
|
||||
|
||||
\$(PHP_DTRACE_OBJS): $ac_bdir[$]ac_hdrobj
|
||||
|
||||
|
||||
Vendored
+8
-7
@@ -193,11 +193,11 @@ AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
|
||||
enable_win32_dll=yes, enable_win32_dll=no)
|
||||
|
||||
AC_ARG_ENABLE([libtool-lock],
|
||||
[ --disable-libtool-lock avoid locking (might break parallel builds)])
|
||||
[ --disable-libtool-lock Avoid locking (might break parallel builds)])
|
||||
test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
|
||||
|
||||
AC_ARG_WITH([pic],
|
||||
[ --with-pic try to use only PIC/non-PIC objects [default=use both]],
|
||||
[ --with-pic Try to use only PIC/non-PIC objects [default=use both]],
|
||||
[pic_mode="$withval"],
|
||||
[pic_mode=default])
|
||||
test -z "$pic_mode" && pic_mode=default
|
||||
@@ -1919,7 +1919,7 @@ fi
|
||||
AC_DEFUN([_LT_AC_TAGCONFIG],
|
||||
[AC_REQUIRE([LT_AC_PROG_SED])dnl
|
||||
AC_ARG_WITH([tags],
|
||||
[ --with-tags[=TAGS] include additional configurations [automatic]
|
||||
[ --with-tags[=TAGS] Include additional configurations [automatic]
|
||||
],
|
||||
[tagnames="$withval"])
|
||||
|
||||
@@ -2023,7 +2023,7 @@ AC_DEFUN([AC_ENABLE_SHARED],
|
||||
[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
|
||||
AC_ARG_ENABLE([shared],
|
||||
changequote(<<, >>)dnl
|
||||
<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
|
||||
<< --enable-shared[=PKGS] Build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
|
||||
changequote([, ])dnl
|
||||
[p=${PACKAGE-default}
|
||||
case $enableval in
|
||||
@@ -2063,7 +2063,7 @@ AC_DEFUN([AC_ENABLE_STATIC],
|
||||
[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
|
||||
AC_ARG_ENABLE([static],
|
||||
changequote(<<, >>)dnl
|
||||
<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
|
||||
<< --enable-static[=PKGS] Build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
|
||||
changequote([, ])dnl
|
||||
[p=${PACKAGE-default}
|
||||
case $enableval in
|
||||
@@ -2103,7 +2103,8 @@ AC_DEFUN([AC_ENABLE_FAST_INSTALL],
|
||||
[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
|
||||
AC_ARG_ENABLE([fast-install],
|
||||
changequote(<<, >>)dnl
|
||||
<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
|
||||
<< --enable-fast-install[=PKGS]
|
||||
Optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
|
||||
changequote([, ])dnl
|
||||
[p=${PACKAGE-default}
|
||||
case $enableval in
|
||||
@@ -2241,7 +2242,7 @@ fi
|
||||
# find the pathname to the GNU or non-GNU linker
|
||||
AC_DEFUN([AC_PROG_LD],
|
||||
[AC_ARG_WITH([gnu-ld],
|
||||
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
|
||||
[ --with-gnu-ld Assume the C compiler uses GNU ld [default=no]],
|
||||
[test "$withval" = no || with_gnu_ld=yes],
|
||||
[with_gnu_ld=no])
|
||||
AC_REQUIRE([LT_AC_PROG_SED])dnl
|
||||
|
||||
+4
-4
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=5
|
||||
PHP_MINOR_VERSION=5
|
||||
PHP_RELEASE_VERSION=1
|
||||
PHP_EXTRA_VERSION="-dev"
|
||||
PHP_RELEASE_VERSION=3
|
||||
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`
|
||||
|
||||
@@ -1006,7 +1006,7 @@ dnl Check if all enabled by default extensions should be disabled
|
||||
dnl
|
||||
|
||||
AC_ARG_ENABLE(all,
|
||||
[ --disable-all Disable all extensions which are enabled by default
|
||||
[ --disable-all Disable all extensions which are enabled by default
|
||||
], [
|
||||
PHP_ENABLE_ALL=$enableval
|
||||
])
|
||||
@@ -1582,7 +1582,7 @@ cat <<X
|
||||
| see the file debug.log for error messages. |
|
||||
| |
|
||||
| If you are unable to fix this, send the file debug.log to the |
|
||||
| php-install@lists.php.net mailing list and include appropiate |
|
||||
| php-install@lists.php.net mailing list and include appropriate |
|
||||
| information about your setup. |
|
||||
X
|
||||
fi
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ dnl $Id$
|
||||
dnl
|
||||
|
||||
PHP_ARG_WITH(bz2, for BZip2 support,
|
||||
[ --with-bz2[=DIR] Include BZip2 support])
|
||||
[ --with-bz2[=DIR] Include BZip2 support])
|
||||
|
||||
if test "$PHP_BZ2" != "no"; then
|
||||
if test -r $PHP_BZ2/include/bzlib.h; then
|
||||
|
||||
@@ -53,7 +53,7 @@ static void safe_array_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC)
|
||||
|
||||
if (HASH_KEY_IS_STRING == keytype) {
|
||||
goto bogus;
|
||||
} else if (HASH_KEY_NON_EXISTANT == keytype) {
|
||||
} else if (HASH_KEY_NON_EXISTENT == keytype) {
|
||||
break;
|
||||
}
|
||||
if (intindex > max_index) {
|
||||
|
||||
@@ -467,7 +467,7 @@ static void generate_dispids(php_dispatchex *disp TSRMLS_DC)
|
||||
/* properties */
|
||||
if (Z_OBJPROP_P(disp->object)) {
|
||||
zend_hash_internal_pointer_reset_ex(Z_OBJPROP_P(disp->object), &pos);
|
||||
while (HASH_KEY_NON_EXISTANT != (keytype =
|
||||
while (HASH_KEY_NON_EXISTENT != (keytype =
|
||||
zend_hash_get_current_key_ex(Z_OBJPROP_P(disp->object), &name,
|
||||
&namelen, &pid, 0, &pos))) {
|
||||
char namebuf[32];
|
||||
@@ -498,7 +498,7 @@ static void generate_dispids(php_dispatchex *disp TSRMLS_DC)
|
||||
/* functions */
|
||||
if (Z_OBJCE_P(disp->object)) {
|
||||
zend_hash_internal_pointer_reset_ex(&Z_OBJCE_P(disp->object)->function_table, &pos);
|
||||
while (HASH_KEY_NON_EXISTANT != (keytype =
|
||||
while (HASH_KEY_NON_EXISTENT != (keytype =
|
||||
zend_hash_get_current_key_ex(&Z_OBJCE_P(disp->object)->function_table,
|
||||
&name, &namelen, &pid, 0, &pos))) {
|
||||
|
||||
@@ -598,7 +598,7 @@ PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *si
|
||||
zend_hash_init(disp->name_to_dispid, 0, NULL, ZVAL_PTR_DTOR, 0);
|
||||
|
||||
zend_hash_internal_pointer_reset_ex(id_to_name, &pos);
|
||||
while (HASH_KEY_NON_EXISTANT != (keytype =
|
||||
while (HASH_KEY_NON_EXISTENT != (keytype =
|
||||
zend_hash_get_current_key_ex(id_to_name, &name, &namelen, &pid, 0, &pos))) {
|
||||
|
||||
if (keytype == HASH_KEY_IS_LONG) {
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ dnl $Id$
|
||||
dnl
|
||||
|
||||
PHP_ARG_WITH(curl, for cURL support,
|
||||
[ --with-curl[=DIR] Include cURL support])
|
||||
[ --with-curl[=DIR] Include cURL support])
|
||||
|
||||
if test "$PHP_CURL" != "no"; then
|
||||
if test -r $PHP_CURL/include/curl/easy.h; then
|
||||
|
||||
+4
-4
@@ -1041,7 +1041,7 @@ char *php_date_short_day_name(timelib_sll y, timelib_sll m, timelib_sll d)
|
||||
static char *date_format(char *format, int format_len, timelib_time *t, int localtime)
|
||||
{
|
||||
smart_str string = {0};
|
||||
int i, length;
|
||||
int i, length = 0;
|
||||
char buffer[97];
|
||||
timelib_time_offset *offset = NULL;
|
||||
timelib_sll isoweek, isoyear;
|
||||
@@ -1396,7 +1396,7 @@ PHPAPI void php_date_set_tzdb(timelib_tzdb *tzdb)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ php_parse_date: Backwards compability function */
|
||||
/* {{{ php_parse_date: Backwards compatibility function */
|
||||
PHPAPI signed long php_parse_date(char *string, signed long *now)
|
||||
{
|
||||
timelib_time *parsed_time;
|
||||
@@ -2538,8 +2538,8 @@ PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str,
|
||||
timelib_time *now;
|
||||
timelib_tzinfo *tzi = NULL;
|
||||
timelib_error_container *err = NULL;
|
||||
int type = TIMELIB_ZONETYPE_ID, new_dst;
|
||||
char *new_abbr;
|
||||
int type = TIMELIB_ZONETYPE_ID, new_dst = 0;
|
||||
char *new_abbr = NULL;
|
||||
timelib_sll new_offset;
|
||||
|
||||
if (dateobj->time) {
|
||||
|
||||
+1
-1
@@ -182,7 +182,7 @@ ZEND_END_MODULE_GLOBALS(date)
|
||||
#define DATEG(v) (date_globals.v)
|
||||
#endif
|
||||
|
||||
/* Backwards compability wrapper */
|
||||
/* Backwards compatibility wrapper */
|
||||
PHPAPI signed long php_parse_date(char *string, signed long *now);
|
||||
PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt);
|
||||
PHPAPI int php_idate(char format, time_t ts, int localtime TSRMLS_DC);
|
||||
|
||||
+2
-2
@@ -557,10 +557,10 @@ PHP_ARG_WITH(cdb,,
|
||||
[ --without-cdb[=DIR] DBA: CDB support (bundled)], $php_dba_enable, no)
|
||||
|
||||
PHP_ARG_ENABLE(inifile,,
|
||||
[ --disable-inifile DBA: INI support (bundled)], $php_dba_enable, no)
|
||||
[ --disable-inifile DBA: INI support (bundled)], $php_dba_enable, no)
|
||||
|
||||
PHP_ARG_ENABLE(flatfile,,
|
||||
[ --disable-flatfile DBA: FlatFile support (bundled)], $php_dba_enable, no)
|
||||
[ --disable-flatfile DBA: FlatFile support (bundled)], $php_dba_enable, no)
|
||||
|
||||
# CDB
|
||||
if test "$PHP_CDB" = "yes"; then
|
||||
|
||||
+12
-4
@@ -1973,14 +1973,15 @@ static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type
|
||||
xmlDoc *docp;
|
||||
dom_object *intern;
|
||||
char *source = NULL, *valid_file = NULL;
|
||||
int source_len = 0;
|
||||
int source_len = 0, valid_opts = 0;
|
||||
long flags = 0;
|
||||
xmlSchemaParserCtxtPtr parser;
|
||||
xmlSchemaPtr sptr;
|
||||
xmlSchemaValidCtxtPtr vptr;
|
||||
int is_valid;
|
||||
char resolved_path[MAXPATHLEN + 1];
|
||||
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Op", &id, dom_document_class_entry, &source, &source_len) == FAILURE) {
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Op|l", &id, dom_document_class_entry, &source, &source_len, &flags) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2029,6 +2030,13 @@ static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
#if LIBXML_VERSION >= 20614
|
||||
if (flags & XML_SCHEMA_VAL_VC_I_CREATE) {
|
||||
valid_opts |= XML_SCHEMA_VAL_VC_I_CREATE;
|
||||
}
|
||||
#endif
|
||||
|
||||
xmlSchemaSetValidOptions(vptr, valid_opts);
|
||||
xmlSchemaSetValidErrors(vptr, php_libxml_error_handler, php_libxml_error_handler, vptr);
|
||||
is_valid = xmlSchemaValidateDoc(vptr, docp);
|
||||
xmlSchemaFree(sptr);
|
||||
@@ -2042,14 +2050,14 @@ static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto boolean dom_document_schema_validate_file(string filename); */
|
||||
/* {{{ proto boolean dom_document_schema_validate_file(string filename, int flags); */
|
||||
PHP_FUNCTION(dom_document_schema_validate_file)
|
||||
{
|
||||
_dom_document_schema_validate(INTERNAL_FUNCTION_PARAM_PASSTHRU, DOM_LOAD_FILE);
|
||||
}
|
||||
/* }}} end dom_document_schema_validate_file */
|
||||
|
||||
/* {{{ proto boolean dom_document_schema_validate(string source); */
|
||||
/* {{{ proto boolean dom_document_schema_validate(string source, int flags); */
|
||||
PHP_FUNCTION(dom_document_schema_validate_xml)
|
||||
{
|
||||
_dom_document_schema_validate(INTERNAL_FUNCTION_PARAM_PASSTHRU, DOM_LOAD_STRING);
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
Test DOMDocument::loadXML() basic behavior
|
||||
--DESCRIPTION--
|
||||
This test verifies the basic behaviour of the method
|
||||
Environment variables used in the test:
|
||||
- XML_FILE: the xml file to load
|
||||
- LOAD_OPTIONS: the second parameter to pass to the method
|
||||
- EXPECTED_RESULT: the expected result
|
||||
--CREDITS--
|
||||
Antonio Diaz Ruiz <dejalatele@gmail.com>
|
||||
--INI--
|
||||
assert.bail=true
|
||||
--SKIPIF--
|
||||
<?php include('skipif.inc'); ?>
|
||||
--ENV--
|
||||
XML_FILE=/book.xml
|
||||
LOAD_OPTIONS=0
|
||||
EXPECTED_RESULT=1
|
||||
--FILE_EXTERNAL--
|
||||
domdocumentloadxml_test_method.php
|
||||
--EXPECT--
|
||||
@@ -0,0 +1,26 @@
|
||||
--TEST--
|
||||
Test DOMDocument::loadXML() detects not-well formed XML
|
||||
--DESCRIPTION--
|
||||
This test verifies the method detects an opening and ending tag mismatch
|
||||
Environment variables used in the test:
|
||||
- XML_FILE: the xml file to load
|
||||
- LOAD_OPTIONS: the second parameter to pass to the method
|
||||
- EXPECTED_RESULT: the expected result
|
||||
--CREDITS--
|
||||
Antonio Diaz Ruiz <dejalatele@gmail.com>
|
||||
--INI--
|
||||
assert.bail=true
|
||||
--SKIPIF--
|
||||
<?php include('skipif.inc'); ?>
|
||||
--ENV--
|
||||
XML_FILE=/not_well_formed.xml
|
||||
LOAD_OPTIONS=0
|
||||
EXPECTED_RESULT=0
|
||||
--FILE_EXTERNAL--
|
||||
domdocumentloadxml_test_method.php
|
||||
--EXPECTF--
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): Opening and ending tag mismatch: title line 5 and book %s
|
||||
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): expected '>' %s
|
||||
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): Premature end of data in tag books %s
|
||||
@@ -0,0 +1,30 @@
|
||||
--TEST--
|
||||
Test DOMDocument::loadXML() detects not-well formed XML
|
||||
--DESCRIPTION--
|
||||
This test verifies the method detects attributes values not closed between " or '
|
||||
Environment variables used in the test:
|
||||
- XML_FILE: the xml file to load
|
||||
- LOAD_OPTIONS: the second parameter to pass to the method
|
||||
- EXPECTED_RESULT: the expected result
|
||||
--CREDITS--
|
||||
Antonio Diaz Ruiz <dejalatele@gmail.com>
|
||||
--INI--
|
||||
assert.bail=true
|
||||
--SKIPIF--
|
||||
<?php include('skipif.inc'); ?>
|
||||
--ENV--
|
||||
XML_FILE=/not_well_formed2.xml
|
||||
LOAD_OPTIONS=0
|
||||
EXPECTED_RESULT=0
|
||||
--FILE_EXTERNAL--
|
||||
domdocumentloadxml_test_method.php
|
||||
--EXPECTF--
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): AttValue: " or ' expected %s
|
||||
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): attributes construct error %s
|
||||
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): Couldn't find end of Start Tag book %s
|
||||
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): Opening and ending tag mismatch: books %s
|
||||
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): Extra content at the end of the document %s
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Test DOMDocument::loadXML() detects not-well formed XML
|
||||
--DESCRIPTION--
|
||||
This test verifies the method detects a typo in tag names
|
||||
Environment variables used in the test:
|
||||
- XML_FILE: the xml file to load
|
||||
- LOAD_OPTIONS: the second parameter to pass to the method
|
||||
- EXPECTED_RESULT: the expected result
|
||||
--CREDITS--
|
||||
Antonio Diaz Ruiz <dejalatele@gmail.com>
|
||||
--INI--
|
||||
assert.bail=true
|
||||
--SKIPIF--
|
||||
<?php include('skipif.inc'); ?>
|
||||
--ENV--
|
||||
XML_FILE=/not_well_formed3.xml
|
||||
LOAD_OPTIONS=0
|
||||
EXPECTED_RESULT=0
|
||||
--FILE_EXTERNAL--
|
||||
domdocumentloadxml_test_method.php
|
||||
--EXPECTF--
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): Opening and ending tag mismatch: boOk line 8 and book %s
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Test DOMDocument::loadXML() detects not-well formed XML
|
||||
--DESCRIPTION--
|
||||
This test verifies the method detects an unsupported xml version
|
||||
Environment variables used in the test:
|
||||
- XML_FILE: the xml file to load
|
||||
- LOAD_OPTIONS: the second parameter to pass to the method
|
||||
- EXPECTED_RESULT: the expected result
|
||||
--CREDITS--
|
||||
Antonio Diaz Ruiz <dejalatele@gmail.com>
|
||||
--INI--
|
||||
assert.bail=true
|
||||
--SKIPIF--
|
||||
<?php include('skipif.inc'); ?>
|
||||
--ENV--
|
||||
XML_FILE=/not_well_formed4.xml
|
||||
LOAD_OPTIONS=0
|
||||
EXPECTED_RESULT=0
|
||||
--FILE_EXTERNAL--
|
||||
domdocumentloadxml_test_method.php
|
||||
--EXPECTF--
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): Unsupported version '3.1' %s
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Test DOMDocument::loadXML() detects not-well formed XML
|
||||
--DESCRIPTION--
|
||||
This test verifies the method detects extra content at the end of the document
|
||||
Environment variables used in the test:
|
||||
- XML_FILE: the xml file to load
|
||||
- LOAD_OPTIONS: the second parameter to pass to the method
|
||||
- EXPECTED_RESULT: the expected result
|
||||
--CREDITS--
|
||||
Antonio Diaz Ruiz <dejalatele@gmail.com>
|
||||
--INI--
|
||||
assert.bail=true
|
||||
--SKIPIF--
|
||||
<?php include('skipif.inc'); ?>
|
||||
--ENV--
|
||||
XML_FILE=/not_well_formed5.xml
|
||||
LOAD_OPTIONS=0
|
||||
EXPECTED_RESULT=0
|
||||
--FILE_EXTERNAL--
|
||||
domdocumentloadxml_test_method.php
|
||||
--EXPECTF--
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): Extra content at the end of the document %s
|
||||
@@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
Test DOMDocument::loadXML() with LIBXML_DTDLOAD option
|
||||
--DESCRIPTION--
|
||||
This test verifies the right behaviour of the LIBXML_DTDLOAD constant
|
||||
Environment variables used in the test:
|
||||
- XML_FILE: the xml file to load
|
||||
- LOAD_OPTIONS: the second parameter to pass to the method
|
||||
- EXPECTED_RESULT: the expected result
|
||||
--CREDITS--
|
||||
Antonio Diaz Ruiz <dejalatele@gmail.com>
|
||||
--INI--
|
||||
assert.bail=true
|
||||
--SKIPIF--
|
||||
<?php include('skipif.inc'); ?>
|
||||
--ENV--
|
||||
XML_FILE=/book_with_dtd2.xml
|
||||
LOAD_OPTIONS=LIBXML_DTDLOAD
|
||||
EXPECTED_RESULT=1
|
||||
--FILE_EXTERNAL--
|
||||
domdocumentloadxml_test_method.php
|
||||
--EXPECT--
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Test DOMDocument::loadXML() with LIBXML_DTDVALID option
|
||||
--DESCRIPTION--
|
||||
This test verifies the right behaviour of the LIBXML_DTDVALID constant
|
||||
Environment variables used in the test:
|
||||
- XML_FILE: the xml file to load
|
||||
- LOAD_OPTIONS: the second parameter to pass to the method
|
||||
- EXPECTED_RESULT: the expected result
|
||||
--CREDITS--
|
||||
Antonio Diaz Ruiz <dejalatele@gmail.com>
|
||||
--INI--
|
||||
assert.bail=true
|
||||
--SKIPIF--
|
||||
<?php include('skipif.inc'); ?>
|
||||
--ENV--
|
||||
XML_FILE=/wrong_book_with_dtd2.xml
|
||||
LOAD_OPTIONS=LIBXML_DTDVALID
|
||||
EXPECTED_RESULT=1
|
||||
--FILE_EXTERNAL--
|
||||
domdocumentloadxml_test_method.php
|
||||
--EXPECTF--
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): Element book content does not follow the DTD, expecting (title , author), got (title author author ) %s
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Test DOMDocument::loadXML() with LIBXML_DTDVALID and LIBXML_NOERROR options
|
||||
--DESCRIPTION--
|
||||
This test vrifies the right behaviour of the LIBXML_NOERROR constant
|
||||
which avoids the display of the warning message
|
||||
Environment variables used in the test:
|
||||
- XML_FILE: the xml file to load
|
||||
- LOAD_OPTIONS: the second parameter to pass to the method
|
||||
- EXPECTED_RESULT: the expected result
|
||||
--CREDITS--
|
||||
Antonio Diaz Ruiz <dejalatele@gmail.com>
|
||||
--INI--
|
||||
assert.bail=true
|
||||
--SKIPIF--
|
||||
<?php include('skipif.inc'); ?>
|
||||
--ENV--
|
||||
XML_FILE=/wrong_book_with_dtd.xml
|
||||
LOAD_OPTIONS=LIBXML_DTDVALID | LIBXML_NOERROR
|
||||
EXPECTED_RESULT=1
|
||||
--FILE_EXTERNAL--
|
||||
domdocumentloadxml_test_method.php
|
||||
--EXPECT--
|
||||
@@ -0,0 +1,32 @@
|
||||
--TEST--
|
||||
Test DOMDocument::loadXML() with LIBXML_DTDATTR, LIBXML_NOCDATA, LIBXML_NOENT, LIBXML_NOBLANKS
|
||||
--DESCRIPTION--
|
||||
This test verifies the right behaviour of the following constants:
|
||||
LIBXML_DTDATTR, LIBXML_NOCDATA, LIBXML_NOENT and LIBXML_NOBLANKS
|
||||
Environment variables used in the test:
|
||||
- XML_FILE: the xml file to load
|
||||
- LOAD_OPTIONS: the second parameter to pass to the method
|
||||
- EXPECTED_RESULT: the expected result
|
||||
--CREDITS--
|
||||
Antonio Diaz Ruiz <dejalatele@gmail.com>
|
||||
--INI--
|
||||
assert.bail=true
|
||||
--SKIPIF--
|
||||
<?php include('skipif.inc'); ?>
|
||||
--ENV--
|
||||
XML_FILE=/book_with_dtd2.xml
|
||||
LOAD_OPTIONS=LIBXML_DTDATTR|LIBXML_NOCDATA|LIBXML_NOENT|LIBXML_NOBLANKS
|
||||
EXPECTED_RESULT=1
|
||||
--FILE_EXTERNAL--
|
||||
domdocumentloadxml_test_method_savexml.php
|
||||
--EXPECT--
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE books [
|
||||
<!ENTITY entitest "entity is only for test purposes">
|
||||
<!ATTLIST title default CDATA "default title">
|
||||
<!ELEMENT books (book)*>
|
||||
<!ELEMENT book (title , author)>
|
||||
<!ELEMENT title (#PCDATA)>
|
||||
<!ELEMENT author (#PCDATA)>
|
||||
]>
|
||||
<books><book><title default="default title">The Grapes of Wrath</title><author>John Steinbeck</author></book><book><title default="default title">The Pearl</title><author>John Steinbeck</author></book><book><title default="default title">entity is only for test purposes</title><author>data for test</author></book></books>
|
||||
@@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
Test DOMDocument::load() basic behavior
|
||||
--DESCRIPTION--
|
||||
This test verifies the basic behaviour of the method
|
||||
Environment variables used in the test:
|
||||
- XML_FILE: the xml file to load
|
||||
- LOAD_OPTIONS: the second parameter to pass to the method
|
||||
- EXPECTED_RESULT: the expected result
|
||||
--CREDITS--
|
||||
Antonio Diaz Ruiz <dejalatele@gmail.com>
|
||||
--INI--
|
||||
assert.bail=true
|
||||
--SKIPIF--
|
||||
<?php include('skipif.inc'); ?>
|
||||
--ENV--
|
||||
XML_FILE=/book.xml
|
||||
LOAD_OPTIONS=0
|
||||
EXPECTED_RESULT=1
|
||||
--FILE_EXTERNAL--
|
||||
domdocumentload_test_method.php
|
||||
--EXPECT--
|
||||
@@ -0,0 +1,26 @@
|
||||
--TEST--
|
||||
Test DOMDocument::load() detects not-well formed XML
|
||||
--DESCRIPTION--
|
||||
This test verifies the method detects an opening and ending tag mismatch
|
||||
Environment variables used in the test:
|
||||
- XML_FILE: the xml file to load
|
||||
- LOAD_OPTIONS: the second parameter to pass to the method
|
||||
- EXPECTED_RESULT: the expected result
|
||||
--CREDITS--
|
||||
Antonio Diaz Ruiz <dejalatele@gmail.com>
|
||||
--INI--
|
||||
assert.bail=true
|
||||
--SKIPIF--
|
||||
<?php include('skipif.inc'); ?>
|
||||
--ENV--
|
||||
XML_FILE=/not_well_formed.xml
|
||||
LOAD_OPTIONS=0
|
||||
EXPECTED_RESULT=0
|
||||
--FILE_EXTERNAL--
|
||||
domdocumentload_test_method.php
|
||||
--EXPECTF--
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): Opening and ending tag mismatch: title line 5 and book %s
|
||||
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): expected '>' %s
|
||||
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): Premature end of data in tag books %s
|
||||
@@ -0,0 +1,30 @@
|
||||
--TEST--
|
||||
Test DOMDocument::load() detects not-well formed XML
|
||||
--DESCRIPTION--
|
||||
This test verifies the method detects attributes values not closed between " or '
|
||||
Environment variables used in the test:
|
||||
- XML_FILE: the xml file to load
|
||||
- LOAD_OPTIONS: the second parameter to pass to the method
|
||||
- EXPECTED_RESULT: the expected result
|
||||
--CREDITS--
|
||||
Antonio Diaz Ruiz <dejalatele@gmail.com>
|
||||
--INI--
|
||||
assert.bail=true
|
||||
--SKIPIF--
|
||||
<?php include('skipif.inc'); ?>
|
||||
--ENV--
|
||||
XML_FILE=/not_well_formed2.xml
|
||||
LOAD_OPTIONS=0
|
||||
EXPECTED_RESULT=0
|
||||
--FILE_EXTERNAL--
|
||||
domdocumentload_test_method.php
|
||||
--EXPECTF--
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): AttValue: " or ' expected %s
|
||||
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): attributes construct error %s
|
||||
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): Couldn't find end of Start Tag book %s
|
||||
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): Opening and ending tag mismatch: books %s
|
||||
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): Extra content at the end of the document %s
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Test DOMDocument::load() detects not-well formed XML
|
||||
--DESCRIPTION--
|
||||
This test verifies the method detects and opening and ending tag mismatch
|
||||
Environment variables used in the test:
|
||||
- XML_FILE: the xml file to load
|
||||
- LOAD_OPTIONS: the second parameter to pass to the method
|
||||
- EXPECTED_RESULT: the expected result
|
||||
--CREDITS--
|
||||
Antonio Diaz Ruiz <dejalatele@gmail.com>
|
||||
--INI--
|
||||
assert.bail=true
|
||||
--SKIPIF--
|
||||
<?php include('skipif.inc'); ?>
|
||||
--ENV--
|
||||
XML_FILE=/not_well_formed3.xml
|
||||
LOAD_OPTIONS=0
|
||||
EXPECTED_RESULT=0
|
||||
--FILE_EXTERNAL--
|
||||
domdocumentload_test_method.php
|
||||
--EXPECTF--
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): Opening and ending tag mismatch: boOk line 8 and book %s
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Test DOMDocument::load() detects not-well formed XML
|
||||
--DESCRIPTION--
|
||||
This test verifies the method detects an unsupported xml version
|
||||
Environment variables used in the test:
|
||||
- XML_FILE: the xml file to load
|
||||
- LOAD_OPTIONS: the second parameter to pass to the method
|
||||
- EXPECTED_RESULT: the expected result
|
||||
--CREDITS--
|
||||
Antonio Diaz Ruiz <dejalatele@gmail.com>
|
||||
--INI--
|
||||
assert.bail=true
|
||||
--SKIPIF--
|
||||
<?php include('skipif.inc'); ?>
|
||||
--ENV--
|
||||
XML_FILE=/not_well_formed4.xml
|
||||
LOAD_OPTIONS=0
|
||||
EXPECTED_RESULT=0
|
||||
--FILE_EXTERNAL--
|
||||
domdocumentload_test_method.php
|
||||
--EXPECTF--
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): Unsupported version '3.1' %s
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Test DOMDocument::load() detects not-well formed XML
|
||||
--DESCRIPTION--
|
||||
This test verifies the method detects extra content at the end of the document
|
||||
Environment variables used in the test:
|
||||
- XML_FILE: the xml file to load
|
||||
- LOAD_OPTIONS: the second parameter to pass to the method
|
||||
- EXPECTED_RESULT: the expected result
|
||||
--CREDITS--
|
||||
Antonio Diaz Ruiz <dejalatele@gmail.com>
|
||||
--INI--
|
||||
assert.bail=true
|
||||
--SKIPIF--
|
||||
<?php include('skipif.inc'); ?>
|
||||
--ENV--
|
||||
XML_FILE=/not_well_formed5.xml
|
||||
LOAD_OPTIONS=0
|
||||
EXPECTED_RESULT=0
|
||||
--FILE_EXTERNAL--
|
||||
domdocumentload_test_method.php
|
||||
--EXPECTF--
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): Extra content at the end of the document %s
|
||||
@@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
Test DOMDocument::load() with LIBXML_DTDLOAD option
|
||||
--DESCRIPTION--
|
||||
This test verifies the right behaviour of the LIBXML_DTDLOAD constant
|
||||
Environment variables used in the test:
|
||||
- XML_FILE: the xml file to load
|
||||
- LOAD_OPTIONS: the second parameter to pass to the method
|
||||
- EXPECTED_RESULT: the expected result
|
||||
--CREDITS--
|
||||
Antonio Diaz Ruiz <dejalatele@gmail.com>
|
||||
--INI--
|
||||
assert.bail=true
|
||||
--SKIPIF--
|
||||
<?php include('skipif.inc'); ?>
|
||||
--ENV--
|
||||
XML_FILE=/book_with_dtd.xml
|
||||
LOAD_OPTIONS=LIBXML_DTDLOAD
|
||||
EXPECTED_RESULT=1
|
||||
--FILE_EXTERNAL--
|
||||
domdocumentload_test_method.php
|
||||
--EXPECT--
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Test DOMDocument::load() with LIBXML_DTDVALID option
|
||||
--DESCRIPTION--
|
||||
This test verifies the right behaviour of the LIBXML_DTDVALID constant
|
||||
Environment variables used in the test:
|
||||
- XML_FILE: the xml file to load
|
||||
- LOAD_OPTIONS: the second parameter to pass to the method
|
||||
- EXPECTED_RESULT: the expected result
|
||||
--CREDITS--
|
||||
Antonio Diaz Ruiz <dejalatele@gmail.com>
|
||||
--INI--
|
||||
assert.bail=true
|
||||
--SKIPIF--
|
||||
<?php include('skipif.inc'); ?>
|
||||
--ENV--
|
||||
XML_FILE=/wrong_book_with_dtd.xml
|
||||
LOAD_OPTIONS=LIBXML_DTDVALID
|
||||
EXPECTED_RESULT=1
|
||||
--FILE_EXTERNAL--
|
||||
domdocumentload_test_method.php
|
||||
--EXPECTF--
|
||||
Warning: DOMDocument::load%r(XML){0,1}%r(): Element book content does not follow the DTD, expecting (title , author), got (title author author ) %s
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Test DOMDocument::load() with LIBXML_DTDVALID and LIBXML_NOERROR options
|
||||
--DESCRIPTION--
|
||||
This test vrifies the right behaviour of the LIBXML_NOERROR constant
|
||||
which avoids the display of the warning message
|
||||
Environment variables used in the test:
|
||||
- XML_FILE: the xml file to load
|
||||
- LOAD_OPTIONS: the second parameter to pass to the method
|
||||
- EXPECTED_RESULT: the expected result
|
||||
--CREDITS--
|
||||
Antonio Diaz Ruiz <dejalatele@gmail.com>
|
||||
--INI--
|
||||
assert.bail=true
|
||||
--SKIPIF--
|
||||
<?php include('skipif.inc'); ?>
|
||||
--ENV--
|
||||
XML_FILE=/wrong_book_with_dtd.xml
|
||||
LOAD_OPTIONS=LIBXML_DTDVALID | LIBXML_NOERROR
|
||||
EXPECTED_RESULT=1
|
||||
--FILE_EXTERNAL--
|
||||
domdocumentload_test_method.php
|
||||
--EXPECT--
|
||||
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
Test DOMDocument::load() with LIBXML_DTDATTR, LIBXML_NOCDATA, LIBXML_NOENT, LIBXML_NOBLANKS
|
||||
--DESCRIPTION--
|
||||
This test verifies the right behaviour of the following constants:
|
||||
LIBXML_DTDATTR, LIBXML_NOCDATA, LIBXML_NOENT and LIBXML_NOBLANKS
|
||||
Environment variables used in the test:
|
||||
- XML_FILE: the xml file to load
|
||||
- LOAD_OPTIONS: the second parameter to pass to the method
|
||||
- EXPECTED_RESULT: the expected result
|
||||
--CREDITS--
|
||||
Antonio Diaz Ruiz <dejalatele@gmail.com>
|
||||
--INI--
|
||||
assert.bail=true
|
||||
--SKIPIF--
|
||||
<?php include('skipif.inc'); ?>
|
||||
--ENV--
|
||||
XML_FILE=/book_with_dtd.xml
|
||||
LOAD_OPTIONS=LIBXML_DTDATTR|LIBXML_NOCDATA|LIBXML_NOENT|LIBXML_NOBLANKS
|
||||
EXPECTED_RESULT=1
|
||||
--FILE_EXTERNAL--
|
||||
domdocumentload_test_method_savexml.php
|
||||
--EXPECT--
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE books SYSTEM "books.dtd">
|
||||
<books><book><title default="default title">The Grapes of Wrath</title><author>John Steinbeck</author></book><book><title default="default title">The Pearl</title><author>John Steinbeck</author></book><book><title default="default title">entity is only for test purposes</title><author>data for test</author></book></books>
|
||||
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
DomDocument::schemaValidateSource() - Add missing attribute default values from schema
|
||||
--CREDITS--
|
||||
Chris Wright <info@daverandom.com>
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$doc = new DOMDocument;
|
||||
|
||||
$doc->load(dirname(__FILE__)."/book-attr.xml");
|
||||
|
||||
$xsd = file_get_contents(dirname(__FILE__)."/book.xsd");
|
||||
|
||||
$doc->schemaValidateSource($xsd, LIBXML_SCHEMA_CREATE);
|
||||
|
||||
foreach ($doc->getElementsByTagName('book') as $book) {
|
||||
var_dump($book->getAttribute('is-hardback'));
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(5) "false"
|
||||
string(4) "true"
|
||||
@@ -17,5 +17,5 @@ var_dump($result);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: DOMDocument::schemaValidateSource() expects exactly 1 parameter, 0 given in %s.php on line %d
|
||||
Warning: DOMDocument::schemaValidateSource() expects at least 1 parameter, 0 given in %s.php on line %d
|
||||
NULL
|
||||
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
DomDocument::schemaValidateSource() - Don't add missing attribute default values from schema
|
||||
--CREDITS--
|
||||
Chris Wright <info@daverandom.com>
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$doc = new DOMDocument;
|
||||
|
||||
$doc->load(dirname(__FILE__)."/book-attr.xml");
|
||||
|
||||
$xsd = file_get_contents(dirname(__FILE__)."/book.xsd");
|
||||
|
||||
$doc->schemaValidateSource($xsd);
|
||||
|
||||
foreach ($doc->getElementsByTagName('book') as $book) {
|
||||
var_dump($book->getAttribute('is-hardback'));
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(0) ""
|
||||
string(4) "true"
|
||||
@@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
DomDocument::schemaValidate() - Add missing attribute default values from schema
|
||||
--CREDITS--
|
||||
Chris Wright <info@daverandom.com>
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$doc = new DOMDocument;
|
||||
|
||||
$doc->load(dirname(__FILE__)."/book-attr.xml");
|
||||
|
||||
$doc->schemaValidate(dirname(__FILE__)."/book.xsd", LIBXML_SCHEMA_CREATE);
|
||||
|
||||
foreach ($doc->getElementsByTagName('book') as $book) {
|
||||
var_dump($book->getAttribute('is-hardback'));
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(5) "false"
|
||||
string(4) "true"
|
||||
@@ -17,5 +17,5 @@ var_dump($result);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: DOMDocument::schemaValidate() expects exactly 1 parameter, 0 given in %s.php on line %d
|
||||
Warning: DOMDocument::schemaValidate() expects at least 1 parameter, 0 given in %s.php on line %d
|
||||
NULL
|
||||
@@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
DomDocument::schemaValidate() - Don't add missing attribute default values from schema
|
||||
--CREDITS--
|
||||
Chris Wright <info@daverandom.com>
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$doc = new DOMDocument;
|
||||
|
||||
$doc->load(dirname(__FILE__)."/book-attr.xml");
|
||||
|
||||
$doc->schemaValidate(dirname(__FILE__)."/book.xsd");
|
||||
|
||||
foreach ($doc->getElementsByTagName('book') as $book) {
|
||||
var_dump($book->getAttribute('is-hardback'));
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(0) ""
|
||||
string(4) "true"
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" ?>
|
||||
<books>
|
||||
<book>
|
||||
<title>The Grapes of Wrath</title>
|
||||
<author>John Steinbeck</author>
|
||||
</book>
|
||||
<book is-hardback="true">
|
||||
<title>The Pearl</title>
|
||||
<author>John Steinbeck</author>
|
||||
</book>
|
||||
</books>
|
||||
@@ -9,6 +9,7 @@
|
||||
<xs:element name="title" type="xs:string"/>
|
||||
<xs:element name="author" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="is-hardback" type="xs:boolean" default="false" use="optional" />
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE books SYSTEM "books.dtd">
|
||||
<books>
|
||||
<book>
|
||||
<title>The Grapes of Wrath</title>
|
||||
<author>John Steinbeck</author>
|
||||
</book>
|
||||
<book>
|
||||
<title>The Pearl</title>
|
||||
<author>John Steinbeck</author>
|
||||
</book>
|
||||
<book>
|
||||
<title>&entitest;</title>
|
||||
<author><![CDATA[data for test]]></author>
|
||||
</book>
|
||||
</books>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE books [
|
||||
<!ENTITY entitest "entity is only for test purposes">
|
||||
<!ATTLIST title default CDATA "default title">
|
||||
<!ELEMENT books (book*)>
|
||||
<!ELEMENT book (title, author)>
|
||||
<!ELEMENT title (#PCDATA)>
|
||||
<!ELEMENT author (#PCDATA)>
|
||||
]>
|
||||
<books>
|
||||
<book>
|
||||
<title>The Grapes of Wrath</title>
|
||||
<author>John Steinbeck</author>
|
||||
</book>
|
||||
<book>
|
||||
<title>The Pearl</title>
|
||||
<author>John Steinbeck</author>
|
||||
</book>
|
||||
<book>
|
||||
<title>&entitest;</title>
|
||||
<author><![CDATA[data for test]]></author>
|
||||
</book>
|
||||
</books>
|
||||
@@ -0,0 +1,7 @@
|
||||
<!ENTITY entitest "entity is only for test purposes">
|
||||
<!ATTLIST title
|
||||
default CDATA "default title">
|
||||
<!ELEMENT books (book*)>
|
||||
<!ELEMENT book (title, author)>
|
||||
<!ELEMENT title (#PCDATA)>
|
||||
<!ELEMENT author (#PCDATA)>
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Bug #44648 (Attribute names not checked for wellformedness)
|
||||
Bug #44648 (Attribute names not checked for well formedness)
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
include(dirname(__FILE__) . '/domdocumentload_utilities.php');
|
||||
|
||||
$doc = new DOMDocument();
|
||||
|
||||
$libxml_options = libxml_options_to_int(getenv('LOAD_OPTIONS'));
|
||||
|
||||
$result = $doc->load(dirname(__FILE__) . getenv('XML_FILE'), $libxml_options);
|
||||
|
||||
$expectedResult = (bool) getenv('EXPECTED_RESULT');
|
||||
assert('$result === $expectedResult');
|
||||
?>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
include(dirname(__FILE__) . '/domdocumentload_utilities.php');
|
||||
|
||||
$doc = new DOMDocument();
|
||||
|
||||
$libxml_options = libxml_options_to_int(getenv('LOAD_OPTIONS'));
|
||||
|
||||
$result = $doc->load(dirname(__FILE__) . getenv('XML_FILE'), $libxml_options);
|
||||
|
||||
$expectedResult = (bool) getenv('EXPECTED_RESULT');
|
||||
assert('$result === $expectedResult');
|
||||
|
||||
echo $doc->saveXML();
|
||||
?>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
function libxml_options_to_int($libxmlOptions) {
|
||||
|
||||
$defined_constants = get_defined_constants(true);
|
||||
$env_array = explode('|', $libxmlOptions);
|
||||
$libxml_constants = array_intersect_key($defined_constants['libxml'], array_flip($env_array));
|
||||
|
||||
$sum = 0;
|
||||
foreach($libxml_constants as $value) {
|
||||
$sum = $sum|$value;
|
||||
}
|
||||
|
||||
return $sum;
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
include(dirname(__FILE__) . '/domdocumentload_utilities.php');
|
||||
|
||||
$doc = new DOMDocument();
|
||||
|
||||
$libxml_options = libxml_options_to_int(getenv('LOAD_OPTIONS'));
|
||||
$result = $doc->loadXML(file_get_contents(dirname(__FILE__) . getenv('XML_FILE')),
|
||||
$libxml_options);
|
||||
|
||||
$expectedResult = (bool) getenv('EXPECTED_RESULT');
|
||||
assert('$result === $expectedResult');
|
||||
?>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
include(dirname(__FILE__) . '/domdocumentload_utilities.php');
|
||||
|
||||
$doc = new DOMDocument();
|
||||
|
||||
$libxml_options = libxml_options_to_int(getenv('LOAD_OPTIONS'));
|
||||
$result = $doc->loadXML(file_get_contents(dirname(__FILE__) . getenv('XML_FILE')),
|
||||
$libxml_options);
|
||||
|
||||
$expectedResult = (bool) getenv('EXPECTED_RESULT');
|
||||
assert('$result === $expectedResult');
|
||||
|
||||
echo $doc->saveXML();
|
||||
?>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" ?>
|
||||
<!-- Opening and ending tag mismatch -->
|
||||
<books>
|
||||
<book>
|
||||
<title>The Grapes of Wrath
|
||||
<author>John Steinbeck</author>
|
||||
</book>
|
||||
<book>
|
||||
<title>The Pearl</title>
|
||||
<author>John Steinbeck</author>
|
||||
</book>
|
||||
</books>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" ?>
|
||||
<!-- AttValue: " or ' expected -->
|
||||
<books>
|
||||
<book number=nine>
|
||||
<title>The Grapes of Wrath</title>
|
||||
<author>John Steinbeck</author>
|
||||
</book>
|
||||
<book>
|
||||
<title>The Pearl</title>
|
||||
<author>John Steinbeck</author>
|
||||
</book>
|
||||
</books>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" ?>
|
||||
<!-- Opening and ending tag mismatch -->
|
||||
<books>
|
||||
<book>
|
||||
<title>The Grapes of Wrath</title>
|
||||
<author>John Steinbeck</author>
|
||||
</book>
|
||||
<boOk>
|
||||
<title>The Pearl</title>
|
||||
<author>John Steinbeck</author>
|
||||
</book>
|
||||
</books>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="3.1" ?>
|
||||
<!-- Unsupported version '3.1' -->
|
||||
<books>
|
||||
<book>
|
||||
<title>The Grapes of Wrath</title>
|
||||
<author>John Steinbeck</author>
|
||||
</book>
|
||||
<book>
|
||||
<title>The Pearl</title>
|
||||
<author>John Steinbeck</author>
|
||||
</book>
|
||||
</books>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" ?>
|
||||
<!-- Extra content at the end of the document -->
|
||||
<book>
|
||||
<title>The Grapes of Wrath</title>
|
||||
<author>John Steinbeck</author>
|
||||
</book>
|
||||
<book>
|
||||
<title>The Pearl</title>
|
||||
<author>John Steinbeck</author>
|
||||
</book>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE books SYSTEM "books.dtd">
|
||||
<books>
|
||||
<book>
|
||||
<title>The Grapes of Wrath</title>
|
||||
<author>John Steinbeck</author>
|
||||
<author>John Steinbeck</author>
|
||||
</book>
|
||||
<book>
|
||||
<title>The Pearl</title>
|
||||
<author>John Steinbeck</author>
|
||||
</book>
|
||||
</books>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE books [
|
||||
<!ENTITY entitest "entity is only for test purposes">
|
||||
<!ATTLIST title default CDATA "default title">
|
||||
<!ELEMENT books (book)*>
|
||||
<!ELEMENT book (title , author)>
|
||||
<!ELEMENT title (#PCDATA)>
|
||||
<!ELEMENT author (#PCDATA)>
|
||||
]>
|
||||
<books>
|
||||
<book>
|
||||
<title>The Grapes of Wrath</title>
|
||||
<author>John Steinbeck</author>
|
||||
<author>John Steinbeck</author>
|
||||
</book>
|
||||
<book>
|
||||
<title>The Pearl</title>
|
||||
<author>John Steinbeck</author>
|
||||
</book>
|
||||
</books>
|
||||
+1
-1
@@ -74,7 +74,7 @@ const zend_function_entry php_dom_xpath_class_functions[] = {
|
||||
|
||||
static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int type) /* {{{ */
|
||||
{
|
||||
zval **args;
|
||||
zval **args = NULL;
|
||||
zval *retval;
|
||||
int result, i, ret;
|
||||
int error = 0;
|
||||
|
||||
@@ -3,7 +3,7 @@ dnl $Id$
|
||||
dnl
|
||||
|
||||
PHP_ARG_WITH(enchant,for ENCHANT support,
|
||||
[ --with-enchant[=DIR] Include enchant support.
|
||||
[ --with-enchant[=DIR] Include enchant support.
|
||||
GNU Aspell version 1.1.3 or higher required.])
|
||||
|
||||
if test "$PHP_ENCHANT" != "no"; then
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ dnl
|
||||
dnl Check for regex library type
|
||||
dnl
|
||||
PHP_ARG_WITH(regex,,
|
||||
[ --with-regex=TYPE regex library type: system, php. [TYPE=php]
|
||||
[ --with-regex=TYPE Regex library type: system, php. [TYPE=php]
|
||||
WARNING: Do NOT use unless you know what you are doing!], php, no)
|
||||
|
||||
case $PHP_REGEX in
|
||||
|
||||
@@ -11969,7 +11969,7 @@
|
||||
#>65 string ZSYS (Pre-System 7 system file)
|
||||
#>65 string acf3 (Aldus FreeHand)
|
||||
#>65 string cdev (control panel)
|
||||
#>65 string dfil (Desk Acessory suitcase)
|
||||
#>65 string dfil (Desk Accessory suitcase)
|
||||
#>65 string libr (library)
|
||||
#>65 string nX^d (WriteNow word processor)
|
||||
#>65 string nX^w (WriteNow dictionary)
|
||||
|
||||
@@ -5,7 +5,7 @@ PHP_ARG_ENABLE(filter, whether to enable input filter support,
|
||||
[ --disable-filter Disable input filter support], yes)
|
||||
|
||||
PHP_ARG_WITH(pcre-dir, pcre install prefix,
|
||||
[ --with-pcre-dir FILTER: pcre install prefix], no, no)
|
||||
[ --with-pcre-dir FILTER: pcre install prefix], no, no)
|
||||
|
||||
if test "$PHP_FILTER" != "no"; then
|
||||
|
||||
|
||||
+1
-1
@@ -243,7 +243,7 @@ PHP_MINIT_FUNCTION(filter)
|
||||
REGISTER_LONG_CONSTANT("FILTER_SANITIZE_STRIPPED", FILTER_SANITIZE_STRING, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("FILTER_SANITIZE_ENCODED", FILTER_SANITIZE_ENCODED, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("FILTER_SANITIZE_SPECIAL_CHARS", FILTER_SANITIZE_SPECIAL_CHARS, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("FILTER_SANITIZE_FULL_SPECIAL_CHARS", FILTER_SANITIZE_SPECIAL_CHARS, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("FILTER_SANITIZE_FULL_SPECIAL_CHARS", FILTER_SANITIZE_FULL_SPECIAL_CHARS, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("FILTER_SANITIZE_EMAIL", FILTER_SANITIZE_EMAIL, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("FILTER_SANITIZE_URL", FILTER_SANITIZE_URL, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("FILTER_SANITIZE_NUMBER_INT", FILTER_SANITIZE_NUMBER_INT, CONST_CS | CONST_PERSISTENT);
|
||||
|
||||
+19
-37
@@ -39,7 +39,7 @@
|
||||
#ifdef PHP_WIN32
|
||||
#include <winsock2.h>
|
||||
#elif defined(NETWARE)
|
||||
#ifdef USE_WINSOCK /* Modified to use Winsock (NOVSOCK2.H), atleast for now */
|
||||
#ifdef USE_WINSOCK /* Modified to use Winsock (NOVSOCK2.H), at least for now */
|
||||
#include <novsock2.h>
|
||||
#else
|
||||
#include <sys/socket.h>
|
||||
@@ -612,7 +612,7 @@ ftp_chmod(ftpbuf_t *ftp, const int mode, const char *filename, const int filenam
|
||||
/* {{{ ftp_alloc
|
||||
*/
|
||||
int
|
||||
ftp_alloc(ftpbuf_t *ftp, const int size, char **response)
|
||||
ftp_alloc(ftpbuf_t *ftp, const long size, char **response)
|
||||
{
|
||||
char buffer[64];
|
||||
|
||||
@@ -620,8 +620,8 @@ ftp_alloc(ftpbuf_t *ftp, const int size, char **response)
|
||||
return 0;
|
||||
}
|
||||
|
||||
snprintf(buffer, sizeof(buffer) - 1, "%d", size);
|
||||
|
||||
snprintf(buffer, sizeof(buffer) - 1, "%ld", size);
|
||||
|
||||
if (!ftp_putcmd(ftp, "ALLO", buffer)) {
|
||||
return 0;
|
||||
}
|
||||
@@ -787,7 +787,7 @@ ftp_pasv(ftpbuf_t *ftp, int pasv)
|
||||
/* {{{ ftp_get
|
||||
*/
|
||||
int
|
||||
ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, int resumepos TSRMLS_DC)
|
||||
ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, long resumepos TSRMLS_DC)
|
||||
{
|
||||
databuf_t *data = NULL;
|
||||
int lastch;
|
||||
@@ -808,11 +808,7 @@ ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type,
|
||||
ftp->data = data;
|
||||
|
||||
if (resumepos > 0) {
|
||||
if (resumepos > 2147483647) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP cannot handle files greater than 2147483647 bytes.");
|
||||
goto bail;
|
||||
}
|
||||
snprintf(arg, sizeof(arg), "%u", resumepos);
|
||||
snprintf(arg, sizeof(arg), "%ld", resumepos);
|
||||
if (!ftp_putcmd(ftp, "REST", arg)) {
|
||||
goto bail;
|
||||
}
|
||||
@@ -885,10 +881,10 @@ bail:
|
||||
/* {{{ ftp_put
|
||||
*/
|
||||
int
|
||||
ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, int startpos TSRMLS_DC)
|
||||
ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, long startpos TSRMLS_DC)
|
||||
{
|
||||
databuf_t *data = NULL;
|
||||
int size;
|
||||
long size;
|
||||
char *ptr;
|
||||
int ch;
|
||||
char arg[11];
|
||||
@@ -905,11 +901,7 @@ ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, i
|
||||
ftp->data = data;
|
||||
|
||||
if (startpos > 0) {
|
||||
if (startpos > 2147483647) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP cannot handle files with a size greater than 2147483647 bytes.");
|
||||
goto bail;
|
||||
}
|
||||
snprintf(arg, sizeof(arg), "%u", startpos);
|
||||
snprintf(arg, sizeof(arg), "%ld", startpos);
|
||||
if (!ftp_putcmd(ftp, "REST", arg)) {
|
||||
goto bail;
|
||||
}
|
||||
@@ -966,7 +958,7 @@ bail:
|
||||
|
||||
/* {{{ ftp_size
|
||||
*/
|
||||
int
|
||||
long
|
||||
ftp_size(ftpbuf_t *ftp, const char *path)
|
||||
{
|
||||
if (ftp == NULL) {
|
||||
@@ -981,7 +973,7 @@ ftp_size(ftpbuf_t *ftp, const char *path)
|
||||
if (!ftp_getresp(ftp) || ftp->resp != 213) {
|
||||
return -1;
|
||||
}
|
||||
return atoi(ftp->inbuf);
|
||||
return atol(ftp->inbuf);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -1143,7 +1135,7 @@ ftp_putcmd(ftpbuf_t *ftp, const char *cmd, const char *args)
|
||||
int
|
||||
ftp_readline(ftpbuf_t *ftp)
|
||||
{
|
||||
int size, rcvd;
|
||||
long size, rcvd;
|
||||
char *data, *eol;
|
||||
|
||||
/* shift the extra to the front */
|
||||
@@ -1236,7 +1228,8 @@ ftp_getresp(ftpbuf_t *ftp)
|
||||
int
|
||||
my_send(ftpbuf_t *ftp, php_socket_t s, void *buf, size_t len)
|
||||
{
|
||||
int n, size, sent;
|
||||
long size, sent;
|
||||
int n;
|
||||
|
||||
size = len;
|
||||
while (size) {
|
||||
@@ -1719,7 +1712,7 @@ bail:
|
||||
/* {{{ ftp_nb_get
|
||||
*/
|
||||
int
|
||||
ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, int resumepos TSRMLS_DC)
|
||||
ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, long resumepos TSRMLS_DC)
|
||||
{
|
||||
databuf_t *data = NULL;
|
||||
char arg[11];
|
||||
@@ -1737,14 +1730,7 @@ ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t typ
|
||||
}
|
||||
|
||||
if (resumepos>0) {
|
||||
/* We are working on an architecture that supports 64-bit integers
|
||||
* since php is 32 bit by design, we bail out with warning
|
||||
*/
|
||||
if (resumepos > 2147483647) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP cannot handle files greater than 2147483648 bytes.");
|
||||
goto bail;
|
||||
}
|
||||
snprintf(arg, sizeof(arg), "%u", resumepos);
|
||||
snprintf(arg, sizeof(arg), "%ld", resumepos);
|
||||
if (!ftp_putcmd(ftp, "REST", arg)) {
|
||||
goto bail;
|
||||
}
|
||||
@@ -1843,7 +1829,7 @@ bail:
|
||||
/* {{{ ftp_nb_put
|
||||
*/
|
||||
int
|
||||
ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, int startpos TSRMLS_DC)
|
||||
ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, long startpos TSRMLS_DC)
|
||||
{
|
||||
databuf_t *data = NULL;
|
||||
char arg[11];
|
||||
@@ -1858,11 +1844,7 @@ ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type
|
||||
goto bail;
|
||||
}
|
||||
if (startpos > 0) {
|
||||
if (startpos > 2147483647) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP cannot handle files with a size greater than 2147483647 bytes.");
|
||||
goto bail;
|
||||
}
|
||||
snprintf(arg, sizeof(arg), "%u", startpos);
|
||||
snprintf(arg, sizeof(arg), "%ld", startpos);
|
||||
if (!ftp_putcmd(ftp, "REST", arg)) {
|
||||
goto bail;
|
||||
}
|
||||
@@ -1899,7 +1881,7 @@ bail:
|
||||
int
|
||||
ftp_nb_continue_write(ftpbuf_t *ftp TSRMLS_DC)
|
||||
{
|
||||
int size;
|
||||
long size;
|
||||
char *ptr;
|
||||
int ch;
|
||||
|
||||
|
||||
+6
-6
@@ -146,7 +146,7 @@ int ftp_chmod(ftpbuf_t *ftp, const int mode, const char *filename, const int fi
|
||||
* however some servers will not accept STOR or APPE until ALLO is confirmed.
|
||||
* If response is passed, it is estrdup()ed from ftp->inbuf and must be freed
|
||||
* or assigned to a zval returned to the user */
|
||||
int ftp_alloc(ftpbuf_t *ftp, const int size, char **response);
|
||||
int ftp_alloc(ftpbuf_t *ftp, const long size, char **response);
|
||||
|
||||
/* returns a NULL-terminated array of filenames in the given path
|
||||
* or NULL on error. the return array must be freed (but don't
|
||||
@@ -169,15 +169,15 @@ int ftp_pasv(ftpbuf_t *ftp, int pasv);
|
||||
/* retrieves a file and saves its contents to outfp
|
||||
* returns true on success, false on error
|
||||
*/
|
||||
int ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, int resumepos TSRMLS_DC);
|
||||
int ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, long resumepos TSRMLS_DC);
|
||||
|
||||
/* stores the data from a file, socket, or process as a file on the remote server
|
||||
* returns true on success, false on error
|
||||
*/
|
||||
int ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, int startpos TSRMLS_DC);
|
||||
int ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, long startpos TSRMLS_DC);
|
||||
|
||||
/* returns the size of the given file, or -1 on error */
|
||||
int ftp_size(ftpbuf_t *ftp, const char *path);
|
||||
long ftp_size(ftpbuf_t *ftp, const char *path);
|
||||
|
||||
/* returns the last modified time of the given file, or -1 on error */
|
||||
time_t ftp_mdtm(ftpbuf_t *ftp, const char *path);
|
||||
@@ -194,12 +194,12 @@ int ftp_site(ftpbuf_t *ftp, const char *cmd);
|
||||
/* retrieves part of a file and saves its contents to outfp
|
||||
* returns true on success, false on error
|
||||
*/
|
||||
int ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, int resumepos TSRMLS_DC);
|
||||
int ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, long resumepos TSRMLS_DC);
|
||||
|
||||
/* stores the data from a file, socket, or process as a file on the remote server
|
||||
* returns true on success, false on error
|
||||
*/
|
||||
int ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, int startpos TSRMLS_DC);
|
||||
int ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, long startpos TSRMLS_DC);
|
||||
|
||||
/* continues a previous nb_(f)get command
|
||||
*/
|
||||
|
||||
+7
-9
@@ -784,8 +784,8 @@ PHP_FUNCTION(ftp_nb_fget)
|
||||
ftptype_t xtype;
|
||||
php_stream *stream;
|
||||
char *file;
|
||||
int file_len, ret;
|
||||
long mode, resumepos=0;
|
||||
int file_len;
|
||||
long mode, resumepos=0, ret;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrsl|l", &z_ftp, &z_file, &file, &file_len, &mode, &resumepos) == FAILURE) {
|
||||
return;
|
||||
@@ -968,9 +968,7 @@ PHP_FUNCTION(ftp_nb_get)
|
||||
RETURN_LONG(PHP_FTP_FAILED);
|
||||
}
|
||||
|
||||
if (ret == PHP_FTP_FINISHED) {
|
||||
php_stream_close(outstream);
|
||||
}
|
||||
php_stream_close(outstream);
|
||||
|
||||
RETURN_LONG(ret);
|
||||
}
|
||||
@@ -982,7 +980,7 @@ PHP_FUNCTION(ftp_nb_continue)
|
||||
{
|
||||
zval *z_ftp;
|
||||
ftpbuf_t *ftp;
|
||||
int ret;
|
||||
long ret;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_ftp) == FAILURE) {
|
||||
return;
|
||||
@@ -1120,7 +1118,7 @@ PHP_FUNCTION(ftp_put)
|
||||
ftpbuf_t *ftp;
|
||||
ftptype_t xtype;
|
||||
char *remote, *local;
|
||||
int remote_len, local_len;
|
||||
long remote_len, local_len;
|
||||
long mode, startpos=0;
|
||||
php_stream *instream;
|
||||
|
||||
@@ -1173,8 +1171,8 @@ PHP_FUNCTION(ftp_nb_put)
|
||||
ftpbuf_t *ftp;
|
||||
ftptype_t xtype;
|
||||
char *remote, *local;
|
||||
int remote_len, local_len, ret;
|
||||
long mode, startpos=0;
|
||||
int remote_len, local_len;
|
||||
long mode, startpos=0, ret;
|
||||
php_stream *instream;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rppl|l", &z_ftp, &remote, &remote_len, &local, &local_len, &mode, &startpos) == FAILURE) {
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
Verify php can handle filesizes >32bit
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require 'skipif.inc';
|
||||
if (2147483647 == PHP_INT_MAX) {
|
||||
die('skip 64-bit only');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require 'server.inc';
|
||||
|
||||
$ftp = ftp_connect('127.0.0.1', $port);
|
||||
if (!$ftp) die("Couldn't connect to the server");
|
||||
|
||||
ftp_login($ftp, 'user', 'pass');
|
||||
var_dump(ftp_size($ftp, 'largefile'));
|
||||
|
||||
ftp_close($ftp);
|
||||
?>
|
||||
--EXPECT--
|
||||
int(5368709120)
|
||||
@@ -0,0 +1,36 @@
|
||||
--TEST--
|
||||
Testing ftp_nb_fget can handle large files incl. resume
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require 'skipif.inc';
|
||||
if (2147483647 == PHP_INT_MAX) {
|
||||
die('skip ot supported on this system');
|
||||
}
|
||||
if (disk_free_space(__DIR__) < 10*1024*1024*1024) {
|
||||
die('not enough disk space');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require 'server.inc';
|
||||
|
||||
$ftp = ftp_connect('127.0.0.1', $port);
|
||||
ftp_login($ftp, 'user', 'pass');
|
||||
if (!$ftp) die("Couldn't connect to the server");
|
||||
|
||||
$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt";
|
||||
touch($local_file);
|
||||
ftp_nb_get($ftp, $local_file, 'fget_large.txt', FTP_BINARY, 5368709119);
|
||||
$fp = fopen($local_file, 'r');
|
||||
fseek($fp, 5368709119);
|
||||
var_dump(fread($fp, 1));
|
||||
var_dump(filesize($local_file));
|
||||
fclose($fp);
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt");
|
||||
?>
|
||||
--EXPECT--
|
||||
string(1) "X"
|
||||
int(5368709120)
|
||||
@@ -357,7 +357,17 @@ if ($pid) {
|
||||
$transfer_type = $ascii? 'ASCII' : 'BINARY' ;
|
||||
fputs($fs, "Bar\r\n");
|
||||
fputs($s, "226 Closing data Connection.\r\n");
|
||||
break;
|
||||
break;
|
||||
case "fget_large":
|
||||
fputs($s, "150 File status okay; about to open data connection.\r\n");
|
||||
$transfer_type = $ascii? 'ASCII' : 'BINARY' ;
|
||||
if ($GLOBALS['rest_pos'] == '5368709119') {
|
||||
fputs($fs, "X");
|
||||
} else {
|
||||
fputs($fs, "Y");
|
||||
}
|
||||
fputs($s, "226 Closing data Connection.\r\n");
|
||||
break;
|
||||
default:
|
||||
fputs($s, "550 {$matches[1]}: No such file or directory \r\n");
|
||||
break;
|
||||
@@ -393,11 +403,12 @@ if ($pid) {
|
||||
}elseif (preg_match('/^LIST no_exists\//', $buf, $matches)) {
|
||||
fputs($s, "425 Error establishing connection\r\n");
|
||||
|
||||
}elseif (preg_match('/^REST \d+/', $buf, $matches)) {
|
||||
}elseif (preg_match('/^REST (\d+)/', $buf, $matches)) {
|
||||
$GLOBALS['rest_pos'] = $matches[1];
|
||||
fputs($s, "350 OK\r\n");
|
||||
}
|
||||
|
||||
else {
|
||||
}elseif (preg_match('/^SIZE largefile/', $buf)) {
|
||||
fputs($s, "213 5368709120\r\n");
|
||||
}else {
|
||||
fputs($s, "500 Syntax error, command unrecognized.\r\n");
|
||||
dump_and_exit($buf);
|
||||
}
|
||||
@@ -407,4 +418,4 @@ if ($pid) {
|
||||
}
|
||||
|
||||
fclose($socket);
|
||||
?>
|
||||
?>
|
||||
+4
-4
@@ -7,11 +7,11 @@ dnl Configure options
|
||||
dnl
|
||||
|
||||
PHP_ARG_WITH(gd, for GD support,
|
||||
[ --with-gd[=DIR] Include GD support. DIR is the GD library base
|
||||
[ --with-gd[=DIR] Include GD support. DIR is the GD library base
|
||||
install directory [BUNDLED]])
|
||||
if test -z "$PHP_VPX_DIR"; then
|
||||
PHP_ARG_WITH(vpx-dir, for the location of libvpx,
|
||||
[ --with-vpx-dir[=DIR] GD: Set the path to libvpx install prefix], no, no)
|
||||
[ --with-vpx-dir[=DIR] GD: Set the path to libvpx install prefix], no, no)
|
||||
fi
|
||||
|
||||
if test -z "$PHP_JPEG_DIR"; then
|
||||
@@ -39,10 +39,10 @@ PHP_ARG_WITH(t1lib, for T1lib support,
|
||||
[ --with-t1lib[=DIR] GD: Include T1lib support. T1lib version >= 5.0.0 required], no, no)
|
||||
|
||||
PHP_ARG_ENABLE(gd-native-ttf, whether to enable truetype string function in GD,
|
||||
[ --enable-gd-native-ttf GD: Enable TrueType string function], no, no)
|
||||
[ --enable-gd-native-ttf GD: Enable TrueType string function], no, no)
|
||||
|
||||
PHP_ARG_ENABLE(gd-jis-conv, whether to enable JIS-mapped Japanese font support in GD,
|
||||
[ --enable-gd-jis-conv GD: Enable JIS-mapped Japanese font support], no, no)
|
||||
[ --enable-gd-jis-conv GD: Enable JIS-mapped Japanese font support], no, no)
|
||||
|
||||
dnl
|
||||
dnl Checks for the configure options
|
||||
|
||||
+1
-1
@@ -2434,7 +2434,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
|
||||
fflush(fp);
|
||||
}
|
||||
|
||||
register_im:
|
||||
/* register_im: */
|
||||
if (im) {
|
||||
ZEND_REGISTER_RESOURCE(return_value, im, le_gd);
|
||||
php_stream_close(stream);
|
||||
|
||||
@@ -3011,7 +3011,6 @@ void gdImageGetClip (gdImagePtr im, int *x1P, int *y1P, int *x2P, int *y2P)
|
||||
int gdImagePaletteToTrueColor(gdImagePtr src)
|
||||
{
|
||||
unsigned int y;
|
||||
unsigned char alloc_y = 0;
|
||||
unsigned int yy;
|
||||
|
||||
if (src == NULL) {
|
||||
|
||||
@@ -3,7 +3,7 @@ dnl $Id$
|
||||
dnl
|
||||
|
||||
PHP_ARG_WITH(gettext,for GNU gettext support,
|
||||
[ --with-gettext[=DIR] Include GNU gettext support])
|
||||
[ --with-gettext[=DIR] Include GNU gettext support])
|
||||
|
||||
if test "$PHP_GETTEXT" != "no"; then
|
||||
for i in $PHP_GETTEXT /usr/local /usr; do
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ dnl $Id$
|
||||
dnl
|
||||
|
||||
PHP_ARG_WITH(gmp, for GNU MP support,
|
||||
[ --with-gmp[=DIR] Include GNU MP support])
|
||||
[ --with-gmp[=DIR] Include GNU MP support])
|
||||
|
||||
if test "$PHP_GMP" != "no"; then
|
||||
|
||||
|
||||
+1
-1
@@ -1069,7 +1069,7 @@ ZEND_FUNCTION(gmp_powm)
|
||||
zval **base_arg, **exp_arg, **mod_arg;
|
||||
mpz_t *gmpnum_base, *gmpnum_exp, *gmpnum_mod, *gmpnum_result;
|
||||
int use_ui = 0;
|
||||
int temp_base, temp_exp, temp_mod;
|
||||
int temp_base = 0, temp_exp = 0, temp_mod;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ZZZ", &base_arg, &exp_arg, &mod_arg) == FAILURE){
|
||||
return;
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ dnl $Id$
|
||||
dnl config.m4 for extension hash
|
||||
|
||||
PHP_ARG_WITH(mhash, for mhash support,
|
||||
[ --with-mhash[=DIR] Include mhash support])
|
||||
[ --with-mhash[=DIR] Include mhash support])
|
||||
|
||||
PHP_ARG_ENABLE(hash, whether to enable hash support,
|
||||
[ --disable-hash Disable hash support], yes)
|
||||
|
||||
+2
-2
@@ -597,7 +597,7 @@ PHP_FUNCTION(hash_algos)
|
||||
|
||||
array_init(return_value);
|
||||
for(zend_hash_internal_pointer_reset_ex(&php_hash_hashtable, &pos);
|
||||
(type = zend_hash_get_current_key_ex(&php_hash_hashtable, &str, &str_len, &idx, 0, &pos)) != HASH_KEY_NON_EXISTANT;
|
||||
(type = zend_hash_get_current_key_ex(&php_hash_hashtable, &str, &str_len, &idx, 0, &pos)) != HASH_KEY_NON_EXISTENT;
|
||||
zend_hash_move_forward_ex(&php_hash_hashtable, &pos)) {
|
||||
add_next_index_stringl(return_value, str, str_len-1, 1);
|
||||
}
|
||||
@@ -1042,7 +1042,7 @@ PHP_MINFO_FUNCTION(hash)
|
||||
long type;
|
||||
|
||||
for(zend_hash_internal_pointer_reset_ex(&php_hash_hashtable, &pos);
|
||||
(type = zend_hash_get_current_key_ex(&php_hash_hashtable, &str, NULL, &idx, 0, &pos)) != HASH_KEY_NON_EXISTANT;
|
||||
(type = zend_hash_get_current_key_ex(&php_hash_hashtable, &str, NULL, &idx, 0, &pos)) != HASH_KEY_NON_EXISTENT;
|
||||
zend_hash_move_forward_ex(&php_hash_hashtable, &pos)) {
|
||||
s += slprintf(s, e - s, "%s ", str);
|
||||
}
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ dnl $Id$
|
||||
dnl
|
||||
|
||||
PHP_ARG_WITH(iconv, for iconv support,
|
||||
[ --without-iconv[=DIR] Exclude iconv support], yes)
|
||||
[ --without-iconv[=DIR] Exclude iconv support], yes)
|
||||
|
||||
if test "$PHP_ICONV" != "no"; then
|
||||
|
||||
|
||||
+1
-1
@@ -95,7 +95,7 @@ AC_DEFUN([PHP_IMAP_SSL_CHK], [
|
||||
|
||||
|
||||
PHP_ARG_WITH(imap,for IMAP support,
|
||||
[ --with-imap[=DIR] Include IMAP support. DIR is the c-client install prefix])
|
||||
[ --with-imap[=DIR] Include IMAP support. DIR is the c-client install prefix])
|
||||
|
||||
PHP_ARG_WITH(kerberos,for IMAP Kerberos support,
|
||||
[ --with-kerberos[=DIR] IMAP: Include Kerberos support. DIR is the Kerberos install prefix], no, no)
|
||||
|
||||
@@ -3,7 +3,7 @@ dnl $Id$
|
||||
dnl
|
||||
|
||||
PHP_ARG_WITH(interbase,for InterBase support,
|
||||
[ --with-interbase[=DIR] Include InterBase support. DIR is the InterBase base
|
||||
[ --with-interbase[=DIR] Include InterBase support. DIR is the InterBase base
|
||||
install directory [/usr/interbase]])
|
||||
|
||||
if test "$PHP_INTERBASE" != "no"; then
|
||||
|
||||
@@ -245,32 +245,32 @@ ZEND_BEGIN_ARG_INFO_EX(ainfo_biter_void, 0, 0, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(ainfo_biter_locale, 0, 0, 0)
|
||||
ZEND_ARG_INFO(0, "locale")
|
||||
ZEND_ARG_INFO(0, locale)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(ainfo_biter_setText, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, "text")
|
||||
ZEND_ARG_INFO(0, text)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(ainfo_biter_next, 0, 0, 0)
|
||||
ZEND_ARG_INFO(0, "offset")
|
||||
ZEND_ARG_INFO(0, offset)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(ainfo_biter_offset, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, "offset")
|
||||
ZEND_ARG_INFO(0, offset)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(ainfo_biter_get_locale, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, "locale_type")
|
||||
ZEND_ARG_INFO(0, locale_type)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(ainfo_biter_getPartsIterator, 0, 0, 0)
|
||||
ZEND_ARG_INFO(0, "key_type")
|
||||
ZEND_ARG_INFO(0, key_type)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(ainfo_rbbi___construct, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, "rules")
|
||||
ZEND_ARG_INFO(0, "areCompiled")
|
||||
ZEND_ARG_INFO(0, rules)
|
||||
ZEND_ARG_INFO(0, areCompiled)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
/* }}} */
|
||||
|
||||
@@ -139,7 +139,7 @@ void collator_convert_hash_from_utf8_to_utf16( HashTable* hash, UErrorCode* stat
|
||||
|
||||
zend_hash_internal_pointer_reset( hash );
|
||||
while( ( hashKeyType = zend_hash_get_current_key( hash, &hashKey, &hashIndex, 0 ) )
|
||||
!= HASH_KEY_NON_EXISTANT )
|
||||
!= HASH_KEY_NON_EXISTENT )
|
||||
{
|
||||
/* Convert current hash item from UTF-8 to UTF-16LE. */
|
||||
collator_convert_hash_item_from_utf8_to_utf16(
|
||||
@@ -164,7 +164,7 @@ void collator_convert_hash_from_utf16_to_utf8( HashTable* hash, UErrorCode* stat
|
||||
|
||||
zend_hash_internal_pointer_reset( hash );
|
||||
while( ( hashKeyType = zend_hash_get_current_key( hash, &hashKey, &hashIndex, 0 ) )
|
||||
!= HASH_KEY_NON_EXISTANT )
|
||||
!= HASH_KEY_NON_EXISTENT )
|
||||
{
|
||||
/* Convert current hash item from UTF-16LE to UTF-8. */
|
||||
collator_convert_hash_item_from_utf16_to_utf8(
|
||||
|
||||
Loaded 100 of 321 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user