mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
backport 9a07245b72 from 7.0
This commit is contained in:
19
main/main.c
19
main/main.c
@@ -788,9 +788,20 @@ PHPAPI void php_verror(const char *docref, const char *params, int type, const c
|
||||
if (PG(html_errors)) {
|
||||
size_t len;
|
||||
char *replace = php_escape_html_entities(buffer, buffer_len, &len, 0, ENT_COMPAT, NULL TSRMLS_CC);
|
||||
|
||||
if (!replace || len < 1) {
|
||||
replace = php_escape_html_entities(buffer, buffer_len, &len, 0, ENT_COMPAT | ENT_HTML_SUBSTITUTE_ERRORS, NULL TSRMLS_CC);
|
||||
}
|
||||
|
||||
efree(buffer);
|
||||
buffer = replace;
|
||||
buffer_len = len;
|
||||
|
||||
if (replace) {
|
||||
buffer = replace;
|
||||
buffer_len = len;
|
||||
} else {
|
||||
buffer = "";
|
||||
buffer_len = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* which function caused the problem if any at all */
|
||||
@@ -935,7 +946,9 @@ PHPAPI void php_verror(const char *docref, const char *params, int type, const c
|
||||
zend_hash_update(EG(active_symbol_table), "php_errormsg", sizeof("php_errormsg"), (void **) &tmp, sizeof(zval *), NULL);
|
||||
}
|
||||
}
|
||||
str_efree(buffer);
|
||||
if (buffer_len > 0) {
|
||||
str_efree(buffer);
|
||||
}
|
||||
|
||||
php_error(type, "%s", message);
|
||||
efree(message);
|
||||
|
||||
21
tests/basic/bug71273.phpt
Normal file
21
tests/basic/bug71273.phpt
Normal file
@@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
Bug #71273 A wrong ext directory setup in php.ini leads to crash
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if ("cli" != php_sapi_name()) {
|
||||
die("skip CLI only");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/* NOTE this file is required to be encoded in iso-8859-1 */
|
||||
|
||||
$cmd = getenv('TEST_PHP_EXECUTABLE') . " -n -d html_errors=on -d extension_dir=a/é/w -d extension=php_kartoffelbrei.dll -v 2>&1";
|
||||
$out = shell_exec($cmd);
|
||||
|
||||
var_dump(preg_match(",.+a[\\/].+[\\/]w.php_kartoffelbrei.dll.+,s", $out));
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECTF--
|
||||
int(1)
|
||||
==DONE==
|
||||
Reference in New Issue
Block a user