From 115cc7b700979787e2adbb105832f27de4c89f28 Mon Sep 17 00:00:00 2001 From: "burnus%gmx.de" <> Date: Fri, 22 Aug 2003 20:55:13 +0000 Subject: Bug 139011 - Improve buglist colors further r,a=justdave --- Bugzilla/Util.pm | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'Bugzilla/Util.pm') diff --git a/Bugzilla/Util.pm b/Bugzilla/Util.pm index 511ba2592..c0d671744 100644 --- a/Bugzilla/Util.pm +++ b/Bugzilla/Util.pm @@ -30,6 +30,7 @@ use strict; use base qw(Exporter); @Bugzilla::Util::EXPORT = qw(is_tainted trick_taint detaint_natural html_quote url_quote value_quote xml_quote + css_class_quote lsearch max min trim format_time); @@ -73,6 +74,13 @@ sub url_quote { return $toencode; } +sub css_class_quote { + my ($toencode) = (@_); + $toencode =~ s/ /_/g; + $toencode =~ s/([^a-zA-Z0-9_\-.])/uc sprintf("&#x%x;",ord($1))/eg; + return $toencode; +} + sub value_quote { my ($var) = (@_); $var =~ s/\&/\&/g; @@ -260,6 +268,11 @@ replaced with their appropriate HTML entities. Quotes characters so that they may be included as part of a url. +=item C + +Quotes characters so that they may be used as CSS class names. Spaces +are replaced by underscores. + =item C As well as escaping html like C, this routine converts newlines -- cgit v1.2.3-24-g4f1b