mirror of https://github.com/calzoneman/sync.git
Fix setting channel js/css
This commit is contained in:
parent
002dadd67a
commit
03ba657783
|
@ -145,9 +145,14 @@ OptionsModule.prototype.handleSetOptions = function (user, data) {
|
|||
|
||||
if ("externalcss" in data && user.account.effectiveRank >= 3) {
|
||||
var link = (""+data.externalcss).substring(0, 255);
|
||||
if (!link) {
|
||||
this.opts.externalcss = "";
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
var data = url.parse(link);
|
||||
if (!data.protocol || !data.protocol.match(/^(https?|ftp):$/)) {
|
||||
if (!data.protocol || !data.protocol.match(/^(https?|ftp):/)) {
|
||||
throw "Unacceptable protocol " + data.protocol;
|
||||
} else if (!data.host) {
|
||||
throw "URL is missing host";
|
||||
|
@ -167,10 +172,14 @@ OptionsModule.prototype.handleSetOptions = function (user, data) {
|
|||
|
||||
if ("externaljs" in data && user.account.effectiveRank >= 3) {
|
||||
var link = (""+data.externaljs).substring(0, 255);
|
||||
if (!link) {
|
||||
this.opts.externaljs = "";
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
var data = url.parse(link);
|
||||
if (!data.protocol || !data.protocol.match(/^(https?|ftp)$/)) {
|
||||
if (!data.protocol || !data.protocol.match(/^(https?|ftp):/)) {
|
||||
throw "Unacceptable protocol " + data.protocol;
|
||||
} else if (!data.host) {
|
||||
throw "URL is missing host";
|
||||
|
|
Loading…
Reference in New Issue