]> granicus.if.org Git - php/commitdiff
Please review this one. It seems pretty fundamental.
authorRasmus Lerdorf <rasmus@php.net>
Sun, 26 Jul 2009 15:53:36 +0000 (15:53 +0000)
committerRasmus Lerdorf <rasmus@php.net>
Sun, 26 Jul 2009 15:53:36 +0000 (15:53 +0000)
When $str is a binary string and you do: $str[4]=0;
there should be no unicode conversion.

Zend/zend_execute.c

index aa592fd4605cf5fe1065018abda52ffea4c8ba51..822a2ddcf02392367fdb28d747ec446804b42c59 100644 (file)
@@ -649,7 +649,7 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, zval
 
 static inline int zend_assign_to_string_offset(const temp_variable *T, const zval *value, int value_type TSRMLS_DC) /* {{{ */
 {
-       if (Z_TYPE_P(T->str_offset.str) == IS_STRING && Z_TYPE_P(value) != IS_STRING) {
+       if (Z_TYPE_P(T->str_offset.str) == IS_STRING && Z_TYPE_P(value) == IS_UNICODE) {
                convert_to_unicode(T->str_offset.str);
        }