Summary: | URLParser should handle . and .. in URL paths | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Alex Christensen <achristensen> | ||||||||||
Component: | New Bugs | Assignee: | Alex Christensen <achristensen> | ||||||||||
Status: | RESOLVED FIXED | ||||||||||||
Severity: | Normal | CC: | commit-queue, saam | ||||||||||
Priority: | P2 | ||||||||||||
Version: | WebKit Nightly Build | ||||||||||||
Hardware: | Unspecified | ||||||||||||
OS: | Unspecified | ||||||||||||
Attachments: |
|
Description
Alex Christensen
2016-08-31 11:23:31 PDT
Created attachment 287522 [details]
Patch
Attachment 287522 [details] did not pass style-queue:
ERROR: Source/WebCore/ChangeLog:8: You should remove the 'No new tests' and either add and list tests, or explain why no new tests were possible. [changelog/nonewtests] [5]
Total errors found: 1 in 4 files
If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 287543 [details]
Patch
Created attachment 287649 [details]
Patch
Comment on attachment 287543 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=287543&action=review > Source/WebCore/platform/URLParser.cpp:152 > +static bool isSingleDotPathSegment(StringView::CodePoints::Iterator c, const StringView::CodePoints::Iterator& end) > +{ > + if (c == end) > + return false; > + if (*c == '.') { > + ++c; > + return c == end || *c == '/' || *c == '\\' || *c == '?' || *c == '#'; > + } > + if (*c != '%') > + return false; > + ++c; > + if (c == end || *c != '2') > + return false; > + ++c; > + if (c == end) > + return false; > + if (*c == 'e' || *c == 'E') { > + ++c; > + return c == end || *c == '/' || *c == '\\' || *c == '?' || *c == '#'; > + } > + return false; > +} "2E" is a magic constant that should be more obvious. static const char dotASCIICode = "2E"; ? > Source/WebCore/platform/URLParser.cpp:171 > + if (c == end || *c != '2') > + return false; > + ++c; > + if (c == end) > + return false; > + if (*c == 'e' || *c == 'E') { > + ++c; Same magic constant comment. > Source/WebCore/platform/URLParser.cpp:194 > + ASSERT(*c == '%'); > + ++c; > + ASSERT(*c == '2'); > + ++c; > + ASSERT(*c == 'e' || *c == 'E'); > + ++c; Same comment you guessed it. > Source/WebCore/platform/URLParser.cpp:215 > + ASSERT(*c == '2'); > + ++c; > + ASSERT(*c == 'e' || *c == 'E'); > + ++c; > + } You guessed it. Created attachment 287657 [details]
Patch
|