[yast-commit] r53892 - in /trunk/storage/libstorage/src: AppUtil.cc AppUtil.h
Author: aschnell Date: Thu Dec 4 17:57:00 2008 New Revision: 53892 URL: http://svn.opensuse.org/viewcvs/yast?rev=53892&view=rev Log: - added function to escape html stuff (bnc #450496) Modified: trunk/storage/libstorage/src/AppUtil.cc trunk/storage/libstorage/src/AppUtil.h Modified: trunk/storage/libstorage/src/AppUtil.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/AppUtil.cc?rev=53892&r1=53891&r2=53892&view=diff ============================================================================== --- trunk/storage/libstorage/src/AppUtil.cc (original) +++ trunk/storage/libstorage/src/AppUtil.cc Thu Dec 4 17:57:00 2008 @@ -533,6 +533,18 @@ } +string escapeHtml(const string& str) +{ + string ret = str; + boost::replace_all(ret, "&", "&"); + boost::replace_all(ret, "<", "<"); + boost::replace_all(ret, ">", ">"); + boost::replace_all(ret, "\"", """); + boost::replace_all(ret, "'", "'"); + return ret; +} + + string sformat(const char* format, ...) { char* result; Modified: trunk/storage/libstorage/src/AppUtil.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/AppUtil.h?rev=53892&r1=53891&r2=53892&view=diff ============================================================================== --- trunk/storage/libstorage/src/AppUtil.h (original) +++ trunk/storage/libstorage/src/AppUtil.h Thu Dec 4 17:57:00 2008 @@ -47,6 +47,8 @@ bool isNfsDev( const string& dev ); unsigned getMajorDevices( const string& driver ); +string escapeHtml(const string& str); + template<class StreamType> void classic(StreamType& stream) -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
aschnell@svn.opensuse.org