diff options
| author | Christoph M. Becker <cmbecker69@gmx.de> | 2018-08-04 12:51:57 +0200 |
|---|---|---|
| committer | Christoph M. Becker <cmbecker69@gmx.de> | 2018-08-04 12:51:57 +0200 |
| commit | c00f5e6531a3f72bb8f7c107d2c390fadad736a0 (patch) | |
| tree | 50522d94ecefc3af839e9269df2432582b20f939 /ext/mbstring/mbstring.c | |
| parent | b71a5038448baa79cae72fadb22a4bfb4c2465a9 (diff) | |
| download | php-git-c00f5e6531a3f72bb8f7c107d2c390fadad736a0.tar.gz | |
Fix #76704: mb_detect_order return value varies based on argument type
php_mb_parse_encoding_list() and php_mb_parse_encoding_array() are
supposed to return SUCCESS and FAILURE, not 1 and 0, respectively.
Diffstat (limited to 'ext/mbstring/mbstring.c')
| -rw-r--r-- | ext/mbstring/mbstring.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index d997ffbe52..fa2d794e1a 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -681,7 +681,7 @@ static sapi_post_entry mbstr_post_entries[] = { /* }}} */ /* {{{ static int php_mb_parse_encoding_list() - * Return 0 if input contains any illegal encoding, otherwise 1. + * Return FAILURE if input contains any illegal encoding, otherwise SUCCESS. * Even if any illegal encoding is detected the result may contain a list * of parsed encodings. */ @@ -762,7 +762,7 @@ php_mb_parse_encoding_list(const char *value, size_t value_length, const mbfl_en *entry++ = encoding; n++; } else { - ret = 0; + ret = FAILURE; } } p1 = p2 + 1; @@ -778,7 +778,7 @@ php_mb_parse_encoding_list(const char *value, size_t value_length, const mbfl_en if (return_list) { *return_list = NULL; } - ret = 0; + ret = FAILURE; } if (return_size) { *return_size = n; @@ -790,7 +790,7 @@ php_mb_parse_encoding_list(const char *value, size_t value_length, const mbfl_en if (return_size) { *return_size = 0; } - ret = 0; + ret = FAILURE; } efree(tmpstr); } @@ -800,7 +800,7 @@ php_mb_parse_encoding_list(const char *value, size_t value_length, const mbfl_en /* }}} */ /* {{{ static int php_mb_parse_encoding_array() - * Return 0 if input contains any illegal encoding, otherwise 1. + * Return FAILURE if input contains any illegal encoding, otherwise SUCCESS. * Even if any illegal encoding is detected the result may contain a list * of parsed encodings. */ |
