version 1.1, 2012/02/21 23:48:02
|
version 1.1.1.3, 2013/07/22 01:32:05
|
Line 2
|
Line 2
|
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| PHP Version 5 | |
| PHP Version 5 | |
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| Copyright (c) 1997-2012 The PHP Group | | | Copyright (c) 1997-2013 The PHP Group | |
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| This source file is subject to version 3.01 of the PHP license, | |
| This source file is subject to version 3.01 of the PHP license, | |
| that is bundled with this package in the file LICENSE, and is | |
| that is bundled with this package in the file LICENSE, and is | |
Line 151 PHPAPI unsigned char *php_quot_print_encode(const unsi
|
Line 151 PHPAPI unsigned char *php_quot_print_encode(const unsi
|
unsigned char c, *ret, *d; |
unsigned char c, *ret, *d; |
char *hex = "0123456789ABCDEF"; |
char *hex = "0123456789ABCDEF"; |
|
|
ret = safe_emalloc(1, 3 * length + 3 * (((3 * length)/PHP_QPRINT_MAXL) + 1), 0); | ret = safe_emalloc(3, length + (((3 * length)/(PHP_QPRINT_MAXL-9)) + 1), 1); |
d = ret; |
d = ret; |
|
|
while (length--) { |
while (length--) { |
Line 162 PHPAPI unsigned char *php_quot_print_encode(const unsi
|
Line 162 PHPAPI unsigned char *php_quot_print_encode(const unsi
|
lp = 0; |
lp = 0; |
} else { |
} else { |
if (iscntrl (c) || (c == 0x7f) || (c & 0x80) || (c == '=') || ((c == ' ') && (*str == '\015'))) { |
if (iscntrl (c) || (c == 0x7f) || (c & 0x80) || (c == '=') || ((c == ' ') && (*str == '\015'))) { |
if ((lp += 3) > PHP_QPRINT_MAXL) { | if ((((lp+= 3) > PHP_QPRINT_MAXL) && (c <= 0x7f)) |
| || ((c > 0x7f) && (c <= 0xdf) && ((lp + 3) > PHP_QPRINT_MAXL)) |
| || ((c > 0xdf) && (c <= 0xef) && ((lp + 6) > PHP_QPRINT_MAXL)) |
| || ((c > 0xef) && (c <= 0xf4) && ((lp + 9) > PHP_QPRINT_MAXL))) { |
*d++ = '='; |
*d++ = '='; |
*d++ = '\015'; |
*d++ = '\015'; |
*d++ = '\012'; |
*d++ = '\012'; |