mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-26 10:45:45 +01:00
Fix bug.
This commit is contained in:
@@ -182,31 +182,34 @@ function XMLChannel(uri, contentType, noErrorChannel, unprivileged) {
|
|||||||
this.channel.contentType = contentType || channel.contentType;
|
this.channel.contentType = contentType || channel.contentType;
|
||||||
this.channel.contentCharset = "UTF-8";
|
this.channel.contentCharset = "UTF-8";
|
||||||
if (!unprivileged)
|
if (!unprivileged)
|
||||||
this.channel.owner = systemPrincipal;
|
this.channel.owner = systemPrincipal;
|
||||||
|
|
||||||
let stream = services.InputStream(channelStream);
|
let type = this.channel.contentType;
|
||||||
let [, pre, doctype, url, extra, open, post] = util.regexp(<![CDATA[
|
if (type.indexOf("text/") == 0 || type.indexOf("+xml") == type.length - 4) {
|
||||||
^ ([^]*?)
|
let stream = services.InputStream(channelStream);
|
||||||
(?:
|
let [, pre, doctype, url, extra, open, post] = util.regexp(<![CDATA[
|
||||||
(<!DOCTYPE \s+ \S+ \s+) (?:SYSTEM \s+ "([^"]*)" | ((?:[^[>\s]|\s[^[])*))
|
^ ([^]*?)
|
||||||
(\s+ \[)?
|
(?:
|
||||||
([^]*)
|
(<!DOCTYPE \s+ \S+ \s+) (?:SYSTEM \s+ "([^"]*)" | ((?:[^[>\s]|\s[^[])*))
|
||||||
)?
|
(\s+ \[)?
|
||||||
$
|
([^]*)
|
||||||
]]>, "x").exec(stream.read(4096));
|
)?
|
||||||
this.writes.push(pre);
|
$
|
||||||
if (doctype) {
|
]]>, "x").exec(stream.read(4096));
|
||||||
this.writes.push(doctype + (extra || "") + " [\n");
|
this.writes.push(pre);
|
||||||
if (url)
|
if (doctype) {
|
||||||
this.addChannel(url);
|
this.writes.push(doctype + (extra || "") + " [\n");
|
||||||
|
|
||||||
if (!open)
|
|
||||||
this.writes.push("\n]");
|
|
||||||
|
|
||||||
for (let [, pre, url] in util.regexp.iterate(/([^]*?)(?:%include\s+"([^"]*)";|$)/gy, post)) {
|
|
||||||
this.writes.push(pre);
|
|
||||||
if (url)
|
if (url)
|
||||||
this.addChannel(url);
|
this.addChannel(url);
|
||||||
|
|
||||||
|
if (!open)
|
||||||
|
this.writes.push("\n]");
|
||||||
|
|
||||||
|
for (let [, pre, url] in util.regexp.iterate(/([^]*?)(?:%include\s+"([^"]*)";|$)/gy, post)) {
|
||||||
|
this.writes.push(pre);
|
||||||
|
if (url)
|
||||||
|
this.addChannel(url);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.writes.push(channelStream);
|
this.writes.push(channelStream);
|
||||||
|
|||||||
@@ -1316,7 +1316,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
|||||||
* Escapes a string against shell meta-characters and argument
|
* Escapes a string against shell meta-characters and argument
|
||||||
* separators.
|
* separators.
|
||||||
*/
|
*/
|
||||||
shellEscape: function shellEscape(str) '"' + String.replace(str, /[\\"$]/g, "\\$&") + '"',
|
shellEscape: function shellEscape(str) '"' + String.replace(str, /[\\"$`]/g, "\\$&") + '"',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Suspend execution for at least *delay* milliseconds. Functions by
|
* Suspend execution for at least *delay* milliseconds. Functions by
|
||||||
|
|||||||
Reference in New Issue
Block a user