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 b724bf2d28e13db16af0d2da2e13935433c20553..894732dfaf9582dc871424ecd8b0d266b6cd980d 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)