validator/httpd/cgi-bin check,1.566,1.567

Update of /sources/public/validator/httpd/cgi-bin
In directory hutz:/tmp/cvs-serv12276

Modified Files:
	check 
Log Message:
Tighten matching of content types that we treat as special in parse_content_type()

Index: check
===================================================================
RCS file: /sources/public/validator/httpd/cgi-bin/check,v
retrieving revision 1.566
retrieving revision 1.567
diff -u -d -r1.566 -r1.567
--- check	11 Sep 2007 06:45:38 -0000	1.566
+++ check	11 Sep 2007 06:52:21 -0000	1.567
@@ -1426,17 +1426,17 @@
   $charset = HTML::Encoding::encoding_from_content_type($Content_Type);
 
   if ($mode =~ m(/)) { # a "/" means it's unknown or we'd have a mode here.
-    if ($ct =~ m(text/css) and defined $url) {
+    if ($ct eq 'text/css' and defined $url) {
       print redirect
         'http://jigsaw.w3.org/css-validator/validator?uri='
           . uri_escape $url;
       exit;
-    } elsif ($ct =~ m(application/atom\+xml) and defined $url) {
+    } elsif ($ct eq 'application/atom+xml' and defined $url) {
       print redirect
         'http://validator.w3.org/feed/check.cgi?url='
           . uri_escape $url;
       exit;
-    } elsif ($ct =~ m(application/.+\+xml)) {
+    } elsif ($ct =~ m(^application/.+\+xml$)) {
       # unknown media types which should be XML - we give these a try
       $mode = "XML";
     } else {

Received on Tuesday, 11 September 2007 06:52:27 UTC