From: Dmitry Stogov Date: Fri, 29 Jun 2007 14:53:02 +0000 (+0000) Subject: ord() must not convert binary data to unicode in unicode mode X-Git-Tag: BEFORE_IMPORT_OF_MYSQLND~341 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8ff24e8728912c633bb389383bb2477badc9912b;p=php ord() must not convert binary data to unicode in unicode mode --- diff --git a/ext/standard/string.c b/ext/standard/string.c index a2715c412f..718a64b2ef 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -3613,7 +3613,9 @@ PHP_FUNCTION(ord) WRONG_PARAM_COUNT; } - convert_to_text_ex(str); + if (Z_TYPE_PP(str) != IS_UNICODE && Z_TYPE_PP(str) != IS_STRING) { + convert_to_text_ex(str); + } if (Z_TYPE_PP(str) == IS_UNICODE) { RETURN_LONG(zend_get_codepoint_at(Z_USTRVAL_PP(str), Z_USTRLEN_PP(str), 0)); } else {