mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-12 03:30:50 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
86d7c5866f | ||
|
|
a66b5c9a28 | ||
|
|
da4e5307b9 | ||
|
|
91ce8041a3 | ||
|
|
be4053cea0 | ||
|
|
ff41bfc878 | ||
|
|
b7903f9778 | ||
|
|
9cbd7a24b6 | ||
|
|
250393f925 | ||
|
|
b741d3315b | ||
|
|
4420b43907 | ||
|
|
dfce6bf5d6 | ||
|
|
5f31c81f07 | ||
|
|
896ac689c9 | ||
|
|
b8d453d8d4 | ||
|
|
75d8af715c | ||
|
|
ed1f058591 | ||
|
|
b7dbcbd41f | ||
|
|
8fe87e7fea | ||
|
|
a614f8edea | ||
|
|
a19d5c520c | ||
|
|
1ac611f24f | ||
|
|
d86b6ea35c | ||
|
|
e6cf7d7745 | ||
|
|
08f4b3c3ac | ||
|
|
f826ea093f | ||
|
|
8992da2451 | ||
|
|
34ab5650bc | ||
|
|
7e8276ca68 | ||
|
|
405ebfcd18 | ||
|
|
974324676b | ||
|
|
2996eeeed0 | ||
|
|
b025b9d0cf | ||
|
|
d372b33c9b | ||
|
|
4662151ea7 | ||
|
|
9a86784859 | ||
|
|
bc0972e78d | ||
|
|
7a0f4cfdde | ||
|
|
ffcfa6f920 | ||
|
|
ad2bee193d | ||
|
|
a44a1dc194 | ||
|
|
ce2082d24f | ||
|
|
91e1df704e | ||
|
|
e427182279 | ||
|
|
ad641950b3 | ||
|
|
5b3f4d25ea | ||
|
|
36fa17a5fa | ||
|
|
84fe2cc890 | ||
|
|
e886272577 | ||
|
|
cc90ac54be | ||
|
|
5e36306feb | ||
|
|
c3f34796a0 | ||
|
|
2418791731 | ||
|
|
84b1c568f4 | ||
|
|
5e23a047ac | ||
|
|
a62d4e2c43 | ||
|
|
4af92aca87 | ||
|
|
b8e946b02e | ||
|
|
af516750ff | ||
|
|
055ecbc628 | ||
|
|
041dd77135 | ||
|
|
d93892de7a | ||
|
|
02cda8fd94 | ||
|
|
5d81fe6f12 | ||
|
|
fed1f2d124 | ||
|
|
cce4764f13 | ||
|
|
4cba4c6193 | ||
|
|
34bd1c941b | ||
|
|
e793539678 | ||
|
|
5c001d42d4 | ||
|
|
df138c5719 | ||
|
|
f072662621 | ||
|
|
0a65b661e4 | ||
|
|
a8948d0808 | ||
|
|
d8ba49a2c7 | ||
|
|
592917f91f | ||
|
|
1c4e48650c | ||
|
|
b408028b88 | ||
|
|
6176b96a23 | ||
|
|
c56ff2bf75 | ||
|
|
d3780f1f90 | ||
|
|
11a202ef50 | ||
|
|
280e3a4ec8 | ||
|
|
3faebe2bec | ||
|
|
fef691b142 | ||
|
|
26cb570615 | ||
|
|
79e44c394f | ||
|
|
f0d6059389 | ||
|
|
c7be96b08f | ||
|
|
a2bfad051d | ||
|
|
f8cc363841 | ||
|
|
bccd1e672f | ||
|
|
b5b8ea1050 | ||
|
|
a18cede1c5 | ||
|
|
b55e69285b | ||
|
|
51a5e98af6 | ||
|
|
f464ffd780 | ||
|
|
b9babd22e0 | ||
|
|
cda14b995c | ||
|
|
503358c179 | ||
|
|
c4cc43169c | ||
|
|
ba8333cdb0 | ||
|
|
c467e81c86 | ||
|
|
17c0ff1194 | ||
|
|
59eaa7c877 | ||
|
|
fc74503792 | ||
|
|
0e3a650e74 | ||
|
|
10e8da1738 | ||
|
|
7d04e0fb2e | ||
|
|
d24d5b62c1 | ||
|
|
baacc2cb13 | ||
|
|
7907dc4d66 | ||
|
|
d206206c10 | ||
|
|
9ecb67d5a4 | ||
|
|
5ebdc46aa0 | ||
|
|
bde0e8c2a1 | ||
|
|
8ca457f64d | ||
|
|
e883892664 | ||
|
|
b8cdc731b8 | ||
|
|
a37e84e549 | ||
|
|
f4a44f18b8 | ||
|
|
a39bcfc5ee | ||
|
|
9a2365412e | ||
|
|
335a11b14b | ||
|
|
7cae4ff02c | ||
|
|
7881158690 | ||
|
|
018a9b321f | ||
|
|
c975320eb9 | ||
|
|
8e65ce35b9 | ||
|
|
4e6f27f4db | ||
|
|
494c170e6f | ||
|
|
fed5923dbc | ||
|
|
deac80eb9a | ||
|
|
c56ff39c05 | ||
|
|
83542dcf3b | ||
|
|
6ecc9f1d9d | ||
|
|
d9810af45a | ||
|
|
e118a0794a | ||
|
|
db1e425b1a | ||
|
|
c1ac325228 | ||
|
|
52d541a314 | ||
|
|
45b3fa4dee | ||
|
|
15213768e6 | ||
|
|
9b233b7e5e | ||
|
|
8779a9aad5 | ||
|
|
4fc49c04df | ||
|
|
60c5f9910f | ||
|
|
d57b278ad1 | ||
|
|
e59b6dc0ae | ||
|
|
1fa8ecd082 | ||
|
|
238caeb63c | ||
|
|
ec4a1d576b | ||
|
|
43ec708882 | ||
|
|
38ca8cb7a1 | ||
|
|
35abf3f20c | ||
|
|
59e0930d37 | ||
|
|
b548d9ad2e | ||
|
|
1f5327a602 | ||
|
|
5ebb0e520f | ||
|
|
ed6ce83101 | ||
|
|
303dd7f346 | ||
|
|
428dddd3e8 | ||
|
|
fa05f038cb | ||
|
|
9b98cf7865 | ||
|
|
abe6362716 | ||
|
|
7511f972fd | ||
|
|
a331f43f8c | ||
|
|
692b3bcd88 | ||
|
|
aab49e934d | ||
|
|
6074da9809 | ||
|
|
8d5e953a19 | ||
|
|
c0e046a130 | ||
|
|
ad0371ac7e | ||
|
|
b4b0aaae93 | ||
|
|
dbc727373c | ||
|
|
c4f9b01422 | ||
|
|
4054890b26 | ||
|
|
158d8a6b08 | ||
|
|
213119c83f | ||
|
|
0a90643e53 | ||
|
|
4b04bf8793 | ||
|
|
339508d6ac | ||
|
|
72911237b5 | ||
|
|
773e85a788 | ||
|
|
2f7bd57f93 | ||
|
|
60cca8b9c9 | ||
|
|
e7ff3e839b | ||
|
|
e052da3a6b | ||
|
|
0298b92b69 | ||
|
|
decc394a20 | ||
|
|
f6655b62d8 | ||
|
|
0037598252 | ||
|
|
63e11f9025 | ||
|
|
d90003b549 | ||
|
|
a7761262f7 | ||
|
|
c2f33fb129 | ||
|
|
bf9120ecae | ||
|
|
91ad40d9bb | ||
|
|
c3547f1935 | ||
|
|
16a592b13a | ||
|
|
86d2fafded | ||
|
|
4aac4da673 | ||
|
|
6fb0e4a401 | ||
|
|
d4d36fba28 | ||
|
|
3cd50ca714 | ||
|
|
8fc9df3f67 | ||
|
|
cfea8e5d04 | ||
|
|
6c9056ceb7 | ||
|
|
abe0f17e88 | ||
|
|
84b2c39920 | ||
|
|
11b4f3becd | ||
|
|
a10da87c6a | ||
|
|
bde86a6639 | ||
|
|
04fd0b1098 | ||
|
|
85c777d2f1 | ||
|
|
888e77ff73 | ||
|
|
72c7cfe6f2 | ||
|
|
92039fed22 | ||
|
|
0e12a778df | ||
|
|
0dc9b0e708 | ||
|
|
b5511dcfd7 | ||
|
|
f1969d4b4c | ||
|
|
e8009e2dca | ||
|
|
2da2de46a8 | ||
|
|
523fd2c244 | ||
|
|
acd711685a | ||
|
|
0838a2b7c5 | ||
|
|
e08566c613 | ||
|
|
9205c4fd62 | ||
|
|
c449bf1443 | ||
|
|
1c19146f46 | ||
|
|
8ee8ccda19 | ||
|
|
1eff3b01b8 | ||
|
|
86ea921291 | ||
|
|
07c0d714a5 | ||
|
|
51286bd8e5 | ||
|
|
1299503936 | ||
|
|
5d61e56dd7 | ||
|
|
d236c1af8a | ||
|
|
0b44f16ea2 | ||
|
|
3e62aae1b4 | ||
|
|
a07d76c0ba | ||
|
|
812d248193 | ||
|
|
f4c38016b6 | ||
|
|
757e3fc3d5 | ||
|
|
629273d11b | ||
|
|
06c7c3674b | ||
|
|
7b396c078c | ||
|
|
8475c5b98d | ||
|
|
5b8316188c | ||
|
|
df481764f3 | ||
|
|
f733173b1f | ||
|
|
a7df6ce664 | ||
|
|
29876c5c29 | ||
|
|
621fddab93 | ||
|
|
bdf0c9ccbe | ||
|
|
dce259099d | ||
|
|
d1e529c1cb | ||
|
|
faca4e08b4 | ||
|
|
a472649016 | ||
|
|
074d361d64 | ||
|
|
4c9a11c857 | ||
|
|
bbcea230e1 | ||
|
|
fbb86bd7b3 | ||
|
|
c973fef48d | ||
|
|
77e70b391c | ||
|
|
645d65f3e3 | ||
|
|
2ae8d2fbfb | ||
|
|
c8f47a8e7c | ||
|
|
c5fcd9f5af | ||
|
|
ffe8303f24 | ||
|
|
867447f420 | ||
|
|
778d69ddfe | ||
|
|
c9331a3ef2 | ||
|
|
79d52503a4 | ||
|
|
88275e547f | ||
|
|
6d928fd26d | ||
|
|
29a85d49ae | ||
|
|
89e7a195bc | ||
|
|
72a9b595ca | ||
|
|
67039363cd | ||
|
|
1f6f619451 | ||
|
|
6e51989501 | ||
|
|
4eb802bb14 | ||
|
|
4d2d8e8717 | ||
|
|
d4afbd487a | ||
|
|
1abcd81872 | ||
|
|
93c91c733c | ||
|
|
d84fa39667 | ||
|
|
e36a5a1197 | ||
|
|
be8b1c74cf | ||
|
|
df2a38e7f8 | ||
|
|
a10e778bfb |
No files matched your search
+10
@@ -0,0 +1,10 @@
|
||||
language: php
|
||||
|
||||
php:
|
||||
# We only specify one version so we only get one worker
|
||||
- 5.4
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
|
||||
script: exit 0
|
||||
@@ -1,6 +1,97 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? 2012, PHP 5.4.4
|
||||
19 Jul 2012, PHP 5.4.5
|
||||
|
||||
- Core:
|
||||
. Fixed bug #62443 (Crypt SHA256/512 Segfaults With Malformed
|
||||
Salt). (Anthony Ferrara)
|
||||
. Fixed bug #62432 (ReflectionMethod random corrupt memory on high
|
||||
concurrent). (Johannes)
|
||||
. Fixed bug #62373 (serialize() generates wrong reference to the object).
|
||||
(Moriyoshi)
|
||||
. Fixed bug #62357 (compile failure: (S) Arguments missing for built-in
|
||||
function __memcmp). (Laruence)
|
||||
. Fixed bug #61998 (Using traits with method aliases appears to result in
|
||||
crash during execution). (Dmitry)
|
||||
. Fixed bug #51094 (parse_ini_file() with INI_SCANNER_RAW cuts a value that
|
||||
includes a semi-colon). (Pierrick)
|
||||
. Fixed potential overflow in _php_stream_scandir (CVE-2012-2688).
|
||||
(Jason Powell, Stas)
|
||||
|
||||
- EXIF:
|
||||
. Fixed information leak in ext exif (discovered by Martin Noga,
|
||||
Matthew "j00ru" Jurczyk, Gynvael Coldwind)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #62205 (php-fpm segfaults (null passed to strstr)). (fat)
|
||||
. Fixed bug #62160 (Add process.priority to set nice(2) priorities). (fat)
|
||||
. Fixed bug #62153 (when using unix sockets, multiples FPM instances
|
||||
. Fixed bug #62033 (php-fpm exits with status 0 on some failures to start).
|
||||
(fat)
|
||||
. Fixed bug #61839 (Unable to cross-compile PHP with --enable-fpm). (fat)
|
||||
. Fixed bug #61835 (php-fpm is not allowed to run as root). (fat)
|
||||
. Fixed bug #61295 (php-fpm should not fail with commented 'user'
|
||||
. Fixed bug #61218 (FPM drops connection while receiving some binary values
|
||||
in FastCGI requests). (fat)
|
||||
. Fixed bug #61045 (fpm don't send error log to fastcgi clients). (fat)
|
||||
for non-root start). (fat)
|
||||
. Fixed bug #61026 (FPM pools can listen on the same address). (fat)
|
||||
can be launched without errors). (fat)
|
||||
|
||||
- Iconv:
|
||||
. Fix bug #55042 (Erealloc in iconv.c unsafe). (Stas)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #62083 (grapheme_extract() memory leaks). (Gustavo)
|
||||
. ResourceBundle constructor now accepts NULL for the first two arguments.
|
||||
(Gustavo)
|
||||
. Fixed bug #62081 (IntlDateFormatter constructor leaks memory when called
|
||||
twice). (Gustavo)
|
||||
. Fixed bug #62070 (Collator::getSortKey() returns garbage). (Gustavo)
|
||||
. Fixed bug #62017 (datefmt_create with incorrectly encoded timezone leaks
|
||||
pattern). (Gustavo)
|
||||
. Fixed bug #60785 (memory leak in IntlDateFormatter constructor). (Gustavo)
|
||||
|
||||
- JSON:
|
||||
. Fixed bug #61359 (json_encode() calls too many reallocs). (Stas)
|
||||
|
||||
- libxml:
|
||||
. Fixed bug #62266 (Custom extension segfaults during xmlParseFile with FPM
|
||||
SAPI). (Gustavo)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #62227 (Invalid phar stream path causes crash). (Felipe)
|
||||
|
||||
- Readline:
|
||||
. Fixed bug #62186 (readline fails to compile - void function should not
|
||||
return a value). (Johannes)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #62384 (Attempting to invoke a Closure more than once causes
|
||||
segfault). (Felipe)
|
||||
. Fixed bug #62202 (ReflectionParameter::getDefaultValue() memory leaks
|
||||
with constant). (Laruence)
|
||||
|
||||
- Sockets:
|
||||
. Fixed bug #62025 (__ss_family was changed on AIX 5.3). (Felipe)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #62433 (Inconsistent behavior of RecursiveDirectoryIterator to
|
||||
dot files). (Laruence)
|
||||
. Fixed bug #62262 (RecursiveArrayIterator does not implement Countable).
|
||||
(Nikita Popov)
|
||||
|
||||
- XML Writer:
|
||||
. Fixed bug #62064 (memory leak in the XML Writer module).
|
||||
(jean-pierre dot lozi at lip6 dot fr)
|
||||
|
||||
- Zip:
|
||||
. Upgraded libzip to 0.10.1 (Anatoliy)
|
||||
|
||||
14 Jun 2012, PHP 5.4.4
|
||||
|
||||
- COM:
|
||||
. Fixed bug #62146 com_dotnet cannot be built shared. (Johannes)
|
||||
|
||||
- CLI Server:
|
||||
. Implemented FR #61977 (Need CLI web-server support for files with .htm &
|
||||
@@ -11,12 +102,10 @@ PHP NEWS
|
||||
. Fixed bug #61546 (functions related to current script failed when chdir()
|
||||
in cli sapi). (Laruence, reeze.xia@gmail.com)
|
||||
|
||||
- CURL:
|
||||
. Fixed bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction).
|
||||
(Laruence)
|
||||
|
||||
- Core:
|
||||
. Fixed missing bound check in iptcparse(). (chris at chiappa.net)
|
||||
. Fixed CVE-2012-2143. (Solar Designer)
|
||||
. Fixed bug #62097 (fix for for bug #54547). (Gustavo)
|
||||
. Fixed bug #62005 (unexpected behavior when incrementally assigning to a
|
||||
member of a null object). (Laruence)
|
||||
. Fixed bug #61978 (Object recursion not detected for classes that implement
|
||||
@@ -27,12 +116,15 @@ PHP NEWS
|
||||
. Fixed bug #61827 (incorrect \e processing on Windows) (Anatoliy)
|
||||
. Fixed bug #61782 (__clone/__destruct do not match other methods when checking
|
||||
access controls). (Stas)
|
||||
. Fixed bug #61764 ('I' unpacks n as signed if n > 2^31-1 on LP64). (Gustavo)
|
||||
. Fixed bug #61761 ('Overriding' a private static method with a different
|
||||
signature causes crash). (Laruence)
|
||||
. Fixed bug #61730 (Segfault from array_walk modifying an array passed by
|
||||
reference). (Laruence)
|
||||
. Fixed bug #61728 (PHP crash when calling ob_start in request_shutdown
|
||||
phase). (Laruence)
|
||||
. Fixed bug #61713 (Logic error in charset detection for htmlentities).
|
||||
(Anatoliy)
|
||||
. Fixed bug #61660 (bin2hex(hex2bin($data)) != $data). (Nikita Popov)
|
||||
. Fixed bug #61650 (ini parser crashes when using ${xxxx} ini variables
|
||||
(without apache2)). (Laruence)
|
||||
@@ -40,19 +132,42 @@ PHP NEWS
|
||||
. Fixed bug #54547 (wrong equality of string numbers). (Gustavo)
|
||||
. Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename
|
||||
set to null). (Anatoliy)
|
||||
. Changed php://fd to be available only for CLI.
|
||||
|
||||
- Reflection:
|
||||
. Implemented FR #61602 (Allow access to the name of constant
|
||||
used as function/method parameter's default value). (reeze.xia@gmail.com)
|
||||
- CURL:
|
||||
. Fixed bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction).
|
||||
(Laruence)
|
||||
|
||||
- FPM
|
||||
- Fileinfo
|
||||
. Fixed bug #61812 (Uninitialised value used in libmagic).
|
||||
(Laruence, Gustavo)
|
||||
. Fixed bug #61566 failure caused by the posix lseek and read versions
|
||||
under windows in cdf_read(). (Anatoliy)
|
||||
. Fixed bug #61565 where php_stream_open_wrapper_ex tries to open a
|
||||
directory descriptor under windows. (Anatoliy)
|
||||
|
||||
- Intl
|
||||
. Fixed bug #62082 (Memory corruption in internal function
|
||||
get_icu_disp_value_src_php()). (Gustavo)
|
||||
|
||||
- Libxml:
|
||||
. Fixed bug #61617 (Libxml tests failed(ht is already destroyed)).
|
||||
(Laruence)
|
||||
|
||||
- PDO:
|
||||
. Fixed bug #61755 (A parsing bug in the prepared statements can lead to
|
||||
access violations). (Johannes)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #61065 (Secunia SA44335, CVE-2012-2386). (Rasmus)
|
||||
|
||||
- Pgsql:
|
||||
. Added pg_escape_identifier/pg_escape_literal. (Yasuo Ohgaki)
|
||||
|
||||
- Streams:
|
||||
. Fixed bug #61961 (file_get_contents leaks when access empty file with
|
||||
maxlen set). (Reeze)
|
||||
|
||||
- Zlib:
|
||||
. Fixed bug #61820 (using ob_gzhandler will complain about headers already
|
||||
sent when no compression). (Mike)
|
||||
@@ -141,23 +256,6 @@ PHP NEWS
|
||||
. Fixed bug #60948 (mysqlnd FTBFS when -Wformat-security is enabled).
|
||||
(Johannes)
|
||||
|
||||
- Readline:
|
||||
. Fixed bug #61088 (Memory leak in readline_callback_handler_install).
|
||||
(Nikic, Laruence)
|
||||
|
||||
- Session
|
||||
. Fixed bug #60634 (Segmentation fault when trying to die() in
|
||||
SessionHandler::write()). (Ilia)
|
||||
|
||||
- SOAP
|
||||
. Fixed bug #61423 (gzip compression fails). (Ilia)
|
||||
. Fixed bug #60887 (SoapClient ignores user_agent option and sends no
|
||||
User-Agent header). (carloschilazo at gmail dot com)
|
||||
. Fixed bug #60842, #51775 (Chunked response parsing error when
|
||||
chunksize length line is > 10 bytes). (Ilia)
|
||||
. Fixed bug #49853 (Soap Client stream context header option ignored).
|
||||
(Dmitry)
|
||||
|
||||
- PDO
|
||||
. Fixed bug #61292 (Segfault while calling a method on an overloaded PDO
|
||||
object). (Laruence)
|
||||
@@ -175,12 +273,29 @@ PHP NEWS
|
||||
. Fixed bug #61184 (Phar::webPhar() generates headers with trailing NUL
|
||||
bytes). (Nikita Popov)
|
||||
|
||||
- Readline:
|
||||
. Fixed bug #61088 (Memory leak in readline_callback_handler_install).
|
||||
(Nikic, Laruence)
|
||||
|
||||
- Reflection:
|
||||
. Implemented FR #61602 (Allow access to the name of constant
|
||||
used as function/method parameter's default value). (reeze.xia@gmail.com)
|
||||
. Fixed bug #60968 (Late static binding doesn't work with
|
||||
ReflectionMethod::invokeArgs()). (Laruence)
|
||||
|
||||
- Session
|
||||
. Fixed bug #60634 (Segmentation fault when trying to die() in
|
||||
SessionHandler::write()). (Ilia)
|
||||
|
||||
- SOAP
|
||||
. Fixed bug #61423 (gzip compression fails). (Ilia)
|
||||
. Fixed bug #60887 (SoapClient ignores user_agent option and sends no
|
||||
User-Agent header). (carloschilazo at gmail dot com)
|
||||
. Fixed bug #60842, #51775 (Chunked response parsing error when
|
||||
chunksize length line is > 10 bytes). (Ilia)
|
||||
. Fixed bug #49853 (Soap Client stream context header option ignored).
|
||||
(Dmitry)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #61453 (SplObjectStorage does not identify objects correctly).
|
||||
(Gustavo)
|
||||
@@ -637,6 +752,73 @@ PHP NEWS
|
||||
. Fixed bug #55544 (ob_gzhandler always conflicts with zlib.output_compression).
|
||||
(Mike)
|
||||
|
||||
14 Jun 2012, PHP 5.3.14
|
||||
|
||||
- CLI SAPI:
|
||||
. Fixed bug #61546 (functions related to current script failed when chdir()
|
||||
in cli sapi). (Laruence, reeze.xia@gmail.com)
|
||||
|
||||
- CURL:
|
||||
. Fixed bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction).
|
||||
(Laruence)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #62146 com_dotnet cannot be built shared. (Johannes)
|
||||
|
||||
- Core:
|
||||
. Fixed CVE-2012-2143. (Solar Designer)
|
||||
. Fixed missing bound check in iptcparse(). (chris at chiappa.net)
|
||||
. Fixed bug #62373 (serialize() generates wrong reference to the object).
|
||||
(Moriyoshi)
|
||||
. Fixed bug #62005 (unexpected behavior when incrementally assigning to a
|
||||
member of a null object). (Laruence)
|
||||
. Fixed bug #61991 (long overflow in realpath_cache_get()). (Anatoliy)
|
||||
. Fixed bug #61764 ('I' unpacks n as signed if n > 2^31-1 on LP64). (Gustavo)
|
||||
. Fixed bug #61730 (Segfault from array_walk modifying an array passed by
|
||||
reference). (Laruence)
|
||||
. Fixed bug #61713 (Logic error in charset detection for htmlentities).
|
||||
(Anatoliy)
|
||||
. Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename
|
||||
set to null). (Anatoliy)
|
||||
. Changed php://fd to be available only for CLI.
|
||||
|
||||
- Fileinfo:
|
||||
. Fixed bug #61812 (Uninitialised value used in libmagic).
|
||||
(Laruence, Gustavo)
|
||||
|
||||
- Iconv extension:
|
||||
. Fixed a bug that iconv extension fails to link to the correct library
|
||||
when another extension makes use of a library that links to the iconv
|
||||
library. See https://bugs.gentoo.org/show_bug.cgi?id=364139 for detail.
|
||||
(Moriyoshi)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #62082 (Memory corruption in internal function
|
||||
get_icu_disp_value_src_php()). (Gustavo)
|
||||
|
||||
- JSON
|
||||
. Fixed bug #61537 (json_encode() incorrectly truncates/discards
|
||||
information). (Adam)
|
||||
|
||||
- PDO:
|
||||
. Fixed bug #61755 (A parsing bug in the prepared statements can lead to
|
||||
access violations). (Johannes)
|
||||
|
||||
- Phar:
|
||||
. Fix bug #61065 (Secunia SA44335). (Rasmus)
|
||||
|
||||
- Streams:
|
||||
. Fixed bug #61961 (file_get_contents leaks when access empty file with
|
||||
maxlen set). (Reeze)
|
||||
|
||||
08 May 2012, PHP 5.3.13
|
||||
- CGI
|
||||
. Improve fix for PHP-CGI query string parameter vulnerability, CVE-2012-2311.
|
||||
(Stas)
|
||||
|
||||
03 May 2012, PHP 5.3.12
|
||||
- Fix PHP-CGI query string parameter vulnerability, CVE-2012-1823. (Rasmus)
|
||||
|
||||
26 Apr 2012, PHP 5.3.11
|
||||
|
||||
- Core:
|
||||
|
||||
@@ -37,9 +37,9 @@ PHP 5.4 UPGRADE NOTES
|
||||
=============================
|
||||
|
||||
- PHP 5.4 now checks at compile time if /dev/urandom or /dev/arandom
|
||||
are present. If either is available, session.entropy_file now
|
||||
are present. If either is available, session.entropy_file now
|
||||
defaults to that file and session.entropy_length defaults to 32.
|
||||
This provides non-blocking entropy to session id generation. If you
|
||||
This provides non-blocking entropy to session id generation. If you
|
||||
do not want extra entropy for your session ids, add:
|
||||
|
||||
session.entropy_file=
|
||||
@@ -89,9 +89,9 @@ PHP 5.4 UPGRADE NOTES
|
||||
session.upload_progress.min_freq
|
||||
|
||||
- Added a zend.multibyte directive as a replacement of the PHP compile time
|
||||
configuration option --enable-zend-multibyte. Now the Zend Engine always
|
||||
configuration option --enable-zend-multibyte. Now the Zend Engine always
|
||||
contains code for multibyte support, which can be enabled or disabled at
|
||||
runtime. Note: It doesn't make a lot of sense to enable this option if
|
||||
runtime. Note: It doesn't make a lot of sense to enable this option if
|
||||
ext/mbstring is not enabled, because most functionality is implemented by
|
||||
mbstrings callbacks.
|
||||
|
||||
@@ -107,7 +107,7 @@ PHP 5.4 UPGRADE NOTES
|
||||
in a stream fashion (through php://input) without having it copied in memory
|
||||
multiple times.
|
||||
|
||||
- Added windows_show_crt_warning. This directive shows the CRT warnings when
|
||||
- Added windows_show_crt_warning. This directive shows the CRT warnings when
|
||||
enabled. These warnings were displayed by default until now. It is disabled
|
||||
by default.
|
||||
|
||||
@@ -162,7 +162,7 @@ PHP 5.4 UPGRADE NOTES
|
||||
|
||||
- Non-numeric string offsets, e.g. $a['foo'] where $a is a string, now
|
||||
return false on isset() and true on empty(), and produce warning if
|
||||
trying to use them. Offsets of types double, bool and null produce
|
||||
trying to use them. Offsets of types double, bool and null produce
|
||||
notice. Numeric strings ($a['2']) still work as before.
|
||||
|
||||
Note that offsets like '12.3' and '5 and a half' are considered
|
||||
@@ -207,7 +207,7 @@ PHP 5.4 UPGRADE NOTES
|
||||
|
||||
- htmlentities() and htmlspecialchars() are stricter in the code units they
|
||||
accept for the asian encodings. For Big5-HKSCS, the octets 0x80 and 0xFF are
|
||||
rejected. For GB2312/EUC-CN, the octets 0x8E, 0x8F, 0xA0 and 0xFF are
|
||||
rejected. For GB2312/EUC-CN, the octets 0x8E, 0x8F, 0xA0 and 0xFF are
|
||||
rejected. For SJIS, the octets 0x80, 0xA0, 0xFD, 0xFE and 0xFF are rejected,
|
||||
except maybe after a valid starting byte. For EUC-JP, the octets 0xA0 and
|
||||
0xFF are rejected.
|
||||
@@ -233,7 +233,7 @@ PHP 5.4 UPGRADE NOTES
|
||||
checks on the validity of the entities. Numerical entities are checked for a
|
||||
valid range (0 to 0x10FFFF); if the flag ENT_DISALLOWED is given, the
|
||||
validity of such numerical entity in the target document type is also
|
||||
checked. Named entities are checked for necessary existence in the target
|
||||
checked. Named entities are checked for necessary existence in the target
|
||||
document type instead of only checking whether they were constituted by
|
||||
alphanumeric characters.
|
||||
|
||||
@@ -339,6 +339,10 @@ PHP 5.4 UPGRADE NOTES
|
||||
- ob_start() no longer starts multiple output buffers when passed
|
||||
array("callback1", "callback2", "callback3", ...).
|
||||
|
||||
- Since 5.4.4, "php://fd" stream syntax is available only in CLI build.
|
||||
|
||||
- Since 5.4.5, resourcebundle_create() accepts null for the first two arguments.
|
||||
|
||||
==============================
|
||||
5. Changes to existing classes
|
||||
==============================
|
||||
@@ -371,6 +375,9 @@ PHP 5.4 UPGRADE NOTES
|
||||
- FilesystemIterator, GlobIterator and (Recursive)DirectoryIterator now use
|
||||
the default stream context.
|
||||
|
||||
- Since 5.4.5, the constructor of ResourceBundle accepts NULL for the first two
|
||||
arguments.
|
||||
|
||||
===========================
|
||||
7. Deprecated Functionality
|
||||
===========================
|
||||
@@ -429,7 +436,7 @@ d. Removed hash algorithms
|
||||
a. Extensions no longer maintained
|
||||
|
||||
- ext/sqlite is no longer part of the base distribution and has been moved
|
||||
to PECL. Use sqlite3 or PDO_SQLITE instead.
|
||||
to PECL. Use sqlite3 or PDO_SQLITE instead.
|
||||
|
||||
b. Extensions with changed behavior
|
||||
|
||||
@@ -483,7 +490,7 @@ b. Extensions with changed behavior
|
||||
===========================
|
||||
|
||||
- A REQUEST_TIME_FLOAT value returns a floating point number indicating the
|
||||
time with microsecond precision. All SAPIs providing this value should be
|
||||
time with microsecond precision. All SAPIs providing this value should be
|
||||
returning float and not time_t.
|
||||
|
||||
- apache_child_terminate(), getallheaders(), apache_request_headers()
|
||||
@@ -506,6 +513,11 @@ b. Extensions with changed behavior
|
||||
- is_link now works properly for symbolic links on Windows Vista
|
||||
or later. Earlier systems do not support symbolic links.
|
||||
|
||||
- As of PHP 5.4.5 and above the COM extension isn't compiled statically in PHP
|
||||
anymore but shared. It'll still be delivered with the standard PHP release but
|
||||
must be activated manually with the "extension = php_com_dotnet.dll" directive
|
||||
in php.ini.
|
||||
|
||||
==================
|
||||
12. New in PHP 5.4
|
||||
==================
|
||||
@@ -608,6 +620,10 @@ c. New functions
|
||||
- mysqli_error_list()
|
||||
- mysqli_stmt_error_list()
|
||||
|
||||
- pgsql
|
||||
- pg_escape_identifier() (5.4.4)
|
||||
- pg_escape_literal() (5.4.4)
|
||||
|
||||
- Session:
|
||||
- session_register_shutdown()
|
||||
- session_status()
|
||||
|
||||
-22097
File diff suppressed because it is too large.
Load diff
@@ -62,17 +62,17 @@ print "\nDone\n";
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: String offset cast occured in %s on line %d
|
||||
Notice: String offset cast occurred in %s on line %d
|
||||
|
||||
Notice: Uninitialized string offset: 0 in %s on line %d
|
||||
|
||||
Notice: Uninitialized string offset: 0 in %s on line %d
|
||||
|
||||
Notice: String offset cast occured in %s on line %d
|
||||
Notice: String offset cast occurred in %s on line %d
|
||||
|
||||
Notice: Uninitialized string offset: %i in %s on line %d
|
||||
|
||||
Notice: String offset cast occured in %s on line %d
|
||||
Notice: String offset cast occurred in %s on line %d
|
||||
|
||||
Notice: Uninitialized string offset: %i in %s on line %d
|
||||
|
||||
@@ -88,16 +88,16 @@ Notice: Uninitialized string offset: 4 in %s on line %d
|
||||
|
||||
Notice: Uninitialized string offset: 4 in %s on line %d
|
||||
|
||||
Notice: String offset cast occured in %s on line %d
|
||||
Notice: String offset cast occurred in %s on line %d
|
||||
|
||||
Notice: Uninitialized string offset: 12 in %s on line %d
|
||||
|
||||
Notice: String offset cast occured in %s on line %d
|
||||
Notice: String offset cast occurred in %s on line %d
|
||||
|
||||
Notice: Uninitialized string offset: 12 in %s on line %d
|
||||
|
||||
Notice: String offset cast occured in %s on line %d
|
||||
Notice: String offset cast occurred in %s on line %d
|
||||
|
||||
Notice: String offset cast occured in %s on line %d
|
||||
Notice: String offset cast occurred in %s on line %d
|
||||
b
|
||||
Done
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #62097: fix for bug #54547 is wrong for 32-bit machines
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (PHP_INT_MAX !== 2147483647)
|
||||
die('skip for system with 32-bit wide longs only');
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump("02147483647" == "2147483647",
|
||||
"02147483648" == "2147483648",
|
||||
"09007199254740991" == "9007199254740991",
|
||||
"09007199254740992" == "9007199254740992");
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(false)
|
||||
@@ -30,10 +30,10 @@ echo "Done\n";
|
||||
--EXPECTF--
|
||||
string(1) "i"
|
||||
|
||||
Notice: String offset cast occured in %s on line %d
|
||||
Notice: String offset cast occurred in %s on line %d
|
||||
string(1) "S"
|
||||
|
||||
Notice: String offset cast occured in %s on line %d
|
||||
Notice: String offset cast occurred in %s on line %d
|
||||
string(1) "S"
|
||||
|
||||
Warning: Illegal string offset 'run away' in %s on line %d
|
||||
@@ -46,10 +46,10 @@ string(1) "o"
|
||||
Notice: A non well formed numeric value encountered in %s on line %d
|
||||
string(1) "r"
|
||||
|
||||
Notice: String offset cast occured in %s on line %d
|
||||
Notice: String offset cast occurred in %s on line %d
|
||||
string(1) "i"
|
||||
|
||||
Notice: String offset cast occured in %s on line %d
|
||||
Notice: String offset cast occurred in %s on line %d
|
||||
string(1) "S"
|
||||
|
||||
Warning: Illegal offset type in %s on line %d
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
--TEST--
|
||||
Bug #61998 (Using traits with method aliases appears to result in crash during execution)
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo {
|
||||
use T1 {
|
||||
func as newFunc;
|
||||
}
|
||||
|
||||
public function func() {
|
||||
echo "From Foo\n";
|
||||
}
|
||||
}
|
||||
|
||||
trait T1 {
|
||||
public function func() {
|
||||
echo "From T1\n";
|
||||
}
|
||||
}
|
||||
|
||||
class Bar {
|
||||
public function func() {
|
||||
echo "From Bar\n";
|
||||
}
|
||||
public function func2() {
|
||||
echo "From Bar\n";
|
||||
}
|
||||
public function func3() {
|
||||
echo "From Bar\n";
|
||||
}
|
||||
use T1 {
|
||||
func as newFunc;
|
||||
func as func2;
|
||||
}
|
||||
use T2 {
|
||||
func2 as newFunc2;
|
||||
func2 as newFunc3;
|
||||
func2 as func3;
|
||||
}
|
||||
}
|
||||
|
||||
trait T2 {
|
||||
public function func2() {
|
||||
echo "From T2\n";
|
||||
}
|
||||
}
|
||||
|
||||
$f = new Foo();
|
||||
|
||||
$f->newFunc(); //from T1
|
||||
$f->func(); //from Foo
|
||||
|
||||
$b = new Bar();
|
||||
$b->newFunc(); //from T1
|
||||
$b->func(); //from Bar
|
||||
$b->func2(); //from Bar
|
||||
$b->newFunc2(); //from T2
|
||||
$b->newFunc3(); //from T2
|
||||
$b->func3(); //from Bar
|
||||
--EXPECTF--
|
||||
From T1
|
||||
From Foo
|
||||
From T1
|
||||
From Bar
|
||||
From Bar
|
||||
From T2
|
||||
From T2
|
||||
From Bar
|
||||
+13
-12
@@ -1685,7 +1685,7 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
|
||||
zval key;
|
||||
|
||||
if (CG(current_namespace)) {
|
||||
/* Prefix function name with current namespcae name */
|
||||
/* Prefix function name with current namespace name */
|
||||
znode tmp;
|
||||
|
||||
tmp.u.constant = *CG(current_namespace);
|
||||
@@ -3619,6 +3619,7 @@ ZEND_API void zend_do_implement_trait(zend_class_entry *ce, zend_class_entry *tr
|
||||
}
|
||||
}
|
||||
ce->traits[ce->num_traits++] = trait;
|
||||
trait->refcount++;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
@@ -3711,7 +3712,7 @@ static int zend_traits_merge_functions(zend_function *fn TSRMLS_DC, int num_args
|
||||
} else {
|
||||
/* Add it to result function table */
|
||||
if (zend_hash_quick_add(resulting_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h, fn, sizeof(zend_function), NULL)==FAILURE) {
|
||||
zend_error(E_COMPILE_ERROR, "Trait method %s has not been applied, because failure occured during updating resulting trait method table", fn->common.function_name);
|
||||
zend_error(E_COMPILE_ERROR, "Trait method %s has not been applied, because failure occurred during updating resulting trait method table", fn->common.function_name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3828,7 +3829,7 @@ static int zend_traits_merge_functions_to_class(zend_function *fn TSRMLS_DC, int
|
||||
function_add_ref(&fn_copy);
|
||||
|
||||
if (zend_hash_quick_update(&ce->function_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h, &fn_copy, sizeof(zend_function), (void**)&fn_copy_p)==FAILURE) {
|
||||
zend_error(E_COMPILE_ERROR, "Trait method %s has not been applied, because failure occured during updating class method table", hash_key->arKey);
|
||||
zend_error(E_COMPILE_ERROR, "Trait method %s has not been applied, because failure occurred during updating class method table", hash_key->arKey);
|
||||
}
|
||||
|
||||
zend_add_magic_methods(ce, hash_key->arKey, hash_key->nKeyLength, fn_copy_p TSRMLS_CC);
|
||||
@@ -3870,8 +3871,8 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args,
|
||||
fn_copy = *fn;
|
||||
function_add_ref(&fn_copy);
|
||||
/* this function_name is never destroyed, because its refcount
|
||||
greater than 1, classes are always destoyed in reverse order
|
||||
and trait is declared early than this class */
|
||||
greater than 1 and classes are always destoyed before the
|
||||
traits they use */
|
||||
fn_copy.common.function_name = aliases[i]->alias;
|
||||
|
||||
/* if it is 0, no modifieres has been changed */
|
||||
@@ -4076,14 +4077,14 @@ static void zend_do_traits_method_binding(zend_class_entry *ce TSRMLS_DC) /* {{{
|
||||
size_t i;
|
||||
|
||||
/* prepare copies of trait function tables for combination */
|
||||
function_tables = malloc(sizeof(HashTable*) * ce->num_traits);
|
||||
resulting_table = (HashTable *) malloc(sizeof(HashTable));
|
||||
function_tables = emalloc(sizeof(HashTable*) * ce->num_traits);
|
||||
resulting_table = (HashTable *)emalloc(sizeof(HashTable));
|
||||
|
||||
/* TODO: revisit this start size, may be its not optimal */
|
||||
zend_hash_init_ex(resulting_table, 10, NULL, NULL, 1, 0);
|
||||
zend_hash_init_ex(resulting_table, 10, NULL, NULL, 0, 0);
|
||||
|
||||
for (i = 0; i < ce->num_traits; i++) {
|
||||
function_tables[i] = (HashTable *) malloc(sizeof(HashTable));
|
||||
function_tables[i] = (HashTable *)emalloc(sizeof(HashTable));
|
||||
zend_hash_init_ex(function_tables[i], ce->traits[i]->function_table.nNumOfElements, NULL, NULL, 1, 0);
|
||||
|
||||
if (ce->trait_precedences) {
|
||||
@@ -4116,14 +4117,14 @@ static void zend_do_traits_method_binding(zend_class_entry *ce TSRMLS_DC) /* {{{
|
||||
for (i = 0; i < ce->num_traits; i++) {
|
||||
/* zend_hash_destroy(function_tables[i]); */
|
||||
zend_hash_graceful_destroy(function_tables[i]);
|
||||
free(function_tables[i]);
|
||||
efree(function_tables[i]);
|
||||
}
|
||||
free(function_tables);
|
||||
efree(function_tables);
|
||||
|
||||
/* free temporary resulting table */
|
||||
/* zend_hash_destroy(resulting_table); */
|
||||
zend_hash_graceful_destroy(resulting_table);
|
||||
free(resulting_table);
|
||||
efree(resulting_table);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
+2
-2
@@ -1161,7 +1161,7 @@ convert_to_array:
|
||||
case IS_DOUBLE:
|
||||
case IS_NULL:
|
||||
case IS_BOOL:
|
||||
zend_error(E_NOTICE, "String offset cast occured");
|
||||
zend_error(E_NOTICE, "String offset cast occurred");
|
||||
break;
|
||||
default:
|
||||
zend_error(E_WARNING, "Illegal offset type");
|
||||
@@ -1284,7 +1284,7 @@ static void zend_fetch_dimension_address_read(temp_variable *result, zval **cont
|
||||
case IS_NULL:
|
||||
case IS_BOOL:
|
||||
if (type != BP_VAR_IS) {
|
||||
zend_error(E_NOTICE, "String offset cast occured");
|
||||
zend_error(E_NOTICE, "String offset cast occurred");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
+1
-1
@@ -330,7 +330,7 @@ END_EXTERN_C()
|
||||
if (idx-1 > LONG_MAX) { /* overflow */ \
|
||||
break; \
|
||||
} \
|
||||
idx = (ulong)(-(long)idx); \
|
||||
idx = -idx; \
|
||||
} else if (idx > LONG_MAX) { /* overflow */ \
|
||||
break; \
|
||||
} \
|
||||
|
||||
+1612
-1574
File diff suppressed because it is too large.
Load diff
+27
-6
@@ -347,7 +347,7 @@ DOLLAR_CURLY "${"
|
||||
|
||||
SECTION_RAW_CHARS [^\]\n\r]
|
||||
SINGLE_QUOTED_CHARS [^']
|
||||
RAW_VALUE_CHARS [^\n\r;\000]
|
||||
RAW_VALUE_CHARS [^"\n\r;\000]
|
||||
|
||||
LITERAL_DOLLAR ("$"([^{\000]|("\\"{ANY_CHAR})))
|
||||
VALUE_CHARS ([^$= \t\n\r;&|~()!"'\000]|{LITERAL_DOLLAR})
|
||||
@@ -445,12 +445,33 @@ SECTION_VALUE_CHARS ([^$\n\r;"'\]\\]|("\\"{ANY_CHAR})|{LITERAL_DOLLAR})
|
||||
return '=';
|
||||
}
|
||||
|
||||
<ST_RAW>{RAW_VALUE_CHARS}+ { /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
|
||||
/* Eat leading and trailing double quotes */
|
||||
if (yytext[0] == '"' && yytext[yyleng - 1] == '"') {
|
||||
SCNG(yy_text)++;
|
||||
yyleng = yyleng - 2;
|
||||
<ST_RAW>["] {
|
||||
while (YYCURSOR < YYLIMIT) {
|
||||
switch (*YYCURSOR++) {
|
||||
case '\n':
|
||||
SCNG(lineno)++;
|
||||
break;
|
||||
case '\r':
|
||||
if (*YYCURSOR != '\n') {
|
||||
SCNG(lineno)++;
|
||||
}
|
||||
break;
|
||||
case '"':
|
||||
yyleng = YYCURSOR - SCNG(yy_text) - 2;
|
||||
SCNG(yy_text)++;
|
||||
RETURN_TOKEN(TC_RAW, yytext, yyleng);
|
||||
case '\\':
|
||||
if (YYCURSOR < YYLIMIT) {
|
||||
YYCURSOR++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
RETURN_TOKEN(TC_RAW, yytext, yyleng);
|
||||
}
|
||||
|
||||
<ST_RAW>{RAW_VALUE_CHARS}+ { /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
|
||||
RETURN_TOKEN(TC_RAW, yytext, yyleng);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.13.5 on Fri Mar 2 11:49:21 2012 */
|
||||
/* Generated by re2c 0.13.5 on Thu Jun 7 17:48:25 2012 */
|
||||
#line 3 "Zend/zend_ini_scanner_defs.h"
|
||||
|
||||
enum YYCONDTYPE {
|
||||
|
||||
@@ -1191,7 +1191,7 @@ static YYSIZE_T zend_yytnamerr(char *yyres, const char *yystr)
|
||||
|
||||
if (LANG_SCNG(yy_text)[0] == 0 &&
|
||||
LANG_SCNG(yy_leng) == 1 &&
|
||||
memcmp(yystr, ZEND_STRL("\"end of file\"")) == 0) {
|
||||
memcmp(yystr, "\"end of file\"", sizeof("\"end of file\"") - 1) == 0) {
|
||||
yystpcpy(yyres, "end of file");
|
||||
return sizeof("end of file")-1;
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ ZEND_API const zend_encoding *zend_multibyte_get_script_encoding(TSRMLS_D)
|
||||
ZEND_API int zend_multibyte_set_script_encoding(const zend_encoding **encoding_list, size_t encoding_list_size TSRMLS_DC)
|
||||
{
|
||||
if (CG(script_encoding_list)) {
|
||||
efree(CG(script_encoding_list));
|
||||
free(CG(script_encoding_list));
|
||||
}
|
||||
CG(script_encoding_list) = encoding_list;
|
||||
CG(script_encoding_list_size) = encoding_list_size;
|
||||
|
||||
@@ -215,6 +215,12 @@ ZEND_API int zend_cleanup_class_data(zend_class_entry **pce TSRMLS_DC)
|
||||
void _destroy_zend_class_traits_info(zend_class_entry *ce)
|
||||
{
|
||||
if (ce->num_traits > 0 && ce->traits) {
|
||||
size_t i;
|
||||
for (i = 0; i < ce->num_traits; i++) {
|
||||
if (ce->traits[i]) {
|
||||
destroy_zend_class(&ce->traits[i]);
|
||||
}
|
||||
}
|
||||
efree(ce->traits);
|
||||
}
|
||||
|
||||
|
||||
+10
-3
@@ -1605,7 +1605,8 @@ ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
|
||||
&& (!memcmp(Z_STRVAL_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op1))));
|
||||
break;
|
||||
case IS_ARRAY:
|
||||
Z_LVAL_P(result) = zend_hash_compare(Z_ARRVAL_P(op1), Z_ARRVAL_P(op2), (compare_func_t) hash_zval_identical_function, 1 TSRMLS_CC)==0;
|
||||
Z_LVAL_P(result) = (Z_ARRVAL_P(op1) == Z_ARRVAL_P(op2) ||
|
||||
zend_hash_compare(Z_ARRVAL_P(op1), Z_ARRVAL_P(op2), (compare_func_t) hash_zval_identical_function, 1 TSRMLS_CC)==0);
|
||||
break;
|
||||
case IS_OBJECT:
|
||||
if (Z_OBJ_HT_P(op1) == Z_OBJ_HT_P(op2)) {
|
||||
@@ -2041,7 +2042,13 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2) /* {{{ */
|
||||
|
||||
if ((ret1=is_numeric_string_ex(Z_STRVAL_P(s1), Z_STRLEN_P(s1), &lval1, &dval1, 0, &oflow1)) &&
|
||||
(ret2=is_numeric_string_ex(Z_STRVAL_P(s2), Z_STRLEN_P(s2), &lval2, &dval2, 0, &oflow2))) {
|
||||
#if ULONG_MAX == 0xFFFFFFFF
|
||||
if (oflow1 != 0 && oflow1 == oflow2 && dval1 - dval2 == 0. &&
|
||||
((oflow1 == 1 && dval1 > 9007199254740991. /*0x1FFFFFFFFFFFFF*/)
|
||||
|| (oflow1 == -1 && dval1 < -9007199254740991.))) {
|
||||
#else
|
||||
if (oflow1 != 0 && oflow1 == oflow2 && dval1 - dval2 == 0.) {
|
||||
#endif
|
||||
/* both values are integers overflown to the same side, and the
|
||||
* double comparison may have resulted in crucial accuracy lost */
|
||||
goto string_cmp;
|
||||
@@ -2091,13 +2098,13 @@ static int hash_zval_compare_function(const zval **z1, const zval **z2 TSRMLS_DC
|
||||
|
||||
ZEND_API int zend_compare_symbol_tables_i(HashTable *ht1, HashTable *ht2 TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
return zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC);
|
||||
return ht1 == ht2 ? 0 : zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API void zend_compare_symbol_tables(zval *result, HashTable *ht1, HashTable *ht2 TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
ZVAL_LONG(result, zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC));
|
||||
ZVAL_LONG(result, ht1 == ht2 ? 0 : zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
+2
-2
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=5
|
||||
PHP_MINOR_VERSION=4
|
||||
PHP_RELEASE_VERSION=4
|
||||
PHP_EXTRA_VERSION="-dev"
|
||||
PHP_RELEASE_VERSION=5
|
||||
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`
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ void php_com_throw_exception(HRESULT code, char *message TSRMLS_DC)
|
||||
}
|
||||
}
|
||||
|
||||
PHPAPI void php_com_wrap_dispatch(zval *z, IDispatch *disp,
|
||||
PHP_COM_DOTNET_API void php_com_wrap_dispatch(zval *z, IDispatch *disp,
|
||||
int codepage TSRMLS_DC)
|
||||
{
|
||||
php_com_dotnet_object *obj;
|
||||
@@ -65,7 +65,7 @@ PHPAPI void php_com_wrap_dispatch(zval *z, IDispatch *disp,
|
||||
z->value.obj.handlers = &php_com_object_handlers;
|
||||
}
|
||||
|
||||
PHPAPI void php_com_wrap_variant(zval *z, VARIANT *v,
|
||||
PHP_COM_DOTNET_API void php_com_wrap_variant(zval *z, VARIANT *v,
|
||||
int codepage TSRMLS_DC)
|
||||
{
|
||||
php_com_dotnet_object *obj;
|
||||
@@ -92,7 +92,7 @@ PHPAPI void php_com_wrap_variant(zval *z, VARIANT *v,
|
||||
|
||||
/* this is a convenience function for fetching a particular
|
||||
* element from a (possibly multi-dimensional) safe array */
|
||||
PHPAPI int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC)
|
||||
PHP_COM_DOTNET_API int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC)
|
||||
{
|
||||
UINT dims;
|
||||
LONG lbound, ubound;
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include "php_com_dotnet_internal.h"
|
||||
|
||||
|
||||
PHPAPI OLECHAR *php_com_string_to_olestring(char *string, uint string_len, int codepage TSRMLS_DC)
|
||||
PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string, uint string_len, int codepage TSRMLS_DC)
|
||||
{
|
||||
OLECHAR *olestring = NULL;
|
||||
DWORD flags = codepage == CP_UTF8 ? 0 : MB_PRECOMPOSED | MB_ERR_INVALID_CHARS;
|
||||
@@ -65,7 +65,7 @@ PHPAPI OLECHAR *php_com_string_to_olestring(char *string, uint string_len, int c
|
||||
return olestring;
|
||||
}
|
||||
|
||||
PHPAPI char *php_com_olestring_to_string(OLECHAR *olestring, uint *string_len, int codepage TSRMLS_DC)
|
||||
PHP_COM_DOTNET_API char *php_com_olestring_to_string(OLECHAR *olestring, uint *string_len, int codepage TSRMLS_DC)
|
||||
{
|
||||
char *string;
|
||||
uint length = 0;
|
||||
|
||||
@@ -268,7 +268,7 @@ static void istream_destructor(php_istream *stm TSRMLS_DC)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
PHPAPI IStream *php_com_wrapper_export_stream(php_stream *stream TSRMLS_DC)
|
||||
PHP_COM_DOTNET_API IStream *php_com_wrapper_export_stream(php_stream *stream TSRMLS_DC)
|
||||
{
|
||||
php_istream *stm = (php_istream*)CoTaskMemAlloc(sizeof(*stm));
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
* b) a CLSID, major, minor e.g. "{00000200-0000-0010-8000-00AA006D2EA4},2,0"
|
||||
* c) a Type Library name e.g. "Microsoft OLE DB ActiveX Data Objects 1.0 Library"
|
||||
*/
|
||||
PHPAPI ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC)
|
||||
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC)
|
||||
{
|
||||
ITypeLib *TL = NULL;
|
||||
char *strtok_buf, *major, *minor;
|
||||
@@ -153,7 +153,7 @@ PHPAPI ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_D
|
||||
}
|
||||
|
||||
/* Given a type-library, merge it into the current engine state */
|
||||
PHPAPI int php_com_import_typelib(ITypeLib *TL, int mode, int codepage TSRMLS_DC)
|
||||
PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode, int codepage TSRMLS_DC)
|
||||
{
|
||||
int i, j, interfaces;
|
||||
TYPEKIND pTKind;
|
||||
@@ -228,7 +228,7 @@ void php_com_typelibrary_dtor(void *pDest)
|
||||
ITypeLib_Release(*Lib);
|
||||
}
|
||||
|
||||
PHPAPI ITypeLib *php_com_load_typelib_via_cache(char *search_string,
|
||||
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib_via_cache(char *search_string,
|
||||
int codepage, int *cached TSRMLS_DC)
|
||||
{
|
||||
ITypeLib **TLp;
|
||||
|
||||
@@ -98,7 +98,7 @@ bogus:
|
||||
}
|
||||
}
|
||||
|
||||
PHPAPI void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC)
|
||||
PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC)
|
||||
{
|
||||
OLECHAR *olestring;
|
||||
php_com_dotnet_object *obj;
|
||||
@@ -166,7 +166,7 @@ PHPAPI void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_D
|
||||
}
|
||||
}
|
||||
|
||||
PHPAPI int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC)
|
||||
PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC)
|
||||
{
|
||||
OLECHAR *olestring = NULL;
|
||||
int ret = SUCCESS;
|
||||
@@ -258,7 +258,7 @@ PHPAPI int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC
|
||||
}
|
||||
|
||||
|
||||
PHPAPI int php_com_copy_variant(VARIANT *dstvar, VARIANT *srcvar TSRMLS_DC)
|
||||
PHP_COM_DOTNET_API int php_com_copy_variant(VARIANT *dstvar, VARIANT *srcvar TSRMLS_DC)
|
||||
{
|
||||
int ret = SUCCESS;
|
||||
|
||||
|
||||
@@ -578,7 +578,7 @@ static void disp_destructor(php_dispatchex *disp TSRMLS_DC)
|
||||
CoTaskMemFree(disp);
|
||||
}
|
||||
|
||||
PHPAPI IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid,
|
||||
PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid,
|
||||
HashTable *id_to_name TSRMLS_DC)
|
||||
{
|
||||
php_dispatchex *disp = disp_constructor(val TSRMLS_CC);
|
||||
@@ -617,7 +617,7 @@ PHPAPI IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid,
|
||||
return (IDispatch*)disp;
|
||||
}
|
||||
|
||||
PHPAPI IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC)
|
||||
PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC)
|
||||
{
|
||||
php_dispatchex *disp = NULL;
|
||||
|
||||
|
||||
@@ -28,6 +28,14 @@ extern zend_module_entry com_dotnet_module_entry;
|
||||
#include "TSRM.h"
|
||||
#endif
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
# define PHP_COM_DOTNET_API __declspec(dllexport)
|
||||
#elif defined(__GNUC__) && __GNUC__ >= 4
|
||||
# define PHP_COM_DOTNET_API __attribute__ ((visibility("default")))
|
||||
#else
|
||||
# define PHP_COM_DOTNET_API
|
||||
#endif
|
||||
|
||||
PHP_MINIT_FUNCTION(com_dotnet);
|
||||
PHP_MSHUTDOWN_FUNCTION(com_dotnet);
|
||||
PHP_RINIT_FUNCTION(com_dotnet);
|
||||
|
||||
@@ -84,9 +84,9 @@ zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *objec
|
||||
int php_com_saproxy_create(zval *com_object, zval *proxy_out, zval *index TSRMLS_DC);
|
||||
|
||||
/* com_olechar.c */
|
||||
PHPAPI char *php_com_olestring_to_string(OLECHAR *olestring,
|
||||
PHP_COM_DOTNET_API char *php_com_olestring_to_string(OLECHAR *olestring,
|
||||
uint *string_len, int codepage TSRMLS_DC);
|
||||
PHPAPI OLECHAR *php_com_string_to_olestring(char *string,
|
||||
PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string,
|
||||
uint string_len, int codepage TSRMLS_DC);
|
||||
|
||||
|
||||
@@ -112,8 +112,8 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, char *name, int namelen,
|
||||
|
||||
/* com_wrapper.c */
|
||||
int php_com_wrapper_minit(INIT_FUNC_ARGS);
|
||||
PHPAPI IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid, HashTable *id_to_name TSRMLS_DC);
|
||||
PHPAPI IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC);
|
||||
PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid, HashTable *id_to_name TSRMLS_DC);
|
||||
PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC);
|
||||
|
||||
/* com_persist.c */
|
||||
int php_com_persist_minit(INIT_FUNC_ARGS);
|
||||
@@ -147,10 +147,10 @@ PHP_FUNCTION(variant_get_type);
|
||||
PHP_FUNCTION(variant_set_type);
|
||||
PHP_FUNCTION(variant_cast);
|
||||
|
||||
PHPAPI void php_com_variant_from_zval_with_type(VARIANT *v, zval *z, VARTYPE type, int codepage TSRMLS_DC);
|
||||
PHPAPI void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC);
|
||||
PHPAPI int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC);
|
||||
PHPAPI int php_com_copy_variant(VARIANT *dst, VARIANT *src TSRMLS_DC);
|
||||
PHP_COM_DOTNET_API void php_com_variant_from_zval_with_type(VARIANT *v, zval *z, VARTYPE type, int codepage TSRMLS_DC);
|
||||
PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC);
|
||||
PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC);
|
||||
PHP_COM_DOTNET_API int php_com_copy_variant(VARIANT *dst, VARIANT *src TSRMLS_DC);
|
||||
|
||||
/* com_dotnet.c */
|
||||
PHP_FUNCTION(com_dotnet_create_instance);
|
||||
@@ -159,17 +159,17 @@ void php_com_dotnet_mshutdown(TSRMLS_D);
|
||||
|
||||
/* com_misc.c */
|
||||
void php_com_throw_exception(HRESULT code, char *message TSRMLS_DC);
|
||||
PHPAPI void php_com_wrap_dispatch(zval *z, IDispatch *disp,
|
||||
PHP_COM_DOTNET_API void php_com_wrap_dispatch(zval *z, IDispatch *disp,
|
||||
int codepage TSRMLS_DC);
|
||||
PHPAPI void php_com_wrap_variant(zval *z, VARIANT *v,
|
||||
PHP_COM_DOTNET_API void php_com_wrap_variant(zval *z, VARIANT *v,
|
||||
int codepage TSRMLS_DC);
|
||||
PHPAPI int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC);
|
||||
PHP_COM_DOTNET_API int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC);
|
||||
|
||||
/* com_typeinfo.c */
|
||||
PHPAPI ITypeLib *php_com_load_typelib_via_cache(char *search_string,
|
||||
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib_via_cache(char *search_string,
|
||||
int codepage, int *cached TSRMLS_DC);
|
||||
PHPAPI ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC);
|
||||
PHPAPI int php_com_import_typelib(ITypeLib *TL, int mode,
|
||||
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC);
|
||||
PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode,
|
||||
int codepage TSRMLS_DC);
|
||||
void php_com_typelibrary_dtor(void *pDest);
|
||||
ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj, char *dispname, int sink TSRMLS_DC);
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
Bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl")) print "skip";
|
||||
if(substr(PHP_OS, 0, 3) != 'WIN' )
|
||||
die("skip Not Valid for Linux");
|
||||
?>
|
||||
--INI--
|
||||
open_basedir="c:/tmp"
|
||||
--FILE--
|
||||
<?php
|
||||
$ch = curl_init();
|
||||
var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, ""));
|
||||
var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, "c:/tmp/foo"));
|
||||
var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, "c:/xxx/bar"));
|
||||
curl_close($ch);
|
||||
?>
|
||||
--EXPECTF--
|
||||
%a
|
||||
|
||||
Warning: curl_setopt(): open_basedir restriction in effect. File(c:/tmp/foo) is not within the allowed path(s): (c:/tmp) in %sbug61948-win32.php on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: curl_setopt(): open_basedir restriction in effect. File(c:/xxx/bar) is not within the allowed path(s): (c:/tmp) in %sbug61948-win32.php on line %d
|
||||
bool(false)
|
||||
@@ -1,7 +1,10 @@
|
||||
--TEST--
|
||||
Bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl")) print "skip"; ?>
|
||||
<?php if (!extension_loaded("curl")) print "skip";
|
||||
if(substr(PHP_OS, 0, 3) == 'WIN' )
|
||||
die("skip Not Valid for Windows");
|
||||
?>
|
||||
--INI--
|
||||
open_basedir="/tmp"
|
||||
--FILE--
|
||||
|
||||
+1
-1
@@ -216,7 +216,7 @@ static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs,
|
||||
if (Z_TYPE(handler) == IS_STRING) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call handler %s()", Z_STRVAL_P(&handler));
|
||||
}
|
||||
/* retval is == NULL, when an exception occured, don't report anything, because PHP itself will handle that */
|
||||
/* retval is == NULL, when an exception occurred, don't report anything, because PHP itself will handle that */
|
||||
} else if (retval == NULL) {
|
||||
} else {
|
||||
if (retval->type == IS_OBJECT && instanceof_function( Z_OBJCE_P(retval), dom_node_class_entry TSRMLS_CC)) {
|
||||
|
||||
+5
-1
@@ -3254,7 +3254,7 @@ static void exif_process_APP12(image_info_type *ImageInfo, char *buffer, size_t
|
||||
if ((l1 = php_strnlen(buffer+2, length-2)) > 0) {
|
||||
exif_iif_add_tag(ImageInfo, SECTION_APP12, "Company", TAG_NONE, TAG_FMT_STRING, l1, buffer+2 TSRMLS_CC);
|
||||
if (length > 2+l1+1) {
|
||||
l2 = php_strnlen(buffer+2+l1+1, length-2-l1+1);
|
||||
l2 = php_strnlen(buffer+2+l1+1, length-2-l1-1);
|
||||
exif_iif_add_tag(ImageInfo, SECTION_APP12, "Info", TAG_NONE, TAG_FMT_STRING, l2, buffer+2+l1+1 TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
@@ -3404,6 +3404,10 @@ static int exif_scan_JPEG_header(image_info_type *ImageInfo TSRMLS_DC)
|
||||
case M_SOF13:
|
||||
case M_SOF14:
|
||||
case M_SOF15:
|
||||
if ((itemlen - 2) < 6) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
exif_process_SOFn(Data, marker, &sof_info);
|
||||
ImageInfo->Width = sof_info.width;
|
||||
ImageInfo->Height = sof_info.height;
|
||||
|
||||
+50
-74
@@ -1,6 +1,6 @@
|
||||
diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
|
||||
--- libmagic.orig/apprentice.c 2012-04-22 19:30:43.182305355 +0800
|
||||
+++ libmagic/apprentice.c 2012-04-22 19:28:57.346309536 +0800
|
||||
--- libmagic.orig/apprentice.c 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/apprentice.c 2012-04-22 18:57:16.215980866 +0200
|
||||
@@ -29,6 +29,8 @@
|
||||
* apprentice - make one pass through /etc/magic, learning its secrets.
|
||||
*/
|
||||
@@ -729,8 +729,8 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
|
||||
m->str_flags = swap4(m->str_flags);
|
||||
}
|
||||
diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
|
||||
--- libmagic.orig/ascmagic.c 2012-04-22 19:30:43.182305355 +0800
|
||||
+++ libmagic/ascmagic.c 2012-04-22 19:28:57.330309533 +0800
|
||||
--- libmagic.orig/ascmagic.c 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/ascmagic.c 2012-04-22 18:57:16.215980866 +0200
|
||||
@@ -139,10 +139,8 @@
|
||||
/* malloc size is a conservative overestimate; could be
|
||||
improved, or at least realloced after conversion. */
|
||||
@@ -755,8 +755,8 @@ diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
|
||||
return rv;
|
||||
}
|
||||
diff -u libmagic.orig/cdf.c libmagic/cdf.c
|
||||
--- libmagic.orig/cdf.c 2012-04-22 19:30:43.182305355 +0800
|
||||
+++ libmagic/cdf.c 2012-04-22 19:28:57.370309531 +0800
|
||||
--- libmagic.orig/cdf.c 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/cdf.c 2012-04-22 18:57:16.219978162 +0200
|
||||
@@ -43,7 +43,17 @@
|
||||
#include <err.h>
|
||||
#endif
|
||||
@@ -819,8 +819,8 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
|
||||
(void)fprintf(stderr, "timestamp %s\n", buf);
|
||||
} else {
|
||||
diff -u libmagic.orig/cdf.h libmagic/cdf.h
|
||||
--- libmagic.orig/cdf.h 2012-04-22 19:30:43.182305355 +0800
|
||||
+++ libmagic/cdf.h 2012-04-22 19:28:57.370309531 +0800
|
||||
--- libmagic.orig/cdf.h 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/cdf.h 2012-04-22 18:57:16.219978162 +0200
|
||||
@@ -35,7 +35,7 @@
|
||||
#ifndef _H_CDF_
|
||||
#define _H_CDF_
|
||||
@@ -857,8 +857,8 @@ diff -u libmagic.orig/cdf.h libmagic/cdf.h
|
||||
void cdf_swap_header(cdf_header_t *);
|
||||
void cdf_unpack_header(cdf_header_t *, char *);
|
||||
diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
|
||||
--- libmagic.orig/cdf_time.c 2012-04-22 19:30:43.182305355 +0800
|
||||
+++ libmagic/cdf_time.c 2012-04-22 19:28:57.326309537 +0800
|
||||
--- libmagic.orig/cdf_time.c 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/cdf_time.c 2012-04-22 18:57:16.219978162 +0200
|
||||
@@ -96,7 +96,7 @@
|
||||
}
|
||||
|
||||
@@ -916,8 +916,8 @@ diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
|
||||
static const char *ref = "Sat Apr 23 01:30:00 1977";
|
||||
char *p, *q;
|
||||
diff -u libmagic.orig/compress.c libmagic/compress.c
|
||||
--- libmagic.orig/compress.c 2012-04-22 19:30:43.182305355 +0800
|
||||
+++ libmagic/compress.c 2012-04-22 19:28:57.314309548 +0800
|
||||
--- libmagic.orig/compress.c 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/compress.c 2012-04-22 18:57:16.219978162 +0200
|
||||
@@ -32,6 +32,7 @@
|
||||
* uncompress(method, old, n, newch) - uncompress old into new,
|
||||
* using method, return sizeof new
|
||||
@@ -1079,8 +1079,8 @@ diff -u libmagic.orig/compress.c libmagic/compress.c
|
||||
-#endif
|
||||
+#endif /* if PHP_FILEINFO_UNCOMPRESS */
|
||||
diff -u libmagic.orig/file.h libmagic/file.h
|
||||
--- libmagic.orig/file.h 2012-04-22 19:30:43.186305188 +0800
|
||||
+++ libmagic/file.h 2012-04-22 19:49:58.922256776 +0800
|
||||
--- libmagic.orig/file.h 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/file.h 2012-04-22 18:57:16.219978162 +0200
|
||||
@@ -33,11 +33,9 @@
|
||||
#ifndef __file_h__
|
||||
#define __file_h__
|
||||
@@ -1252,8 +1252,8 @@ diff -u libmagic.orig/file.h libmagic/file.h
|
||||
+
|
||||
#endif /* __file_h__ */
|
||||
diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
|
||||
--- libmagic.orig/fsmagic.c 2012-04-22 19:30:43.186305188 +0800
|
||||
+++ libmagic/fsmagic.c 2012-04-22 19:28:57.298309521 +0800
|
||||
--- libmagic.orig/fsmagic.c 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/fsmagic.c 2012-04-22 18:57:16.219978162 +0200
|
||||
@@ -59,27 +59,21 @@
|
||||
# define minor(dev) ((dev) & 0xff)
|
||||
#endif
|
||||
@@ -1577,8 +1577,8 @@ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
|
||||
|
||||
/*
|
||||
diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
--- libmagic.orig/funcs.c 2012-04-22 19:30:43.186305188 +0800
|
||||
+++ libmagic/funcs.c 2012-04-22 19:28:57.370309531 +0800
|
||||
--- libmagic.orig/funcs.c 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/funcs.c 2012-04-22 18:57:16.219978162 +0200
|
||||
@@ -41,52 +41,42 @@
|
||||
#if defined(HAVE_WCTYPE_H)
|
||||
#include <wctype.h>
|
||||
@@ -1872,11 +1872,9 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
+ return rep_cnt;
|
||||
}
|
||||
+
|
||||
Only in libmagic.orig: funcs.c.orig
|
||||
Only in libmagic.orig: funcs.c.rej
|
||||
diff -u libmagic.orig/magic.c libmagic/magic.c
|
||||
--- libmagic.orig/magic.c 2012-04-22 19:30:43.186305188 +0800
|
||||
+++ libmagic/magic.c 2012-04-22 19:28:57.370309531 +0800
|
||||
--- libmagic.orig/magic.c 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/magic.c 2012-04-22 18:57:16.219978162 +0200
|
||||
@@ -25,11 +25,6 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
@@ -2253,8 +2251,8 @@ diff -u libmagic.orig/magic.c libmagic/magic.c
|
||||
public const char *
|
||||
magic_error(struct magic_set *ms)
|
||||
diff -u libmagic.orig/magic.h libmagic/magic.h
|
||||
--- libmagic.orig/magic.h 2012-04-22 19:30:43.190305058 +0800
|
||||
+++ libmagic/magic.h 2012-04-22 19:28:57.326309537 +0800
|
||||
--- libmagic.orig/magic.h 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/magic.h 2012-04-22 18:57:16.219978162 +0200
|
||||
@@ -85,6 +85,7 @@
|
||||
|
||||
const char *magic_getpath(const char *, int);
|
||||
@@ -2272,8 +2270,8 @@ diff -u libmagic.orig/magic.h libmagic/magic.h
|
||||
int magic_errno(magic_t);
|
||||
|
||||
diff -u libmagic.orig/print.c libmagic/print.c
|
||||
--- libmagic.orig/print.c 2012-04-22 19:30:43.190305058 +0800
|
||||
+++ libmagic/print.c 2012-04-22 19:28:57.326309537 +0800
|
||||
--- libmagic.orig/print.c 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/print.c 2012-05-29 14:34:03.770376387 +0200
|
||||
@@ -29,6 +29,9 @@
|
||||
* print.c - debugging printout routines
|
||||
*/
|
||||
@@ -2467,8 +2465,8 @@ diff -u libmagic.orig/print.c libmagic/print.c
|
||||
|
||||
protected const char *
|
||||
diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
|
||||
--- libmagic.orig/readcdf.c 2012-04-22 19:30:43.190305058 +0800
|
||||
+++ libmagic/readcdf.c 2012-04-22 19:28:57.326309537 +0800
|
||||
--- libmagic.orig/readcdf.c 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/readcdf.c 2012-04-22 18:57:16.219978162 +0200
|
||||
@@ -30,7 +30,11 @@
|
||||
#endif
|
||||
|
||||
@@ -2515,8 +2513,8 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
|
||||
if ((ec = strchr(c, '\n')) != NULL)
|
||||
*ec = '\0';
|
||||
diff -u libmagic.orig/readelf.c libmagic/readelf.c
|
||||
--- libmagic.orig/readelf.c 2012-04-22 19:30:43.190305058 +0800
|
||||
+++ libmagic/readelf.c 2012-04-22 19:28:57.378309534 +0800
|
||||
--- libmagic.orig/readelf.c 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/readelf.c 2012-04-22 18:57:16.219978162 +0200
|
||||
@@ -49,7 +49,7 @@
|
||||
off_t, int *, int);
|
||||
private int doshn(struct magic_set *, int, int, int, off_t, int, size_t,
|
||||
@@ -2672,8 +2670,8 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
|
||||
|
||||
if (fstat(fd, &st) == -1) {
|
||||
diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
--- libmagic.orig/softmagic.c 2012-04-22 19:30:43.194304945 +0800
|
||||
+++ libmagic/softmagic.c 2012-04-22 19:28:57.286309597 +0800
|
||||
--- libmagic.orig/softmagic.c 2012-05-29 14:40:41.710960045 +0200
|
||||
+++ libmagic/softmagic.c 2012-05-29 14:34:31.900417647 +0200
|
||||
@@ -41,6 +41,11 @@
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
@@ -2860,7 +2858,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1669,6 +1642,65 @@
|
||||
@@ -1669,6 +1642,42 @@
|
||||
return file_strncmp(a, b, len, flags);
|
||||
}
|
||||
|
||||
@@ -2876,29 +2874,6 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
+
|
||||
+ for (i=0; i<Z_STRLEN_P(pattern); i++, j++) {
|
||||
+ switch (Z_STRVAL_P(pattern)[i]) {
|
||||
+ case '?':
|
||||
+ t[j] = '.';
|
||||
+ break;
|
||||
+ case '*':
|
||||
+ t[j++] = '.';
|
||||
+ t[j] = '*';
|
||||
+ break;
|
||||
+ case '.':
|
||||
+ t[j++] = '\\';
|
||||
+ t[j] = '.';
|
||||
+ break;
|
||||
+ case '\\':
|
||||
+ t[j++] = '\\';
|
||||
+ t[j] = '\\';
|
||||
+ break;
|
||||
+ case '(':
|
||||
+ t[j++] = '\\';
|
||||
+ t[j] = '(';
|
||||
+ break;
|
||||
+ case ')':
|
||||
+ t[j++] = '\\';
|
||||
+ t[j] = ')';
|
||||
+ break;
|
||||
+ case '~':
|
||||
+ t[j++] = '\\';
|
||||
+ t[j] = '~';
|
||||
@@ -2926,7 +2901,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
private int
|
||||
magiccheck(struct magic_set *ms, struct magic *m)
|
||||
{
|
||||
@@ -1825,67 +1857,163 @@
|
||||
@@ -1825,67 +1834,163 @@
|
||||
break;
|
||||
}
|
||||
case FILE_REGEX: {
|
||||
@@ -2937,23 +2912,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
- if (ms->search.s == NULL)
|
||||
- return 0;
|
||||
-
|
||||
+ zval *pattern;
|
||||
+ int options = 0;
|
||||
+ pcre_cache_entry *pce;
|
||||
+ TSRMLS_FETCH();
|
||||
+
|
||||
+ MAKE_STD_ZVAL(pattern);
|
||||
+ ZVAL_STRINGL(pattern, (char *)m->value.s, m->vallen, 0);
|
||||
+
|
||||
+ options |= PCRE_MULTILINE;
|
||||
+
|
||||
+ if (m->str_flags & STRING_IGNORE_CASE) {
|
||||
+ options |= PCRE_CASELESS;
|
||||
+ }
|
||||
+
|
||||
+ convert_libmagic_pattern(pattern, options);
|
||||
+
|
||||
l = 0;
|
||||
- l = 0;
|
||||
- rc = regcomp(&rx, m->value.s,
|
||||
- REG_EXTENDED|REG_NEWLINE|
|
||||
- ((m->str_flags & STRING_IGNORE_CASE) ? REG_ICASE : 0));
|
||||
@@ -2970,6 +2929,23 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
- size_t l = ms->search.s_len - 1;
|
||||
- char c = ms->search.s[l];
|
||||
- ((char *)(intptr_t)ms->search.s)[l] = '\0';
|
||||
+ zval *pattern;
|
||||
+ int options = 0;
|
||||
+ pcre_cache_entry *pce;
|
||||
+ TSRMLS_FETCH();
|
||||
+
|
||||
+ MAKE_STD_ZVAL(pattern);
|
||||
+ ZVAL_STRINGL(pattern, (char *)m->value.s, m->vallen, 0);
|
||||
+
|
||||
+ options |= PCRE_MULTILINE;
|
||||
+
|
||||
+ if (m->str_flags & STRING_IGNORE_CASE) {
|
||||
+ options |= PCRE_CASELESS;
|
||||
+ }
|
||||
+
|
||||
+ convert_libmagic_pattern(pattern, options);
|
||||
+
|
||||
+ l = v = 0;
|
||||
+#if (PHP_MAJOR_VERSION < 6)
|
||||
+ if ((pce = pcre_get_compiled_regex_cache(Z_STRVAL_P(pattern), Z_STRLEN_P(pattern) TSRMLS_CC)) == NULL) {
|
||||
#else
|
||||
|
||||
@@ -1654,29 +1654,6 @@ convert_libmagic_pattern(zval *pattern, int options)
|
||||
|
||||
for (i=0; i<Z_STRLEN_P(pattern); i++, j++) {
|
||||
switch (Z_STRVAL_P(pattern)[i]) {
|
||||
case '?':
|
||||
t[j] = '.';
|
||||
break;
|
||||
case '*':
|
||||
t[j++] = '.';
|
||||
t[j] = '*';
|
||||
break;
|
||||
case '.':
|
||||
t[j++] = '\\';
|
||||
t[j] = '.';
|
||||
break;
|
||||
case '\\':
|
||||
t[j++] = '\\';
|
||||
t[j] = '\\';
|
||||
break;
|
||||
case '(':
|
||||
t[j++] = '\\';
|
||||
t[j] = '(';
|
||||
break;
|
||||
case ')':
|
||||
t[j++] = '\\';
|
||||
t[j] = ')';
|
||||
break;
|
||||
case '~':
|
||||
t[j++] = '\\';
|
||||
t[j] = '~';
|
||||
@@ -1873,7 +1850,7 @@ magiccheck(struct magic_set *ms, struct magic *m)
|
||||
|
||||
convert_libmagic_pattern(pattern, options);
|
||||
|
||||
l = 0;
|
||||
l = v = 0;
|
||||
#if (PHP_MAJOR_VERSION < 6)
|
||||
if ((pce = pcre_get_compiled_regex_cache(Z_STRVAL_P(pattern), Z_STRLEN_P(pattern) TSRMLS_CC)) == NULL) {
|
||||
#else
|
||||
|
||||
@@ -18,9 +18,11 @@ ksort($results);
|
||||
var_dump($results);
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(6) {
|
||||
array(7) {
|
||||
["%s/resources/dir.zip"]=>
|
||||
string(15) "application/zip"
|
||||
["%s/resources/test.awk"]=>
|
||||
string(10) "text/plain"
|
||||
["%s/resources/test.bmp"]=>
|
||||
string(14) "image/x-ms-bmp"
|
||||
["%s/resources/test.gif"]=>
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
--TEST--
|
||||
Test finfo_file() function : regex rules
|
||||
--SKIPIF--
|
||||
<?php require_once(dirname(__FILE__) . '/skipif.inc');
|
||||
if (substr(PHP_OS, 0, 3) != 'WIN') {
|
||||
die('skip.. only for Windows');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/**
|
||||
* Works with the unix file command:
|
||||
* $ file -m magic resources/test.awk
|
||||
* resources/test.awk: awk script, ASCII text
|
||||
*/
|
||||
$magicFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'magic';
|
||||
$finfo = finfo_open( FILEINFO_MIME, $magicFile );
|
||||
|
||||
echo "*** Testing finfo_file() : regex rules ***\n";
|
||||
|
||||
// Calling finfo_file() with all possible arguments
|
||||
$file = __DIR__ . '/resources/test.awk';
|
||||
var_dump( finfo_file( $finfo, $file ) );
|
||||
var_dump( finfo_file( $finfo, $file, FILEINFO_CONTINUE ) );
|
||||
|
||||
// Windows uses libfileinfo 1.0.5-dev
|
||||
// this may be causing the slightly different output from the first
|
||||
// finfo_file() call
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Testing finfo_file() : regex rules ***
|
||||
string(10) "text/plain"
|
||||
string(22) "awk script, ASCII text"
|
||||
===DONE===
|
||||
@@ -0,0 +1,32 @@
|
||||
--TEST--
|
||||
Test finfo_file() function : regex rules
|
||||
--SKIPIF--
|
||||
<?php require_once(dirname(__FILE__) . '/skipif.inc');
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
die('skip.. only for Non Windows Systems');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/**
|
||||
* Works with the unix file command:
|
||||
* $ file -m magic resources/test.awk
|
||||
* resources/test.awk: awk script, ASCII text
|
||||
*/
|
||||
$magicFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'magic';
|
||||
$finfo = finfo_open( FILEINFO_MIME, $magicFile );
|
||||
|
||||
echo "*** Testing finfo_file() : regex rules ***\n";
|
||||
|
||||
// Calling finfo_file() with all possible arguments
|
||||
$file = __DIR__ . '/resources/test.awk';
|
||||
var_dump( finfo_file( $finfo, $file ) );
|
||||
var_dump( finfo_file( $finfo, $file, FILEINFO_CONTINUE ) );
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Testing finfo_file() : regex rules ***
|
||||
string(28) "text/plain; charset=us-ascii"
|
||||
string(22) "awk script, ASCII text"
|
||||
===DONE===
|
||||
@@ -0,0 +1,59 @@
|
||||
--TEST--
|
||||
Test finfo_open() function : error functionality
|
||||
--SKIPIF--
|
||||
<?php require_once(dirname(__FILE__) . '/skipif.inc');
|
||||
if(substr(PHP_OS, 0, 3) != 'WIN' )
|
||||
die("skip Not Valid for Linux");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : resource finfo_open([int options [, string arg]])
|
||||
* Description: Create a new fileinfo resource.
|
||||
* Source code: ext/fileinfo/fileinfo.c
|
||||
* Alias to functions:
|
||||
*/
|
||||
|
||||
$magicFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'magic';
|
||||
|
||||
echo "*** Testing finfo_open() : error functionality ***\n";
|
||||
|
||||
// on 5_4, this line generates additional warning messages that 5_3 does not. functionally, it should be fine (should pass)
|
||||
var_dump( finfo_open( FILEINFO_MIME, 'foobarfile' ) );
|
||||
var_dump( finfo_open( array(), $magicFile ) );
|
||||
var_dump( finfo_open( FILEINFO_MIME, $magicFile, 'extraArg' ) );
|
||||
var_dump( finfo_open( PHP_INT_MAX - 1, $magicFile ) );
|
||||
var_dump( finfo_open( 'foobar' ) );
|
||||
|
||||
var_dump( new finfo('foobar') );
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Testing finfo_open() : error functionality ***
|
||||
|
||||
Warning: finfo_open(%sfoobarfile): failed to open stream: No such file or directory in %sfinfo_open_error-win32.php on line %d
|
||||
|
||||
Warning: finfo_open(%sfoobarfile): failed to open stream: No such file or directory in %sfinfo_open_error-win32.php on line %d
|
||||
|
||||
Warning: finfo_open(): Failed to load magic database at '%sfoobarfile'. in %sfinfo_open_error-win32.php on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: finfo_open() expects parameter 1 to be long, array given in %sfinfo_open_error-win32.php on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: finfo_open() expects at most 2 parameters, 3 given in %sfinfo_open_error-win32.php on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: finfo_open(%smagic): failed to open stream: No such file or directory in %sfinfo_open_error-win32.php on line %d
|
||||
|
||||
Warning: finfo_open(%smagic): failed to open stream: No such file or directory in %sfinfo_open_error-win32.php on line %d
|
||||
|
||||
Warning: finfo_open(): Failed to load magic database at '%smagic'. in %sfinfo_open_error-win32.php on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: finfo_open() expects parameter 1 to be long, string given in %sfinfo_open_error-win32.php on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: finfo::finfo() expects parameter 1 to be long, string given in %sfinfo_open_error-win32.php on line %d
|
||||
NULL
|
||||
===DONE===
|
||||
@@ -1,7 +1,10 @@
|
||||
--TEST--
|
||||
Test finfo_open() function : error functionality
|
||||
--SKIPIF--
|
||||
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
|
||||
<?php require_once(dirname(__FILE__) . '/skipif.inc');
|
||||
if(substr(PHP_OS, 0, 3) == 'WIN' )
|
||||
die("skip Not Valid for Windows");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : resource finfo_open([int options [, string arg]])
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
BEGIN { print "START" }
|
||||
@@ -0,0 +1,90 @@
|
||||
--TEST--
|
||||
gmp_gcdext() basic tests
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("gmp")) print "skip";
|
||||
if(substr(PHP_OS, 0, 3) != 'WIN' ) {
|
||||
die('skip windows only test');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$n = gmp_init("34293864345");
|
||||
$n1 = gmp_init("23434293864345");
|
||||
|
||||
$a = array(
|
||||
array(123,45),
|
||||
array(4341,9734),
|
||||
array(23487,333),
|
||||
array(-234234,-123123),
|
||||
array(-100,-2234),
|
||||
array(345,"34587345"),
|
||||
array(345,"0"),
|
||||
array("345556456",345873),
|
||||
array("34545345556456","323432445873"),
|
||||
array($n, $n1),
|
||||
);
|
||||
|
||||
foreach ($a as $val) {
|
||||
$r = gmp_gcdext($val[0],$val[1]);
|
||||
var_dump(gmp_strval($r['g']));
|
||||
var_dump(gmp_strval($r['s']));
|
||||
var_dump(gmp_strval($r['t']));
|
||||
}
|
||||
|
||||
var_dump(gmp_gcdext($val[0],array()));
|
||||
var_dump(gmp_gcdext(array(),array()));
|
||||
var_dump(gmp_gcdext(array(),array(),1));
|
||||
var_dump(gmp_gcdext(array()));
|
||||
var_dump(gmp_gcdext());
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(1) "3"
|
||||
string(2) "41"
|
||||
string(4) "-112"
|
||||
string(1) "1"
|
||||
string(4) "-805"
|
||||
string(3) "359"
|
||||
string(1) "3"
|
||||
string(2) "32"
|
||||
string(5) "-2257"
|
||||
string(4) "3003"
|
||||
string(3) "-10"
|
||||
string(2) "19"
|
||||
string(1) "2"
|
||||
string(2) "67"
|
||||
string(2) "-3"
|
||||
string(2) "15"
|
||||
string(7) "-601519"
|
||||
string(1) "6"
|
||||
string(3) "345"
|
||||
string(1) "1"
|
||||
string(1) "0"
|
||||
string(1) "1"
|
||||
string(5) "84319"
|
||||
string(9) "-84241831"
|
||||
string(1) "1"
|
||||
string(12) "167180205823"
|
||||
string(15) "-17856272782919"
|
||||
string(3) "195"
|
||||
string(15) "-23387298979862"
|
||||
string(11) "34225091793"
|
||||
|
||||
Warning: gmp_gcdext(): Unable to convert variable to GMP - wrong type in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: gmp_gcdext(): Unable to convert variable to GMP - wrong type in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: gmp_gcdext() expects exactly 2 parameters, 3 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: gmp_gcdext() expects exactly 2 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: gmp_gcdext() expects exactly 2 parameters, 0 given in %s on line %d
|
||||
NULL
|
||||
Done
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
--TEST--
|
||||
gmp_gcdext() basic tests
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("gmp")) print "skip"; ?>
|
||||
<?php if (!extension_loaded("gmp")) print "skip";
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
die('skip.. only for Non Windows Systems');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
--TEST--
|
||||
gmp_nextprime()
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("gmp")) print "skip";
|
||||
if(substr(PHP_OS, 0, 3) != 'WIN' ) {
|
||||
die('skip windows only test');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$n = gmp_nextprime(-1);
|
||||
var_dump(gmp_strval($n));
|
||||
$n = gmp_nextprime(0);
|
||||
var_dump(gmp_strval($n));
|
||||
$n = gmp_nextprime(-1000);
|
||||
var_dump(gmp_strval($n));
|
||||
$n = gmp_nextprime(1000);
|
||||
var_dump(gmp_strval($n));
|
||||
$n = gmp_nextprime(100000);
|
||||
var_dump(gmp_strval($n));
|
||||
$n = gmp_nextprime(array());
|
||||
var_dump(gmp_strval($n));
|
||||
$n = gmp_nextprime("");
|
||||
var_dump(gmp_strval($n));
|
||||
$n = gmp_nextprime(new stdclass());
|
||||
var_dump(gmp_strval($n));
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(1) "2"
|
||||
string(1) "2"
|
||||
string(4) "-997"
|
||||
string(4) "1009"
|
||||
string(6) "100003"
|
||||
|
||||
Warning: gmp_nextprime(): Unable to convert variable to GMP - wrong type in %s on line %d
|
||||
string(1) "0"
|
||||
string(1) "0"
|
||||
|
||||
Warning: gmp_nextprime(): Unable to convert variable to GMP - wrong type in %s on line %d
|
||||
string(1) "0"
|
||||
Done
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
--TEST--
|
||||
gmp_nextprime()
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("gmp")) print "skip"; ?>
|
||||
<?php if (!extension_loaded("gmp")) print "skip";
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
die('skip.. only for Non Windows Systems');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
+66
-62
@@ -190,7 +190,7 @@ typedef enum _php_iconv_enc_scheme_t {
|
||||
#define PHP_ICONV_MIME_DECODE_STRICT (1<<0)
|
||||
#define PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR (1<<1)
|
||||
|
||||
/* {{{ prototypes */
|
||||
/* {{{ prototypes */
|
||||
static php_iconv_err_t _php_iconv_appendl(smart_str *d, const char *s, size_t l, iconv_t cd);
|
||||
static php_iconv_err_t _php_iconv_appendc(smart_str *d, const char c, iconv_t cd);
|
||||
|
||||
@@ -249,7 +249,7 @@ PHP_MINIT_FUNCTION(miconv)
|
||||
{
|
||||
static char buf[16];
|
||||
snprintf(buf, sizeof(buf), "%d.%d",
|
||||
((_libiconv_version >> 8) & 0x0f), (_libiconv_version & 0x0f));
|
||||
((_libiconv_version >> 8) & 0x0f), (_libiconv_version & 0x0f));
|
||||
version = buf;
|
||||
}
|
||||
#elif HAVE_GLIBC_ICONV
|
||||
@@ -354,7 +354,7 @@ static int php_iconv_output_handler(void **nothing, php_output_context *output_c
|
||||
|
||||
if (mimetype != NULL && !(output_context->op & PHP_OUTPUT_HANDLER_CLEAN)) {
|
||||
int len;
|
||||
char *p = strstr(ICONVG(output_encoding), "//");
|
||||
char *p = strstr(ICONVG(output_encoding), "//");
|
||||
|
||||
if (p) {
|
||||
len = spprintf(&content_type, 0, "Content-Type:%.*s; charset=%.*s", mimetype_len ? mimetype_len : (int) strlen(mimetype), mimetype, (int)(p - ICONVG(output_encoding)), ICONVG(output_encoding));
|
||||
@@ -375,7 +375,7 @@ static int php_iconv_output_handler(void **nothing, php_output_context *output_c
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/* {{{ _php_iconv_appendl() */
|
||||
static php_iconv_err_t _php_iconv_appendl(smart_str *d, const char *s, size_t l, iconv_t cd)
|
||||
{
|
||||
@@ -400,7 +400,7 @@ static php_iconv_err_t _php_iconv_appendl(smart_str *d, const char *s, size_t l,
|
||||
|
||||
if (iconv(cd, (char **)&in_p, &in_left, (char **) &out_p, &out_left) == (size_t)-1) {
|
||||
#if ICONV_SUPPORTS_ERRNO
|
||||
switch (errno) {
|
||||
switch (errno) {
|
||||
case EINVAL:
|
||||
return PHP_ICONV_ERR_ILLEGAL_CHAR;
|
||||
|
||||
@@ -415,7 +415,7 @@ static php_iconv_err_t _php_iconv_appendl(smart_str *d, const char *s, size_t l,
|
||||
}
|
||||
#else
|
||||
if (prev_in_left == in_left) {
|
||||
return PHP_ICONV_ERR_UNKNOWN;
|
||||
return PHP_ICONV_ERR_UNKNOWN;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -446,7 +446,7 @@ static php_iconv_err_t _php_iconv_appendl(smart_str *d, const char *s, size_t l,
|
||||
#else
|
||||
if (out_left != 0) {
|
||||
return PHP_ICONV_ERR_UNKNOWN;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
(d)->len += (buf_growth - out_left);
|
||||
@@ -492,31 +492,35 @@ PHP_ICONV_API php_iconv_err_t php_iconv_string(const char *in_p, size_t in_len,
|
||||
in_size = in_len;
|
||||
|
||||
cd = iconv_open(out_charset, in_charset);
|
||||
|
||||
|
||||
if (cd == (iconv_t)(-1)) {
|
||||
return PHP_ICONV_ERR_UNKNOWN;
|
||||
}
|
||||
|
||||
out_buffer = (char *) emalloc(out_size + 1);
|
||||
out_p = out_buffer;
|
||||
|
||||
|
||||
#ifdef NETWARE
|
||||
result = iconv(cd, (char **) &in_p, &in_size, (char **)
|
||||
#else
|
||||
result = iconv(cd, (const char **) &in_p, &in_size, (char **)
|
||||
#endif
|
||||
&out_p, &out_left);
|
||||
|
||||
|
||||
if (result == (size_t)(-1)) {
|
||||
efree(out_buffer);
|
||||
return PHP_ICONV_ERR_UNKNOWN;
|
||||
}
|
||||
|
||||
if (out_left < 8) {
|
||||
out_buffer = (char *) erealloc(out_buffer, out_size + 8);
|
||||
size_t pos = out_p - out_buffer;
|
||||
out_buffer = (char *) safe_erealloc(out_buffer, out_size, 1, 8);
|
||||
out_p = out_buffer+pos;
|
||||
out_size += 7;
|
||||
out_left += 7;
|
||||
}
|
||||
|
||||
/* flush the shift-out sequences */
|
||||
/* flush the shift-out sequences */
|
||||
result = iconv(cd, NULL, NULL, &out_p, &out_left);
|
||||
|
||||
if (result == (size_t)(-1)) {
|
||||
@@ -555,10 +559,10 @@ PHP_ICONV_API php_iconv_err_t php_iconv_string(const char *in_p, size_t in_len,
|
||||
}
|
||||
}
|
||||
in_left= in_len;
|
||||
out_left = in_len + 32; /* Avoid realloc() most cases */
|
||||
out_left = in_len + 32; /* Avoid realloc() most cases */
|
||||
out_size = 0;
|
||||
bsz = out_left;
|
||||
out_buf = (char *) emalloc(bsz+1);
|
||||
out_buf = (char *) emalloc(bsz+1);
|
||||
out_p = out_buf;
|
||||
|
||||
while (in_left > 0) {
|
||||
@@ -573,14 +577,14 @@ PHP_ICONV_API php_iconv_err_t php_iconv_string(const char *in_p, size_t in_len,
|
||||
out_p = out_buf = tmp_buf;
|
||||
out_p += out_size;
|
||||
out_left = bsz - out_size;
|
||||
continue;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (result != (size_t)(-1)) {
|
||||
/* flush the shift-out sequences */
|
||||
/* flush the shift-out sequences */
|
||||
for (;;) {
|
||||
result = iconv(cd, NULL, NULL, (char **) &out_p, &out_left);
|
||||
out_size = bsz - out_left;
|
||||
@@ -592,7 +596,7 @@ PHP_ICONV_API php_iconv_err_t php_iconv_string(const char *in_p, size_t in_len,
|
||||
if (errno == E2BIG) {
|
||||
bsz += 16;
|
||||
tmp_buf = (char *) erealloc(out_buf, bsz);
|
||||
|
||||
|
||||
out_p = out_buf = tmp_buf;
|
||||
out_p += out_size;
|
||||
out_left = bsz - out_size;
|
||||
@@ -684,7 +688,7 @@ static php_iconv_err_t _php_iconv_strlen(unsigned int *pretval, const char *str,
|
||||
}
|
||||
|
||||
if (out_left > 0) {
|
||||
cnt -= out_left / GENERIC_SUPERSET_NBYTES;
|
||||
cnt -= out_left / GENERIC_SUPERSET_NBYTES;
|
||||
}
|
||||
|
||||
#if ICONV_SUPPORTS_ERRNO
|
||||
@@ -735,12 +739,12 @@ static php_iconv_err_t _php_iconv_substr(smart_str *pretval,
|
||||
|
||||
unsigned int cnt;
|
||||
int total_len;
|
||||
|
||||
|
||||
err = _php_iconv_strlen(&total_len, str, nbytes, enc);
|
||||
if (err != PHP_ICONV_ERR_SUCCESS) {
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
if (len < 0) {
|
||||
if ((len += (total_len - offset)) < 0) {
|
||||
return PHP_ICONV_ERR_SUCCESS;
|
||||
@@ -772,7 +776,7 @@ static php_iconv_err_t _php_iconv_substr(smart_str *pretval,
|
||||
smart_str_0(pretval);
|
||||
return PHP_ICONV_ERR_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
cd1 = iconv_open(GENERIC_SUPERSET_NAME, enc);
|
||||
|
||||
if (cd1 == (iconv_t)(-1)) {
|
||||
@@ -857,7 +861,7 @@ static php_iconv_err_t _php_iconv_substr(smart_str *pretval,
|
||||
|
||||
if (cd2 != (iconv_t)NULL) {
|
||||
iconv_close(cd2);
|
||||
}
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -1042,7 +1046,7 @@ static php_iconv_err_t _php_iconv_strpos(unsigned int *pretval,
|
||||
if (ndl_buf) {
|
||||
efree(ndl_buf);
|
||||
}
|
||||
|
||||
|
||||
iconv_close(cd);
|
||||
|
||||
return err;
|
||||
@@ -1089,7 +1093,7 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fn
|
||||
if ((fname_nbytes + 2) >= max_line_len
|
||||
|| (out_charset_len + 12) >= max_line_len) {
|
||||
/* field name is too long */
|
||||
err = PHP_ICONV_ERR_TOO_BIG;
|
||||
err = PHP_ICONV_ERR_TOO_BIG;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -1131,7 +1135,7 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fn
|
||||
char_cnt -= 2;
|
||||
|
||||
in_p = fval;
|
||||
in_left = fval_nbytes;
|
||||
in_left = fval_nbytes;
|
||||
|
||||
do {
|
||||
size_t prev_in_left;
|
||||
@@ -1142,8 +1146,8 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fn
|
||||
smart_str_appendl(pretval, lfchars, lfchars_len);
|
||||
smart_str_appendc(pretval, ' ');
|
||||
char_cnt = max_line_len - 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
smart_str_appendl(pretval, "=?", sizeof("=?") - 1);
|
||||
char_cnt -= 2;
|
||||
smart_str_appendl(pretval, out_charset, out_charset_len);
|
||||
@@ -1195,7 +1199,7 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fn
|
||||
goto out;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
err = PHP_ICONV_ERR_UNKNOWN;
|
||||
goto out;
|
||||
@@ -1295,7 +1299,7 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fn
|
||||
goto out;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
err = PHP_ICONV_ERR_UNKNOWN;
|
||||
goto out;
|
||||
@@ -1372,7 +1376,7 @@ out:
|
||||
}
|
||||
if (encoded != NULL) {
|
||||
efree(encoded);
|
||||
}
|
||||
}
|
||||
if (buf != NULL) {
|
||||
efree(buf);
|
||||
}
|
||||
@@ -1391,7 +1395,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
|
||||
size_t str_left;
|
||||
unsigned int scan_stat = 0;
|
||||
const char *csname = NULL;
|
||||
size_t csname_len;
|
||||
size_t csname_len;
|
||||
const char *encoded_text = NULL;
|
||||
size_t encoded_text_len = 0;
|
||||
const char *encoded_word = NULL;
|
||||
@@ -1430,7 +1434,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
|
||||
break;
|
||||
|
||||
case '\n':
|
||||
scan_stat = 8;
|
||||
scan_stat = 8;
|
||||
break;
|
||||
|
||||
case '=': /* first letter of an encoded chunk */
|
||||
@@ -1455,7 +1459,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
|
||||
|
||||
case 1: /* expecting a delimiter */
|
||||
if (*p1 != '?') {
|
||||
err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
|
||||
err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
|
||||
if (err != PHP_ICONV_ERR_SUCCESS) {
|
||||
goto out;
|
||||
}
|
||||
@@ -1470,7 +1474,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
|
||||
csname = p1 + 1;
|
||||
scan_stat = 2;
|
||||
break;
|
||||
|
||||
|
||||
case 2: /* expecting a charset name */
|
||||
switch (*p1) {
|
||||
case '?': /* normal delimiter: encoding scheme follows */
|
||||
@@ -1480,7 +1484,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
|
||||
case '*': /* new style delimiter: locale id follows */
|
||||
scan_stat = 10;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (scan_stat != 2) {
|
||||
char tmpbuf[80];
|
||||
|
||||
@@ -1493,7 +1497,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
|
||||
|
||||
if (csname_len > sizeof(tmpbuf) - 1) {
|
||||
if ((mode & PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR)) {
|
||||
err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
|
||||
err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
|
||||
if (err != PHP_ICONV_ERR_SUCCESS) {
|
||||
goto out;
|
||||
}
|
||||
@@ -1549,7 +1553,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
|
||||
--str_left;
|
||||
}
|
||||
|
||||
err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
|
||||
err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
|
||||
if (err != PHP_ICONV_ERR_SUCCESS) {
|
||||
goto out;
|
||||
}
|
||||
@@ -1608,12 +1612,12 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case 4: /* expecting a delimiter */
|
||||
if (*p1 != '?') {
|
||||
if ((mode & PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR)) {
|
||||
/* pass the entire chunk through the converter */
|
||||
err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
|
||||
err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
|
||||
if (err != PHP_ICONV_ERR_SUCCESS) {
|
||||
goto out;
|
||||
}
|
||||
@@ -1669,7 +1673,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
|
||||
if (*p1 != '=') {
|
||||
if ((mode & PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR)) {
|
||||
/* pass the entire chunk through the converter */
|
||||
err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
|
||||
err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
|
||||
if (err != PHP_ICONV_ERR_SUCCESS) {
|
||||
goto out;
|
||||
}
|
||||
@@ -1696,17 +1700,17 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
|
||||
switch (*p1) {
|
||||
default:
|
||||
/* Handle non-RFC-compliant formats
|
||||
*
|
||||
*
|
||||
* RFC2047 requires the character that comes right
|
||||
* after an encoded word (chunk) to be a whitespace,
|
||||
* while there are lots of broken implementations that
|
||||
* generate such malformed headers that don't fulfill
|
||||
* that requirement.
|
||||
*/
|
||||
if (!eos) {
|
||||
*/
|
||||
if (!eos) {
|
||||
if ((mode & PHP_ICONV_MIME_DECODE_STRICT)) {
|
||||
/* pass the entire chunk through the converter */
|
||||
err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
|
||||
err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
|
||||
if (err != PHP_ICONV_ERR_SUCCESS) {
|
||||
goto out;
|
||||
}
|
||||
@@ -1738,7 +1742,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
|
||||
if (decoded_text == NULL) {
|
||||
if ((mode & PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR)) {
|
||||
/* pass the entire chunk through the converter */
|
||||
err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
|
||||
err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
|
||||
if (err != PHP_ICONV_ERR_SUCCESS) {
|
||||
goto out;
|
||||
}
|
||||
@@ -1761,7 +1765,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
|
||||
if (err != PHP_ICONV_ERR_SUCCESS) {
|
||||
if ((mode & PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR)) {
|
||||
/* pass the entire chunk through the converter */
|
||||
err = _php_iconv_appendl(pretval, encoded_word, (size_t)(p1 - encoded_word), cd_pl);
|
||||
err = _php_iconv_appendl(pretval, encoded_word, (size_t)(p1 - encoded_word), cd_pl);
|
||||
encoded_word = NULL;
|
||||
if (err != PHP_ICONV_ERR_SUCCESS) {
|
||||
break;
|
||||
@@ -1956,7 +1960,7 @@ PHP_FUNCTION(iconv_strlen)
|
||||
char *charset = ICONVG(internal_encoding);
|
||||
int charset_len = 0;
|
||||
char *str;
|
||||
int str_len;
|
||||
int str_len;
|
||||
|
||||
php_iconv_err_t err;
|
||||
|
||||
@@ -1972,7 +1976,7 @@ PHP_FUNCTION(iconv_strlen)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
err = _php_iconv_strlen(&retval, str, str_len, charset);
|
||||
err = _php_iconv_strlen(&retval, str, str_len, charset);
|
||||
_php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset TSRMLS_CC);
|
||||
if (err == PHP_ICONV_ERR_SUCCESS) {
|
||||
RETVAL_LONG(retval);
|
||||
@@ -1989,7 +1993,7 @@ PHP_FUNCTION(iconv_substr)
|
||||
char *charset = ICONVG(internal_encoding);
|
||||
int charset_len = 0;
|
||||
char *str;
|
||||
int str_len;
|
||||
int str_len;
|
||||
long offset, length = 0;
|
||||
|
||||
php_iconv_err_t err;
|
||||
@@ -2008,10 +2012,10 @@ PHP_FUNCTION(iconv_substr)
|
||||
}
|
||||
|
||||
if (ZEND_NUM_ARGS() < 3) {
|
||||
length = str_len;
|
||||
length = str_len;
|
||||
}
|
||||
|
||||
err = _php_iconv_substr(&retval, str, str_len, offset, length, charset);
|
||||
err = _php_iconv_substr(&retval, str, str_len, offset, length, charset);
|
||||
_php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset TSRMLS_CC);
|
||||
|
||||
if (err == PHP_ICONV_ERR_SUCCESS && str != NULL && retval.c != NULL) {
|
||||
@@ -2029,7 +2033,7 @@ PHP_FUNCTION(iconv_strpos)
|
||||
char *charset = ICONVG(internal_encoding);
|
||||
int charset_len = 0;
|
||||
char *haystk;
|
||||
int haystk_len;
|
||||
int haystk_len;
|
||||
char *ndl;
|
||||
int ndl_len;
|
||||
long offset = 0;
|
||||
@@ -2059,7 +2063,7 @@ PHP_FUNCTION(iconv_strpos)
|
||||
}
|
||||
|
||||
err = _php_iconv_strpos(&retval, haystk, haystk_len, ndl, ndl_len,
|
||||
offset, charset);
|
||||
offset, charset);
|
||||
_php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset TSRMLS_CC);
|
||||
|
||||
if (err == PHP_ICONV_ERR_SUCCESS && retval != (unsigned int)-1) {
|
||||
@@ -2077,7 +2081,7 @@ PHP_FUNCTION(iconv_strrpos)
|
||||
char *charset = ICONVG(internal_encoding);
|
||||
int charset_len = 0;
|
||||
char *haystk;
|
||||
int haystk_len;
|
||||
int haystk_len;
|
||||
char *ndl;
|
||||
int ndl_len;
|
||||
|
||||
@@ -2101,7 +2105,7 @@ PHP_FUNCTION(iconv_strrpos)
|
||||
}
|
||||
|
||||
err = _php_iconv_strpos(&retval, haystk, haystk_len, ndl, ndl_len,
|
||||
-1, charset);
|
||||
-1, charset);
|
||||
_php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset TSRMLS_CC);
|
||||
|
||||
if (err == PHP_ICONV_ERR_SUCCESS && retval != (unsigned int)-1) {
|
||||
@@ -2241,7 +2245,7 @@ PHP_FUNCTION(iconv_mime_decode)
|
||||
char *charset = ICONVG(internal_encoding);
|
||||
int charset_len = 0;
|
||||
long mode = 0;
|
||||
|
||||
|
||||
smart_str retval = {0};
|
||||
|
||||
php_iconv_err_t err;
|
||||
@@ -2282,7 +2286,7 @@ PHP_FUNCTION(iconv_mime_decode_headers)
|
||||
char *charset = ICONVG(internal_encoding);
|
||||
int charset_len = 0;
|
||||
long mode = 0;
|
||||
|
||||
|
||||
php_iconv_err_t err = PHP_ICONV_ERR_SUCCESS;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ls",
|
||||
@@ -2350,14 +2354,14 @@ PHP_FUNCTION(iconv_mime_decode_headers)
|
||||
zend_hash_update(Z_ARRVAL_P(return_value), header_name, header_name_len, (void *)&new_elem, sizeof(new_elem), NULL);
|
||||
|
||||
elem = &new_elem;
|
||||
}
|
||||
}
|
||||
add_next_index_stringl(*elem, header_value, header_value_len, 1);
|
||||
} else {
|
||||
add_assoc_stringl_ex(return_value, header_name, header_name_len, header_value, header_value_len, 1);
|
||||
}
|
||||
}
|
||||
encoded_str_len -= next_pos - encoded_str;
|
||||
encoded_str = next_pos;
|
||||
encoded_str = next_pos;
|
||||
|
||||
smart_str_free(&decoded_header);
|
||||
}
|
||||
@@ -2378,7 +2382,7 @@ PHP_NAMED_FUNCTION(php_if_iconv)
|
||||
size_t out_len;
|
||||
int in_charset_len = 0, out_charset_len = 0, in_buffer_len;
|
||||
php_iconv_err_t err;
|
||||
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss",
|
||||
&in_charset, &in_charset_len, &out_charset, &out_charset_len, &in_buffer, &in_buffer_len) == FAILURE)
|
||||
return;
|
||||
@@ -2390,7 +2394,7 @@ PHP_NAMED_FUNCTION(php_if_iconv)
|
||||
|
||||
err = php_iconv_string(in_buffer, (size_t)in_buffer_len,
|
||||
&out_buffer, &out_len, out_charset, in_charset);
|
||||
_php_iconv_show_error(err, out_charset, in_charset TSRMLS_CC);
|
||||
_php_iconv_show_error(err, out_charset, in_charset TSRMLS_CC);
|
||||
if (err == PHP_ICONV_ERR_SUCCESS && out_buffer != NULL) {
|
||||
RETVAL_STRINGL(out_buffer, out_len, 0);
|
||||
} else {
|
||||
@@ -2539,7 +2543,7 @@ static int php_iconv_stream_filter_append_bucket(
|
||||
icnt = buf_len;
|
||||
}
|
||||
|
||||
out_buf_size = ocnt = prev_ocnt = initial_out_buf_size;
|
||||
out_buf_size = ocnt = prev_ocnt = initial_out_buf_size;
|
||||
if (NULL == (out_buf = pemalloc(out_buf_size, persistent))) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ require_once(dirname(__FILE__).'/skipif.inc');
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : array imap_errors ( void )
|
||||
* Description: Returns all of the IMAP errors that have occured.
|
||||
* Description: Returns all of the IMAP errors that have occurred.
|
||||
* Source code: ext/imap/php_imap.c
|
||||
*/
|
||||
|
||||
|
||||
@@ -594,6 +594,8 @@ PHP_FUNCTION( collator_get_sort_key )
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
/* ucol_getSortKey is exception in that the key length includes the
|
||||
* NUL terminator*/
|
||||
key_len = ucol_getSortKey(co->ucoll, ustr, ustr_len, key, 0);
|
||||
if(!key_len) {
|
||||
efree( ustr );
|
||||
@@ -605,7 +607,7 @@ PHP_FUNCTION( collator_get_sort_key )
|
||||
if(!key_len) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
RETURN_STRINGL((char *)key, key_len, 0);
|
||||
RETURN_STRINGL((char *)key, key_len - 1, 0);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "common_error.h"
|
||||
|
||||
/* {{{ proto int intl_get_error_code()
|
||||
* Get code of the last occured error.
|
||||
* Get code of the last occurred error.
|
||||
*/
|
||||
PHP_FUNCTION( intl_get_error_code )
|
||||
{
|
||||
@@ -33,7 +33,7 @@ PHP_FUNCTION( intl_get_error_code )
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto string intl_get_error_message()
|
||||
* Get text description of the last occured error.
|
||||
* Get text description of the last occurred error.
|
||||
*/
|
||||
PHP_FUNCTION( intl_get_error_message )
|
||||
{
|
||||
|
||||
@@ -99,17 +99,46 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
|
||||
}
|
||||
|
||||
INTL_CHECK_LOCALE_LEN_OBJ(locale_len, return_value);
|
||||
|
||||
if (calendar != UCAL_TRADITIONAL && calendar != UCAL_GREGORIAN) {
|
||||
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_create: "
|
||||
"invalid value for calendar type; it must be one of "
|
||||
"IntlDateFormatter::TRADITIONAL (locale's default calendar) "
|
||||
"or IntlDateFormatter::GREGORIAN", 0 TSRMLS_CC);
|
||||
goto error;
|
||||
}
|
||||
|
||||
DATE_FORMAT_METHOD_FETCH_OBJECT;
|
||||
|
||||
if (DATE_FORMAT_OBJECT(dfo) != NULL) {
|
||||
intl_errors_set(INTL_DATA_ERROR_P(dfo), U_ILLEGAL_ARGUMENT_ERROR,
|
||||
"datefmt_create: cannot call constructor twice", 0 TSRMLS_CC);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Convert pattern (if specified) to UTF-16. */
|
||||
if( pattern_str && pattern_str_len>0 ){
|
||||
intl_convert_utf8_to_utf16(&svalue, &slength, pattern_str, pattern_str_len, &INTL_DATA_ERROR_CODE(dfo));
|
||||
INTL_CTOR_CHECK_STATUS(dfo, "datefmt_create: error converting pattern to UTF-16");
|
||||
intl_convert_utf8_to_utf16(&svalue, &slength,
|
||||
pattern_str, pattern_str_len, &INTL_DATA_ERROR_CODE(dfo));
|
||||
if (U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
|
||||
/* object construction -> only set global error */
|
||||
intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create: "
|
||||
"error converting pattern to UTF-16", 0 TSRMLS_CC);
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
/* resources allocated from now on */
|
||||
|
||||
/* Convert pattern (if specified) to UTF-16. */
|
||||
if( timezone_str && timezone_str_len >0 ){
|
||||
intl_convert_utf8_to_utf16(&timezone_utf16, &timezone_utf16_len, timezone_str, timezone_str_len, &INTL_DATA_ERROR_CODE(dfo));
|
||||
INTL_CTOR_CHECK_STATUS(dfo, "datefmt_create: error converting timezone_str to UTF-16" );
|
||||
intl_convert_utf8_to_utf16(&timezone_utf16, &timezone_utf16_len,
|
||||
timezone_str, timezone_str_len, &INTL_DATA_ERROR_CODE(dfo));
|
||||
if (U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
|
||||
intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create: "
|
||||
"error converting timezone_str to UTF-16", 0 TSRMLS_CC);
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
if(locale_len == 0) {
|
||||
@@ -122,24 +151,24 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
|
||||
DATE_FORMAT_OBJECT(dfo) = udat_open(time_type, date_type, locale, timezone_utf16, timezone_utf16_len, svalue, slength, &INTL_DATA_ERROR_CODE(dfo));
|
||||
}
|
||||
|
||||
/* Set the calendar if passed */
|
||||
if(!U_FAILURE(INTL_DATA_ERROR_CODE(dfo)) && calendar) {
|
||||
ucal_obj = ucal_open( timezone_utf16, timezone_utf16_len, locale, calendar, &INTL_DATA_ERROR_CODE(dfo) );
|
||||
if(!U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
|
||||
udat_setCalendar( DATE_FORMAT_OBJECT(dfo), ucal_obj );
|
||||
if (!U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
|
||||
if (calendar != UCAL_TRADITIONAL) {
|
||||
ucal_obj = ucal_open(timezone_utf16, timezone_utf16_len, locale,
|
||||
calendar, &INTL_DATA_ERROR_CODE(dfo));
|
||||
if (!U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
|
||||
udat_setCalendar(DATE_FORMAT_OBJECT(dfo), ucal_obj);
|
||||
ucal_close(ucal_obj);
|
||||
} else {
|
||||
intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create"
|
||||
": error opening calendar", 0 TSRMLS_CC);
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(svalue)
|
||||
{
|
||||
efree(svalue);
|
||||
} else {
|
||||
intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create: date "
|
||||
"formatter creation failed", 0 TSRMLS_CC);
|
||||
goto error;
|
||||
}
|
||||
if(timezone_utf16)
|
||||
{
|
||||
efree(timezone_utf16);
|
||||
}
|
||||
|
||||
INTL_CTOR_CHECK_STATUS(dfo, "datefmt_create: date formatter creation failed");
|
||||
|
||||
/* Set the class variables */
|
||||
dfo->date_type = date_type;
|
||||
@@ -148,6 +177,19 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
|
||||
if( timezone_str && timezone_str_len > 0){
|
||||
dfo->timezone_id = estrndup( timezone_str, timezone_str_len);
|
||||
}
|
||||
|
||||
error:
|
||||
if (svalue) {
|
||||
efree(svalue);
|
||||
}
|
||||
if (timezone_utf16) {
|
||||
efree(timezone_utf16);
|
||||
}
|
||||
if (U_FAILURE(intl_error_get_code(NULL TSRMLS_CC))) {
|
||||
/* free_object handles partially constructed instances fine */
|
||||
zval_dtor(return_value);
|
||||
RETVAL_NULL();
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -169,6 +211,8 @@ PHP_FUNCTION( datefmt_create )
|
||||
*/
|
||||
PHP_METHOD( IntlDateFormatter, __construct )
|
||||
{
|
||||
/* return_value param is being changed, therefore we will always return
|
||||
* NULL here */
|
||||
return_value = getThis();
|
||||
datefmt_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU);
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ class Collator {
|
||||
/**
|
||||
* Return error text for the last ICU operation.
|
||||
*
|
||||
* @return string Description of an error occured in the last
|
||||
* @return string Description of an error occurred in the last
|
||||
* Collator method call.
|
||||
*/
|
||||
public function getErrorMessage() {}
|
||||
@@ -236,7 +236,7 @@ class Collator {
|
||||
*
|
||||
* @return string Real locale name from which the
|
||||
* collation data comes. If the collator
|
||||
* was instantiated from rules or an error occured,
|
||||
* was instantiated from rules or an error occurred,
|
||||
* returns false.
|
||||
*/
|
||||
public function getLocale( $type ) {}
|
||||
@@ -331,7 +331,7 @@ function collator_sort_with_sort_keys( $coll, $arr ) {}
|
||||
*
|
||||
* @return string Real locale name from which the
|
||||
* collation data comes. If the collator
|
||||
* was instantiated from rules or an error occured,
|
||||
* was instantiated from rules or an error occurred,
|
||||
* returns false.
|
||||
*/
|
||||
function collator_get_locale( $coll, $type ) {}
|
||||
@@ -391,7 +391,7 @@ function collator_get_error_code( $coll ) {}
|
||||
*
|
||||
* @param Collator $coll Collator object.
|
||||
*
|
||||
* @return string Description of an error occured in the last
|
||||
* @return string Description of an error occurred in the last
|
||||
* Collator API function call.
|
||||
*/
|
||||
function collator_get_error_message( $coll ) {}
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Handling of errors occured in static methods
|
||||
* Handling of errors occurred in static methods
|
||||
* when there's no object to get error code/message from.
|
||||
*
|
||||
* Example #1:
|
||||
@@ -29,7 +29,7 @@ function intl_get_error_code() {}
|
||||
/**
|
||||
* Get description of the last error.
|
||||
*
|
||||
* @return string Description of an error occured in the last
|
||||
* @return string Description of an error occurred in the last
|
||||
* API function call.
|
||||
*/
|
||||
function intl_get_error_message() {}
|
||||
|
||||
@@ -215,7 +215,7 @@ class DateFormatter {
|
||||
/**
|
||||
* Sets the pattern to use
|
||||
* @param string $pattern new pattern string to use
|
||||
* @return boolean 'true' if successful, 'false' if an error occured. Bad format
|
||||
* @return boolean 'true' if successful, 'false' if an error occurred. Bad format
|
||||
* strings are usually the cause of the latter.
|
||||
*/
|
||||
public function setPattern($pattern) {}
|
||||
@@ -410,7 +410,7 @@ class DateFormatter {
|
||||
* Sets the pattern to use
|
||||
* @param DateFormatter $fmt The date formatter resource
|
||||
* @param string $pattern new pattern string to use
|
||||
* @return boolean 'true' if successful, 'false' if an error occured. Bad format
|
||||
* @return boolean 'true' if successful, 'false' if an error occurred. Bad format
|
||||
* strings are usually the cause of the latter.
|
||||
*/
|
||||
function datefmt_set_pattern($fmt , $pattern) {}
|
||||
|
||||
@@ -317,7 +317,7 @@ class NumberFormatter {
|
||||
/**
|
||||
* Get the error text from the last operation.
|
||||
*
|
||||
* @return string Description of the last occured error.
|
||||
* @return string Description of the last occurred error.
|
||||
*/
|
||||
public public function getErrorMessage() {}
|
||||
|
||||
@@ -495,6 +495,6 @@ function numfmt_get_error_code($formatter) {}
|
||||
* Get the error text from the last operation.
|
||||
*
|
||||
* @param NumberFormatter $formatter The formatter resource
|
||||
* @return string Description of the last occured error.
|
||||
* @return string Description of the last occurred error.
|
||||
*/
|
||||
function numfmt_get_error_message($formatter) {}
|
||||
@@ -54,7 +54,7 @@ class MessageFormatter {
|
||||
* @param string $locale the locale to use when formatting numbers and dates and suchlike
|
||||
* @param string $pattern the pattern string to insert things into
|
||||
* @param array $args the array of values to insert into $pattern
|
||||
* @return string the formatted pattern string or false if an error occured
|
||||
* @return string the formatted pattern string or false if an error occurred
|
||||
*/
|
||||
public static function formatMessage($locale, $pattern, $args) {}
|
||||
|
||||
@@ -148,7 +148,7 @@ class MessageFormatter {
|
||||
* @param string $locale the locale to use when formatting numbers and dates and suchlike
|
||||
* @param string $pattern the pattern string to insert things into
|
||||
* @param array $args the array of values to insert into $pattern
|
||||
* @return string the formatted pattern string or false if an error occured
|
||||
* @return string the formatted pattern string or false if an error occurred
|
||||
*/
|
||||
function msgfmt_format_message($locale, $pattern, $args) {}
|
||||
|
||||
|
||||
@@ -822,6 +822,7 @@ PHP_FUNCTION(grapheme_extract)
|
||||
}
|
||||
else {
|
||||
/* initialize next */
|
||||
zval_dtor(next);
|
||||
ZVAL_LONG(next, lstart);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ void intl_convert_utf8_to_utf16(
|
||||
return;
|
||||
}
|
||||
|
||||
/* Bail out if an unexpected error occured.
|
||||
/* Bail out if an unexpected error occurred.
|
||||
* (U_BUFFER_OVERFLOW_ERROR means that *target buffer is not large enough).
|
||||
* (U_STRING_NOT_TERMINATED_WARNING usually means that the input string is empty).
|
||||
*/
|
||||
@@ -119,7 +119,7 @@ void intl_convert_utf16_to_utf8(
|
||||
*status = U_ZERO_ERROR;
|
||||
u_strToUTF8( NULL, 0, &dst_len, src, src_len, status );
|
||||
|
||||
/* Bail out if an unexpected error occured.
|
||||
/* Bail out if an unexpected error occurred.
|
||||
* (U_BUFFER_OVERFLOW_ERROR means that *target buffer is not large enough).
|
||||
* (U_STRING_NOT_TERMINATED_WARNING usually means that the input string is empty).
|
||||
*/
|
||||
|
||||
@@ -527,7 +527,7 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME
|
||||
|
||||
/* Get the disp_value for the given locale */
|
||||
do{
|
||||
disp_name = erealloc( disp_name , buflen );
|
||||
disp_name = erealloc( disp_name , buflen * sizeof(UChar) );
|
||||
disp_name_len = buflen;
|
||||
|
||||
if( strcmp(tag_name , LOC_LANG_TAG)==0 ){
|
||||
@@ -542,6 +542,7 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME
|
||||
buflen = uloc_getDisplayName ( mod_loc_name , disp_loc_name , disp_name , disp_name_len , &status);
|
||||
}
|
||||
|
||||
/* U_STRING_NOT_TERMINATED_WARNING is admissible here; don't look for it */
|
||||
if( U_FAILURE( status ) )
|
||||
{
|
||||
if( status == U_BUFFER_OVERFLOW_ERROR )
|
||||
@@ -1562,11 +1563,11 @@ PHP_FUNCTION(locale_lookup)
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto string Locale::acceptFromHttp(string $http_accept)
|
||||
* Tries to find out best available locale based on HTTP “Accept-Language” header
|
||||
* Tries to find out best available locale based on HTTP �Accept-Language� header
|
||||
*/
|
||||
/* }}} */
|
||||
/* {{{ proto string locale_accept_from_http(string $http_accept)
|
||||
* Tries to find out best available locale based on HTTP “Accept-Language” header
|
||||
* Tries to find out best available locale based on HTTP �Accept-Language� header
|
||||
*/
|
||||
PHP_FUNCTION(locale_accept_from_http)
|
||||
{
|
||||
|
||||
@@ -64,9 +64,11 @@ static void msgfmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
|
||||
locale = INTL_G(default_locale);
|
||||
}
|
||||
|
||||
#ifdef MSG_FORMAT_QUOTE_APOS
|
||||
if(msgformat_fix_quotes(&spattern, &spattern_len, &INTL_DATA_ERROR_CODE(mfo)) != SUCCESS) {
|
||||
INTL_CTOR_CHECK_STATUS(mfo, "msgfmt_create: error converting pattern to quote-friendly format");
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((mfo)->mf_data.orig_format) {
|
||||
msgformat_data_free(&mfo->mf_data TSRMLS_CC);
|
||||
|
||||
@@ -82,11 +82,13 @@ PHP_FUNCTION( msgfmt_set_pattern )
|
||||
intl_convert_utf8_to_utf16(&spattern, &spattern_len, value, value_len, &INTL_DATA_ERROR_CODE(mfo));
|
||||
INTL_METHOD_CHECK_STATUS(mfo, "Error converting pattern to UTF-16" );
|
||||
|
||||
#ifdef MSG_FORMAT_QUOTE_APOS
|
||||
if(msgformat_fix_quotes(&spattern, &spattern_len, &INTL_DATA_ERROR_CODE(mfo)) != SUCCESS) {
|
||||
intl_error_set( NULL, U_INVALID_FORMAT_ERROR,
|
||||
"msgfmt_set_pattern: error converting pattern to quote-friendly format", 0 TSRMLS_CC );
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* TODO: add parse error information */
|
||||
umsg_applyPattern(MSG_FORMAT_OBJECT(mfo), spattern, spattern_len, NULL, &INTL_DATA_ERROR_CODE(mfo));
|
||||
|
||||
@@ -19,9 +19,11 @@
|
||||
|
||||
#include <php.h>
|
||||
|
||||
#include "intl_common.h"
|
||||
#include "intl_error.h"
|
||||
#include "intl_data.h"
|
||||
#include <unicode/uconfig.h>
|
||||
|
||||
#include "../intl_common.h"
|
||||
#include "../intl_error.h"
|
||||
#include "../intl_data.h"
|
||||
#include "msgformat_data.h"
|
||||
|
||||
typedef struct {
|
||||
@@ -38,4 +40,8 @@ extern zend_class_entry *MessageFormatter_ce_ptr;
|
||||
#define MSG_FORMAT_METHOD_FETCH_OBJECT INTL_METHOD_FETCH_OBJECT(MessageFormatter, mfo)
|
||||
#define MSG_FORMAT_OBJECT(mfo) (mfo)->mf_data.umsgf
|
||||
|
||||
#if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM < 48
|
||||
# define MSG_FORMAT_QUOTE_APOS 1
|
||||
#endif
|
||||
|
||||
#endif // #ifndef MSG_FORMAT_CLASS_H
|
||||
@@ -21,6 +21,8 @@
|
||||
#include <unicode/ustring.h>
|
||||
#include "msgformat_data.h"
|
||||
|
||||
#include "msgformat_class.h"
|
||||
|
||||
/* {{{ void msgformat_data_init( msgformat_data* mf_data )
|
||||
* Initialize internals of msgformat_data.
|
||||
*/
|
||||
@@ -69,6 +71,7 @@ msgformat_data* msgformat_data_create( TSRMLS_D )
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#ifdef MSG_FORMAT_QUOTE_APOS
|
||||
int msgformat_fix_quotes(UChar **spattern, uint32_t *spattern_len, UErrorCode *ec)
|
||||
{
|
||||
if(*spattern && *spattern_len && u_strchr(*spattern, (UChar)'\'')) {
|
||||
@@ -86,6 +89,7 @@ int msgformat_fix_quotes(UChar **spattern, uint32_t *spattern_len, UErrorCode *e
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
|
||||
#include <php.h>
|
||||
|
||||
#include <unicode/umsg.h>
|
||||
#include "../intl_error.h"
|
||||
|
||||
#include "intl_error.h"
|
||||
#include <unicode/umsg.h>
|
||||
|
||||
typedef struct {
|
||||
// error hangling
|
||||
@@ -36,6 +36,9 @@ typedef struct {
|
||||
msgformat_data* msgformat_data_create( TSRMLS_D );
|
||||
void msgformat_data_init( msgformat_data* mf_data TSRMLS_DC );
|
||||
void msgformat_data_free( msgformat_data* mf_data TSRMLS_DC );
|
||||
|
||||
#ifdef MSG_FORMAT_QUOTE_APOS
|
||||
int msgformat_fix_quotes(UChar **spattern, uint32_t *spattern_len, UErrorCode *ec);
|
||||
#endif
|
||||
|
||||
#endif // MSG_FORMAT_DATA_H
|
||||
@@ -154,11 +154,13 @@ PHP_FUNCTION( msgfmt_format_message )
|
||||
slocale = INTL_G(default_locale);
|
||||
}
|
||||
|
||||
#ifdef MSG_FORMAT_QUOTE_APOS
|
||||
if(msgformat_fix_quotes(&spattern, &spattern_len, &INTL_DATA_ERROR_CODE(mfo)) != SUCCESS) {
|
||||
intl_error_set( NULL, U_INVALID_FORMAT_ERROR,
|
||||
"msgfmt_format_message: error converting pattern to quote-friendly format", 0 TSRMLS_CC );
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Create an ICU message formatter. */
|
||||
MSG_FORMAT_OBJECT(mfo) = umsg_open(spattern, spattern_len, slocale, NULL, &INTL_DATA_ERROR_CODE(mfo));
|
||||
|
||||
@@ -129,11 +129,13 @@ PHP_FUNCTION( msgfmt_parse_message )
|
||||
slocale = INTL_G(default_locale);
|
||||
}
|
||||
|
||||
#ifdef MSG_FORMAT_QUOTE_APOS
|
||||
if(msgformat_fix_quotes(&spattern, &spattern_len, &INTL_DATA_ERROR_CODE(mfo)) != SUCCESS) {
|
||||
intl_error_set( NULL, U_INVALID_FORMAT_ERROR,
|
||||
"msgfmt_parse_message: error converting pattern to quote-friendly format", 0 TSRMLS_CC );
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Create an ICU message formatter. */
|
||||
MSG_FORMAT_OBJECT(mfo) = umsg_open(spattern, spattern_len, slocale, NULL, &INTL_DATA_ERROR_CODE(mfo));
|
||||
|
||||
@@ -110,7 +110,7 @@ PHP_FUNCTION( normalizer_normalize )
|
||||
/* normalize */
|
||||
size_needed = unorm_normalize( uinput, uinput_len, form, (int32_t) 0 /* options */, uret_buf, uret_len, &status);
|
||||
|
||||
/* Bail out if an unexpected error occured.
|
||||
/* Bail out if an unexpected error occurred.
|
||||
* (U_BUFFER_OVERFLOW_ERROR means that *target buffer is not large enough).
|
||||
* (U_STRING_NOT_TERMINATED_WARNING usually means that the input string is empty).
|
||||
*/
|
||||
@@ -133,7 +133,7 @@ PHP_FUNCTION( normalizer_normalize )
|
||||
/* try normalize again */
|
||||
size_needed = unorm_normalize( uinput, uinput_len, form, (int32_t) 0 /* options */, uret_buf, uret_len, &status);
|
||||
|
||||
/* Bail out if an unexpected error occured. */
|
||||
/* Bail out if an unexpected error occurred. */
|
||||
if( U_FAILURE(status) ) {
|
||||
/* Set error messages. */
|
||||
intl_error_set_custom_msg( NULL,"Error normalizing string", 0 TSRMLS_CC );
|
||||
@@ -234,7 +234,7 @@ PHP_FUNCTION( normalizer_is_normalized )
|
||||
|
||||
efree( uinput );
|
||||
|
||||
/* Bail out if an unexpected error occured. */
|
||||
/* Bail out if an unexpected error occurred. */
|
||||
if( U_FAILURE(status) ) {
|
||||
/* Set error messages. */
|
||||
intl_error_set_custom_msg( NULL,"Error testing if string is the given normalization form.", 0 TSRMLS_CC );
|
||||
|
||||
@@ -91,7 +91,7 @@ static void resourcebundle_ctor(INTERNAL_FUNCTION_PARAMETERS)
|
||||
|
||||
intl_error_reset( NULL TSRMLS_CC );
|
||||
|
||||
if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "ss|b",
|
||||
if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s!s!|b",
|
||||
&locale, &locale_len, &bundlename, &bundlename_len, &fallback ) == FAILURE )
|
||||
{
|
||||
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
|
||||
@@ -101,6 +101,10 @@ static void resourcebundle_ctor(INTERNAL_FUNCTION_PARAMETERS)
|
||||
}
|
||||
|
||||
INTL_CHECK_LOCALE_LEN_OBJ(locale_len, return_value);
|
||||
|
||||
if (locale == NULL) {
|
||||
locale = INTL_G(default_locale);
|
||||
}
|
||||
|
||||
if (fallback) {
|
||||
rb->me = ures_open(bundlename, locale, &INTL_DATA_ERROR_CODE(rb));
|
||||
@@ -110,13 +114,17 @@ static void resourcebundle_ctor(INTERNAL_FUNCTION_PARAMETERS)
|
||||
|
||||
INTL_CTOR_CHECK_STATUS(rb, "resourcebundle_ctor: Cannot load libICU resource bundle");
|
||||
|
||||
if (!fallback && (INTL_DATA_ERROR_CODE(rb) == U_USING_FALLBACK_WARNING || INTL_DATA_ERROR_CODE(rb) == U_USING_DEFAULT_WARNING)) {
|
||||
intl_errors_set_code( NULL, INTL_DATA_ERROR_CODE(rb) TSRMLS_CC );
|
||||
spprintf( &pbuf, 0, "resourcebundle_ctor: Cannot load libICU resource '%s' without fallback from %s to %s",
|
||||
bundlename, locale, ures_getLocaleByType( rb->me, ULOC_ACTUAL_LOCALE, &INTL_DATA_ERROR_CODE(rb)) );
|
||||
intl_errors_set_custom_msg( INTL_DATA_ERROR_P(rb), pbuf, 1 TSRMLS_CC );
|
||||
if (!fallback && (INTL_DATA_ERROR_CODE(rb) == U_USING_FALLBACK_WARNING ||
|
||||
INTL_DATA_ERROR_CODE(rb) == U_USING_DEFAULT_WARNING)) {
|
||||
intl_errors_set_code(NULL, INTL_DATA_ERROR_CODE(rb) TSRMLS_CC);
|
||||
spprintf(&pbuf, 0, "resourcebundle_ctor: Cannot load libICU resource "
|
||||
"'%s' without fallback from %s to %s",
|
||||
bundlename ? bundlename : "(default data)", locale,
|
||||
ures_getLocaleByType(
|
||||
rb->me, ULOC_ACTUAL_LOCALE, &INTL_DATA_ERROR_CODE(rb)));
|
||||
intl_errors_set_custom_msg(INTL_DATA_ERROR_P(rb), pbuf, 1 TSRMLS_CC);
|
||||
efree(pbuf);
|
||||
zval_dtor( return_value );
|
||||
zval_dtor(return_value);
|
||||
RETURN_NULL();
|
||||
}
|
||||
}
|
||||
@@ -427,6 +435,8 @@ void resourcebundle_register_class( TSRMLS_D )
|
||||
ResourceBundle_object_handlers.clone_obj = NULL; /* ICU ResourceBundle has no clone implementation */
|
||||
ResourceBundle_object_handlers.read_dimension = resourcebundle_array_get;
|
||||
ResourceBundle_object_handlers.count_elements = resourcebundle_array_count;
|
||||
|
||||
zend_class_implements(ResourceBundle_ce_ptr TSRMLS_CC, 1, zend_ce_traversable);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ $value = $formatter->parse('2147483650', \NumberFormatter::TYPE_INT64);
|
||||
var_dump($value);
|
||||
|
||||
?>
|
||||
--EXPECTREGEX--
|
||||
--EXPECT--
|
||||
int(2147483647)
|
||||
int(2147483650)
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #62017: datefmt_create with incorrectly encoded timezone leaks pattern
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl'))
|
||||
die('skip intl extension not enabled');
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set('intl.error_level', E_WARNING);
|
||||
var_dump(
|
||||
datefmt_create('', IntlDateFormatter::NONE, IntlDateFormatter::NONE, "\xFF",
|
||||
IntlDateFormatter::GREGORIAN, 'a'));
|
||||
var_dump(
|
||||
new IntlDateFormatter('', IntlDateFormatter::NONE, IntlDateFormatter::NONE, "Europe/Lisbon",
|
||||
IntlDateFormatter::GREGORIAN, "\x80"));
|
||||
--EXPECTF--
|
||||
Warning: datefmt_create(): datefmt_create: error converting timezone_str to UTF-16 in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: IntlDateFormatter::__construct(): datefmt_create: error converting pattern to UTF-16 in %s on line %d
|
||||
NULL
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #62070: Collator::getSortKey() returns garbage
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl'))
|
||||
die('skip intl extension not enabled');
|
||||
--FILE--
|
||||
<?php
|
||||
$s1 = 'Hello';
|
||||
|
||||
$coll = collator_create('en_US');
|
||||
$res = collator_get_sort_key($coll, $s1);
|
||||
|
||||
echo urlencode($res);
|
||||
--EXPECT--
|
||||
5%2F%3D%3DC%01%09%01%8F%08
|
||||
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Bug #62081: IntlDateFormatter leaks memory if called twice
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl'))
|
||||
die('skip intl extension not enabled');
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set('intl.error_level', E_WARNING);
|
||||
$x = new IntlDateFormatter(1,1,1,1,1);
|
||||
var_dump($x->__construct(1,1,1,1,1));
|
||||
--EXPECTF--
|
||||
Warning: IntlDateFormatter::__construct(): datefmt_create: cannot call constructor twice in %s on line %d
|
||||
NULL
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #62082: Memory corruption in internal get_icu_disp_value_src_php()
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl'))
|
||||
die('skip intl extension not enabled');
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(locale_get_display_name(str_repeat("a", 300), null));
|
||||
var_dump(locale_get_display_name(str_repeat("a", 512), null));
|
||||
var_dump(locale_get_display_name(str_repeat("a", 600), null));
|
||||
--EXPECT--
|
||||
string(300) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
string(512) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
string(600) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
Bug #62083: grapheme_extract() leaks memory
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl'))
|
||||
die('skip intl extension not enabled');
|
||||
--FILE--
|
||||
<?php
|
||||
$arr1 = array();
|
||||
var_dump(grapheme_extract(-1, -1, -1,-1, $arr1));
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
@@ -2,8 +2,7 @@
|
||||
collator_get_sort_key()
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
--XFAIL--
|
||||
Sort keys are not fixed, comparing them to fixed strings doesn't work.
|
||||
<?php if(version_compare(INTL_ICU_VERSION, '4.8') < 0) print 'skip ICU >= 4.8 only'; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -18,8 +17,8 @@ function sort_arrays( $locale, $data )
|
||||
|
||||
foreach($data as $value) {
|
||||
$res_val = ut_coll_get_sort_key( $coll, $value );
|
||||
$res_str .= "source: ".urlencode($value)."\n".
|
||||
"key: ".urlencode($res_val)."\n";
|
||||
$res_str .= "source: ".$value."\n".
|
||||
"key: ".bin2hex($res_val)."\n";
|
||||
}
|
||||
|
||||
return $res_str;
|
||||
@@ -58,42 +57,42 @@ ut_run();
|
||||
?>
|
||||
--EXPECT--
|
||||
source: abc
|
||||
key: %29%2B-%01%07%01%07%00
|
||||
key: 27292b01070107
|
||||
source: abd
|
||||
key: %29%2B%2F%01%07%01%07%00
|
||||
key: 27292d01070107
|
||||
source: aaa
|
||||
key: %29%29%29%01%07%01%07%00
|
||||
source: %D0%B0%D0%B0
|
||||
key: _++%01%06%01%06%00
|
||||
source: %D0%B0
|
||||
key: _+%01%05%01%05%00
|
||||
key: 27272701070107
|
||||
source: аа
|
||||
key: 5c0a0a01060106
|
||||
source: а
|
||||
key: 5c0a01050105
|
||||
source: z
|
||||
key: %5B%01%05%01%05%00
|
||||
source:
|
||||
key: %01%01%00
|
||||
source:
|
||||
key: %01%01%00
|
||||
key: 5901050105
|
||||
source:
|
||||
key: 0101
|
||||
source:
|
||||
key: 0101
|
||||
source: 3
|
||||
key: %26%80%01%05%01%05%00
|
||||
key: 1801050105
|
||||
source: y
|
||||
key: Y%01%05%01%05%00
|
||||
key: 5701050105
|
||||
source: i
|
||||
key: 9%01%05%01%05%00
|
||||
key: 3701050105
|
||||
source: k
|
||||
key: %3D%01%05%01%05%00
|
||||
source: %D0%B0%D0%B1%D0%B3
|
||||
key: _+%2C0%01%07%01%07%00
|
||||
source: %D0%B0%D0%B1%D0%B2
|
||||
key: _+%2C.%01%07%01%07%00
|
||||
source: %D0%B6%D0%B6%D0%B6
|
||||
key: _LLL%01%07%01%07%00
|
||||
source: %D1%8D%D1%8E%D1%8F
|
||||
key: %60%05%09%0B%01%07%01%07%00
|
||||
source: %D0%B0%D0%B1%D0%B3
|
||||
key: _+%2C0%01%07%01%07%00
|
||||
source: %D0%B0%D0%B1%D0%B2
|
||||
key: _+%2C.%01%07%01%07%00
|
||||
source: %D0%B6%D0%B6%D0%B6
|
||||
key: _LLL%01%07%01%07%00
|
||||
source: %D1%8D%D1%8E%D1%8F
|
||||
key: %60%05%09%0B%01%07%01%07%00
|
||||
key: 3b01050105
|
||||
source: абг
|
||||
key: 5c0a161a01070107
|
||||
source: абв
|
||||
key: 5c0a161801070107
|
||||
source: жжж
|
||||
key: 5c3a3a3a01070107
|
||||
source: эюя
|
||||
key: 5d3b3f4501070107
|
||||
source: абг
|
||||
key: 5c0a161a01070107
|
||||
source: абв
|
||||
key: 5c0a161801070107
|
||||
source: жжж
|
||||
key: 5c3a3a3a01070107
|
||||
source: эюя
|
||||
key: 5d3b3f4501070107
|
||||
@@ -0,0 +1,45 @@
|
||||
--TEST--
|
||||
IntlDateFormatter, calendars and time zone
|
||||
--INI--
|
||||
date.timezone=Atlantic/Azores
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl'))
|
||||
die('skip intl extension not enabled');
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
|
||||
$fmt1 = new IntlDateFormatter('en_US',
|
||||
IntlDateFormatter::FULL,
|
||||
IntlDateFormatter::FULL,
|
||||
'GMT+05:12',
|
||||
IntlDateFormatter::TRADITIONAL);
|
||||
$fmt2 = new IntlDateFormatter('en_US',
|
||||
IntlDateFormatter::FULL,
|
||||
IntlDateFormatter::FULL,
|
||||
'GMT+05:12',
|
||||
IntlDateFormatter::GREGORIAN);
|
||||
$fmt3 = new IntlDateFormatter('en_US@calendar=hebrew',
|
||||
IntlDateFormatter::FULL,
|
||||
IntlDateFormatter::FULL,
|
||||
'GMT+05:12',
|
||||
IntlDateFormatter::TRADITIONAL);
|
||||
var_dump($fmt1->format(strtotime('2012-01-01 00:00:00 +0000')));
|
||||
var_dump($fmt2->format(strtotime('2012-01-01 00:00:00 +0000')));
|
||||
var_dump($fmt3->format(strtotime('2012-01-01 00:00:00 +0000')));
|
||||
|
||||
new IntlDateFormatter('en_US@calendar=hebrew',
|
||||
IntlDateFormatter::FULL,
|
||||
IntlDateFormatter::FULL,
|
||||
'GMT+05:12',
|
||||
-1);
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECTF--
|
||||
string(44) "Sunday, January 1, 2012 5:12:00 AM GMT+05:12"
|
||||
string(44) "Sunday, January 1, 2012 5:12:00 AM GMT+05:12"
|
||||
string(42) "Sunday, Tevet 6, 5772 5:12:00 AM GMT+05:12"
|
||||
|
||||
Warning: IntlDateFormatter::__construct(): datefmt_create: invalid value for calendar type; it must be one of IntlDateFormatter::TRADITIONAL (locale's default calendar) or IntlDateFormatter::GREGORIAN in %s on line %d
|
||||
==DONE==
|
||||
@@ -19,7 +19,7 @@ function ut_main()
|
||||
if( $num === false )
|
||||
return $fmt->getErrorMessage() . " (" . $fmt->getErrorCode() . ")\n";
|
||||
else
|
||||
return "Ooops, an error should have occured.";
|
||||
return "Ooops, an error should have occurred.";
|
||||
}
|
||||
|
||||
include_once( 'ut_common.inc' );
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--TEST--
|
||||
numfmt_get/set_attribute() icu < 4.2
|
||||
numfmt_get/set_attribute()
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if(version_compare(INTL_ICU_VERSION, '4.2', '<') != 1) print 'skip'; ?>
|
||||
<?php if(version_compare(INTL_ICU_VERSION, '4.2', '<') != 1) print 'skip for ICU 4.4+'; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -29,7 +29,7 @@ function ut_main()
|
||||
'ROUNDING_MODE' => array( NumberFormatter::ROUNDING_MODE, 1, 12345.123456 ),
|
||||
'ROUNDING_INCREMENT' => array( NumberFormatter::ROUNDING_INCREMENT, (float)2, 12345.123456 ),
|
||||
'FORMAT_WIDTH' => array( NumberFormatter::FORMAT_WIDTH, 27, 12345.123456 ),
|
||||
'PADDING_POSITION' => array( NumberFormatter::PADDING_POSITION, 21, 12345.123456 ),
|
||||
'PADDING_POSITION' => array( NumberFormatter::PADDING_POSITION, 2, 12345.123456 ),
|
||||
'SECONDARY_GROUPING_SIZE' => array( NumberFormatter::SECONDARY_GROUPING_SIZE, 2, 12345.123456 ),
|
||||
'SIGNIFICANT_DIGITS_USED' => array( NumberFormatter::SIGNIFICANT_DIGITS_USED, 1, 12345.123456 ),
|
||||
'MIN_SIGNIFICANT_DIGITS' => array( NumberFormatter::MIN_SIGNIFICANT_DIGITS, 3, 1 ),
|
||||
@@ -159,7 +159,7 @@ Setting attribute: ok
|
||||
New attribute value: 1 ; Format result: '0,012,345.12345' ; Parse result: 12345.12345
|
||||
|
||||
Attribute ROUNDING_INCREMENT
|
||||
Old attribute value: 1.0E-5 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346
|
||||
Old attribute value: 0 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346
|
||||
Setting attribute: ok
|
||||
New attribute value: 2 ; Format result: '0,012,346.00000' ; Parse result: 12346
|
||||
|
||||
@@ -171,7 +171,7 @@ New attribute value: 27 ; Format result: '************0,012,345.12346' ; Parse
|
||||
Attribute PADDING_POSITION
|
||||
Old attribute value: 0 ; Format result: '************0,012,345.12346' ; Parse result: 12345.12346
|
||||
Setting attribute: ok
|
||||
New attribute value: 21 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346
|
||||
New attribute value: 2 ; Format result: '0,012,345.12346************' ; Parse result: 12345.12346
|
||||
|
||||
Attribute SECONDARY_GROUPING_SIZE
|
||||
Old attribute value: 0 ; Format result: '************0,012,345.12346' ; Parse result: 12345.12346
|
||||
|
||||
@@ -1,194 +0,0 @@
|
||||
--TEST--
|
||||
numfmt_get/set_attribute() icu >= 4.8
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if(version_compare(INTL_ICU_VERSION, '4.8') < 0) print 'skip'; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Get/set various number formatting attributes.
|
||||
*/
|
||||
|
||||
|
||||
function ut_main()
|
||||
{
|
||||
// attr_name => array( attr, value )
|
||||
$attributes = array(
|
||||
'PARSE_INT_ONLY' => array( NumberFormatter::PARSE_INT_ONLY, 1, 12345.123456 ),
|
||||
'GROUPING_USED' => array( NumberFormatter::GROUPING_USED, 0, 12345.123456 ),
|
||||
'DECIMAL_ALWAYS_SHOWN' => array( NumberFormatter::DECIMAL_ALWAYS_SHOWN, 1, 12345 ),
|
||||
'MAX_INTEGER_DIGITS' => array( NumberFormatter::MAX_INTEGER_DIGITS, 2, 12345.123456 ),
|
||||
'MIN_INTEGER_DIGITS' => array( NumberFormatter::MIN_INTEGER_DIGITS, 20, 12345.123456 ),
|
||||
'INTEGER_DIGITS' => array( NumberFormatter::INTEGER_DIGITS, 7, 12345.123456 ),
|
||||
'MAX_FRACTION_DIGITS' => array( NumberFormatter::MAX_FRACTION_DIGITS, 2, 12345.123456 ),
|
||||
'MIN_FRACTION_DIGITS' => array( NumberFormatter::MIN_FRACTION_DIGITS, 20, 12345.123456 ),
|
||||
'FRACTION_DIGITS' => array( NumberFormatter::FRACTION_DIGITS, 5, 12345.123456 ),
|
||||
'MULTIPLIER' => array( NumberFormatter::MULTIPLIER, 2, 12345.123456 ),
|
||||
'GROUPING_SIZE' => array( NumberFormatter::GROUPING_SIZE, 2, 12345.123456 ),
|
||||
'ROUNDING_MODE' => array( NumberFormatter::ROUNDING_MODE, 1, 12345.123456 ),
|
||||
'ROUNDING_INCREMENT' => array( NumberFormatter::ROUNDING_INCREMENT, (float)2, 12345.123456 ),
|
||||
'FORMAT_WIDTH' => array( NumberFormatter::FORMAT_WIDTH, 27, 12345.123456 ),
|
||||
'PADDING_POSITION' => array( NumberFormatter::PADDING_POSITION, 21, 12345.123456 ),
|
||||
'SECONDARY_GROUPING_SIZE' => array( NumberFormatter::SECONDARY_GROUPING_SIZE, 2, 12345.123456 ),
|
||||
'SIGNIFICANT_DIGITS_USED' => array( NumberFormatter::SIGNIFICANT_DIGITS_USED, 1, 12345.123456 ),
|
||||
'MIN_SIGNIFICANT_DIGITS' => array( NumberFormatter::MIN_SIGNIFICANT_DIGITS, 3, 1 ),
|
||||
'MAX_SIGNIFICANT_DIGITS' => array( NumberFormatter::MAX_SIGNIFICANT_DIGITS, 4, 12345.123456 ),
|
||||
// 'LENIENT_PARSE' => array( NumberFormatter::LENIENT_PARSE, 2, 12345.123456 )
|
||||
);
|
||||
|
||||
$res_str = '';
|
||||
|
||||
$fmt = ut_nfmt_create( "en_US", NumberFormatter::DECIMAL );
|
||||
|
||||
foreach( $attributes as $attr_name => $args )
|
||||
{
|
||||
list( $attr, $new_val, $number ) = $args;
|
||||
$res_str .= "\nAttribute $attr_name\n";
|
||||
|
||||
// Get original value of the attribute.
|
||||
$orig_val = ut_nfmt_get_attribute( $fmt, $attr );
|
||||
|
||||
// Format the number using the original attribute value.
|
||||
$rc = ut_nfmt_format( $fmt, $number );
|
||||
|
||||
$ps = ut_nfmt_parse( $fmt, $rc );
|
||||
|
||||
$res_str .= sprintf( "Old attribute value: %s ; Format result: %s ; Parse result: %s\n",
|
||||
dump( $orig_val ),
|
||||
dump( $rc ),
|
||||
dump( $ps ) );
|
||||
|
||||
// Set new attribute value.
|
||||
$rc = ut_nfmt_set_attribute( $fmt, $attr, $new_val );
|
||||
if( $rc )
|
||||
$res_str .= "Setting attribute: ok\n";
|
||||
else
|
||||
$res_str .= sprintf( "Setting attribute failed: %s\n", ut_nfmt_get_error_message( $fmt ) );
|
||||
|
||||
// Format the number using the new value.
|
||||
$rc = ut_nfmt_format( $fmt, $number );
|
||||
|
||||
// Get current value of the attribute and check if it equals $new_val.
|
||||
$attr_val_check = ut_nfmt_get_attribute( $fmt, $attr );
|
||||
if( $attr_val_check !== $new_val )
|
||||
$res_str .= "ERROR: New $attr_name attribute value has not been set correctly.\n";
|
||||
|
||||
$ps = ut_nfmt_parse( $fmt, $rc );
|
||||
|
||||
$res_str .= sprintf( "New attribute value: %s ; Format result: %s ; Parse result: %s\n",
|
||||
dump( $new_val ),
|
||||
dump( $rc ),
|
||||
dump( $ps ) );
|
||||
|
||||
|
||||
// Restore original attribute of the value
|
||||
if( $attr != NumberFormatter::INTEGER_DIGITS && $attr != NumberFormatter::FRACTION_DIGITS
|
||||
&& $attr != NumberFormatter::FORMAT_WIDTH && $attr != NumberFormatter::SIGNIFICANT_DIGITS_USED )
|
||||
ut_nfmt_set_attribute( $fmt, $attr, $orig_val );
|
||||
}
|
||||
|
||||
return $res_str;
|
||||
}
|
||||
|
||||
include_once( 'ut_common.inc' );
|
||||
|
||||
// Run the test
|
||||
ut_run();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Attribute PARSE_INT_ONLY
|
||||
Old attribute value: 0 ; Format result: '12,345.123' ; Parse result: 12345.123
|
||||
Setting attribute: ok
|
||||
New attribute value: 1 ; Format result: '12,345.123' ; Parse result: 12345
|
||||
|
||||
Attribute GROUPING_USED
|
||||
Old attribute value: 1 ; Format result: '12,345.123' ; Parse result: 12345.123
|
||||
Setting attribute: ok
|
||||
New attribute value: 0 ; Format result: '12345.123' ; Parse result: 12345.123
|
||||
|
||||
Attribute DECIMAL_ALWAYS_SHOWN
|
||||
Old attribute value: 0 ; Format result: '12,345' ; Parse result: 12345
|
||||
Setting attribute: ok
|
||||
New attribute value: 1 ; Format result: '12,345.' ; Parse result: 12345
|
||||
|
||||
Attribute MAX_INTEGER_DIGITS
|
||||
Old attribute value: 309 ; Format result: '12,345.123' ; Parse result: 12345.123
|
||||
Setting attribute: ok
|
||||
New attribute value: 2 ; Format result: '45.123' ; Parse result: 45.123
|
||||
|
||||
Attribute MIN_INTEGER_DIGITS
|
||||
Old attribute value: 1 ; Format result: '12,345.123' ; Parse result: 12345.123
|
||||
Setting attribute: ok
|
||||
New attribute value: 20 ; Format result: '00,000,000,000,000,012,345.123' ; Parse result: 12345.123
|
||||
|
||||
Attribute INTEGER_DIGITS
|
||||
Old attribute value: 1 ; Format result: '12,345.123' ; Parse result: 12345.123
|
||||
Setting attribute: ok
|
||||
New attribute value: 7 ; Format result: '0,012,345.123' ; Parse result: 12345.123
|
||||
|
||||
Attribute MAX_FRACTION_DIGITS
|
||||
Old attribute value: 3 ; Format result: '0,012,345.123' ; Parse result: 12345.123
|
||||
Setting attribute: ok
|
||||
New attribute value: 2 ; Format result: '0,012,345.12' ; Parse result: 12345.12
|
||||
|
||||
Attribute MIN_FRACTION_DIGITS
|
||||
Old attribute value: 0 ; Format result: '0,012,345.123' ; Parse result: 12345.123
|
||||
Setting attribute: ok
|
||||
New attribute value: 20 ; Format result: '0,012,345.12345600000000000000' ; Parse result: 12345.123456
|
||||
|
||||
Attribute FRACTION_DIGITS
|
||||
Old attribute value: 0 ; Format result: '0,012,345.123456' ; Parse result: 12345.123456
|
||||
Setting attribute: ok
|
||||
New attribute value: 5 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346
|
||||
|
||||
Attribute MULTIPLIER
|
||||
Old attribute value: 1 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346
|
||||
Setting attribute: ok
|
||||
New attribute value: 2 ; Format result: '0,024,690.24691' ; Parse result: 12345.123455
|
||||
|
||||
Attribute GROUPING_SIZE
|
||||
Old attribute value: 3 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346
|
||||
Setting attribute: ok
|
||||
New attribute value: 2 ; Format result: '0,01,23,45.12346' ; Parse result: 12345.12346
|
||||
|
||||
Attribute ROUNDING_MODE
|
||||
Old attribute value: 4 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346
|
||||
Setting attribute: ok
|
||||
New attribute value: 1 ; Format result: '0,012,345.12345' ; Parse result: 12345.12345
|
||||
|
||||
Attribute ROUNDING_INCREMENT
|
||||
Old attribute value: 0 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346
|
||||
Setting attribute: ok
|
||||
New attribute value: 2 ; Format result: '0,012,346.00000' ; Parse result: 12346
|
||||
|
||||
Attribute FORMAT_WIDTH
|
||||
Old attribute value: 0 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346
|
||||
Setting attribute: ok
|
||||
New attribute value: 27 ; Format result: '************0,012,345.12346' ; Parse result: 12345.12346
|
||||
|
||||
Attribute PADDING_POSITION
|
||||
Old attribute value: 0 ; Format result: '************0,012,345.12346' ; Parse result: 12345.12346
|
||||
Setting attribute: ok
|
||||
New attribute value: 21 ; Format result: '0,012,345.12346' ; Parse result: 12345.12346
|
||||
|
||||
Attribute SECONDARY_GROUPING_SIZE
|
||||
Old attribute value: 0 ; Format result: '************0,012,345.12346' ; Parse result: 12345.12346
|
||||
Setting attribute: ok
|
||||
New attribute value: 2 ; Format result: '************00,12,345.12346' ; Parse result: 12345.12346
|
||||
|
||||
Attribute SIGNIFICANT_DIGITS_USED
|
||||
Old attribute value: 0 ; Format result: '************0,012,345.12346' ; Parse result: 12345.12346
|
||||
Setting attribute: ok
|
||||
New attribute value: 1 ; Format result: '*******************12,345.1' ; Parse result: 12345.1
|
||||
|
||||
Attribute MIN_SIGNIFICANT_DIGITS
|
||||
Old attribute value: 1 ; Format result: '**************************1' ; Parse result: 1
|
||||
Setting attribute: ok
|
||||
New attribute value: 3 ; Format result: '***********************1.00' ; Parse result: 1
|
||||
|
||||
Attribute MAX_SIGNIFICANT_DIGITS
|
||||
Old attribute value: 6 ; Format result: '*******************12,345.1' ; Parse result: 12345.1
|
||||
Setting attribute: ok
|
||||
New attribute value: 4 ; Format result: '*********************12,350' ; Parse result: 12350
|
||||
@@ -0,0 +1,26 @@
|
||||
--TEST--
|
||||
IntlCalendar::setTime() basic test
|
||||
--INI--
|
||||
date.timezone=Atlantic/Azores
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl'))
|
||||
die('skip intl extension not enabled');
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
|
||||
$r = new ResourceBundle('en_US', NULL);
|
||||
$c = $r->get('calendar')->get('gregorian')->get('DateTimePatterns')->get(0);
|
||||
var_dump($c);
|
||||
|
||||
ini_set('intl.default_locale', 'pt_PT');
|
||||
$r = new ResourceBundle(NULL, NULL);
|
||||
$c = $r->get('calendar')->get('gregorian')->get('DateTimePatterns')->get(0);
|
||||
var_dump($c);
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
string(14) "h:mm:ss a zzzz"
|
||||
string(12) "H:mm:ss zzzz"
|
||||
==DONE==
|
||||
@@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
Bug #55610: ResourceBundle does not implement Traversable
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
include "resourcebundle.inc";
|
||||
|
||||
$r = new ResourceBundle( 'es', BUNDLE );
|
||||
|
||||
var_dump($r instanceof Traversable);
|
||||
var_dump(iterator_to_array($r->get('testarray')));
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(true)
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(8) "cadena 1"
|
||||
[1]=>
|
||||
string(8) "cadena 2"
|
||||
[2]=>
|
||||
string(8) "cadena 3"
|
||||
}
|
||||
+12
-9
@@ -302,7 +302,7 @@ static void json_encode_array(smart_str *buf, zval **val, int options TSRMLS_DC)
|
||||
smart_str_appendc(buf, ':');
|
||||
|
||||
json_pretty_print_char(buf, options, ' ' TSRMLS_CC);
|
||||
|
||||
|
||||
php_json_encode(buf, *data, options TSRMLS_CC);
|
||||
} else {
|
||||
if (need_comma) {
|
||||
@@ -320,7 +320,7 @@ static void json_encode_array(smart_str *buf, zval **val, int options TSRMLS_DC)
|
||||
smart_str_appendc(buf, ':');
|
||||
|
||||
json_pretty_print_char(buf, options, ' ' TSRMLS_CC);
|
||||
|
||||
|
||||
php_json_encode(buf, *data, options TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
@@ -331,7 +331,7 @@ static void json_encode_array(smart_str *buf, zval **val, int options TSRMLS_DC)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
--JSON_G(encoder_depth);
|
||||
json_pretty_print_char(buf, options, '\n' TSRMLS_CC);
|
||||
json_pretty_print_indent(buf, options TSRMLS_CC);
|
||||
@@ -351,6 +351,7 @@ static void json_escape_string(smart_str *buf, char *s, int len, int options TSR
|
||||
int pos = 0, ulen = 0;
|
||||
unsigned short us;
|
||||
unsigned short *utf16;
|
||||
size_t newlen;
|
||||
|
||||
if (len == 0) {
|
||||
smart_str_appendl(buf, "\"\"", 2);
|
||||
@@ -378,9 +379,9 @@ static void json_escape_string(smart_str *buf, char *s, int len, int options TSR
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
utf16 = (options & PHP_JSON_UNESCAPED_UNICODE) ? NULL : (unsigned short *) safe_emalloc(len, sizeof(unsigned short), 0);
|
||||
ulen = utf8_to_utf16(utf16, s, len);
|
||||
if (ulen <= 0) {
|
||||
@@ -402,6 +403,8 @@ static void json_escape_string(smart_str *buf, char *s, int len, int options TSR
|
||||
len = ulen;
|
||||
}
|
||||
|
||||
/* pre-allocate for string length plus 2 quotes */
|
||||
smart_str_alloc(buf, len+2, 0);
|
||||
smart_str_appendc(buf, '"');
|
||||
|
||||
while (pos < len)
|
||||
@@ -514,13 +517,13 @@ static void json_encode_serializable_object(smart_str *buf, zval *val, int optio
|
||||
zend_class_entry *ce = Z_OBJCE_P(val);
|
||||
zval *retval = NULL, fname;
|
||||
HashTable* myht;
|
||||
|
||||
|
||||
if (Z_TYPE_P(val) == IS_ARRAY) {
|
||||
myht = HASH_OF(val);
|
||||
} else {
|
||||
myht = Z_OBJPROP_P(val);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (myht && myht->nApplyCount > 1) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "recursion detected");
|
||||
smart_str_appendl(buf, "null", 4);
|
||||
@@ -533,7 +536,7 @@ static void json_encode_serializable_object(smart_str *buf, zval *val, int optio
|
||||
zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Failed calling %s::jsonSerialize()", ce->name);
|
||||
smart_str_appendl(buf, "null", sizeof("null") - 1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (EG(exception)) {
|
||||
/* Error already raised */
|
||||
|
||||
@@ -9,12 +9,8 @@ var_dump(json_encode("latin 1234 -/ russian мама мыла раму speci
|
||||
var_dump(json_encode("ab\xE0"));
|
||||
var_dump(json_encode("ab\xE0", JSON_UNESCAPED_UNICODE));
|
||||
?>
|
||||
--EXPECTF--
|
||||
--EXPECT--
|
||||
string(156) ""latin 1234 -\/ russian \u043c\u0430\u043c\u0430 \u043c\u044b\u043b\u0430 \u0440\u0430\u043c\u0443 specialchars \u0002 \b \n U+1D11E >\ud834\udd1e<""
|
||||
string(100) ""latin 1234 -\/ russian мама мыла раму specialchars \u0002 \b \n U+1D11E >𝄞<""
|
||||
|
||||
Warning: json_encode(): Invalid UTF-8 sequence in argument in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: json_encode(): Invalid UTF-8 sequence in argument in %s on line %d
|
||||
bool(false)
|
||||
string(4) "null"
|
||||
string(4) "null"
|
||||
+11
-2
@@ -677,9 +677,18 @@ is_string:
|
||||
static xmlParserInputPtr _php_libxml_pre_ext_ent_loader(const char *URL,
|
||||
const char *ID, xmlParserCtxtPtr context)
|
||||
{
|
||||
TSRMLS_FETCH();
|
||||
|
||||
/* Check whether we're running in a PHP context, since the entity loader
|
||||
* we've defined is an application level (true global) setting */
|
||||
if (xmlGenericError == php_libxml_error_handler) {
|
||||
* we've defined is an application level (true global) setting.
|
||||
* If we are, we also want to check whether we've finished activating
|
||||
* the modules (RINIT phase). Using our external entity loader during a
|
||||
* RINIT should not be problem per se (though during MINIT it is, because
|
||||
* we don't even have a resource list by then), but then whether one
|
||||
* extension would be using the custom external entity loader or not
|
||||
* could depend on extension loading order
|
||||
* (if _php_libxml_per_request_initialization */
|
||||
if (xmlGenericError == php_libxml_error_handler && PG(modules_activated)) {
|
||||
return _php_libxml_external_entity_loader(URL, ID, context);
|
||||
} else {
|
||||
return _php_libxml_default_entity_loader(URL, ID, context);
|
||||
|
||||
@@ -4,11 +4,12 @@ Bug #61367: open_basedir bypass in libxml RSHUTDOWN: read test
|
||||
<?php if(!extension_loaded('dom')) echo 'skip'; ?>
|
||||
--INI--
|
||||
open_basedir=.
|
||||
; Suppress spurious "Trying to get property of non-object" notices
|
||||
error_reporting=E_ALL & ~E_NOTICE
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Note: Using error_reporting=E_ALL & ~E_NOTICE to supress "Trying to get property of non-object" notices.
|
||||
*/
|
||||
class StreamExploiter {
|
||||
public function stream_close ( ) {
|
||||
$doc = new DOMDocument;
|
||||
|
||||
@@ -4,8 +4,6 @@ Bug #61367: open_basedir bypass in libxml RSHUTDOWN: write test
|
||||
<?php if(!extension_loaded('dom')) echo 'skip'; ?>
|
||||
--INI--
|
||||
open_basedir=.
|
||||
; Suppress spurious "Trying to get property of non-object" notices
|
||||
error_reporting=E_ALL & ~E_NOTICE
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
+1
-1
@@ -162,7 +162,7 @@ void php_clear_stmt_bind(MY_STMT *stmt TSRMLS_DC)
|
||||
{
|
||||
if (stmt->stmt) {
|
||||
if (mysqli_stmt_close(stmt->stmt, TRUE)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error occured while closing statement");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error occurred while closing statement");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
--TEST--
|
||||
Bug #62046 mysqli@mysqlnd can't iterate over stored sets after call to mysqli_stmt_reset()
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
|
||||
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
|
||||
printf("[001] Connect failed, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
}
|
||||
if (FALSE === ($stmt = $link->prepare('SELECT 42'))) {
|
||||
printf("[002] Prepare failed, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
}
|
||||
if (FALSE === $stmt->execute()) {
|
||||
printf("[003] Execute failed, [%d] %s\n", $stmt->errorno, $stmt->error);
|
||||
}
|
||||
if (FALSE === $stmt->store_result()) {
|
||||
printf("[004] store_result failed, [%d] %s\n", $stmt->errorno, $stmt->error);
|
||||
}
|
||||
$one = NULL;
|
||||
if (FALSE === $stmt->bind_result($one)) {
|
||||
printf("[005] bind_result failed, [%d] %s\n", $stmt->errorno, $stmt->error);
|
||||
}
|
||||
if (FALSE === $stmt->reset()) {
|
||||
printf("[006] bind_result failed, [%d] %s\n", $stmt->errorno, $stmt->error);
|
||||
}
|
||||
while ($stmt->fetch()) {
|
||||
var_dump($one);
|
||||
}
|
||||
$stmt->close();
|
||||
$link->close();
|
||||
echo "done!";
|
||||
?>
|
||||
--EXPECT--
|
||||
int(42)
|
||||
done!
|
||||
@@ -63,7 +63,7 @@ require_once('skipifconnectfailure.inc');
|
||||
// NOTE: the error message varies with the MySQL Server version, dump only the error code!
|
||||
printf("[009] [%d] (error message varies with the MySQL Server version, check the error code)\n", mysqli_stmt_errno($stmt));
|
||||
|
||||
/* an error occured: affected rows should return -1 */
|
||||
/* an error occurred: affected rows should return -1 */
|
||||
if (-1 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
|
||||
printf("[010] Expecting int/0, got %s/%s\n", gettype($tmp), $tmp);
|
||||
|
||||
|
||||
@@ -764,6 +764,13 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
|
||||
conn->server_version = mnd_pestrdup(greet_packet->server_version, conn->persistent);
|
||||
|
||||
conn->greet_charset = mysqlnd_find_charset_nr(greet_packet->charset_no);
|
||||
if (!conn->greet_charset) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING,
|
||||
"Server sent charset (%d) unknown to the client. Please, report to the developers", greet_packet->charset_no);
|
||||
SET_CLIENT_ERROR(*conn->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE,
|
||||
"Server sent charset unknown to the client. Please, report to the developers");
|
||||
goto err;
|
||||
}
|
||||
/* we allow load data local infile by default */
|
||||
mysql_flags |= MYSQLND_CAPABILITIES;
|
||||
|
||||
|
||||
@@ -450,20 +450,27 @@ const MYSQLND_CHARSET mysqlnd_charsets[] =
|
||||
{ 6, "hp8", "hp8_english_ci", 1, 1, "", NULL, NULL},
|
||||
{ 7, "koi8r", "koi8r_general_ci", 1, 1, "", NULL, NULL},
|
||||
{ 8, "latin1", "latin1_swedish_ci", 1, 1, "", NULL, NULL},
|
||||
{ 5, "latin1", "latin1_german_ci", 1, 1, "", NULL, NULL}, /* should be after 0x9 because swedish_ci is the default collation */
|
||||
{ 9, "latin2", "latin2_general_ci", 1, 1, "", NULL, NULL},
|
||||
{ 2, "latin2", "latin2_czech_cs", 1, 1, "", NULL, NULL}, /* should be after 0x9 because general_ci is the default collation */
|
||||
{ 10, "swe7", "swe7_swedish_ci", 1, 1, "", NULL, NULL},
|
||||
{ 11, "ascii", "ascii_general_ci", 1, 1, "", NULL, NULL},
|
||||
{ 12, "ujis", "ujis_japanese_ci", 1, 3, "", mysqlnd_mbcharlen_ujis, check_mb_ujis},
|
||||
{ 13, "sjis", "sjis_japanese_ci", 1, 2, "", mysqlnd_mbcharlen_sjis, check_mb_sjis},
|
||||
{ 16, "hebrew", "hebrew_general_ci", 1, 1, "", NULL, NULL},
|
||||
{ 17, "filename", "filename", 1, 5, "", NULL, NULL},
|
||||
{ 18, "tis620", "tis620_thai_ci", 1, 1, "", NULL, NULL},
|
||||
{ 19, "euckr", "euckr_korean_ci", 1, 2, "", mysqlnd_mbcharlen_euckr, check_mb_euckr},
|
||||
{ 21, "latin2", "latin2_hungarian_ci", 1, 1, "", NULL, NULL},
|
||||
{ 27, "latin2", "latin2_croatian_ci", 1, 1, "", NULL, NULL},
|
||||
{ 22, "koi8u", "koi8u_general_ci", 1, 1, "", NULL, NULL},
|
||||
{ 24, "gb2312", "gb2312_chinese_ci", 1, 2, "", mysqlnd_mbcharlen_gb2312, check_mb_gb2312},
|
||||
{ 25, "greek", "greek_general_ci", 1, 1, "", NULL, NULL},
|
||||
{ 26, "cp1250", "cp1250_general_ci", 1, 1, "", NULL, NULL},
|
||||
{ 28, "gbk", "gbk_chinese_ci", 1, 2, "", mysqlnd_mbcharlen_gbk, check_mb_gbk},
|
||||
{ 30, "latin5", "latin5_turkish_ci", 1, 1, "", NULL, NULL},
|
||||
{ 31, "latin1", "latin1_german2_ci", 1, 1, "", NULL, NULL},
|
||||
{ 15, "latin1", "latin1_danish_ci", 1, 1, "", NULL, NULL},
|
||||
{ 32, "armscii8", "armscii8_general_ci", 1, 1, "", NULL, NULL},
|
||||
{ 33, UTF8_MB3, UTF8_MB3"_general_ci", 1, 3, "UTF-8 Unicode", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
|
||||
{ 35, "ucs2", "ucs2_general_ci", 2, 2, "UCS-2 Unicode", mysqlnd_mbcharlen_ucs2, check_mb_ucs2},
|
||||
@@ -473,22 +480,11 @@ const MYSQLND_CHARSET mysqlnd_charsets[] =
|
||||
{ 39, "macroman", "macroman_general_ci", 1, 1, "", NULL, NULL},
|
||||
{ 40, "cp852", "cp852_general_ci", 1, 1, "", NULL, NULL},
|
||||
{ 41, "latin7", "latin7_general_ci", 1, 1, "", NULL, NULL},
|
||||
{ 51, "cp1251", "cp1251_general_ci", 1, 1, "", NULL, NULL},
|
||||
{ 20, "latin7", "latin7_estonian_cs", 1, 1, "", NULL, NULL},
|
||||
{ 57, "cp1256", "cp1256_general_ci", 1, 1, "", NULL, NULL},
|
||||
{ 59, "cp1257", "cp1257_general_ci", 1, 1, "", NULL, NULL},
|
||||
{ 63, "binary", "binary", 1, 1, "", NULL, NULL},
|
||||
{ 92, "geostd8", "geostd8_general_ci", 1, 1, "", NULL, NULL},
|
||||
{ 95, "cp932", "cp932_japanese_ci", 1, 2, "", mysqlnd_mbcharlen_cp932, check_mb_cp932},
|
||||
{ 97, "eucjpms", "eucjpms_japanese_ci", 1, 3, "", mysqlnd_mbcharlen_eucjpms, check_mb_eucjpms},
|
||||
{ 2, "latin2", "latin2_czech_cs", 1, 1, "", NULL, NULL},
|
||||
{ 5, "latin1", "latin1_german_ci", 1, 1, "", NULL, NULL},
|
||||
{ 14, "cp1251", "cp1251_bulgarian_ci", 1, 1, "", NULL, NULL},
|
||||
{ 15, "latin1", "latin1_danish_ci", 1, 1, "", NULL, NULL},
|
||||
{ 17, "filename", "filename", 1, 5, "", NULL, NULL},
|
||||
{ 20, "latin7", "latin7_estonian_cs", 1, 1, "", NULL, NULL},
|
||||
{ 21, "latin2", "latin2_hungarian_ci", 1, 1, "", NULL, NULL},
|
||||
{ 23, "cp1251", "cp1251_ukrainian_ci", 1, 1, "", NULL, NULL},
|
||||
{ 27, "latin2", "latin2_croatian_ci", 1, 1, "", NULL, NULL},
|
||||
{ 29, "cp1257", "cp1257_lithunian_ci", 1, 1, "", NULL, NULL},
|
||||
{ 31, "latin1", "latin1_german2_ci", 1, 1, "", NULL, NULL},
|
||||
{ 34, "cp1250", "cp1250_czech_cs", 1, 1, "", NULL, NULL},
|
||||
@@ -500,6 +496,9 @@ const MYSQLND_CHARSET mysqlnd_charsets[] =
|
||||
{ 47, "latin1", "latin1_bin", 1, 1, "", NULL, NULL},
|
||||
{ 48, "latin1", "latin1_general_ci", 1, 1, "", NULL, NULL},
|
||||
{ 49, "latin1", "latin1_general_cs", 1, 1, "", NULL, NULL},
|
||||
{ 51, "cp1251", "cp1251_general_ci", 1, 1, "", NULL, NULL},
|
||||
{ 14, "cp1251", "cp1251_bulgarian_ci", 1, 1, "", NULL, NULL},
|
||||
{ 23, "cp1251", "cp1251_ukrainian_ci", 1, 1, "", NULL, NULL},
|
||||
{ 50, "cp1251", "cp1251_bin", 1, 1, "", NULL, NULL},
|
||||
{ 52, "cp1251", "cp1251_general_cs", 1, 1, "", NULL, NULL},
|
||||
{ 53, "macroman", "macroman_bin", 1, 1, "", NULL, NULL},
|
||||
@@ -509,8 +508,8 @@ const MYSQLND_CHARSET mysqlnd_charsets[] =
|
||||
#ifdef USED_TO_BE_SO_BEFORE_MYSQL_5_5
|
||||
{ 60, "armascii8", "armascii8_bin", 1, 1, "", NULL, NULL},
|
||||
#endif
|
||||
{ 60, "utf32", "utf32_general_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
|
||||
{ 61, "utf32", "utf32_bin", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
|
||||
/*55*/{ 60, "utf32", "utf32_general_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
|
||||
/*55*/{ 61, "utf32", "utf32_bin", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
|
||||
{ 65, "ascii", "ascii_bin", 1, 1, "", NULL, NULL},
|
||||
{ 66, "cp1250", "cp1250_bin", 1, 1, "", NULL, NULL},
|
||||
{ 67, "cp1256", "cp1256_bin", 1, 1, "", NULL, NULL},
|
||||
@@ -528,7 +527,6 @@ const MYSQLND_CHARSET mysqlnd_charsets[] =
|
||||
{ 80, "cp850", "cp850_bin", 1, 1, "", NULL, NULL},
|
||||
{ 81, "cp852", "cp852_bin", 1, 1, "", NULL, NULL},
|
||||
{ 82, "swe7", "swe7_bin", 1, 1, "", NULL, NULL},
|
||||
{ 93, "geostd8", "geostd8_bin", 1, 1, "", NULL, NULL},
|
||||
{ 83, UTF8_MB3, UTF8_MB3"_bin", 1, 3, "UTF-8 Unicode", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
|
||||
{ 84, "big5", "big5_bin", 1, 2, "", mysqlnd_mbcharlen_big5, check_mb_big5},
|
||||
{ 85, "euckr", "euckr_bin", 1, 2, "", mysqlnd_mbcharlen_euckr, check_mb_euckr},
|
||||
@@ -538,10 +536,14 @@ const MYSQLND_CHARSET mysqlnd_charsets[] =
|
||||
{ 89, "tis620", "tis620_bin", 1, 1, "", NULL, NULL},
|
||||
{ 90, "ucs2", "ucs2_bin", 2, 2, "UCS-2 Unicode", mysqlnd_mbcharlen_ucs2, check_mb_ucs2},
|
||||
{ 91, "ujis", "ujis_bin", 1, 3, "", mysqlnd_mbcharlen_ujis, check_mb_ujis},
|
||||
{ 92, "geostd8", "geostd8_general_ci", 1, 1, "", NULL, NULL},
|
||||
{ 93, "geostd8", "geostd8_bin", 1, 1, "", NULL, NULL},
|
||||
{ 94, "latin1", "latin1_spanish_ci", 1, 1, "", NULL, NULL},
|
||||
{ 95, "cp932", "cp932_japanese_ci", 1, 2, "", mysqlnd_mbcharlen_cp932, check_mb_cp932},
|
||||
{ 96, "cp932", "cp932_bin", 1, 2, "", mysqlnd_mbcharlen_cp932, check_mb_cp932},
|
||||
{ 99, "cp1250", "cp1250_polish_ci", 1, 1, "", NULL, NULL},
|
||||
{ 97, "eucjpms", "eucjpms_japanese_ci", 1, 3, "", mysqlnd_mbcharlen_eucjpms, check_mb_eucjpms},
|
||||
{ 98, "eucjpms", "eucjpms_bin", 1, 3, "", mysqlnd_mbcharlen_eucjpms, check_mb_eucjpms},
|
||||
{ 99, "cp1250", "cp1250_polish_ci", 1, 1, "", NULL, NULL},
|
||||
{ 128, "ucs2", "ucs2_unicode_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2},
|
||||
{ 129, "ucs2", "ucs2_icelandic_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2},
|
||||
{ 130, "ucs2", "ucs2_latvian_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2},
|
||||
@@ -562,7 +564,35 @@ const MYSQLND_CHARSET mysqlnd_charsets[] =
|
||||
{ 145, "ucs2", "ucs2_esperanto_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2},
|
||||
{ 146, "ucs2", "ucs2_hungarian_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2},
|
||||
{ 147, "ucs2", "ucs2_sinhala_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2},
|
||||
{ 149, "ucs2", "ucs2_croatian_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2}, /* MDB */
|
||||
{ 148, "ucs2", "ucs2_german2_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2},
|
||||
{ 149, "ucs2", "ucs2_croatian_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2},
|
||||
{ 150, "ucs2", "ucs2_unicode_520_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2},
|
||||
{ 151, "ucs2", "ucs2_vietnamese_ci", 2, 2, "", mysqlnd_mbcharlen_ucs2, check_mb_ucs2},
|
||||
|
||||
/*56*/{160, "utf32", "utf32_unicode_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
|
||||
/*56*/{161, "utf32", "utf32_icelandic_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
|
||||
/*56*/{162, "utf32", "utf32_latvian_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
|
||||
/*56*/{163, "utf32", "utf32_romanian_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
|
||||
/*56*/{164, "utf32", "utf32_slovenian_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
|
||||
/*56*/{165, "utf32", "utf32_polish_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
|
||||
/*56*/{166, "utf32", "utf32_estonian_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
|
||||
/*56*/{167, "utf32", "utf32_spanish_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
|
||||
/*56*/{168, "utf32", "utf32_swedish_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
|
||||
/*56*/{169, "utf32", "utf32_turkish_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
|
||||
/*56*/{170, "utf32", "utf32_czech_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
|
||||
/*56*/{171, "utf32", "utf32_danish_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
|
||||
/*56*/{172, "utf32", "utf32_lithuanian_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
|
||||
/*56*/{173, "utf32", "utf32_slovak_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
|
||||
/*56*/{174, "utf32", "utf32_spanish2_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
|
||||
/*56*/{175, "utf32", "utf32_roman_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
|
||||
/*56*/{176, "utf32", "utf32_persian_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
|
||||
/*56*/{177, "utf32", "utf32_esperanto_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
|
||||
/*56*/{178, "utf32", "utf32_hungarian_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
|
||||
/*56*/{179, "utf32", "utf32_sinhala_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
|
||||
/*56*/{180, "utf32", "utf32_german2_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
|
||||
/*56*/{181, "utf32", "utf32_croatian_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
|
||||
/*56*/{182, "utf32", "utf32_unicode_520_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
|
||||
/*56*/{183, "utf32", "utf32_vietnamese_ci", 4, 4, "UTF-32 Unicode", mysqlnd_mbcharlen_utf32, check_mb_utf32},
|
||||
|
||||
{ 192, UTF8_MB3, UTF8_MB3"_general_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
|
||||
{ 193, UTF8_MB3, UTF8_MB3"_icelandic_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
|
||||
@@ -571,7 +601,7 @@ const MYSQLND_CHARSET mysqlnd_charsets[] =
|
||||
{ 196, UTF8_MB3, UTF8_MB3"_slovenian_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
|
||||
{ 197, UTF8_MB3, UTF8_MB3"_polish_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
|
||||
{ 198, UTF8_MB3, UTF8_MB3"_estonian_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
|
||||
{ 119, UTF8_MB3, UTF8_MB3"_spanish_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
|
||||
{ 199, UTF8_MB3, UTF8_MB3"_spanish_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
|
||||
{ 200, UTF8_MB3, UTF8_MB3"_swedish_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
|
||||
{ 201, UTF8_MB3, UTF8_MB3"_turkish_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
|
||||
{ 202, UTF8_MB3, UTF8_MB3"_czech_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
|
||||
@@ -584,7 +614,10 @@ const MYSQLND_CHARSET mysqlnd_charsets[] =
|
||||
{ 209, UTF8_MB3, UTF8_MB3"_esperanto_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
|
||||
{ 210, UTF8_MB3, UTF8_MB3"_hungarian_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
|
||||
{ 211, UTF8_MB3, UTF8_MB3"_sinhala_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
|
||||
{ 213, UTF8_MB3, UTF8_MB3"_croatian_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, /*MDB*/
|
||||
{ 211, UTF8_MB3, UTF8_MB3"_german2_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
|
||||
{ 213, UTF8_MB3, UTF8_MB3"_croatian_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
|
||||
{ 214, UTF8_MB3, UTF8_MB3"_unicode_520_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
|
||||
{ 215, UTF8_MB3, UTF8_MB3"_vietnamese_ci", 1, 3, "", mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
|
||||
|
||||
{ 224, UTF8_MB4, UTF8_MB4"_unicode_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
|
||||
{ 225, UTF8_MB4, UTF8_MB4"_icelandic_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
|
||||
@@ -606,6 +639,10 @@ const MYSQLND_CHARSET mysqlnd_charsets[] =
|
||||
{ 241, UTF8_MB4, UTF8_MB4"_esperanto_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
|
||||
{ 242, UTF8_MB4, UTF8_MB4"_hungarian_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
|
||||
{ 243, UTF8_MB4, UTF8_MB4"_sinhala_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
|
||||
{ 244, UTF8_MB4, UTF8_MB4"_german2_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
|
||||
{ 245, UTF8_MB4, UTF8_MB4"_croatian_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
|
||||
{ 246, UTF8_MB4, UTF8_MB4"_unicode_520_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
|
||||
{ 247, UTF8_MB4, UTF8_MB4"_vietnamese_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
|
||||
|
||||
{ 254, UTF8_MB3, UTF8_MB3"_general_cs", 1, 3, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
|
||||
{ 0, NULL, NULL, 0, 0, NULL, NULL, NULL}
|
||||
|
||||
@@ -188,7 +188,7 @@ mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * filename, zen
|
||||
char tmp_buf[sizeof(conn->error_info->error)];
|
||||
int tmp_error_no;
|
||||
*is_warning = TRUE;
|
||||
/* error occured */
|
||||
/* error occurred */
|
||||
tmp_error_no = infile.local_infile_error(info, tmp_buf, sizeof(tmp_buf) TSRMLS_CC);
|
||||
SET_CLIENT_ERROR(*conn->error_info, tmp_error_no, UNKNOWN_SQLSTATE, tmp_buf);
|
||||
/* write empty packet to server */
|
||||
@@ -211,7 +211,7 @@ mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * filename, zen
|
||||
goto infile_error;
|
||||
}
|
||||
|
||||
/* error during read occured */
|
||||
/* error during read occurred */
|
||||
if (bufsize < 0) {
|
||||
char tmp_buf[sizeof(conn->error_info->error)];
|
||||
int tmp_error_no;
|
||||
|
||||
@@ -636,6 +636,8 @@ MYSQLND_METHOD(mysqlnd_stmt, execute)(MYSQLND_STMT * const s TSRMLS_DC)
|
||||
have it again.
|
||||
*/
|
||||
stmt->result->m.free_result_buffers(stmt->result TSRMLS_CC);
|
||||
|
||||
stmt->state = MYSQLND_STMT_PREPARED;
|
||||
} else if (stmt->state < MYSQLND_STMT_PREPARED) {
|
||||
/* Only initted - error */
|
||||
SET_CLIENT_ERROR(*conn->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE,
|
||||
@@ -1221,8 +1223,6 @@ MYSQLND_METHOD(mysqlnd_stmt, reset)(MYSQLND_STMT * const s TSRMLS_DC)
|
||||
COPY_CLIENT_ERROR(*stmt->error_info, *conn->error_info);
|
||||
}
|
||||
*stmt->upsert_status = *conn->upsert_status;
|
||||
|
||||
stmt->state = MYSQLND_STMT_PREPARED;
|
||||
}
|
||||
DBG_INF(ret == PASS? "PASS":"FAIL");
|
||||
DBG_RETURN(ret);
|
||||
@@ -1261,8 +1261,6 @@ MYSQLND_METHOD(mysqlnd_stmt, flush)(MYSQLND_STMT * const s TSRMLS_DC)
|
||||
stmt->result->m.skip_result(stmt->result TSRMLS_CC);
|
||||
}
|
||||
} while (mysqlnd_stmt_more_results(s) && mysqlnd_stmt_next_result(s) == PASS);
|
||||
|
||||
stmt->state = MYSQLND_STMT_PREPARED;
|
||||
}
|
||||
DBG_INF(ret == PASS? "PASS":"FAIL");
|
||||
DBG_RETURN(ret);
|
||||
|
||||
+1
-1
@@ -387,7 +387,7 @@ const zend_function_entry odbc_functions[] = {
|
||||
};
|
||||
/* }}} */
|
||||
|
||||
ZEND_DECLARE_MODULE_GLOBALS(odbc);
|
||||
ZEND_DECLARE_MODULE_GLOBALS(odbc)
|
||||
static PHP_GINIT_FUNCTION(odbc);
|
||||
|
||||
/* {{{ odbc_module_entry
|
||||
|
||||
+4
-4
@@ -816,7 +816,7 @@ PHP_FUNCTION(pcntl_exec)
|
||||
|
||||
if (execve(path, argv, envp) == -1) {
|
||||
PCNTL_G(last_error) = errno;
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error has occured: (errno %d) %s", errno, strerror(errno));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error has occurred: (errno %d) %s", errno, strerror(errno));
|
||||
}
|
||||
|
||||
/* Cleanup */
|
||||
@@ -826,7 +826,7 @@ PHP_FUNCTION(pcntl_exec)
|
||||
|
||||
if (execv(path, argv) == -1) {
|
||||
PCNTL_G(last_error) = errno;
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error has occured: (errno %d) %s", errno, strerror(errno));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error has occurred: (errno %d) %s", errno, strerror(errno));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1127,7 +1127,7 @@ PHP_FUNCTION(pcntl_getpriority)
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error %d: Invalid identifier flag", errno);
|
||||
break;
|
||||
default:
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error %d has occured", errno);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error %d has occurred", errno);
|
||||
break;
|
||||
}
|
||||
RETURN_FALSE;
|
||||
@@ -1167,7 +1167,7 @@ PHP_FUNCTION(pcntl_setpriority)
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error %d: Only a super user may attempt to increase the process priority", errno);
|
||||
break;
|
||||
default:
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error %d has occured", errno);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error %d has occurred", errno);
|
||||
break;
|
||||
}
|
||||
RETURN_FALSE;
|
||||
|
||||
@@ -13,5 +13,5 @@ unlink($file);
|
||||
Warning: pcntl_exec() expects at least 1 parameter, 0 given %s
|
||||
NULL
|
||||
|
||||
Warning: pcntl_exec(): Error has occured: (errno %d) %s
|
||||
Warning: pcntl_exec(): Error has occurred: (errno %d) %s
|
||||
bool(false)
|
||||
@@ -134,7 +134,7 @@ static int pdo_mysql_fill_stmt_from_result(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
|
||||
|
||||
row_count = mysql_affected_rows(H->server);
|
||||
if (row_count == (my_ulonglong)-1) {
|
||||
/* we either have a query that returned a result set or an error occured
|
||||
/* we either have a query that returned a result set or an error occurred
|
||||
lets see if we have access to a result set */
|
||||
if (!H->buffered) {
|
||||
S->result = mysql_use_result(H->server);
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
ZEND_GET_MODULE(pdo_mysql)
|
||||
#endif
|
||||
|
||||
ZEND_DECLARE_MODULE_GLOBALS(pdo_mysql);
|
||||
ZEND_DECLARE_MODULE_GLOBALS(pdo_mysql)
|
||||
|
||||
/*
|
||||
The default socket location is sometimes defined by configure.
|
||||
|
||||
@@ -760,7 +760,7 @@ static struct pdo_dbh_methods sqlite_methods = {
|
||||
|
||||
static char *make_filename_safe(const char *filename TSRMLS_DC)
|
||||
{
|
||||
if (*filename && strncmp(filename, ":memory:", sizeof(":memory:")-1)) {
|
||||
if (*filename && memcmp(filename, ":memory:", sizeof(":memory:"))) {
|
||||
char *fullpath = expand_filepath(filename, NULL TSRMLS_CC);
|
||||
|
||||
if (!fullpath) {
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
#!/bin/sh
|
||||
export SCRIPT_NAME=/front.phar.php
|
||||
export PATH_INFO=/index.php
|
||||
export SCRIPT_FILENAME=/home/cellog/workspace/php5/ext/phar/tests/front.phar.php
|
||||
export PATH_TRANSLATED=/home/cellog/workspace/php5/ext/phar/tests/front.phar.php
|
||||
export REDIRECT_STATUS=1
|
||||
export REQUEST_METHOD=GET
|
||||
export REQUEST_URI=/front.phar.php/index.php
|
||||
cd /home/cellog/workspace/php5
|
||||
ddd sapi/cgi/php-cgi &
|
||||
cd /home/cellog/workspace/php5/ext/phar
|
||||
@@ -1,139 +0,0 @@
|
||||
<?php
|
||||
|
||||
$notes = '
|
||||
BC BREAKING RELEASE
|
||||
BC breaks:
|
||||
* Phar object Compression API is rewritten. Use Phar::compress() and decompress(),
|
||||
Phar::compressFiles()/decompressFiles() and PharFileInfo->compress()/decompress().
|
||||
* phar.extract_list and Phar::getExtractList() are removed
|
||||
|
||||
Major feature functionality release
|
||||
* phar.cache_list allows web-based phar applications to run at equal or faster than
|
||||
their on-disk equivalent [Greg]
|
||||
* new default stub allows running of phar-based phars without phar extension [Greg/Steph]
|
||||
* add support for tar-based and zip-based phar archives [Greg]
|
||||
* add support for OpenSSL-based true signatures [Greg]
|
||||
* add support for signatures to tar-based phar archives [Greg]
|
||||
* add Phar::isFileFormat() [Greg]
|
||||
* add Phar::convertToExecutable(), Phar::convertToData() [Greg]
|
||||
* add Phar::compress() [Greg]
|
||||
* rename Phar::compressAllFiles() to compressFiles(), uncompressAllFiles() to
|
||||
decompressFiles() [Greg]
|
||||
* conversion to compressed or to other file formats automatically copies the archive
|
||||
to a new extension (i.e. ".phar" to ".phar.tar" or ".tar" to ".tar.gz") [Steph]
|
||||
* add Phar::webPhar() for running a web-based application unmodified
|
||||
directly from a phar archive [Greg]
|
||||
* file functions (fopen-based and stat-based) can be instructed to only look for
|
||||
relative paths within a phar via Phar::interceptFileFuncs()
|
||||
* add PharData class to allow manipulation/creation of non-executable tar and zip archives. [Steph]
|
||||
non-executable tar/zip manipulation is allowed even when phar.readonly=1 [Greg]
|
||||
* paths with . and .. work (phar://blah.phar/a/../b.php => phar://blah.phar/b.php) [Greg]
|
||||
* add support for mkdir()/rmdir() and support for empty directories to phar file format [Greg]
|
||||
* add option to compress the entire phar file for phar/tar file format [Greg]
|
||||
* implement Phar::isCompressed() returning 0, Phar::GZ or Phar::BZ2 [Greg]
|
||||
* implement Phar::copy(string $from, string $to) [Greg]
|
||||
* implement Phar::running(), returns path or URL to currently executed phar
|
||||
* implement Phar::buildFromIterator(Iterator $it[, string $base_directory]) [Greg]
|
||||
* implement Phar::buildFromDirectory(string $base_directory[, string $regex]) [Steph]
|
||||
* implement Phar::mount() for mounting external paths or files to locations inside a phar [Greg]
|
||||
* add Phar::delete() [Greg]
|
||||
* implement Phar::unlinkArchive() [Greg]
|
||||
|
||||
Security addition
|
||||
* aliases are validated so that they contain no directory separators as intended
|
||||
* on conversion to other formats, user-supplied aliases are validated
|
||||
|
||||
Changes since 2.0.0RC2:
|
||||
fixed PHP Bug #49021: phar tar signature algorithm reports as Unknown (0) in
|
||||
getSignature() call
|
||||
fixed PHP Bug #49020: phar misinterprets ustar long filename standard
|
||||
fixed PHP Bug #49018: phar tar stores long filenames with prefix/name reversed
|
||||
fixed PHP Bug #48791: open office files always reported as corrupted
|
||||
fixed PHP Bug #48783: make install will fail saying phar file exists
|
||||
fixed PHP Bug #48740: PHAR install fails when INSTALL_ROOT is not the final install location
|
||||
fixed PHP Bug #48681: openssl signature verification for tar archives broken
|
||||
fixed PHP Bug #48377: error message unclear on converting phar with existing file
|
||||
fixed isset() on sub-directories (isset("blah") if file "blah/foo.php" exists)
|
||||
|
||||
make phar work in PHP 6
|
||||
Changes since 2.0.0RC1:
|
||||
security vulnerability in handling of long tar filenames fixed
|
||||
fixed PECL Bug #14646: phar error message unclear with php stream wrappers
|
||||
fixed PECL Bug #16338: php_stream_copy_to_stream{,_ex}()
|
||||
fixed PHP Bug #48257: PharData throws an exception with non-phar tar
|
||||
fixed PHP Bug #47085: rename() returns true even if the file in PHAR does not exist
|
||||
fixed PHP Bug #46032: PharData::__construct() - wrong memory read
|
||||
fixed PHP Bug #46060: Phar::addEmptyDir() breaks
|
||||
fixed PHP Bug #45907: undefined reference to \'PHP_SHA512Init\'
|
||||
fixed PHP Bug #45726: PHP_Archive / Archive.php missing
|
||||
Changes since 2.0.0a2: many bugfixes, removal of phar.extract_list, compression API refactored,
|
||||
conversion API refactored
|
||||
Changes since 2.0.0b1: addition of phar.cache_list, many performance improvements and bugfixes
|
||||
implement OpenSSL asynchronous true package signing
|
||||
add support for package signing to tar-based archives
|
||||
require PHP 5.2.1+
|
||||
';
|
||||
|
||||
if (!class_exists("Phar") && !extension_loaded("Phar")) {
|
||||
die("Extension phar not present");
|
||||
}
|
||||
error_reporting(E_ALL & ~E_DEPRECATED);
|
||||
|
||||
require_once 'PEAR/PackageFileManager2.php';
|
||||
|
||||
PEAR::setErrorHandling(PEAR_ERROR_DIE);
|
||||
|
||||
$options = array(
|
||||
'filelistgenerator' => 'svn',
|
||||
'changelogoldtonew' => false,
|
||||
'simpleoutput' => true,
|
||||
'baseinstalldir' => '/',
|
||||
'packagedirectory' => dirname(__FILE__),
|
||||
'packagefile' => 'package.xml',
|
||||
'clearcontents' => true,
|
||||
'ignore' => array('package*.php', 'package*.xml'),
|
||||
'dir_roles' => array(
|
||||
'docs' => 'doc',
|
||||
'examples' => 'doc',
|
||||
'tests' => 'test',
|
||||
'phar' => 'src',
|
||||
),
|
||||
'exceptions' => array(
|
||||
'CREDITS' => 'doc',
|
||||
'EXPERIMENTAL' => 'doc',
|
||||
'LICENSE' => 'doc',
|
||||
'Makefile.frag' => 'src',
|
||||
'phar_path_check.re' => 'src',
|
||||
'TODO' => 'doc',
|
||||
'phar.phar' => 'script',
|
||||
),
|
||||
);
|
||||
|
||||
$package = PEAR_PackageFileManager2::importOptions(dirname(__FILE__) . '/package.xml', $options);
|
||||
|
||||
$package->clearDeps();
|
||||
$package->setPhpDep('5.2.1');
|
||||
$package->setPearInstallerDep('1.4.3');
|
||||
$package->addPackageDepWithChannel('optional', 'bz2', 'pecl.php.net', false, false, false, false, 'bz2');
|
||||
// all this false business sets the <providesextension> tag that allows us to have hash built
|
||||
// in statically
|
||||
$package->addPackageDepWithChannel('optional', 'hash', 'pecl.php.net', false, false, false, false, 'hash');
|
||||
$package->addExtensionDep('optional', 'spl');
|
||||
$package->addExtensionDep('optional', 'zlib');
|
||||
$package->setPackageType('extsrc');
|
||||
$package->addRelease();
|
||||
$package->setReleaseVersion(phpversion('phar'));
|
||||
$package->setAPIVersion(Phar::apiVersion());
|
||||
$package->setReleaseStability('stable');
|
||||
$package->setAPIStability('stable');
|
||||
$package->setNotes("\n$notes\n");
|
||||
//$package->addGlobalReplacement('package-info', '@package_version@', 'version');
|
||||
$package->generateContents();
|
||||
|
||||
if (isset($_GET['make']) || (isset($_SERVER['argv']) && @$_SERVER['argv'][1] == 'make')) {
|
||||
$package->writePackageFile();
|
||||
} else {
|
||||
$package->debugPackageFile();
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -941,7 +941,6 @@ Changes since 2.0.0b1: addition of phar.cache_list, many performance improvement
|
||||
<file name="zf_test.phpt" role="test" />
|
||||
</dir> <!-- /tests -->
|
||||
<file name="build_precommand.php" role="php" />
|
||||
<file name="cgidebug" role="data" />
|
||||
<file name="config.m4" role="src" />
|
||||
<file name="config.w32" role="src" />
|
||||
<file name="CREDITS" role="doc" />
|
||||
|
||||
+13
-3
@@ -38,7 +38,7 @@ static php_uint32 phar_tar_number(char *buf, int len) /* {{{ */
|
||||
/* }}} */
|
||||
|
||||
/* adapted from format_octal() in libarchive
|
||||
*
|
||||
*
|
||||
* Copyright (c) 2003-2009 Tim Kientzle
|
||||
* All rights reserved.
|
||||
*
|
||||
@@ -161,7 +161,7 @@ static int phar_tar_process_metadata(phar_entry_info *entry, php_stream *fp TSRM
|
||||
size_t save = php_stream_tell(fp), read;
|
||||
phar_entry_info *mentry;
|
||||
|
||||
metadata = (char *) emalloc(entry->uncompressed_filesize + 1);
|
||||
metadata = (char *) safe_emalloc(1, entry->uncompressed_filesize, 1);
|
||||
|
||||
read = php_stream_read(fp, metadata, entry->uncompressed_filesize);
|
||||
if (read != entry->uncompressed_filesize) {
|
||||
@@ -337,6 +337,16 @@ bail:
|
||||
last_was_longlink = 1;
|
||||
/* support the ././@LongLink system for storing long filenames */
|
||||
entry.filename_len = entry.uncompressed_filesize;
|
||||
|
||||
/* Check for overflow - bug 61065 */
|
||||
if (entry.filename_len == UINT_MAX) {
|
||||
if (error) {
|
||||
spprintf(error, 4096, "phar error: \"%s\" is a corrupted tar file (invalid entry size)", fname);
|
||||
}
|
||||
php_stream_close(fp);
|
||||
phar_destroy_phar_data(myphar TSRMLS_CC);
|
||||
return FAILURE;
|
||||
}
|
||||
entry.filename = pemalloc(entry.filename_len+1, myphar->is_persistent);
|
||||
|
||||
read = php_stream_read(fp, entry.filename, entry.filename_len);
|
||||
@@ -367,7 +377,7 @@ bail:
|
||||
}
|
||||
|
||||
read = php_stream_read(fp, buf, sizeof(buf));
|
||||
|
||||
|
||||
if (read != sizeof(buf)) {
|
||||
efree(entry.filename);
|
||||
if (error) {
|
||||
|
||||
Loaded 100 of 259 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user