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
6 changes: 3 additions & 3 deletions Zend/tests/zend_ini_parse_quantity_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ int(1048576)

# "1X"

Warning: Invalid quantity "1X": unknown multipler "X", interpreting as "1" for backwards compatibility in %s%ezend_ini_parse_quantity_error.php on line %d
Warning: Invalid quantity "1X": unknown multiplier "X", interpreting as "1" for backwards compatibility in %s%ezend_ini_parse_quantity_error.php on line %d
int(1)

# "1.0K"
Expand Down Expand Up @@ -70,10 +70,10 @@ int(125952)

# " 123K\000"

Warning: Invalid quantity " 123K\x00": unknown multipler "\x00", interpreting as " 123" for backwards compatibility in %s on line %d
Warning: Invalid quantity " 123K\x00": unknown multiplier "\x00", interpreting as " 123" for backwards compatibility in %s on line %d
int(123)

# " 123\000"

Warning: Invalid quantity " 123\x00": unknown multipler "\x00", interpreting as " 123" for backwards compatibility in %s on line %d
Warning: Invalid quantity " 123\x00": unknown multiplier "\x00", interpreting as " 123" for backwards compatibility in %s on line %d
int(123)
2 changes: 1 addition & 1 deletion Zend/tests/zend_ini_parse_quantity_ini_set_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ zend_test
var_dump(ini_set("zend_test.quantity_value", "1MB"));
var_dump(ini_get("zend_test.quantity_value"));
--EXPECTF--
Warning: Invalid "zend_test.quantity_value" setting. Invalid quantity "1MB": unknown multipler "B", interpreting as "1" for backwards compatibility in %s on line %d
Warning: Invalid "zend_test.quantity_value" setting. Invalid quantity "1MB": unknown multiplier "B", interpreting as "1" for backwards compatibility in %s on line %d
string(1) "0"
string(3) "1MB"
2 changes: 1 addition & 1 deletion Zend/tests/zend_ini_parse_quantity_ini_setting_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ zend_test.quantity_value=1MB

var_dump(ini_get("zend_test.quantity_value"));
--EXPECTF--
Warning: Invalid "zend_test.quantity_value" setting. Invalid quantity "1MB": unknown multipler "B", interpreting as "1" for backwards compatibility in %s on line %d
Warning: Invalid "zend_test.quantity_value" setting. Invalid quantity "1MB": unknown multiplier "B", interpreting as "1" for backwards compatibility in %s on line %d
string(3) "1MB"
2 changes: 1 addition & 1 deletion Zend/zend_ini.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ static zend_ulong zend_ini_parse_quantity_internal(zend_string *value, zend_ini_
smart_str_append_escaped(&chr, str_end-1, 1);
smart_str_0(&chr);

*errstr = zend_strpprintf(0, "Invalid quantity \"%s\": unknown multipler \"%s\", interpreting as \"%s\" for backwards compatibility",
*errstr = zend_strpprintf(0, "Invalid quantity \"%s\": unknown multiplier \"%s\", interpreting as \"%s\" for backwards compatibility",
ZSTR_VAL(invalid.s), ZSTR_VAL(chr.s), ZSTR_VAL(interpreted.s));

smart_str_free(&invalid);
Expand Down
4 changes: 2 additions & 2 deletions Zend/zend_ini.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ ZEND_API bool zend_ini_parse_bool(zend_string *str);
*
* The value parameter must be a string in the form
*
* sign? digits ws* multipler?
* sign? digits ws* multiplier?
*
* with
*
* sign: [+-]
* digit: [0-9]
* digits: digit+
* ws: [ \t\n\r\v\f]
* multipler: [KMG]
* multiplier: [KMG]
*
* Leading and trailing whitespaces are ignored.
*
Expand Down
2 changes: 1 addition & 1 deletion tests/basic/ini_parse_quantity_warnings.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ ini_parse_quantity('1mb');
ini_parse_quantity('256 then skip a few then g')
?>
--EXPECTF--
Warning: Invalid quantity "1mb": unknown multipler "b", interpreting as "1" for backwards compatibility in %sini_parse_quantity_warnings.php on line 3
Warning: Invalid quantity "1mb": unknown multiplier "b", interpreting as "1" for backwards compatibility in %sini_parse_quantity_warnings.php on line 3

Warning: Invalid quantity "256 then skip a few then g", interpreting as "256 g" for backwards compatibility in %sini_parse_quantity_warnings.php on line 4