php / php/php-src

mb_http_input test is faild on Windows

Open
#14,407 9 comments 0 reactions 1 assignee View on GitHub

@alexdowad is already working on this.

Since Jun 1, 2024.

Bug Extension: mbstring Status: Needs Triage
Dominant language
C
Stars
40.4k
Forks
8.1k
Avg merge
2d 13h
Merged PRs (30d)
96

Description

Description

The following code:

C:\php-sdk\php-src
+$ nmake test TESTS=ext/mbstring
... ommited ...

Resulted in this output:

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
mb_http_input() [C:\php-sdk\php-src\ext\mbstring\tests\mb_http_input.phpt]
mb_http_input() with pass encoding [C:\php-sdk\php-src\ext\mbstring\tests\mb_http_input_pass.phpt]
=====================================================================
NMAKE : fatal error U1077: 'C:\php-sdk\php-src\x64\Debug_TS\php.exe' : リターン コード '0x1'
Stop.

But I expected this output instead:
Test all passed in mbstring.

I got an error when I put --enable-cgi. At least, PHP 8.0 and master is failed.

config.nice.bat script

@echo off
cscript /nologo /e:jscript configure.js "--disable-all" "--enable-cli" "--enable-cgi" "--enable-debug" "--enable-mbstring" "--enable-intl" %*

mb_http_input.log


---- EXPECTED OUTPUT
ÆüËܸì0123456789ÆüËܸ쥫¥¿¥«¥Ê¤Ò¤é¤¬¤Ê
ÆüËܸì0123456789ÆüËܸ쥫¥¿¥«¥Ê¤Ò¤é¤¬¤Ê
string(10) "ISO-8859-1"
string(10) "ISO-8859-1"
bool(false)
bool(false)
array(1) {
  [0]=>
  string(10) "ISO-8859-1"
}
string(10) "ISO-8859-1"
mb_http_input(): Argument #1 ($type) must be one of "G", "P", "C", "S", "I", or "L"
---- ACTUAL OUTPUT
ÆüËܸì0123456789ÆüËܸ쥫¥¿¥«¥Ê¤Ò¤é¤¬¤Ê
ƁEܸE123456789ƁEܸE«¥¿¥«¥Ê¤Ò¤é¤¬¤Ê
string(10) "ISO-8859-1"
string(10) "ISO-8859-1"
bool(false)
bool(false)
array(1) {
  [0]=>
  string(10) "ISO-8859-1"
}
string(10) "ISO-8859-1"
mb_http_input(): Argument #1 ($type) must be one of "G", "P", "C", "S", "I", or "L"
---- FAILED

mb_http_input.diff

     ÆüËܸì0123456789ÆüËܸ쥫¥¿¥«¥Ê¤Ò¤é¤¬¤Ê
002+ ƁEܸE123456789ƁEܸE«¥¿¥«¥Ê¤Ò¤é¤¬¤Ê
002- ÆüËܸì0123456789ÆüËܸ쥫¥¿¥«¥Ê¤Ò¤é¤¬¤Ê
     string(10) "ISO-8859-1"
     string(10) "ISO-8859-1"
     bool(false)
--

mb_http_input_pass.log


---- EXPECTED OUTPUT
���ܸ�0123456789���ܸ쥫�����ʤҤ餬��
���ܸ�0123456789���ܸ쥫�����ʤҤ餬��
string(4) "pass"
string(4) "pass"
bool(false)
bool(false)
array(1) {
  [0]=>
  string(4) "pass"
}
string(4) "pass"
---- ACTUAL OUTPUT
���ܸ�0123456789���ܸ쥫�����ʤҤ餬��
ƁEܸ�E123456789ƁEܸ�E������ʤҤ餬��
string(4) "pass"
string(4) "pass"
bool(false)
bool(false)
array(1) {
  [0]=>
  string(4) "pass"
}
string(4) "pass"
---- FAILED

mb_http_input_pass.diff

     ���ܸ�0123456789���ܸ쥫�����ʤҤ餬��
002+ ƁEܸ�E123456789ƁEܸ�E������ʤҤ餬��
002- ���ܸ�0123456789���ܸ쥫�����ʤҤ餬��
     string(4) "pass"
     string(4) "pass"
     bool(false)
--

My environment is:

  • Windows 11
  • Probably character code is cp932

Please see below .log file and .diff files.
mb_http_input_test_failes.zip

PHP Version

PHP 8.0 - master

Operating System

Windows

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.