mirror of
https://github.com/php/php-src.git
synced 2024-09-21 09:57:23 +00:00
MFZE1
This commit is contained in:
parent
f866bdc368
commit
2931bb640d
@ -58,18 +58,23 @@ ZEND_API void zend_html_puts(const char *s, uint len)
|
||||
const char *ptr=s, *end=s+len;
|
||||
|
||||
while (ptr<end) {
|
||||
if (*ptr==' '
|
||||
&& len>1
|
||||
&& !(((ptr+1)>=end) || (*(ptr+1)==' ')) /* next is not a space */
|
||||
&& !((ptr==s) || (*(ptr-1)==' '))) /* last is not a space */ {
|
||||
char c = *ptr++;
|
||||
|
||||
ZEND_PUTC(c);
|
||||
continue;
|
||||
if (*ptr==' ') {
|
||||
/* Series of spaces should be displayed as 's
|
||||
* whereas single spaces should be displayed as a space
|
||||
*/
|
||||
if ((ptr+1) < end && *(ptr+1)==' ') {
|
||||
do {
|
||||
zend_html_putc(*ptr);
|
||||
} while ((++ptr < end) && (*ptr==' '));
|
||||
} else {
|
||||
ZEND_PUTC(*ptr);
|
||||
ptr++;
|
||||
}
|
||||
} else {
|
||||
zend_html_putc(*ptr++);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user