Skip to content

Commit 92f8ade

Browse files
author
Tobias Vorwachs
committed
mbstring: fix missing copying of detect_order_list to current_detect_order_list on ini_set('mbstring.detect_order', string)
1 parent d750d30 commit 92f8ade

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

ext/mbstring/mbstring.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,9 @@ static PHP_INI_MH(OnUpdate_mbstring_detect_order)
718718
}
719719
MBSTRG(detect_order_list) = list;
720720
MBSTRG(detect_order_list_size) = size;
721+
722+
php_mb_populate_current_detect_order_list();
723+
721724
return SUCCESS;
722725
}
723726
/* }}} */
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
--TEST--
2+
Test mb_detect_order() function : ini set changes order
3+
--EXTENSIONS--
4+
mbstring
5+
--FILE--
6+
<?php
7+
8+
ini_set('mbstring.detect_order', 'UTF-8, ISO-8859-1, ASCII');
9+
10+
var_dump( mb_detect_order());
11+
12+
ini_set('mbstring.detect_order', 'UTF-8');
13+
14+
var_dump( mb_detect_order());
15+
16+
?>
17+
--EXPECT--
18+
array(3) {
19+
[0]=>
20+
string(5) "UTF-8"
21+
[1]=>
22+
string(10) "ISO-8859-1"
23+
[2]=>
24+
string(5) "ASCII"
25+
}
26+
array(1) {
27+
[0]=>
28+
string(5) "UTF-8"
29+
}

0 commit comments

Comments
 (0)