luci-app-travelmate: qrcode fix openwrt-19.07
authorDirk Brenken <dev@brenken.org>
Fri, 26 Jun 2020 17:35:58 +0000 (19:35 +0200)
committerDirk Brenken <dev@brenken.org>
Fri, 26 Jun 2020 17:41:41 +0000 (19:41 +0200)
* escape more special chars which disturb qrcode generation

Signed-off-by: Dirk Brenken <dev@brenken.org>
(cherry picked from commit 06ce62b65d05806d39099b46102579eeff66aad2)

applications/luci-app-travelmate/luasrc/view/travelmate/runtime.htm

index 22847996648ac62d0352b5c2865e728dc6fdd1d9..d8625ff301dc8c5d5a28d2f2549354a610cd2edb 100644 (file)
@@ -193,8 +193,8 @@ This is free software, licensed under the Apache License, Version 2.0
                                end
 
                                if ssid and enc and key then
-                                       local e_ssid = string.gsub(ssid,"[\"\\';:, ]",[[\\\%1]])
-                                       local e_key = string.gsub(key,"[\"\\';:, ]",[[\\\%1]])
+                                       local e_ssid = string.gsub(ssid,"[\"\\';:,()&`|<> ]",[[\\\%1]])
+                                       local e_key = string.gsub(key,"[\"\\';:,()&`|<> ]",[[\\\%1]])
 
                                        if fs.access("/usr/bin/qrencode") then
                                                qrcode = luci.sys.exec("/usr/bin/qrencode --inline --8bit --type=SVG --output=- 'WIFI:S:\"'" .. e_ssid .. "'\";T:'" .. enc .. "';P:\"'" .. e_key .. "'\";H:'" .. hidden .. "';'")