W3C home > Mailing lists > Public > www-validator-cvs@w3.org > August 2009

validator/httpd/cgi-bin check,1.679,1.680

From: Ville Skytta via cvs-syncmail <cvsmail@w3.org>
Date: Thu, 13 Aug 2009 15:33:07 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1MbcId-0006wa-Sq@lionel-hutz.w3.org>
Update of /sources/public/validator/httpd/cgi-bin
In directory hutz:/tmp/cvs-serv26665

Modified Files:
	check 
Log Message:
Another stab at fixing confusing "did you mean foo" hints in error messages.

Index: check
===================================================================
RCS file: /sources/public/validator/httpd/cgi-bin/check,v
retrieving revision 1.679
retrieving revision 1.680
diff -u -d -r1.679 -r1.680
--- check	11 Aug 2009 11:04:12 -0000	1.679
+++ check	13 Aug 2009 15:33:05 -0000	1.680
@@ -3148,9 +3148,11 @@
           $err->{msg} = "Attribute \"".$bogus_elt_attr."\" is not a valid attribute";
       }
 
-      if((exists $self->{CFG}->{Attributes}->{lc($bogus_elt_attr)}) and ($err->{num} eq '108')) {
+      if(($err->{num} eq '108') and
+         (exists $self->{CFG}->{Attributes}->{lc($bogus_elt_attr)}) and
+         (!$is_xml || $bogus_elt_attr eq lc($bogus_elt_attr))) {
           # attribute not available in this context.
-          $err->{msg} = 'Attribute "'.lc($bogus_elt_attr).'" can not be used for this element.';
+          $err->{msg} = "Attribute \"$bogus_elt_attr\" can not be used for this element.";
       }
       elsif ( (
              ((exists $self->{CFG}->{Attributes}->{lc($bogus_elt_attr)}) and ($err->{num} eq '108'))
Received on Thursday, 13 August 2009 15:33:16 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:17:38 UTC