summaryrefslogtreecommitdiffstats
path: root/toolkit/components
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-06-08 07:48:28 +0000
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-06-08 07:48:28 +0000
commitba9e648ce2705ad1c4679325a9326c47263e2a3e (patch)
tree724cf5101a1b5923c235dc767b355a7b0e906eb7 /toolkit/components
parentc8300fbd6ae08925736c32f8b02c980ce1531f3f (diff)
parent19c0f5e9ff625c6a67e5e0a08f0a800782168492 (diff)
downloadUXP-ba9e648ce2705ad1c4679325a9326c47263e2a3e.tar
UXP-ba9e648ce2705ad1c4679325a9326c47263e2a3e.tar.gz
UXP-ba9e648ce2705ad1c4679325a9326c47263e2a3e.tar.lz
UXP-ba9e648ce2705ad1c4679325a9326c47263e2a3e.tar.xz
UXP-ba9e648ce2705ad1c4679325a9326c47263e2a3e.zip
Merge branch 'master' into remove-unboxed
Diffstat (limited to 'toolkit/components')
-rw-r--r--toolkit/components/places/PlacesUtils.jsm10
-rw-r--r--toolkit/components/typeaheadfind/nsTypeAheadFind.cpp2
2 files changed, 7 insertions, 5 deletions
diff --git a/toolkit/components/places/PlacesUtils.jsm b/toolkit/components/places/PlacesUtils.jsm
index fc303ca8a..323fa41a1 100644
--- a/toolkit/components/places/PlacesUtils.jsm
+++ b/toolkit/components/places/PlacesUtils.jsm
@@ -908,6 +908,7 @@ this.PlacesUtils = {
* @param type
* The content type of the blob.
* @returns An array of objects representing each item contained by the source.
+ * @throws if the blob contains invalid data.
*/
unwrapNodes: function PU_unwrapNodes(blob, type) {
// We split on "\n" because the transferable system converts "\r\n" to "\n"
@@ -939,7 +940,7 @@ this.PlacesUtils = {
catch (e) {}
}
// note: this._uri() will throw if uriString is not a valid URI
- if (this._uri(uriString)) {
+ if (this._uri(uriString) && this._uri(uriString).scheme != "place") {
nodes.push({ uri: uriString,
title: titleString ? titleString : uriString,
type: this.TYPE_X_MOZ_URL });
@@ -952,11 +953,12 @@ this.PlacesUtils = {
for (let i = 0; i < parts.length; i++) {
let uriString = parts[i];
// text/uri-list is converted to TYPE_UNICODE but it could contain
- // comments line prepended by #, we should skip them
- if (uriString.substr(0, 1) == '\x23')
+ // comments line prepended by #, we should skip them, as well as
+ // empty URIs
+ if (uriString.substr(0, 1) == '\x23' || uriString == "")
continue;
// note: this._uri() will throw if uriString is not a valid URI
- if (uriString != "" && this._uri(uriString))
+ if (this._uri(uriString).scheme != "place")
nodes.push({ uri: uriString,
title: uriString,
type: this.TYPE_X_MOZ_URL });
diff --git a/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp b/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
index 674681581..53b1ef66d 100644
--- a/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
+++ b/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
@@ -420,7 +420,7 @@ nsTypeAheadFind::FindItNow(nsIPresShell *aPresShell, bool aIsLinksOnly,
while (true) { // ----- Outer while loop: go through all docs -----
while (true) { // === Inner while loop: go through a single doc ===
- mFind->Find(mTypeAheadBuffer.get(), mSearchRange, mStartPointRange,
+ mFind->Find(mTypeAheadBuffer, mSearchRange, mStartPointRange,
mEndPointRange, getter_AddRefs(returnRange));
if (!returnRange)