Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions ext/mbstring/tests/bug54494.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
Bug #54494: mb_substr() mishandles UTF-32LE and UCS-2LE
--EXTENSIONS--
mbstring
--INI--
internal_encoding=UTF-8
--FILE--
<?php

//declare(encoding = 'UTF-8');
mb_internal_encoding('UTF-8');

header('Content-Type: text/plain; charset=UTF-32LE');

$stringOr = "hällö wörld\n";
Expand Down
4 changes: 2 additions & 2 deletions ext/mbstring/tests/bug65045.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
Bug #65045: mb_convert_encoding breaks well-formed character
--EXTENSIONS--
mbstring
--INI--
internal_encoding=UTF-8
--FILE--
<?php

mb_internal_encoding('UTF-8');

$str = "\xF0\xA4\xAD". "\xF0\xA4\xAD\xA2"."\xF0\xA4\xAD\xA2";
$str2 = "\xF0\xA4\xAD\xA2"."\xF0\xA4\xAD\xA2"."\xF0\xA4\xAD";

Expand Down
3 changes: 2 additions & 1 deletion ext/mbstring/tests/bug79441.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
Bug #79441 Segfault in mb_chr() if internal encoding is unsupported
--EXTENSIONS--
mbstring
--INI--
internal_encoding=utf-7
--FILE--
<?php

