]> granicus.if.org Git - php/commitdiff
improve fix for bug #71273
authorAnatol Belski <ab@php.net>
Tue, 5 Jan 2016 19:03:05 +0000 (20:03 +0100)
committerAnatol Belski <ab@php.net>
Tue, 5 Jan 2016 19:03:05 +0000 (20:03 +0100)
main/main.c

index bc978d9ae311b1f67f8792af264f40fef1c73aab..77a2f64b40af9d6a28dd91bab9ff260e515511f7 100644 (file)
@@ -724,7 +724,7 @@ PHPAPI ZEND_COLD void php_verror(const char *docref, const char *params, int typ
        if (PG(html_errors)) {
                replace_buffer = php_escape_html_entities((unsigned char*)buffer, buffer_len, 0, ENT_COMPAT, NULL);
                /* Retry with substituting invalid chars on fail. */
-               if (!replace_buffer) {
+               if (!replace_buffer || ZSTR_LEN(replace_buffer) < 1) {
                        replace_buffer = php_escape_html_entities((unsigned char*)buffer, buffer_len, 0, ENT_COMPAT | ENT_HTML_SUBSTITUTE_ERRORS, NULL);
                }