svn: /php/php-src/trunk/ext/standard/ html.c
| From: | Ilia Alshanetsky | Date: | Mon, 25 Oct 2010 16:46:55 +0000 |
| Subject: | svn: /php/php-src/trunk/ext/standard/ html.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-63718@lists.php.net to get a copy of this message | ||
iliaa Mon, 25 Oct 2010 16:46:55 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=304882
Log:
Code cleanup & CS
Changed paths:
U php/php-src/trunk/ext/standard/html.c
Modified: php/php-src/trunk/ext/standard/html.c
===================================================================
--- php/php-src/trunk/ext/standard/html.c 2010-10-25 16:38:19 UTC (rev 304881)
+++ php/php-src/trunk/ext/standard/html.c 2010-10-25 16:46:55 UTC (rev 304882)
@@ -1307,9 +1307,11 @@
}
}
- maxlen = 2 * oldlen;
- if (maxlen < 128)
- maxlen = 128;
+ if (oldlen < 64) {
+ maxlen = 128;
+ } else {
+ maxlen = 2 * oldlen;
+ }
replaced = emalloc(maxlen);
len = 0;
cursor = 0;
@@ -1322,8 +1324,9 @@
/* guarantee we have at least 40 bytes to write.
* In HTML5, entities may take up to 33 bytes */
- if (len + 40 > maxlen)
+ if (len + 40 > maxlen) {
replaced = erealloc(replaced, maxlen += 128);
+ }
if (status == FAILURE) {
/* invalid MB sequence */
@@ -1335,9 +1338,6 @@
continue;
} else {
efree(replaced);
- if(!PG(display_errors)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid multibyte sequence in
argument");
- }
*newlen = 0;
return STR_EMPTY_ALLOC();
}