mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-15 13:06:38 +00:00
Compare commits
22
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d41dd0b518 | ||
|
|
46ac6549cc | ||
|
|
92de579a00 | ||
|
|
7a990257a0 | ||
|
|
4104bc908e | ||
|
|
fe947d245b | ||
|
|
75cc438262 | ||
|
|
fd3118ffb0 | ||
|
|
19e6abebc7 | ||
|
|
7d19668f60 | ||
|
|
114c03b9a6 | ||
|
|
545412a6cd | ||
|
|
abaf9a76dc | ||
|
|
a6d219630c | ||
|
|
9a2b42a5c1 | ||
|
|
05560b67bc | ||
|
|
f2fb37a772 | ||
|
|
8ce04df7e0 | ||
|
|
a5d3620d93 | ||
|
|
3124129ca8 | ||
|
|
2fcb5eadbb | ||
|
|
209e37db7d |
No files matched your search
@@ -1,26 +1,49 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? 2019, PHP 7.2.24
|
||||
24 Oct 2019, PHP 7.2.24
|
||||
|
||||
|
||||
- Core:
|
||||
. Fixed bug #78535 (auto_detect_line_endings value not parsed as bool).
|
||||
(bugreportuser)
|
||||
. Fixed bug #78620 (Out of memory error). (cmb, Nikita)
|
||||
|
||||
- Exif:
|
||||
. Fixed bug #78442 ('Illegal component' on exif_read_data since PHP7)
|
||||
(Kalle)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #78599 (env_path_info underflow in fpm_main.c can lead to RCE).
|
||||
(CVE-2019-11043) (Jakub Zelenka)
|
||||
|
||||
- MBString:
|
||||
. Fixed bug #78579 (mb_decode_numericentity: args number inconsistency).
|
||||
(cmb)
|
||||
. Fixed bug #78609 (mb_check_encoding() no longer supports stringable
|
||||
objects). (cmb)
|
||||
|
||||
- MySQLi:
|
||||
. Fixed bug #76809 (SSL settings aren't respected when persistent connections
|
||||
are used). (fabiomsouto)
|
||||
|
||||
- PDO_MySQL:
|
||||
. Fixed bug #78623 (Regression caused by "SP call yields additional empty
|
||||
result set"). (cmb)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #78624 (session_gc return value for user defined session
|
||||
handlers). (bshaffer)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #76342 (file_get_contents waits twice specified timeout).
|
||||
(Thomas Calvet)
|
||||
. Fixed bug #78612 (strtr leaks memory when integer keys are used and the
|
||||
subject string shorter). (Nikita)
|
||||
. Fixed bug #76859 (stream_get_line skips data if used with data-generating
|
||||
filter). (kkopachev)
|
||||
|
||||
- Zip:
|
||||
. Fixed bug #78641 (addGlob can modify given remove_path value). (cmb)
|
||||
|
||||
26 Sep 2019, PHP 7.2.23
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
--TEST--
|
||||
Using __COMPILER_HALF_OFFSET__ with trailing {} (OSS-Fuzz #17895)
|
||||
--FILE--
|
||||
<?php
|
||||
__COMPILER_HALT_OFFSET__;
|
||||
{}
|
||||
--EXPECTF--
|
||||
Warning: Use of undefined constant __COMPILER_HALT_OFFSET__ - assumed '__COMPILER_HALT_OFFSET__' (this will throw an Error in a future version of PHP) in %s on line %d
|
||||
+7
-2
@@ -1723,12 +1723,17 @@ static void *zend_mm_alloc_huge(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_D
|
||||
* We allocate them with 2MB size granularity, to avoid many
|
||||
* reallocations when they are extended by small pieces
|
||||
*/
|
||||
size_t new_size = ZEND_MM_ALIGNED_SIZE_EX(size, MAX(REAL_PAGE_SIZE, ZEND_MM_CHUNK_SIZE));
|
||||
size_t alignment = MAX(REAL_PAGE_SIZE, ZEND_MM_CHUNK_SIZE);
|
||||
#else
|
||||
size_t new_size = ZEND_MM_ALIGNED_SIZE_EX(size, REAL_PAGE_SIZE);
|
||||
size_t alignment = REAL_PAGE_SIZE;
|
||||
#endif
|
||||
size_t new_size = ZEND_MM_ALIGNED_SIZE_EX(size, alignment);
|
||||
void *ptr;
|
||||
|
||||
if (UNEXPECTED(new_size < size)) {
|
||||
zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu + %zu)", size, alignment);
|
||||
}
|
||||
|
||||
#if ZEND_MM_LIMIT
|
||||
if (UNEXPECTED(new_size > heap->limit - heap->real_size)) {
|
||||
if (zend_mm_gc(heap) && new_size <= heap->limit - heap->real_size) {
|
||||
|
||||
@@ -7676,6 +7676,9 @@ void zend_compile_const(znode *result, zend_ast *ast) /* {{{ */
|
||||
|
||||
while (last && last->kind == ZEND_AST_STMT_LIST) {
|
||||
zend_ast_list *list = zend_ast_get_list(last);
|
||||
if (list->children == 0) {
|
||||
break;
|
||||
}
|
||||
last = list->child[list->children-1];
|
||||
}
|
||||
if (last && last->kind == ZEND_AST_HALT_COMPILER) {
|
||||
|
||||
+1
-1
@@ -108,7 +108,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
PHP_MAJOR_VERSION=7
|
||||
PHP_MINOR_VERSION=2
|
||||
PHP_RELEASE_VERSION=24
|
||||
PHP_EXTRA_VERSION="-dev"
|
||||
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`
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ Bug #77198 (auto cropping has insufficient precision)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
if (!GD_BUNDLED) die('upstream bugfix has not been released');
|
||||
if (!GD_BUNDLED) die('skip upstream bugfix has not been released');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -3,7 +3,7 @@ Bug #77198 (threshold cropping has insufficient precision)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
if (!GD_BUNDLED) die('upstream bugfix has not been released');
|
||||
if (!GD_BUNDLED) die('skip upstream bugfix has not been released');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -3,7 +3,7 @@ Bug #77200 (imagecropauto(…, GD_CROP_SIDES) crops left but not right)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
if (!GD_BUNDLED) die('upstream bugfix has not been released');
|
||||
if (!GD_BUNDLED) die('skip upstream bugfix has not been released');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
grapheme()
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '65.0') >= 0) die('skip for ICU < 65.0'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -3,6 +3,7 @@ locale_get_display_name() icu >= 64.0
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '64.0') < 0) die('skip for ICU >= 64.0'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '65.0') >= 0) die('skip for ICU < 65.0'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -0,0 +1,342 @@
|
||||
--TEST--
|
||||
locale_get_display_name() icu >= 64.0
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '65.0') < 0) die('skip for ICU >= 65.0'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Try getting the display_name for different locales
|
||||
* with Procedural and Object methods.
|
||||
*/
|
||||
|
||||
function ut_main()
|
||||
{
|
||||
$res_str='';
|
||||
|
||||
$disp_locales=array('en','fr','de');
|
||||
|
||||
$locales = array(
|
||||
'sl_IT_nedis_KIRTI',
|
||||
'sl_IT_nedis-a-kirti-x-xyz',
|
||||
'sl_IT_rozaj',
|
||||
'sl_IT_NEDIS_ROJAZ_1901',
|
||||
'i-enochian',
|
||||
'zh-hakka',
|
||||
'zh-wuu',
|
||||
'i-tay',
|
||||
'sgn-BE-nl',
|
||||
'sgn-CH-de',
|
||||
'sl_IT_rozaj@currency=EUR',
|
||||
'uk-ua_CALIFORNIA@currency=;currency=GRN',
|
||||
'root',
|
||||
'uk@currency=EURO',
|
||||
'Hindi',
|
||||
//Simple language subtag
|
||||
'de',
|
||||
'fr',
|
||||
'ja',
|
||||
'i-enochian', //(example of a grandfathered tag)
|
||||
//Language subtag plus Script subtag:
|
||||
'zh-Hant',
|
||||
'zh-Hans',
|
||||
'sr-Cyrl',
|
||||
'sr-Latn',
|
||||
//Language-Script-Region
|
||||
'zh-Hans-CN',
|
||||
'sr-Latn-CS',
|
||||
//Language-Variant
|
||||
'sl-rozaj',
|
||||
'sl-nedis',
|
||||
//Language-Region-Variant
|
||||
'de-CH-1901',
|
||||
'sl-IT-nedis',
|
||||
//Language-Script-Region-Variant
|
||||
'sl-Latn-IT-nedis',
|
||||
//Language-Region:
|
||||
'de-DE',
|
||||
'en-US',
|
||||
'es-419',
|
||||
//Private use subtags:
|
||||
'de-CH-x-phonebk',
|
||||
'az-Arab-x-AZE-derbend',
|
||||
//Extended language subtags
|
||||
'zh-min',
|
||||
'zh-min-nan-Hant-CN',
|
||||
//Private use registry values
|
||||
'x-whatever',
|
||||
'qaa-Qaaa-QM-x-southern',
|
||||
'sr-Latn-QM',
|
||||
'sr-Qaaa-CS',
|
||||
/*Tags that use extensions (examples ONLY: extensions MUST be defined
|
||||
by revision or update to this document or by RFC): */
|
||||
'en-US-u-islamCal',
|
||||
'zh-CN-a-myExt-x-private',
|
||||
'en-a-myExt-b-another',
|
||||
//Some Invalid Tags:
|
||||
'de-419-DE',
|
||||
'a-DE',
|
||||
'ar-a-aaa-b-bbb-a-ccc'
|
||||
);
|
||||
|
||||
|
||||
$res_str = '';
|
||||
|
||||
foreach( $locales as $locale )
|
||||
{
|
||||
$res_str .= "locale='$locale'\n";
|
||||
foreach( $disp_locales as $disp_locale )
|
||||
{
|
||||
$scr = ut_loc_get_display_name( $locale ,$disp_locale );
|
||||
$scr = str_replace(array('(', ')'), '#', $scr);
|
||||
$res_str .= "disp_locale=$disp_locale : display_name=$scr";
|
||||
$res_str .= "\n";
|
||||
}
|
||||
$res_str .= "-----------------\n";
|
||||
}
|
||||
|
||||
return $res_str;
|
||||
|
||||
}
|
||||
|
||||
include_once( 'ut_common.inc' );
|
||||
ut_run();
|
||||
|
||||
?>
|
||||
--EXPECTREGEX--
|
||||
locale='sl_IT_nedis_KIRTI'
|
||||
disp_locale=en : display_name=Slovenian #Italy, NEDIS_KIRTI#
|
||||
disp_locale=fr : display_name=slovène #Italie, NEDIS_KIRTI#
|
||||
disp_locale=de : display_name=Slowenisch #Italien, NEDIS_KIRTI#
|
||||
-----------------
|
||||
locale='sl_IT_nedis-a-kirti-x-xyz'
|
||||
disp_locale=en : display_name=Slovenian #Italy, NEDIS_A_KIRTI_X_XYZ#
|
||||
disp_locale=fr : display_name=slovène #Italie, NEDIS_A_KIRTI_X_XYZ#
|
||||
disp_locale=de : display_name=Slowenisch #Italien, NEDIS_A_KIRTI_X_XYZ#
|
||||
-----------------
|
||||
locale='sl_IT_rozaj'
|
||||
disp_locale=en : display_name=Slovenian #Italy, Resian#
|
||||
disp_locale=fr : display_name=slovène #Italie, dialecte de Resia#
|
||||
disp_locale=de : display_name=Slowenisch #Italien, (ROZAJ|Resianisch)#
|
||||
-----------------
|
||||
locale='sl_IT_NEDIS_ROJAZ_1901'
|
||||
disp_locale=en : display_name=Slovenian #Italy, NEDIS_ROJAZ_1901#
|
||||
disp_locale=fr : display_name=slovène #Italie, NEDIS_ROJAZ_1901#
|
||||
disp_locale=de : display_name=Slowenisch #Italien, NEDIS_ROJAZ_1901#
|
||||
-----------------
|
||||
locale='i-enochian'
|
||||
disp_locale=en : display_name=i-enochian #Private-Use=i-enochian#
|
||||
disp_locale=fr : display_name=i-enochian #usage privé=i-enochian#
|
||||
disp_locale=de : display_name=i-enochian #Privatnutzung=i-enochian#
|
||||
-----------------
|
||||
locale='zh-hakka'
|
||||
disp_locale=en : display_name=Chinese( #HAKKA#)?
|
||||
disp_locale=fr : display_name=chinois( #HAKKA#)?
|
||||
disp_locale=de : display_name=Chinesisch( #HAKKA#)?
|
||||
-----------------
|
||||
locale='zh-wuu'
|
||||
disp_locale=en : display_name=Chinese #WUU#
|
||||
disp_locale=fr : display_name=chinois #WUU#
|
||||
disp_locale=de : display_name=Chinesisch #WUU#
|
||||
-----------------
|
||||
locale='i-tay'
|
||||
disp_locale=en : display_name=i-tay
|
||||
disp_locale=fr : display_name=i-tay
|
||||
disp_locale=de : display_name=i-tay
|
||||
-----------------
|
||||
locale='sgn-BE-nl'
|
||||
disp_locale=en : display_name=sgn #Belgium, NL#
|
||||
disp_locale=fr : display_name=sgn #Belgique, NL#
|
||||
disp_locale=de : display_name=sgn #Belgien, NL#
|
||||
-----------------
|
||||
locale='sgn-CH-de'
|
||||
disp_locale=en : display_name=sgn #Switzerland, DE#
|
||||
disp_locale=fr : display_name=sgn #Suisse, DE#
|
||||
disp_locale=de : display_name=sgn #Schweiz, DE#
|
||||
-----------------
|
||||
locale='sl_IT_rozaj@currency=EUR'
|
||||
disp_locale=en : display_name=Slovenian #Italy, Resian, [Cc]urrency=Euro#
|
||||
disp_locale=fr : display_name=slovène #Italie, dialecte de Resia, [Dd]evise=euro#
|
||||
disp_locale=de : display_name=Slowenisch #Italien, (ROZAJ|Resianisch), Währung=Euro#
|
||||
-----------------
|
||||
locale='uk-ua_CALIFORNIA@currency=;currency=GRN'
|
||||
disp_locale=en : display_name=
|
||||
disp_locale=fr : display_name=
|
||||
disp_locale=de : display_name=
|
||||
-----------------
|
||||
locale='root'
|
||||
disp_locale=en : display_name=Unknown language
|
||||
disp_locale=fr : display_name=langue indéterminée
|
||||
disp_locale=de : display_name=Unbekannte Sprache
|
||||
-----------------
|
||||
locale='uk@currency=EURO'
|
||||
disp_locale=en : display_name=Ukrainian #[Cc]urrency=EURO#
|
||||
disp_locale=fr : display_name=ukrainien #[Dd]evise=EURO#
|
||||
disp_locale=de : display_name=Ukrainisch #Währung=EURO#
|
||||
-----------------
|
||||
locale='Hindi'
|
||||
disp_locale=en : display_name=hindi
|
||||
disp_locale=fr : display_name=hindi
|
||||
disp_locale=de : display_name=hindi
|
||||
-----------------
|
||||
locale='de'
|
||||
disp_locale=en : display_name=German
|
||||
disp_locale=fr : display_name=allemand
|
||||
disp_locale=de : display_name=Deutsch
|
||||
-----------------
|
||||
locale='fr'
|
||||
disp_locale=en : display_name=French
|
||||
disp_locale=fr : display_name=français
|
||||
disp_locale=de : display_name=Französisch
|
||||
-----------------
|
||||
locale='ja'
|
||||
disp_locale=en : display_name=Japanese
|
||||
disp_locale=fr : display_name=japonais
|
||||
disp_locale=de : display_name=Japanisch
|
||||
-----------------
|
||||
locale='i-enochian'
|
||||
disp_locale=en : display_name=i-enochian #Private-Use=i-enochian#
|
||||
disp_locale=fr : display_name=i-enochian #usage privé=i-enochian#
|
||||
disp_locale=de : display_name=i-enochian #Privatnutzung=i-enochian#
|
||||
-----------------
|
||||
locale='zh-Hant'
|
||||
disp_locale=en : display_name=Chinese #Traditional#
|
||||
disp_locale=fr : display_name=chinois #traditionnel#
|
||||
disp_locale=de : display_name=Chinesisch #Traditionell#
|
||||
-----------------
|
||||
locale='zh-Hans'
|
||||
disp_locale=en : display_name=Chinese #Simplified#
|
||||
disp_locale=fr : display_name=chinois #simplifié#
|
||||
disp_locale=de : display_name=Chinesisch #Vereinfacht#
|
||||
-----------------
|
||||
locale='sr-Cyrl'
|
||||
disp_locale=en : display_name=Serbian #Cyrillic#
|
||||
disp_locale=fr : display_name=serbe #cyrillique#
|
||||
disp_locale=de : display_name=Serbisch #Kyrillisch#
|
||||
-----------------
|
||||
locale='sr-Latn'
|
||||
disp_locale=en : display_name=Serbian #Latin#
|
||||
disp_locale=fr : display_name=serbe #latin#
|
||||
disp_locale=de : display_name=Serbisch #Lateinisch#
|
||||
-----------------
|
||||
locale='zh-Hans-CN'
|
||||
disp_locale=en : display_name=Chinese #Simplified, China#
|
||||
disp_locale=fr : display_name=chinois #simplifié, Chine#
|
||||
disp_locale=de : display_name=Chinesisch #Vereinfacht, China#
|
||||
-----------------
|
||||
locale='sr-Latn-CS'
|
||||
disp_locale=en : display_name=Serbian #Latin, Serbia#
|
||||
disp_locale=fr : display_name=serbe #latin, Serbie#
|
||||
disp_locale=de : display_name=Serbisch #Lateinisch, Serbien#
|
||||
-----------------
|
||||
locale='sl-rozaj'
|
||||
disp_locale=en : display_name=Slovenian #Resian#
|
||||
disp_locale=fr : display_name=slovène #dialecte de Resia#
|
||||
disp_locale=de : display_name=Slowenisch( #(ROZAJ|Resianisch)#)?
|
||||
-----------------
|
||||
locale='sl-nedis'
|
||||
disp_locale=en : display_name=Slovenian #Natisone dialect#
|
||||
disp_locale=fr : display_name=slovène #dialecte de Natisone#
|
||||
disp_locale=de : display_name=Slowenisch #Natisone-Dialekt#
|
||||
-----------------
|
||||
locale='de-CH-1901'
|
||||
disp_locale=en : display_name=German #Switzerland, Traditional German orthography#
|
||||
disp_locale=fr : display_name=allemand #Suisse, orthographe allemande traditionnelle#
|
||||
disp_locale=de : display_name=Deutsch #Schweiz, (1901|[aA]lte deutsche Rechtschreibung)#
|
||||
-----------------
|
||||
locale='sl-IT-nedis'
|
||||
disp_locale=en : display_name=Slovenian #Italy, Natisone dialect#
|
||||
disp_locale=fr : display_name=slovène #Italie, dialecte de Natisone#
|
||||
disp_locale=de : display_name=Slowenisch #Italien, (NEDIS|Natisone-Dialekt)#
|
||||
-----------------
|
||||
locale='sl-Latn-IT-nedis'
|
||||
disp_locale=en : display_name=Slovenian #Latin, Italy, Natisone dialect#
|
||||
disp_locale=fr : display_name=slovène #latin, Italie, dialecte de Natisone#
|
||||
disp_locale=de : display_name=Slowenisch #Lateinisch, Italien, (NEDIS|Natisone-Dialekt)#
|
||||
-----------------
|
||||
locale='de-DE'
|
||||
disp_locale=en : display_name=German #Germany#
|
||||
disp_locale=fr : display_name=allemand #Allemagne#
|
||||
disp_locale=de : display_name=Deutsch #Deutschland#
|
||||
-----------------
|
||||
locale='en-US'
|
||||
disp_locale=en : display_name=English #United States#
|
||||
disp_locale=fr : display_name=anglais #États-Unis#
|
||||
disp_locale=de : display_name=Englisch #Vereinigte Staaten#
|
||||
-----------------
|
||||
locale='es-419'
|
||||
disp_locale=en : display_name=Spanish #Latin America#
|
||||
disp_locale=fr : display_name=espagnol #Amérique latine#
|
||||
disp_locale=de : display_name=Spanisch #Lateinamerika#
|
||||
-----------------
|
||||
locale='de-CH-x-phonebk'
|
||||
disp_locale=en : display_name=German #Switzerland, Private-Use=phonebk#
|
||||
disp_locale=fr : display_name=allemand #Suisse, usage privé=phonebk#
|
||||
disp_locale=de : display_name=Deutsch #Schweiz, Privatnutzung=phonebk#
|
||||
-----------------
|
||||
locale='az-Arab-x-AZE-derbend'
|
||||
disp_locale=en : display_name=Azerbaijani #Arabic, Private-Use=aze-derbend#
|
||||
disp_locale=fr : display_name=azéri #arabe, usage privé=aze-derbend#
|
||||
disp_locale=de : display_name=Aserbaidschanisch #Arabisch, Privatnutzung=aze-derbend#
|
||||
-----------------
|
||||
locale='zh-min'
|
||||
disp_locale=en : display_name=Chinese #MIN#
|
||||
disp_locale=fr : display_name=chinois #MIN#
|
||||
disp_locale=de : display_name=Chinesisch #MIN#
|
||||
-----------------
|
||||
locale='zh-min-nan-Hant-CN'
|
||||
disp_locale=en : display_name=Chinese #MIN, NAN_HANT_CN#
|
||||
disp_locale=fr : display_name=chinois #MIN, NAN_HANT_CN#
|
||||
disp_locale=de : display_name=Chinesisch #MIN, NAN_HANT_CN#
|
||||
-----------------
|
||||
locale='x-whatever'
|
||||
disp_locale=en : display_name=x-whatever #Private-Use=whatever#
|
||||
disp_locale=fr : display_name=x-whatever #usage privé=whatever#
|
||||
disp_locale=de : display_name=x-whatever #Privatnutzung=whatever#
|
||||
-----------------
|
||||
locale='qaa-Qaaa-QM-x-southern'
|
||||
disp_locale=en : display_name=qaa #Qaaa, QM, Private-Use=southern#
|
||||
disp_locale=fr : display_name=qaa #Qaaa, QM, usage privé=southern#
|
||||
disp_locale=de : display_name=qaa #Qaaa, QM, Privatnutzung=southern#
|
||||
-----------------
|
||||
locale='sr-Latn-QM'
|
||||
disp_locale=en : display_name=Serbian #Latin, QM#
|
||||
disp_locale=fr : display_name=serbe #latin, QM#
|
||||
disp_locale=de : display_name=Serbisch #Lateinisch, QM#
|
||||
-----------------
|
||||
locale='sr-Qaaa-CS'
|
||||
disp_locale=en : display_name=Serbian #Qaaa, Serbia#
|
||||
disp_locale=fr : display_name=serbe #Qaaa, Serbie#
|
||||
disp_locale=de : display_name=Serbisch #Qaaa, Serbien#
|
||||
-----------------
|
||||
locale='en-US-u-islamCal'
|
||||
disp_locale=en : display_name=English #United States, attribute=islamcal#
|
||||
disp_locale=fr : display_name=anglais #États-Unis, attribute=islamcal#
|
||||
disp_locale=de : display_name=Englisch #Vereinigte Staaten, attribute=islamcal#
|
||||
-----------------
|
||||
locale='zh-CN-a-myExt-x-private'
|
||||
disp_locale=en : display_name=Chinese #China, a=myext, Private-Use=private#
|
||||
disp_locale=fr : display_name=chinois #Chine, a=myext, usage privé=private#
|
||||
disp_locale=de : display_name=Chinesisch #China, a=myext, Privatnutzung=private#
|
||||
-----------------
|
||||
locale='en-a-myExt-b-another'
|
||||
disp_locale=en : display_name=English #a=myext, b=another#
|
||||
disp_locale=fr : display_name=anglais #a=myext, b=another#
|
||||
disp_locale=de : display_name=Englisch #a=myext, b=another#
|
||||
-----------------
|
||||
locale='de-419-DE'
|
||||
disp_locale=en : display_name=German #Latin America, DE#
|
||||
disp_locale=fr : display_name=allemand #Amérique latine, DE#
|
||||
disp_locale=de : display_name=Deutsch #Lateinamerika, DE#
|
||||
-----------------
|
||||
locale='a-DE'
|
||||
disp_locale=en : display_name=a #Germany#
|
||||
disp_locale=fr : display_name=a #Allemagne#
|
||||
disp_locale=de : display_name=a #Deutschland#
|
||||
-----------------
|
||||
locale='ar-a-aaa-b-bbb-a-ccc'
|
||||
disp_locale=en : display_name=Arabic #a=aaa, b=bbb#
|
||||
disp_locale=fr : display_name=arabe #a=aaa, b=bbb#
|
||||
disp_locale=de : display_name=Arabisch #a=aaa, b=bbb#
|
||||
-----------------
|
||||
@@ -61,10 +61,12 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne
|
||||
MY_MYSQL *mysql = NULL;
|
||||
MYSQLI_RESOURCE *mysqli_resource = NULL;
|
||||
zval *object = getThis();
|
||||
char *hostname = NULL, *username=NULL, *passwd=NULL, *dbname=NULL, *socket=NULL;
|
||||
size_t hostname_len = 0, username_len = 0, passwd_len = 0, dbname_len = 0, socket_len = 0;
|
||||
zend_bool persistent = FALSE;
|
||||
zend_long port = 0, flags = 0;
|
||||
char *hostname = NULL, *username=NULL, *passwd=NULL, *dbname=NULL, *socket=NULL,
|
||||
*ssl_key = NULL, *ssl_cert = NULL, *ssl_ca = NULL, *ssl_capath = NULL,
|
||||
*ssl_cipher = NULL;
|
||||
size_t hostname_len = 0, username_len = 0, passwd_len = 0, dbname_len = 0, socket_len = 0;
|
||||
zend_bool persistent = FALSE, ssl = FALSE;
|
||||
zend_long port = 0, flags = 0;
|
||||
zend_string *hash_key = NULL;
|
||||
zend_bool new_connection = FALSE;
|
||||
zend_resource *le;
|
||||
@@ -189,6 +191,33 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne
|
||||
|
||||
goto end;
|
||||
} else {
|
||||
#ifdef MYSQLI_USE_MYSQLND
|
||||
if (mysql->mysql->data->vio->data->ssl) {
|
||||
/* copy over pre-existing ssl settings so we can reuse them when reconnecting */
|
||||
ssl = TRUE;
|
||||
|
||||
ssl_key = my_estrdup(mysql->mysql->data->vio->data->options.ssl_key);
|
||||
ssl_cert = my_estrdup(mysql->mysql->data->vio->data->options.ssl_cert);
|
||||
ssl_ca = my_estrdup(mysql->mysql->data->vio->data->options.ssl_ca);
|
||||
ssl_capath = my_estrdup(mysql->mysql->data->vio->data->options.ssl_capath);
|
||||
ssl_cipher = my_estrdup(mysql->mysql->data->vio->data->options.ssl_cipher);
|
||||
}
|
||||
#else
|
||||
if (mysql->mysql->options.ssl_key
|
||||
|| mysql->mysql->options.ssl_cert
|
||||
|| mysql->mysql->options.ssl_ca
|
||||
|| mysql->mysql->options.ssl_capath
|
||||
|| mysql->mysql->options.ssl_cipher) {
|
||||
/* copy over pre-existing ssl settings so we can reuse them when reconnecting */
|
||||
ssl = TRUE;
|
||||
|
||||
ssl_key = my_estrdup(mysql->mysql->options.ssl_key);
|
||||
ssl_cert = my_estrdup(mysql->mysql->options.ssl_cert);
|
||||
ssl_ca = my_estrdup(mysql->mysql->options.ssl_ca);
|
||||
ssl_capath = my_estrdup(mysql->mysql->options.ssl_capath);
|
||||
ssl_cipher = my_estrdup(mysql->mysql->options.ssl_cipher);
|
||||
}
|
||||
#endif
|
||||
mysqli_close(mysql->mysql, MYSQLI_CLOSE_IMPLICIT);
|
||||
mysql->mysql = NULL;
|
||||
}
|
||||
@@ -241,8 +270,28 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne
|
||||
/* BC for prior to bug fix #53425 */
|
||||
flags |= CLIENT_MULTI_RESULTS;
|
||||
|
||||
if (ssl) {
|
||||
/* if we're here, this means previous conn was ssl, repopulate settings */
|
||||
mysql_ssl_set(mysql->mysql, ssl_key, ssl_cert, ssl_ca, ssl_capath, ssl_cipher);
|
||||
|
||||
my_efree(ssl_key);
|
||||
my_efree(ssl_cert);
|
||||
my_efree(ssl_ca);
|
||||
my_efree(ssl_capath);
|
||||
my_efree(ssl_cipher);
|
||||
}
|
||||
if (mysql_real_connect(mysql->mysql, hostname, username, passwd, dbname, port, socket, flags) == NULL)
|
||||
#else
|
||||
if (ssl) {
|
||||
/* if we're here, this means previous conn was ssl, repopulate settings */
|
||||
mysql_ssl_set(mysql->mysql, ssl_key, ssl_cert, ssl_ca, ssl_capath, ssl_cipher);
|
||||
|
||||
my_efree(ssl_key);
|
||||
my_efree(ssl_cert);
|
||||
my_efree(ssl_ca);
|
||||
my_efree(ssl_capath);
|
||||
my_efree(ssl_cipher);
|
||||
}
|
||||
if (mysqlnd_connect(mysql->mysql, hostname, username, passwd, passwd_len, dbname, dbname_len,
|
||||
port, socket, flags, MYSQLND_CLIENT_KNOWS_RSET_COPY_DATA) == NULL)
|
||||
#endif
|
||||
|
||||
@@ -97,7 +97,7 @@ object(mysqli_stmt)#%d (%d) {
|
||||
["sqlstate"]=>
|
||||
string(5) "00000"
|
||||
["id"]=>
|
||||
int(3)
|
||||
int(%d)
|
||||
}
|
||||
bool(true)
|
||||
bool(false)
|
||||
|
||||
@@ -97,7 +97,7 @@ memory_limit=256M
|
||||
require_once("clean_table.inc");
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(1)
|
||||
int(%d)
|
||||
executing
|
||||
bool(true)
|
||||
done!
|
||||
@@ -425,14 +425,14 @@ static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt) /* {{{ */
|
||||
pdo_mysql_error_stmt(stmt);
|
||||
PDO_DBG_RETURN(0);
|
||||
} else {
|
||||
PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt) && stmt->row_count);
|
||||
PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt));
|
||||
}
|
||||
#else
|
||||
if (mysql_next_result(H->server) > 0) {
|
||||
pdo_mysql_error_stmt(stmt);
|
||||
PDO_DBG_RETURN(0);
|
||||
} else {
|
||||
PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt) && stmt->row_count);
|
||||
PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@ if ($version < 50000)
|
||||
die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n",
|
||||
$matches[0], $matches[1], $matches[2], $version));
|
||||
?>
|
||||
--XFAIL--
|
||||
nextRowset() problem with stored proc & emulation mode & mysqlnd
|
||||
--FILE--
|
||||
<?php
|
||||
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
--TEST--
|
||||
PDO MySQL Bug #41997 (stored procedure call returning single rowset blocks future queries)
|
||||
--XFAIL--
|
||||
nextRowset() problem with stored proc & emulation mode & mysqlnd
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
--TEST--
|
||||
MySQL Prepared Statements and different column counts
|
||||
--XFAIL--
|
||||
nextRowset() problem with stored proc & emulation mode & mysqlnd
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
|
||||
|
||||
@@ -192,14 +192,15 @@ PS_GC_FUNC(user)
|
||||
|
||||
if (Z_TYPE(retval) == IS_LONG) {
|
||||
convert_to_long(&retval);
|
||||
return Z_LVAL(retval);
|
||||
*nrdels = Z_LVAL(retval);
|
||||
} else if (Z_TYPE(retval) == IS_TRUE) {
|
||||
/* This is for older API compatibility */
|
||||
*nrdels = 1;
|
||||
} else {
|
||||
/* Anything else is some kind of error */
|
||||
*nrdels = -1; // Error
|
||||
}
|
||||
/* This is for older API compatibility */
|
||||
if (Z_TYPE(retval) == IS_TRUE) {
|
||||
return 1;
|
||||
}
|
||||
/* Anything else is some kind of error */
|
||||
return -1; // Error
|
||||
return *nrdels;
|
||||
}
|
||||
|
||||
PS_CREATE_SID_FUNC(user)
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
--TEST--
|
||||
Test session_set_save_handler() : session_gc() returns the number of deleted records.
|
||||
--INI--
|
||||
session.name=PHPSESSID
|
||||
session.save_handler=files
|
||||
session.gc_probability=0
|
||||
--SKIPIF--
|
||||
<?php include('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
ob_start();
|
||||
|
||||
/*
|
||||
* Prototype : bool session_set_save_handler(SessionHandler $handler [, bool $register_shutdown_function = true])
|
||||
* Description : Sets user-level session storage functions
|
||||
* Source code : ext/session/session.c
|
||||
*/
|
||||
|
||||
echo "*** Test session_set_save_handler() : session_gc() returns the number of deleted records. ***\n";
|
||||
|
||||
class MySession implements SessionHandlerInterface {
|
||||
public function open($path, $name) {
|
||||
echo 'Open', "\n";
|
||||
return true;
|
||||
}
|
||||
public function read($key) {
|
||||
echo 'Read ', session_id(), "\n";
|
||||
return '';
|
||||
}
|
||||
public function write($key, $data) {
|
||||
echo 'Write ', session_id(), "\n";
|
||||
return true;
|
||||
}
|
||||
public function close() {
|
||||
echo 'Close ', session_id(), "\n";
|
||||
return true;
|
||||
}
|
||||
public function destroy($key) {
|
||||
echo 'Destroy ', session_id(), "\n";
|
||||
return true;
|
||||
}
|
||||
public function gc($ts) {
|
||||
echo 'Garbage collect', "\n";
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
$handler = new MySession;
|
||||
session_set_save_handler($handler);
|
||||
session_start();
|
||||
var_dump(session_gc());
|
||||
session_write_close();
|
||||
|
||||
--EXPECTF--
|
||||
*** Test session_set_save_handler() : session_gc() returns the number of deleted records. ***
|
||||
Open
|
||||
Read %s
|
||||
Garbage collect
|
||||
int(1)
|
||||
Write %s
|
||||
Close %s
|
||||
@@ -49,6 +49,12 @@ var_dump($_SESSION);
|
||||
$_SESSION['Bar'] = 'Foo';
|
||||
session_write_close();
|
||||
|
||||
echo "Garbage collection..\n";
|
||||
session_id($session_id);
|
||||
session_start();
|
||||
var_dump(session_gc());
|
||||
session_write_close();
|
||||
|
||||
echo "Cleanup..\n";
|
||||
session_id($session_id);
|
||||
session_start();
|
||||
@@ -101,6 +107,12 @@ array(3) {
|
||||
}
|
||||
Write [%s,%s,Blah|s:12:"Hello World!";Foo|b:0;Guff|i:1234567890;Bar|s:3:"Foo";]
|
||||
Close [%s,PHPSESSID]
|
||||
Garbage collection..
|
||||
Open [%s,PHPSESSID]
|
||||
Read [%s,%s]
|
||||
int(0)
|
||||
Write [%s,%s,Blah|s:12:"Hello World!";Foo|b:0;Guff|i:1234567890;Bar|s:3:"Foo";]
|
||||
Close [%s,PHPSESSID]
|
||||
Cleanup..
|
||||
Open [%s,PHPSESSID]
|
||||
Read [%s,%s]
|
||||
|
||||
@@ -5,7 +5,7 @@ Olivier Doucet
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(dirname(__FILE__).'/skipif.inc');
|
||||
if (!function_exists('snmp_set_enum_print')) die('This function is only available if using NET_SNMP');
|
||||
if (!function_exists('snmp_set_enum_print')) die('skip This function is only available if using NET_SNMP');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -5,7 +5,7 @@ Olivier Doucet
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(dirname(__FILE__).'/skipif.inc');
|
||||
if (!function_exists('snmp_set_oid_output_format')) die('This function is only available if using NET_SNMP');
|
||||
if (!function_exists('snmp_set_oid_output_format')) die('skip This function is only available if using NET_SNMP');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
/*
|
||||
DO NOT EDIT THIS FILE!
|
||||
|
||||
it has been automaticaly created by php7/scripts/credits from
|
||||
it has been automaticaly created by php7/scripts/credits from
|
||||
the information found in the various php7/ext/.../CREDITS and
|
||||
php7/sapi/.../CREDITS files
|
||||
|
||||
if you want to change an entry you have to edit the appropriate
|
||||
php7/sapi/.../CREDITS files
|
||||
|
||||
if you want to change an entry you have to edit the appropriate
|
||||
CREDITS file instead
|
||||
|
||||
*/
|
||||
@@ -28,7 +28,7 @@ CREDIT_LINE("FTP", "Stefan Esser, Andrew Skalski");
|
||||
CREDIT_LINE("GD imaging", "Rasmus Lerdorf, Stig Bakken, Jim Winstead, Jouni Ahto, Ilia Alshanetsky, Pierre-Alain Joye, Marcus Boerger");
|
||||
CREDIT_LINE("GetText", "Alex Plotnick");
|
||||
CREDIT_LINE("GNU GMP support", "Stanislav Malyshev");
|
||||
CREDIT_LINE("Iconv", "Rui Hirokawa, Stig Bakken, Moriyoshi Koizumi ");
|
||||
CREDIT_LINE("Iconv", "Rui Hirokawa, Stig Bakken, Moriyoshi Koizumi");
|
||||
CREDIT_LINE("IMAP", "Rex Logan, Mark Musone, Brian Wang, Kaj-Michael Lang, Antoni Pamies Olive, Rasmus Lerdorf, Andrew Skalski, Chuck Hagenbuch, Daniel R Kalowsky");
|
||||
CREDIT_LINE("Input Filter", "Rasmus Lerdorf, Derick Rethans, Pierre-Alain Joye, Ilia Alshanetsky");
|
||||
CREDIT_LINE("InterBase", "Jouni Ahto, Andrew Avdeev, Ard Biesheuvel");
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
/*
|
||||
DO NOT EDIT THIS FILE!
|
||||
|
||||
it has been automaticaly created by php7/scripts/credits from
|
||||
it has been automaticaly created by php7/scripts/credits from
|
||||
the information found in the various php7/ext/.../CREDITS and
|
||||
php7/sapi/.../CREDITS files
|
||||
|
||||
if you want to change an entry you have to edit the appropriate
|
||||
php7/sapi/.../CREDITS files
|
||||
|
||||
if you want to change an entry you have to edit the appropriate
|
||||
CREDITS file instead
|
||||
|
||||
*/
|
||||
|
||||
@@ -6,7 +6,7 @@ include dirname(__FILE__) . DIRECTORY_SEPARATOR . "util.inc";
|
||||
|
||||
skip_if_not_win();
|
||||
|
||||
if (strlen(dirname(__FILE__)) > 259) die("Unsuitable starting path length");
|
||||
if (strlen(dirname(__FILE__)) > 259) die("skip Unsuitable starting path length");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Creating the stream filter object may fail
|
||||
--FILE--
|
||||
<?php
|
||||
class SampleFilter extends php_user_filter {
|
||||
private $data = \FOO;
|
||||
}
|
||||
stream_filter_register('sample.filter', SampleFilter::class);
|
||||
try {
|
||||
var_dump(file_get_contents('php://filter/read=sample.filter/resource='. __FILE__));
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: file_get_contents(): unable to create or locate filter "sample.filter" in %s on line %d
|
||||
|
||||
Warning: file_get_contents(): Unable to create filter (sample.filter) in %s on line %d
|
||||
Undefined constant 'FOO'
|
||||
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Bug #46147 (after stream seek, appending stream filter reads incorrect data)
|
||||
--FILE--
|
||||
<?php
|
||||
$fp = tmpfile();
|
||||
fwrite($fp, "this is a lowercase string.\n");
|
||||
fseek($fp, 5);
|
||||
stream_filter_append($fp, "string.toupper");
|
||||
while (!feof($fp)) {
|
||||
echo fread($fp, 5);
|
||||
}
|
||||
|
||||
--EXPECT--
|
||||
IS A LOWERCASE STRING.
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #76859 (stream_get_line skips data if used with filters)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$data = '123';
|
||||
|
||||
$fh = fopen('php://memory', 'r+b');
|
||||
fwrite($fh, $data);
|
||||
rewind($fh);
|
||||
stream_filter_append($fh, 'string.rot13', STREAM_FILTER_READ);
|
||||
|
||||
$out = '';
|
||||
while (!feof($fh)) {
|
||||
$out .= stream_get_line($fh, 1024);
|
||||
}
|
||||
|
||||
fclose($fh);
|
||||
|
||||
echo strlen($out) . "\n";
|
||||
--EXPECT--
|
||||
3
|
||||
@@ -2,6 +2,7 @@
|
||||
No overflow should occur during the memory_limit check for wordwrap()
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN' && PHP_INT_SIZE == 4) die("skip this test is not for 32bit Windows platforms");
|
||||
if (getenv("USE_ZEND_ALLOC") === "0") die("skip Zend MM disabled");
|
||||
?>
|
||||
--INI--
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
No overflow should occur during the memory_limit check for wordwrap()
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (substr(PHP_OS, 0, 3) != 'WIN' || PHP_INT_SIZE != 4) die("skip this test is for 32bit Windows platforms only");
|
||||
if (getenv("USE_ZEND_ALLOC") === "0") die("skip Zend MM disabled");
|
||||
?>
|
||||
--INI--
|
||||
memory_limit=128M
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$str = str_repeat('x', 65534);
|
||||
$str2 = str_repeat('x', 65535);
|
||||
wordwrap($str, 1, $str2);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Possible integer overflow in memory allocation (4294901777 + %d) in %s on line %d
|
||||
@@ -323,13 +323,16 @@ static php_stream_filter *user_filter_factory_create(const char *filtername,
|
||||
}
|
||||
}
|
||||
|
||||
filter = php_stream_filter_alloc(&userfilter_ops, NULL, 0);
|
||||
if (filter == NULL) {
|
||||
/* create the object */
|
||||
if (object_init_ex(&obj, fdat->ce) == FAILURE) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* create the object */
|
||||
object_init_ex(&obj, fdat->ce);
|
||||
filter = php_stream_filter_alloc(&userfilter_ops, NULL, 0);
|
||||
if (filter == NULL) {
|
||||
zval_ptr_dtor(&obj);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* filtername */
|
||||
add_property_string(&obj, "filtername", (char*)filtername);
|
||||
|
||||
+6
-2
@@ -1667,7 +1667,7 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /*
|
||||
struct zip *intern;
|
||||
zval *self = getThis();
|
||||
char *path = ".";
|
||||
char *remove_path = NULL;
|
||||
char *remove_path = NULL, *save_remove_path;
|
||||
char *add_path = NULL;
|
||||
size_t add_path_len, remove_path_len = 0, path_len = 1;
|
||||
zend_long remove_all_path = 0;
|
||||
@@ -1703,10 +1703,11 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /*
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
save_remove_path = remove_path;
|
||||
if (remove_path && remove_path_len > 1) {
|
||||
size_t real_len = strlen(remove_path);
|
||||
if ((real_len > 1) && ((remove_path[real_len - 1] == '/') || (remove_path[real_len - 1] == '\\'))) {
|
||||
remove_path[real_len - 1] = '\0';
|
||||
remove_path = estrndup(remove_path, real_len - 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1766,6 +1767,9 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /*
|
||||
}
|
||||
}
|
||||
}
|
||||
if (remove_path != save_remove_path) {
|
||||
efree(remove_path);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
--TEST--
|
||||
Bug #78641 (addGlob can modify given remove_path value)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('zip')) die('skip zip extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
define("TMPDIR", __DIR__ . "/");
|
||||
|
||||
$file = TMPDIR . 'bug78641';
|
||||
touch($file);
|
||||
|
||||
$zip = new ZipArchive();
|
||||
$zip->open(TMPDIR . "bug78641.zip", ZipArchive::CREATE | ZipArchive::OVERWRITE);
|
||||
var_dump(basename(TMPDIR));
|
||||
$zip->addGlob($file, 0, ["remove_path" => TMPDIR]);
|
||||
var_dump(basename(TMPDIR));
|
||||
$zip->close();
|
||||
?>
|
||||
--EXPECT--
|
||||
string(5) "tests"
|
||||
string(5) "tests"
|
||||
--CLEAN--
|
||||
<?php
|
||||
unlink(__DIR__ . '/bug78641');
|
||||
unlink(__DIR__ . '/bug78641.zip');
|
||||
?>
|
||||
+2
-2
@@ -3,6 +3,6 @@
|
||||
#define PHP_MAJOR_VERSION 7
|
||||
#define PHP_MINOR_VERSION 2
|
||||
#define PHP_RELEASE_VERSION 24
|
||||
#define PHP_EXTRA_VERSION "-dev"
|
||||
#define PHP_VERSION "7.2.24-dev"
|
||||
#define PHP_EXTRA_VERSION ""
|
||||
#define PHP_VERSION "7.2.24"
|
||||
#define PHP_VERSION_ID 70224
|
||||
@@ -357,8 +357,6 @@ PHPAPI int php_stream_filter_append_ex(php_stream_filter_chain *chain, php_strea
|
||||
case PSFS_PASS_ON:
|
||||
/* If any data is consumed, we cannot rely upon the existing read buffer,
|
||||
as the filtered data must replace the existing data, so invalidate the cache */
|
||||
/* note that changes here should be reflected in
|
||||
main/streams/streams.c::php_stream_fill_read_buffer */
|
||||
stream->writepos = 0;
|
||||
stream->readpos = 0;
|
||||
|
||||
|
||||
@@ -531,10 +531,6 @@ PHPAPI void _php_stream_fill_read_buffer(php_stream *stream, size_t size)
|
||||
php_stream_bucket_brigade brig_in = { NULL, NULL }, brig_out = { NULL, NULL };
|
||||
php_stream_bucket_brigade *brig_inp = &brig_in, *brig_outp = &brig_out, *brig_swap;
|
||||
|
||||
/* Invalidate the existing cache, otherwise reads can fail, see note in
|
||||
main/streams/filter.c::_php_stream_filter_append */
|
||||
stream->writepos = stream->readpos = 0;
|
||||
|
||||
/* allocate a buffer for reading chunks */
|
||||
chunk_buf = emalloc(stream->chunk_size);
|
||||
|
||||
|
||||
@@ -1209,8 +1209,8 @@ static void init_request_info(void)
|
||||
path_info = script_path_translated + ptlen;
|
||||
tflag = (slen != 0 && (!orig_path_info || strcmp(orig_path_info, path_info) != 0));
|
||||
} else {
|
||||
path_info = env_path_info ? env_path_info + pilen - slen : NULL;
|
||||
tflag = (orig_path_info != path_info);
|
||||
path_info = (env_path_info && pilen > slen) ? env_path_info + pilen - slen : NULL;
|
||||
tflag = path_info && (orig_path_info != path_info);
|
||||
}
|
||||
|
||||
if (tflag) {
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
--TEST--
|
||||
FPM: bug78599 - env_path_info underflow - CVE-2019-11043
|
||||
--SKIPIF--
|
||||
<?php include "skipif.inc"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once "tester.inc";
|
||||
|
||||
$cfg = <<<EOT
|
||||
[global]
|
||||
error_log = {{FILE:LOG}}
|
||||
[unconfined]
|
||||
listen = {{ADDR}}
|
||||
pm = dynamic
|
||||
pm.max_children = 5
|
||||
pm.start_servers = 1
|
||||
pm.min_spare_servers = 1
|
||||
pm.max_spare_servers = 3
|
||||
EOT;
|
||||
|
||||
$code = <<<EOT
|
||||
<?php
|
||||
echo "Test Start\n";
|
||||
var_dump(\$_SERVER["PATH_INFO"]);
|
||||
echo "Test End\n";
|
||||
EOT;
|
||||
|
||||
$tester = new FPM\Tester($cfg, $code);
|
||||
$tester->start();
|
||||
$tester->expectLogStartNotices();
|
||||
$uri = $tester->makeSourceFile();
|
||||
$tester
|
||||
->request(
|
||||
'',
|
||||
[
|
||||
'SCRIPT_FILENAME' => $uri . "/" . str_repeat('A', 35),
|
||||
'PATH_INFO' => '',
|
||||
'HTTP_HUI' => str_repeat('PTEST', 1000),
|
||||
],
|
||||
$uri
|
||||
)
|
||||
->expectBody(
|
||||
[
|
||||
'Test Start',
|
||||
'string(0) ""',
|
||||
'Test End'
|
||||
]
|
||||
);
|
||||
$tester->terminate();
|
||||
$tester->close();
|
||||
|
||||
?>
|
||||
Done
|
||||
--EXPECT--
|
||||
Done
|
||||
--CLEAN--
|
||||
<?php
|
||||
require_once "tester.inc";
|
||||
FPM\Tester::clean();
|
||||
?>
|
||||
@@ -513,7 +513,7 @@ class Tester
|
||||
return new Response(null, true);
|
||||
}
|
||||
if (is_null($uri)) {
|
||||
$uri = $this->makeFile('src.php', $this->code);
|
||||
$uri = $this->makeSourceFile();
|
||||
}
|
||||
|
||||
$params = array_merge(
|
||||
@@ -538,7 +538,6 @@ class Tester
|
||||
],
|
||||
$headers
|
||||
);
|
||||
|
||||
try {
|
||||
$this->response = new Response(
|
||||
$this->getClient($address, $connKeepAlive)->request_data($params, false)
|
||||
@@ -944,6 +943,14 @@ class Tester
|
||||
return $filePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function makeSourceFile()
|
||||
{
|
||||
return $this->makeFile('src.php', $this->code);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $msg
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user