Inprove sanity check for luci.sauth.read
authorSteven Barth <steven@midlink.org>
Fri, 5 Sep 2008 14:52:06 +0000 (14:52 +0000)
committerSteven Barth <steven@midlink.org>
Fri, 5 Sep 2008 14:52:06 +0000 (14:52 +0000)
libs/web/luasrc/sauth.lua

index b724bf2..894732d 100644 (file)
@@ -57,8 +57,11 @@ end
 -- @param id   Session identifier
 -- @return             Session data
 function read(id)
+       if not id then
+               return
+       end
        clean()
-       if not id or not sane(sessionpath .. "/" .. id) then
+       if not sane(sessionpath .. "/" .. id) then
                return
        end
        return luci.fs.readfile(sessionpath .. "/" .. id)