summaryrefslogtreecommitdiffstats
path: root/browser/components/feeds/nsFeedSniffer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'browser/components/feeds/nsFeedSniffer.cpp')
-rw-r--r--browser/components/feeds/nsFeedSniffer.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/browser/components/feeds/nsFeedSniffer.cpp b/browser/components/feeds/nsFeedSniffer.cpp
index f2d0da776..f314d3d3b 100644
--- a/browser/components/feeds/nsFeedSniffer.cpp
+++ b/browser/components/feeds/nsFeedSniffer.cpp
@@ -185,15 +185,9 @@ IsDocumentElement(const char *start, const char* end)
static bool
ContainsTopLevelSubstring(nsACString& dataString, const char *substring)
{
- nsACString::const_iterator start, end;
- dataString.BeginReading(start);
- dataString.EndReading(end);
-
- if (!FindInReadable(nsCString(substring), start, end)){
+ int32_t offset = dataString.Find(substring);
+ if (offset == -1)
return false;
- }
-
- auto offset = start.get() - dataString.Data();
const char *begin = dataString.BeginReading();
@@ -318,10 +312,9 @@ nsFeedSniffer::GetMIMETypeFromContent(nsIRequest* request,
// RSS 1.0
if (!isFeed) {
- bool foundNS_RDF = FindInReadable(NS_LITERAL_CSTRING(NS_RDF), dataString);
- bool foundNS_RSS = FindInReadable(NS_LITERAL_CSTRING(NS_RSS), dataString);
isFeed = ContainsTopLevelSubstring(dataString, "<rdf:RDF") &&
- foundNS_RDF && foundNS_RSS;
+ dataString.Find(NS_RDF) != -1 &&
+ dataString.Find(NS_RSS) != -1;
}
// If we sniffed a feed, coerce our internal type