mirror of
https://github.com/phpv8/v8js.git
synced 2025-01-01 17:11:52 +00:00
Add null-byte passing test, make var_dump null-byte safe, closes #80
This commit is contained in:
parent
0355a95c78
commit
fd801631b7
BIN
tests/null_byte_string.phpt
Normal file
BIN
tests/null_byte_string.phpt
Normal file
Binary file not shown.
@ -100,11 +100,13 @@ static void _php_v8js_dumper(v8::Isolate *isolate, v8::Local<v8::Value> var, int
|
|||||||
}
|
}
|
||||||
v8::String::Utf8Value str(details);
|
v8::String::Utf8Value str(details);
|
||||||
const char *valstr = ToCString(str);
|
const char *valstr = ToCString(str);
|
||||||
size_t valstr_len = (valstr) ? strlen(valstr) : 0;
|
size_t valstr_len = details->ToString()->Utf8Length();
|
||||||
|
|
||||||
if (var->IsString())
|
if (var->IsString())
|
||||||
{
|
{
|
||||||
php_printf("string(%zu) \"%s\"\n", valstr_len, valstr);
|
php_printf("string(%zu) \"", valstr_len, valstr);
|
||||||
|
php_output_write(valstr, valstr_len TSRMLS_CC);
|
||||||
|
php_printf("\"\n");
|
||||||
}
|
}
|
||||||
else if (var->IsDate())
|
else if (var->IsDate())
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user