com php-src: replace AND operator with OR operator: ext/mbstring/mbstring.c

From: Date: Sat, 07 Mar 2015 17:03:47 +0000
Subject: com php-src: replace AND operator with OR operator: ext/mbstring/mbstring.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-93701@lists.php.net to get a copy of this message
Commit: d24dacc594cd82ebb6ac984a91ffbcd3ace2a602 Author: Masaki Kagaya <masakielastic@gmail.com> Sun, 1 Mar 2015 16:01:06 +0900 Parents: 905dfb9179a570b51469febda825a52a529d6793 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d24dacc594cd82ebb6ac984a91ffbcd3ace2a602 Log: replace AND operator with OR operator Changed paths: M ext/mbstring/mbstring.c Diff: diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index c17fc65..25982bd 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -4817,23 +4817,18 @@ static inline char* php_mb_chr(long cp, const char* enc, size_t *output_len) cp = 0x3f; } - } - - if (php_mb_is_no_encoding_utf8(no_enc)) { + } else if (php_mb_is_no_encoding_utf8(no_enc)) { if (cp > 0xd7ff && 0xe000 > cp) { if (php_mb_is_no_encoding_unicode(MBSTRG(current_internal_encoding)->no_encoding)) { - - if (MBSTRG(current_filter_illegal_substchar) > 0xd7ff && 0xe000 > MBSTRG(current_filter_illegal_substchar)) { - cp = 0x3f; - } else { + if (0xd800 > MBSTRG(current_filter_illegal_substchar) || MBSTRG(current_filter_illegal_substchar) > 0xdfff) { cp = MBSTRG(current_filter_illegal_substchar); + } else { + cp = 0x3f; } - } else { cp = 0x3f; } - } } @@ -4854,6 +4849,7 @@ static inline char* php_mb_chr(long cp, const char* enc, size_t *output_len) } return ret; + } else if (php_mb_is_unsupported_no_encoding(no_enc)) { php_error_docref(NULL, E_WARNING, "Unsupported encoding \"%s\"", enc); return NULL;

« previous php.cvs (#93701) next »