| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Adam Barth. All Rights Reserved. | 2 * Copyright (C) 2011 Adam Barth. All Rights Reserved. |
| 3 * Copyright (C) 2011 Daniel Bates (dbates@intudata.com). | 3 * Copyright (C) 2011 Daniel Bates (dbates@intudata.com). |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 689 } | 689 } |
| 690 | 690 |
| 691 String result; | 691 String result; |
| 692 while (startPosition < endPosition && !result.length()) { | 692 while (startPosition < endPosition && !result.length()) { |
| 693 // Stop at next comment (using the same rules as above for SVG/XML vs HT
ML), when we encounter a comma, | 693 // Stop at next comment (using the same rules as above for SVG/XML vs HT
ML), when we encounter a comma, |
| 694 // when we hit an opening <script> tag, or when we exceed the maximum le
ngth target. The comma rule | 694 // when we hit an opening <script> tag, or when we exceed the maximum le
ngth target. The comma rule |
| 695 // covers a common parameter concatenation case performed by some web se
rvers. | 695 // covers a common parameter concatenation case performed by some web se
rvers. |
| 696 lastNonSpacePosition = kNotFound; | 696 lastNonSpacePosition = kNotFound; |
| 697 for (foundPosition = startPosition; foundPosition < endPosition; foundPo
sition++) { | 697 for (foundPosition = startPosition; foundPosition < endPosition; foundPo
sition++) { |
| 698 if (!request.shouldAllowCDATA) { | 698 if (!request.shouldAllowCDATA) { |
| 699 if (startsSingleLineCommentAt(string, foundPosition) || startsMu
ltiLineCommentAt(string, foundPosition)) { | 699 if (startsSingleLineCommentAt(string, foundPosition) |
| 700 foundPosition += 2; | 700 || startsMultiLineCommentAt(string, foundPosition) |
| 701 break; | 701 || startsHTMLCommentAt(string, foundPosition)) { |
| 702 } | |
| 703 if (startsHTMLCommentAt(string, foundPosition)) { | |
| 704 foundPosition += 4; | |
| 705 break; | 702 break; |
| 706 } | 703 } |
| 707 } | 704 } |
| 708 if (string[foundPosition] == ',') | 705 if (string[foundPosition] == ',') |
| 709 break; | 706 break; |
| 710 | 707 |
| 711 if (lastNonSpacePosition != kNotFound && startsOpeningScriptTagAt(st
ring, foundPosition)) { | 708 if (lastNonSpacePosition != kNotFound && startsOpeningScriptTagAt(st
ring, foundPosition)) { |
| 712 foundPosition = lastNonSpacePosition; | 709 foundPosition = lastNonSpacePosition; |
| 713 break; | 710 break; |
| 714 } | 711 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 766 | 763 |
| 767 bool XSSAuditor::isSafeToSendToAnotherThread() const | 764 bool XSSAuditor::isSafeToSendToAnotherThread() const |
| 768 { | 765 { |
| 769 return m_documentURL.isSafeToSendToAnotherThread() | 766 return m_documentURL.isSafeToSendToAnotherThread() |
| 770 && m_decodedURL.isSafeToSendToAnotherThread() | 767 && m_decodedURL.isSafeToSendToAnotherThread() |
| 771 && m_decodedHTTPBody.isSafeToSendToAnotherThread() | 768 && m_decodedHTTPBody.isSafeToSendToAnotherThread() |
| 772 && m_httpBodyAsString.isSafeToSendToAnotherThread(); | 769 && m_httpBodyAsString.isSafeToSendToAnotherThread(); |
| 773 } | 770 } |
| 774 | 771 |
| 775 } // namespace WebCore | 772 } // namespace WebCore |
| OLD | NEW |