Skip to content
Closed
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: 1 addition & 4 deletions ext/mbstring/mbstring.c
Original file line number Diff line number Diff line change
Expand Up @@ -3185,10 +3185,7 @@ PHP_FUNCTION(mb_convert_kana)
* or all FW hiragana to FW katakana, or all FW katakana to FW hiragana, but not
* more than one of these */
if (opt & MBFL_ZEN2HAN_HIRAGANA) {
if (opt & MBFL_ZEN2HAN_KATAKANA) {
zend_argument_value_error(2, "must not combine 'h' and 'k' flags");
RETURN_THROWS();
} else if (opt & MBFL_ZENKAKU_HIRA2KATA) {
if (opt & MBFL_ZENKAKU_HIRA2KATA) {
zend_argument_value_error(2, "must not combine 'h' and 'C' flags");
RETURN_THROWS();
} else if (opt & MBFL_ZENKAKU_KATA2HIRA) {
Expand Down
5 changes: 2 additions & 3 deletions ext/mbstring/tests/mb_convert_kana.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ echo bin2hex(mb_convert_kana("\x30\x9B", 'k', 'UTF-16BE')), "\n";
echo bin2hex(mb_convert_kana("\x30\x9C", 'k', 'UTF-16BE')), "\n";
echo bin2hex(mb_convert_kana("\x30\xFC", 'k', 'UTF-16BE')), "\n";
echo bin2hex(mb_convert_kana("\x30\xFB", 'k', 'UTF-16BE')), "\n";
echo bin2hex(mb_convert_kana("fooあいうエオ", "rnaskh", "UTF-8")), "\n";
echo "Including one which will expand to two codepoints:\n";
echo bin2hex(mb_convert_kana("\x30\x52", 'h', 'UTF-16BE')), "\n\n";

Expand Down Expand Up @@ -117,7 +118,6 @@ tryIncompatibleFlags('R', 'r');
tryIncompatibleFlags('N', 'n');
tryIncompatibleFlags('S', 's');
tryIncompatibleFlags('K', 'H');
tryIncompatibleFlags('k', 'h');
tryIncompatibleFlags('C', 'c');
tryIncompatibleFlags('M', 'm');
tryIncompatibleFlags('h', 'C');
Expand Down Expand Up @@ -204,6 +204,7 @@ ff9e
ff9f
ff70
ff65
666f6fefbdb1efbdb2efbdb3efbdb4efbdb5
Including one which will expand to two codepoints:
ff79ff9e

Expand Down Expand Up @@ -237,8 +238,6 @@ mb_convert_kana(): Argument #2 ($mode) must not combine 'S' and 's' flags
mb_convert_kana(): Argument #2 ($mode) must not combine 'S' and 's' flags
mb_convert_kana(): Argument #2 ($mode) must not combine 'H' and 'K' flags
mb_convert_kana(): Argument #2 ($mode) must not combine 'H' and 'K' flags
mb_convert_kana(): Argument #2 ($mode) must not combine 'h' and 'k' flags
mb_convert_kana(): Argument #2 ($mode) must not combine 'h' and 'k' flags
mb_convert_kana(): Argument #2 ($mode) must not combine 'C' and 'c' flags
mb_convert_kana(): Argument #2 ($mode) must not combine 'C' and 'c' flags
mb_convert_kana(): Argument #2 ($mode) must not combine 'M' and 'm' flags
Expand Down