diff options
author | Sven Roederer <freifunk@it-solutions.geroedel.de> | 2019-07-06 14:18:15 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-07-19 20:14:35 +0200 |
commit | 68521fca04e9b2ae801cc2daa4f920a2c43bc03f (patch) | |
tree | c156d044c3f3ed1e970b0398045ead3624c75b12 /libs/luci-lib-base/luasrc/util.lua | |
parent | 8b8d83e42dd3d10d82e29a8614a7b3e3e94b16c6 (diff) |
luci-base(-libs): move pcdata() and striptags() from util- to xml-class
To complete the previous commit these functions are defined in the resulting
luci-base package but are also used in the new luci-base-libs package. So
move them into the new xml-module of the new package.
Signed-off-by: Sven Roederer <freifunk@it-solutions.geroedel.de>
Diffstat (limited to 'libs/luci-lib-base/luasrc/util.lua')
-rw-r--r-- | libs/luci-lib-base/luasrc/util.lua | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/libs/luci-lib-base/luasrc/util.lua b/libs/luci-lib-base/luasrc/util.lua index a30e8b72f3..38e00ad83b 100644 --- a/libs/luci-lib-base/luasrc/util.lua +++ b/libs/luci-lib-base/luasrc/util.lua @@ -159,8 +159,12 @@ end -- String and data manipulation routines -- +-- compatibility wrapper for xml.pcdata function pcdata(value) - return value and tparser.pcdata(tostring(value)) + local xml = require "luci.xml" + + perror("luci.util.pcdata() has been replaced by luci.xml.pcdata() - Please update your code.") + return xml.pcdata(value) end function urlencode(value) @@ -182,8 +186,12 @@ function urldecode(value, decode_plus) return nil end +-- compatibility wrapper for xml.striptags function striptags(value) - return value and tparser.striptags(tostring(value)) + local xml = require "luci.xml" + + perror("luci.util.striptags() has been replaced by luci.xml.striptags() - Please update your code.") + return xml.striptags(value) end function shellquote(value) @@ -343,8 +351,6 @@ function parse_units(ustr) end -- also register functions above in the central string class for convenience -string.pcdata = pcdata -string.striptags = striptags string.split = split string.trim = trim string.cmatch = cmatch |