1 diff -up php-5.2.17/ext/standard/base64.c.bug-55273 php-5.2.17/ext/standard/base64.c
2 --- php-5.2.17/ext/standard/base64.c.bug-55273 2012-01-12 10:45:40.000000000 +0700
3 +++ php-5.2.17/ext/standard/base64.c 2012-01-12 10:47:32.000000000 +0700
4 @@ -154,7 +154,15 @@ PHPAPI unsigned char *php_base64_decode_
5 /* run through the whole string, converting as we go */
6 while ((ch = *current++) != '\0' && length-- > 0) {
7 if (ch == base64_pad) {
8 - if (*current != '=' && (i % 4) == 1) {
9 + if (*current != '=' && ((i % 4) == 1 || (strict && length > 0))) {
11 + while (isspace(*(++current))) {
14 + if (*current == '\0') {