From 312a3f812e03863722814065c3cc696c604a92fc Mon Sep 17 00:00:00 2001
From: Simon Ser <contact@emersion.fr>
Date: Sat, 9 Oct 2021 10:34:51 +0200
Subject: [PATCH] Don't allow overriding server URL if set in config.json

This has security implications.
---
 components/app.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/components/app.js b/components/app.js
index 6688559..f665ea1 100644
--- a/components/app.js
+++ b/components/app.js
@@ -214,7 +214,7 @@ export default class App extends Component {
 		}
 
 		let queryParams = parseQueryString();
-		if (typeof queryParams.server === "string") {
+		if (typeof queryParams.server === "string" && !connectParams.url) {
 			connectParams.url = queryParams.server;
 
 			// When using a custom server, some configuration options don't
@@ -224,7 +224,7 @@ export default class App extends Component {
 		if (typeof queryParams.nick === "string") {
 			connectParams.nick = queryParams.nick;
 		}
-		if (typeof queryParams.channels == "string") {
+		if (typeof queryParams.channels === "string") {
 			connectParams.autojoin = queryParams.channels.split(",");
 		}