Skip to content

Commit 5f3e75a

Browse files
committed
MFZE1
1 parent 45a203b commit 5f3e75a

File tree

1 file changed

+26
-6
lines changed

1 file changed

+26
-6
lines changed

Zend/zend_ini.c

+26-6
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525

2626
static HashTable *registered_zend_ini_directives;
2727

28+
#define NO_VALUE_PLAINTEXT "no value"
29+
#define NO_VALUE_HTML "<i>no value</i>"
2830

2931
/*
3032
* hash_apply functions
@@ -305,15 +307,25 @@ static void zend_ini_displayer_cb(zend_ini_entry *ini_entry, int type)
305307
display_string = ini_entry->orig_value;
306308
display_string_length = ini_entry->orig_value_length;
307309
} else {
308-
display_string = "<i>no value</i>";
309-
display_string_length = sizeof("<i>no value</i>")-1;
310+
if(zend_uv.html_errors) {
311+
display_string = NO_VALUE_HTML;
312+
display_string_length = sizeof(NO_VALUE_HTML)-1;
313+
} else {
314+
display_string = NO_VALUE_PLAINTEXT;
315+
display_string_length = sizeof(NO_VALUE_PLAINTEXT)-1;
316+
}
310317
}
311318
} else if (ini_entry->value && ini_entry->value[0]) {
312319
display_string = ini_entry->value;
313320
display_string_length = ini_entry->value_length;
314321
} else {
315-
display_string = "<i>no value</i>";
316-
display_string_length = sizeof("<i>no value</i>")-1;
322+
if(zend_uv.html_errors) {
323+
display_string = NO_VALUE_HTML;
324+
display_string_length = sizeof(NO_VALUE_HTML)-1;
325+
} else {
326+
display_string = NO_VALUE_PLAINTEXT;
327+
display_string_length = sizeof(NO_VALUE_PLAINTEXT)-1;
328+
}
317329
}
318330
ZEND_WRITE(display_string, display_string_length);
319331
}
@@ -351,9 +363,17 @@ ZEND_INI_DISP(zend_ini_color_displayer_cb)
351363
value = NULL;
352364
}
353365
if (value) {
354-
zend_printf("<font color=\"%s\">%s</font>", value, value);
366+
if (zend_uv.html_errors) {
367+
zend_printf("<font color=\"%s\">%s</font>", value, value);
368+
} else {
369+
ZEND_PUTS(value);
370+
}
355371
} else {
356-
ZEND_PUTS("<i>no value</i>;");
372+
if (zend_uv.html_errors) {
373+
ZEND_PUTS(NO_VALUE_HTML);
374+
} else {
375+
ZEND_PUTS(NO_VALUE_PLAINTEXT);
376+
}
357377
}
358378
}
359379

0 commit comments

Comments
 (0)