mb_internal_encoding("utf-7");
try {
mb_chr(0xd800);
} catch (\ValueError $e) {
Expand Down
2 changes: 1 addition & 1 deletion ext/mbstring/tests/gh7902.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ if (str_contains(getcwd(), " ")) die("skip sendmail_path ini with spaces");
?>
--INI--
sendmail_path={MAIL:{PWD}/gh7902.eml}
internal_encoding=UTF-8
--FILE--
<?php
mb_internal_encoding("UTF-8");
mb_language("uni");
$to = "omittedvalidaddress@example.com";
$subject = "test mail";
Expand Down
2 changes: 1 addition & 1 deletion ext/mbstring/tests/gh8086.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ GH-8086 (mb_send_mail() function not working correctly in PHP 8.x)
--EXTENSIONS--
mbstring
--INI--
internal_encoding=UTF-8
sendmail_path={MAIL:{PWD}/gh8086.eml}
mail.mixed_lf_and_crlf=on
--FILE--
<?php
mb_internal_encoding("UTF-8");
mb_language("uni");
$to = "omittedvalidaddress@example.com";
$subject = "test mail";
Expand Down
3 changes: 2 additions & 1 deletion ext/mbstring/tests/mb_decode_mimeheader_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
Test mb_decode_mimeheader() function : basic functionality
--EXTENSIONS--
mbstring
--INI--
internal_encoding=utf-8
--FILE--
<?php
echo "*** Testing mb_decode_mimeheader() : basic functionality ***\n";
mb_internal_encoding('utf-8');

//the following encoded-words are identical and are UTF-8 Japanese.
$a = "=?UTF-8?b?5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CC?=";
Expand Down
3 changes: 2 additions & 1 deletion ext/mbstring/tests/mb_decode_mimeheader_variation2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
Test mb_decode_mimeheader() function : variation
--EXTENSIONS--
mbstring
--INI--
internal_encoding=utf-8
--FILE--
<?php
echo "*** Testing mb_decode_mimeheader() : variation ***\n";
mb_internal_encoding('utf-8');

//all the following are identical, we will convert to utf-8

Expand Down
3 changes: 2 additions & 1 deletion ext/mbstring/tests/mb_decode_mimeheader_variation3.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
Test mb_decode_mimeheader() function : variation
--EXTENSIONS--
mbstring
--INI--
internal_encoding=iso-8859-7
--FILE--
<?php
echo "*** Testing mb_decode_mimeheader() : variation ***\n";
mb_internal_encoding('iso-8859-7');

//greek in UTF-8 to be converted to iso-8859-7
$encoded_word = "=?UTF-8?B?zrHOss6zzrTOtc62zrfOuM65zrrOu868zr3Ovs6/z4DPgc+Dz4TPhc+Gz4fPiM+J?=";
Expand Down
4 changes: 2 additions & 2 deletions ext/mbstring/tests/mb_encode_mimeheader_indent.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Test mb_encode_mimeheader() function : basic functionality, indent
--EXTENSIONS--
mbstring
--INI--
internal_encoding=utf-8
--FILE--
<?php
/* (string $str [, string $charset [, string $transfer_encoding [, string $linefeed [, int $indent]]]])
Expand All @@ -15,8 +17,6 @@ mbstring

echo "*** Testing mb_encode_mimeheader() : indent ***\n";

mb_internal_encoding('utf-8');

// Initialise function arguments not being substituted
$str = base64_decode('zpHPhc+Ez4wgzrXOr869zrHOuSDOtc67zrvOt869zrnOus+MIM66zrXOr868zrXOvc6/LiAwMTIzNDU2Nzg5Lg==');
$charset = 'utf-8';
Expand Down
4 changes: 2 additions & 2 deletions ext/mbstring/tests/mb_encode_mimeheader_variation6.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Test mb_encode_mimeheader() function : usage variations - Pass different strings to $linefeed arg
--EXTENSIONS--
mbstring
--INI--
internal_encoding=utf-8
--FILE--
<?php
/* (string $str [, string $charset [, string $transfer_encoding [, string $linefeed [, int $indent]]]])
Expand All @@ -15,8 +17,6 @@ mbstring

echo "*** Testing mb_encode_mimeheader() : usage variations ***\n";

mb_internal_encoding('utf-8');

$linefeeds = array("\r\n",
"\n",
"---");
Expand Down
3 changes: 2 additions & 1 deletion ext/mbstring/tests/mb_ereg_match_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Test mb_ereg_match() function : basic functionality
--EXTENSIONS--
mbstring
--INI--
internal_encoding=UTF-8
--SKIPIF--
<?php
function_exists('mb_ereg_match') or die("skip mb_ereg_match() is not available in this build");
Expand All @@ -12,7 +14,6 @@ function_exists('mb_ereg_match') or die("skip mb_ereg_match() is not available i
* Test basic functionality of mb_ereg_match
*/

mb_internal_encoding('UTF-8');
mb_regex_encoding('UTF-8');

echo "*** Testing mb_ereg_match() : basic functionality ***\n";
Expand Down
3 changes: 2 additions & 1 deletion ext/mbstring/tests/mb_ereg_replace_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Test mb_ereg_replace() function : basic
--EXTENSIONS--
mbstring
--INI--
internal_encoding=UTF-8
--SKIPIF--
<?php
function_exists('mb_ereg_replace') or die("skip mb_ereg_replace() is not available in this build");
Expand All @@ -14,7 +16,6 @@ function_exists('mb_ereg_replace') or die("skip mb_ereg_replace() is not availab

echo "*** Testing mb_ereg_replace() : basic functionality ***\n";

mb_internal_encoding('UTF-8');
mb_regex_encoding('UTF-8');

$string_ascii = 'abc def';
Expand Down
3 changes: 2 additions & 1 deletion ext/mbstring/tests/mb_output_handler_pattern-01.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
mb_output_handler() and mbstring.http_output_conv_mimetypes (1)
--EXTENSIONS--
mbstring
--INI--
output_encoding=EUC-JP
--FILE--
<?php
mb_http_output("EUC-JP");
header("Content-Type: text/html");
ob_start();
ob_start('mb_output_handler');
Expand Down
3 changes: 2 additions & 1 deletion ext/mbstring/tests/mb_output_handler_pattern-02.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
mb_output_handler() and mbstring.http_output_conv_mimetypes (2)
--EXTENSIONS--
mbstring
--INI--
output_encoding=EUC-JP
--FILE--
<?php
mb_http_output("EUC-JP");
header("Content-Type: text/plain");
ob_start();
ob_start('mb_output_handler');
Expand Down
3 changes: 2 additions & 1 deletion ext/mbstring/tests/mb_output_handler_pattern-03.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
mb_output_handler() and mbstring.http_output_conv_mimetypes (3)
--EXTENSIONS--
mbstring
--INI--
output_encoding=EUC-JP
--FILE--
<?php
mb_http_output("EUC-JP");
header("Content-Type: application/xhtml+xml");
ob_start();
ob_start('mb_output_handler');
Expand Down
3 changes: 2 additions & 1 deletion ext/mbstring/tests/mb_output_handler_pattern-04.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
mb_output_handler() and mbstring.http_output_conv_mimetypes (4)
--EXTENSIONS--
mbstring
--INI--
output_encoding=EUC-JP
--FILE--
<?php
mb_http_output("EUC-JP");
header("Content-Type: application/octet-stream");
ob_start();
ob_start('mb_output_handler');
Expand Down
3 changes: 2 additions & 1 deletion ext/mbstring/tests/mb_output_handler_pattern-05.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
mb_output_handler() and mbstring.http_output_conv_mimetypes (5)
--EXTENSIONS--
mbstring
--INI--
output_encoding=EUC-JP
--FILE--
<?php
mb_http_output("EUC-JP");
ob_start();
ob_start('mb_output_handler');
echo "テスト";
Expand Down
3 changes: 2 additions & 1 deletion ext/mbstring/tests/mb_output_handler_pattern-06.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
mb_output_handler() and mbstring.http_output_conv_mimetypes (6)
--EXTENSIONS--
mbstring
--INI--
output_encoding=EUC-JP
--FILE--
<?php
mb_http_output("EUC-JP");
header("Content-Type: text/html");
ob_start();
ob_start('mb_output_handler');
Expand Down
2 changes: 1 addition & 1 deletion ext/mbstring/tests/mb_output_handler_pattern-07.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ mb_output_handler() and mbstring.http_output_conv_mimetypes (7)
mbstring
--INI--
mbstring.http_output_conv_mimetypes=html
output_encoding=EUC-JP
--FILE--
<?php
mb_http_output("EUC-JP");
header("Content-Type: text/html");
ob_start();
ob_start('mb_output_handler');
Expand Down
2 changes: 1 addition & 1 deletion ext/mbstring/tests/mb_output_handler_pattern-08.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ mb_output_handler() and mbstring.http_output_conv_mimetypes (8)
--EXTENSIONS--
mbstring
--INI--
output_encoding=EUC-JP
mbstring.http_output_conv_mimetypes=html
--FILE--
<?php
mb_http_output("EUC-JP");
header("Content-Type: text/plain");
ob_start();
ob_start('mb_output_handler');
Expand Down
2 changes: 1 addition & 1 deletion ext/mbstring/tests/mb_output_handler_pattern-09.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ mb_output_handler() and mbstring.http_output_conv_mimetypes (9)
mbstring
--INI--
mbstring.http_output_conv_mimetypes=html
output_encoding=EUC-JP
--FILE--
<?php
mb_http_output("EUC-JP");
header("Content-Type: application/xhtml+xml");
ob_start();
ob_start('mb_output_handler');
Expand Down
2 changes: 1 addition & 1 deletion ext/mbstring/tests/mb_output_handler_pattern-10.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ mb_output_handler() and mbstring.http_output_conv_mimetypes (10)
--EXTENSIONS--
mbstring
--INI--
output_encoding=EUC-JP
mbstring.http_output_conv_mimetypes=html
--FILE--
<?php
mb_http_output("EUC-JP");
header("Content-Type: application/octet-stream");
ob_start();
ob_start('mb_output_handler');
Expand Down
3 changes: 2 additions & 1 deletion ext/mbstring/tests/mb_output_handler_pattern-11.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
mb_output_handler() and mbstring.http_output_conv_mimetypes (11)
--EXTENSIONS--
mbstring
--INI--
output_encoding=EUC-JP
--FILE--
<?php
mb_http_output("EUC-JP");
ob_start();
ob_start('mb_output_handler');
echo "テスト";
Expand Down
3 changes: 2 additions & 1 deletion ext/mbstring/tests/mb_output_handler_pattern-12.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
mb_output_handler() and mbstring.http_output_conv_mimetypes (12)
--EXTENSIONS--
mbstring
--INI--
output_encoding=EUC-JP
--FILE--
<?php
mb_http_output("EUC-JP");
header("Content-Type: text/html");
ob_start();
ob_start('mb_output_handler');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ mb_output_handler() and mbstring.http_output_conv_mimetypes alteration in runtim
mbstring
--INI--
internal_encoding=UTF-8
output_encoding=EUC-JP
mbstring.http_output_conv_mimetypes=plain
--FILE--
<?php
mb_http_output("EUC-JP");
ini_set('mbstring.http_output_conv_mimetypes', 'text');
header("Content-Type: text/html");
ob_start();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ mb_output_handler() and mbstring.http_output_conv_mimetypes alteration in runtim
mbstring
--INI--
internal_encoding=UTF-8
output_encoding=EUC-JP
mbstring.http_output_conv_mimetypes=html
--FILE--
<?php
mb_http_output("EUC-JP");
ini_set('mbstring.http_output_conv_mimetypes', 'application');
header("Content-Type: text/html");
ob_start();
Expand Down
3 changes: 2 additions & 1 deletion ext/mbstring/tests/mb_parse_str_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
mb_parse_str() error handling
--EXTENSIONS--
mbstring
--INI--
internal_encoding=UTF-8
--FILE--
<?php
mb_internal_encoding('UTF-8');

$queries = array(
"\x80\x80\x80",
Expand Down
2 changes: 1 addition & 1 deletion ext/mbstring/tests/mb_parse_str_multi.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ mb_parse_str() with multiple candidate encodings
--EXTENSIONS--
mbstring
--INI--
internal_encoding=UTF-8
mbstring.http_input=UTF-8,SJIS,EUC-JP,ISO-8859-1,ISO-2022-JP
--FILE--
<?php
// The encoding of the input strings will be guessed, from the list specified
// via mbstring.http_input
// All of them will be converted to UTF-8
mb_internal_encoding('UTF-8');

$queries = array(
// UTF-8
Expand Down
4 changes: 2 additions & 2 deletions ext/mbstring/tests/mb_stripos_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Test mb_stripos() function : basic functionality
--EXTENSIONS--
mbstring
--INI--
internal_encoding=UTF-8
--FILE--
<?php
/*
Expand All @@ -10,8 +12,6 @@ mbstring

echo "*** Testing mb_stripos() : basic functionality***\n";

mb_internal_encoding('UTF-8');

//ascii strings
$ascii_haystacks = array(
'abc defabc def',
Expand Down
Loading