Bug 37032
| Summary: | operator ! operated on wrong target which is an object | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | sw <swang> |
| Component: | WebCore Misc. | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED INVALID | ||
| Severity: | Minor | CC: | ap, swang |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | All | ||
| OS: | All | ||
sw
In WebCore/loader/SubresourceLoader.cpp line 84, the following line is there
else if (!request.httpReferrer())
But since request.httpReferrer returns a String object, the ! operator will interpreted unintentionally, the correct fix shall be:
else if (request.httpReferrer().isEmpty())
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Alexey Proskuryakov
Does this affect observable behavior?
Would you be willing to submit a patch, as described in <http://webkit.org/coding/contributing.html>?
sw
seems it's not changing observable behavior. I'll submit a patch soon within 2 weeks since will be off next week.
Alexey Proskuryakov
I'm actually not sure if there is anything to fix here. Using operator! with String used to convert to NSString* on Mac, but now we have this:
inline bool operator!(const String& str) { return str.isNull(); }
And it was added precisely to fix referrer sending: <http://trac.webkit.org/changeset/18577>.
sw
I see your point, I should have checked it more carefully. Thanks. I think I need to go back and verify whether the httpReferer will return an empty or plain NULL string.
sw
The current code is working as intended. No bug here.