⛅ Sync 2026-09-22 23:24:55

This commit is contained in:
github-actions[bot] committed 2026-09-22 23:24:55 +08:00
1 parent de9cc9a6a9
commit d45e210b8a
16 files changed
+174 -72

No files matched your search

+1 -1
View File
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-passwall
PKG_VERSION:=26.9.16
PKG_RELEASE:=286
PKG_RELEASE:=287
PKG_PO_VERSION:=$(PKG_VERSION)
PKG_CONFIG_DEPENDS:= \
+12 -9
View File
@@ -197,16 +197,19 @@ function exec_call(cmd)
end
function base64Decode(text)
if not text then return '' end
local encoded = text:gsub("%z", ""):gsub("%c", ""):gsub("_", "/"):gsub("-", "+")
if type(text) ~= "string" then return "" end
local encoded = text:gsub("%z", ""):gsub("%c", ""):gsub("_", "/"):gsub("-", "+"):gsub("=+$", "")
if encoded == "" then return text end
if not encoded:match("^[A-Za-z0-9+/]*$") then return text end
local mod4 = #encoded % 4
encoded = encoded .. string.sub('====', mod4 + 1)
local result = nixio.bin.b64decode(encoded)
if result then
return result:gsub("%z", "")
else
return text
end
if mod4 == 1 then return text end
local padded = encoded .. string.rep("=", (4 - mod4) % 4)
local result = nixio.bin.b64decode(padded)
if not result then return text end
-- Verify that the normalized input is canonical Base64.
local reencoded = nixio.bin.b64encode(result):gsub("=+$", "")
if reencoded ~= encoded then return text end
return (result:gsub("%z", ""))
end
function base64Encode(text)