X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=php_http_encoding.c;h=a1667fc0fdc645be68540c69cf75fc670ccdb40e;hb=f67e69874fc670c9ee1944349c227c6df6d25a80;hp=c84c30981277d7f478a83e2330da97a88dfb555b;hpb=305ac2f007710b684d96b05f33964b4f6a4e3e4d;p=m6w6%2Fext-http diff --git a/php_http_encoding.c b/php_http_encoding.c index c84c309..a1667fc 100644 --- a/php_http_encoding.c +++ b/php_http_encoding.c @@ -959,11 +959,7 @@ zend_object_value php_http_encoding_stream_object_new_ex(zend_class_entry *ce, p o = ecalloc(1, sizeof(*o)); zend_object_std_init((zend_object *) o, ce TSRMLS_CC); -#if PHP_VERSION_ID < 50339 - zend_hash_copy(((zend_object *) o)->properties, &(ce->default_properties), (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval*)); -#else object_properties_init((zend_object *) o, ce); -#endif if (ptr) { *ptr = o; @@ -1065,7 +1061,11 @@ PHP_METHOD(HttpEncodingStream, flush) size_t encoded_len; if (SUCCESS == php_http_encoding_stream_flush(obj->stream, &encoded_str, &encoded_len)) { - RETURN_STRINGL(encoded_str, encoded_len, 0); + if (encoded_str) { + RETURN_STRINGL(encoded_str, encoded_len, 0); + } else { + RETURN_EMPTY_STRING(); + } } } }