}
for (i = len; i < len + bytes; i++) {
+ if (buf[i] == '\x03') {
+ if (i != len + bytes - 1) {
+ memmove(buf + i, buf + i + 1, len + bytes - i - 1);
+ }
+ len--;
+ i--;
+ continue;
+ }
if (buf[i] == '\n') {
PHPDBG_G(input_buflen) = len + bytes - 1 - i;
if (PHPDBG_G(input_buflen)) {
len += 4;
*tmpptr++ = '&';
*tmpptr++ = '#';
- *tmpptr++ = ((*buf)[i] / 10) + '0';
+ if ((unsigned int) buf[i] > 10) {
+ *tmpptr++ = ((*buf)[i] / 10) + '0';
+ } else {
+ --len;
+ }
*tmpptr++ = ((*buf)[i] % 10) + '0';
*tmpptr++ = ';';
} else {
buflen = phpdbg_xml_vasprintf(&buffer, fmt, 1, args TSRMLS_CC);
va_end(args);
+ phpdbg_encode_ctrl_chars(&buffer, &buflen);
+
if (PHPDBG_G(in_script_xml)) {
write(fd, ZEND_STRL("</stream>"));
PHPDBG_G(in_script_xml) = 0;
int msglen;
msglen = phpdbg_encode_xml(&msg, buffer, buflen, 256, NULL);
+ phpdbg_encode_ctrl_chars(&msg, &msglen);
if (PHPDBG_G(in_script_xml)) {
write(fd, ZEND_STRL("</stream>"));