Changeset 22013 in webkit
- Timestamp:
- Jun 5, 2007 7:32:15 PM (17 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r21982 r22013 1 2007-06-05 Kevin McCullough <kmccullough@apple.com> 2 3 Reviewed by Mark and Olliver. 4 5 - http://bugs.webkit.org/show_bug.cgi?id=13352 REGRESSION: Gmail hangs on send message. 6 - Now we don't hang, but we do so by avoiding certain legitimate characters, the evangelism bug for this is: <rdar://problem/5252577> gmail does not accept legal characters in the form boundary 7 8 * html/HTMLFormElement.cpp: 9 (WebCore::getUniqueBoundaryString): 10 1 11 2007-06-05 Anders Carlsson <andersca@apple.com> 2 12 -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r21979 r22013 11534 11534 isa = PBXProject; 11535 11535 buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */; 11536 compatibilityVersion = "Xcode 2.4"; 11536 11537 hasScannedForEncodings = 1; 11537 11538 knownRegions = ( … … 11548 11549 projectDirPath = ""; 11549 11550 projectRoot = ""; 11551 shouldCheckCompatibility = 1; 11550 11552 targets = ( 11551 11553 93F198A508245E59001E9ABC /* WebCore */, -
trunk/WebCore/html/HTMLFormElement.cpp
r20260 r22013 366 366 static void getUniqueBoundaryString(Vector<char>& boundary) 367 367 { 368 // The RFC 2046 spec says the AlphaNumeric characters plus the following characters 369 // are legal for boundaries: '()+_,-./:=? 370 // However the following characters, though legal, cause some sites to fail: 371 // (),./:= 372 // http://bugs.webkit.org/show_bug.cgi?id=13352 373 static const char AlphaNumericEncMap[64] = 374 { 375 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 376 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 377 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 378 0x59, 0x5A, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 379 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 380 0x6F, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 381 0x77, 0x78, 0x79, 0x7A, 0x30, 0x31, 0x32, 0x33, 382 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x2B, 0x41 383 // FIXME <rdar://problem/5252577> gmail does not accept legal characters in the form boundary 384 // As stated above, some legal characters cause, sites to fail. Specifically 385 // the / character which was the last character in the above array. I have 386 // replaced the last character with another character already in the array 387 // (notice the first and last values are both 0x41, A). Instead of picking 388 // another unique legal character for boundary strings that, because it has 389 // never been tested, may or may not break other sites, I simply 390 // replaced / with A. This means A is twice as likely to occur in our boundary 391 // strings than any other character but I think this is fine for the time being. 392 // The FIXME here is about restoring the / character once the aforementioned 393 // radar has been resolved. 394 }; 395 368 396 // Start with an informative prefix. 369 397 const char boundaryPrefix[] = "----WebKitFormBoundary"; 370 398 boundary.append(boundaryPrefix, strlen(boundaryPrefix)); 371 399 372 // Append 16 characters of base 64 randomness.400 // Append 16 random 7bit ascii AlphaNumeric characters. 373 401 Vector<char> randomBytes; 374 for (int i = 0; i < 3; ++i) { 402 403 for (int i = 0; i < 4; ++i) { 375 404 int randomness = randomNumber(); 376 randomBytes.append(static_cast<char>(randomness >> 24)); 377 randomBytes.append(static_cast<char>(randomness >> 16)); 378 randomBytes.append(static_cast<char>(randomness >> 8)); 379 randomBytes.append(static_cast<char>(randomness)); 380 } 381 Vector<char> randomBase64; 382 base64Encode(randomBytes, randomBase64); 383 boundary.append(randomBase64); 384 385 // Add a 0 at the end so we can use this as a C-style string. 386 boundary.append(0); 405 randomBytes.append(AlphaNumericEncMap[(randomness >> 24) & 0x3F]); 406 randomBytes.append(AlphaNumericEncMap[(randomness >> 16) & 0x3F]); 407 randomBytes.append(AlphaNumericEncMap[(randomness >> 8) & 0x3F]); 408 randomBytes.append(AlphaNumericEncMap[randomness & 0x3F]); 409 } 410 411 boundary.append(randomBytes); 412 boundary.append(0); // Add a 0 at the end so we can use this as a C-style string. 387 413 } 388 414
Note: See TracChangeset
for help on using the changeset viewer.