]> granicus.if.org Git - php/commitdiff
MFH
authorAntony Dovgal <tony2001@php.net>
Thu, 21 Dec 2006 01:18:28 +0000 (01:18 +0000)
committerAntony Dovgal <tony2001@php.net>
Thu, 21 Dec 2006 01:18:28 +0000 (01:18 +0000)
ext/standard/html.c
main/streams/memory.c

index f2a6f72aa1ee47059eda88e8e74f5bb044c80f1b..0358b4a8271b05c615788f702a6f127668566610 100644 (file)
@@ -948,7 +948,8 @@ PHPAPI char *php_unescape_html_entities(unsigned char *old, int oldlen, int *new
 
                                        default:
                                                php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot yet handle MBCS!");
-                                               return 0;
+                                               efree(ret);
+                                               return NULL;
                                }
 
                                if (php_memnstr(ret, entity, entity_length, ret+retlen)) {
@@ -1308,7 +1309,10 @@ PHP_FUNCTION(html_entity_decode)
        }
 
        replaced = php_unescape_html_entities(str, str_len, &len, 1, quote_style, hint_charset TSRMLS_CC);
-       RETVAL_STRINGL(replaced, len, 0);
+       if (replaced) {
+               RETURN_STRINGL(replaced, len, 0);
+       }
+       RETURN_FALSE;
 }
 /* }}} */
 
index 8d7247c7d70e3f8b379cfbe5195302b0949685cb..6190713d9fe2dd04af25d4e426bd880cef15c736 100644 (file)
@@ -673,7 +673,6 @@ static php_stream * php_stream_url_wrap_rfc2397(php_stream_wrapper *wrapper, cha
        if ((stream = php_stream_temp_create_rel(0, ~0u)) != NULL) {
                /* store data */
                php_stream_temp_write(stream, comma, ilen TSRMLS_CC);
-               efree(comma);
                php_stream_temp_seek(stream, 0, SEEK_SET, &newoffs TSRMLS_CC);
                /* set special stream stuff (enforce exact mode) */
                vlen = strlen(mode);