Skip to content

Commit 698bc2f

Browse files
committed
Fixed bug with incorrect handling of base64 on clipboard
1 parent d95e354 commit 698bc2f

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

xml/xml_serialize.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,23 @@ void SeeIfBase64 (CString & strText)
149149
bool bBase64 = true;
150150
int iCount;
151151

152+
// locale-independent tests (see decodeBase64)
152153
for (iCount = 0 ; c = *p; p++)
153-
if (isspace (c))
154+
if (c == ' ' ||
155+
c == '\t' ||
156+
c == '\n' ||
157+
c == '\r' ||
158+
c == '\f' ||
159+
c == '\v'
160+
)
154161
continue;
155162
else
156-
if (isalnum (c) || c == '+' || c == '/' || c == '=')
163+
if ((c >= 'A' && c <= 'Z') ||
164+
(c >= 'a' && c <= 'z') ||
165+
(c >= '0' && c <= '9') ||
166+
c == '+' ||
167+
c == '/' ||
168+
c == '=')
157169
iCount++;
158170
else
159171
{

0 commit comments

Comments
 (0)