From: Jo-Philipp Wich Date: Sat, 30 May 2009 22:39:30 +0000 (+0000) Subject: luci-0.8: merge r4734 X-Git-Tag: 0.8.8~31 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a37d9f8d34d882851b801e7398ec3f006f55795d;p=oweals%2Fluci.git luci-0.8: merge r4734 --- diff --git a/applications/luci-splash/luasrc/controller/splash/splash.lua b/applications/luci-splash/luasrc/controller/splash/splash.lua index c20964720..8603b141f 100644 --- a/applications/luci-splash/luasrc/controller/splash/splash.lua +++ b/applications/luci-splash/luasrc/controller/splash/splash.lua @@ -20,9 +20,7 @@ end function action_activate() local ip = luci.http.getenv("REMOTE_ADDR") or "127.0.0.1" - local mac = luci.sys.net.ip4mac( - ip:match("::") and (ip:gsub("^%[::ffff:(.+)%]", "%1")) or ip - ) + local mac = luci.sys.net.ip4mac(ip:match("^[\[::ffff:]*(%d+.%d+%.%d+%.%d+)\]*$")) if mac and luci.http.formvalue("accept") then os.execute("luci-splash add "..mac.." >/dev/null 2>&1") luci.http.redirect(luci.model.uci.cursor():get("freifunk", "community", "homepage"))