X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=libs%2Fcore%2Fluasrc%2Futil.lua;h=e493811256bf547f863b633dbf322cadacf3db20;hp=ffab60cb07429a6f51eec3c7785d2b50d40f6ba4;hb=9c260769a50956e9ece40a10e226da8e7191158c;hpb=9a203c52dd9bcbdb11bc86b99ea61027eec7cc26 diff --git a/libs/core/luasrc/util.lua b/libs/core/luasrc/util.lua index ffab60cb0..e49381125 100644 --- a/libs/core/luasrc/util.lua +++ b/libs/core/luasrc/util.lua @@ -105,6 +105,7 @@ class = cutil.class -- @return Boolean indicating whether the object is an instance -- @see class -- @see clone +--[[ function instanceof(object, class) local meta = getmetatable(object) while meta and meta.__index do @@ -115,6 +116,8 @@ function instanceof(object, class) end return false end +]]-- +instanceof = cutil.instanceof -- @@ -201,6 +204,7 @@ end --- Create valid XML PCDATA from given string. -- @param value String value containing the data to escape -- @return String value containing the escaped data +--[[ function pcdata(value) return value and tostring(value):gsub("[&\"'<>]", { ["&"] = "&", @@ -210,6 +214,8 @@ function pcdata(value) [">"] = ">" }) end +]]-- +pcdata = cutil.pcdata --- Strip HTML tags from given string. -- @param value String containing the HTML text