* luci/libs: use pcdata() in striptags()
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 20 Aug 2008 16:55:10 +0000 (16:55 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 20 Aug 2008 16:55:10 +0000 (16:55 +0000)
libs/core/luasrc/util.lua

index 66e3682..d8fc666 100644 (file)
@@ -212,7 +212,7 @@ end
 -- @param value        String containing the HTML text
 -- @return     String with HTML tags stripped of
 function striptags(s)
-       return (s:gsub("</?[A-Za-z][A-Za-z0-9:_%-]*[^>]*>", " "):gsub("%s+", " "))
+       return pcdata(s:gsub("</?[A-Za-z][A-Za-z0-9:_%-]*[^>]*>", " "):gsub("%s+", " "))
 end
 
 --- Splits given string on a defined separator sequence and return a table