dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Security SecurityEleme


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Security SecurityElement.cs, 1.6, 1.7
Date: Wed, 23 Jul 2003 00:57:34 -0400

Update of /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Security
In directory subversions:/tmp/cvs-serv5482/runtime/System/Security

Modified Files:
        SecurityElement.cs 
Log Message:


Some test cases and bug fixes for "System.Security".


Index: SecurityElement.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/runtime/System/Security/SecurityElement.cs,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** SecurityElement.cs  29 May 2003 03:12:58 -0000      1.6
--- SecurityElement.cs  23 Jul 2003 04:57:31 -0000      1.7
***************
*** 74,78 ****
                                        throw new 
ArgumentException(_("Arg_InvalidXMLTag"));
                                }
!                               else if(text != null && !IsValidTag(text))
                                {
                                        throw new 
ArgumentException(_("Arg_InvalidXMLText"));
--- 74,78 ----
                                        throw new 
ArgumentException(_("Arg_InvalidXMLTag"));
                                }
!                               else if(text != null && !IsValidText(text))
                                {
                                        throw new 
ArgumentException(_("Arg_InvalidXMLText"));
***************
*** 93,96 ****
--- 93,104 ----
                     '\u3000', '\uFEFF'};
  
+       // Invalid XML characters in text sections.  It is assumed that
+       // occurrences of '&' are correctly-formatted XML escapes.
+       private static readonly char[] InvalidTextChars = {'<', '>'};
+ 
+       // Invalid XML characters in attribute values.  It is assumed that
+       // occurrences of '&' are correctly-formatted XML escapes.
+       private static readonly char[] InvalidAttrChars = {'<', '>', '"'};
+ 
        // Escape invalid XML characters in a string.
        public static String Escape(String str)
***************
*** 228,232 ****
                                else
                                {
!                                       return 
(name.IndexOfAny(InvalidNameChars) >= 0);
                                }
                        }
--- 236,240 ----
                                else
                                {
!                                       return 
(name.IndexOfAny(InvalidNameChars) < 0);
                                }
                        }
***************
*** 241,245 ****
                                else
                                {
!                                       return true;
                                }
                        }
--- 249,253 ----
                                else
                                {
!                                       return 
(value.IndexOfAny(InvalidAttrChars) < 0);
                                }
                        }
***************
*** 254,258 ****
                                else
                                {
!                                       return 
(name.IndexOfAny(InvalidNameChars) >= 0);
                                }
                        }
--- 262,266 ----
                                else
                                {
!                                       return 
(name.IndexOfAny(InvalidNameChars) < 0);
                                }
                        }
***************
*** 267,271 ****
                                else
                                {
!                                       return true;
                                }
                        }
--- 275,279 ----
                                else
                                {
!                                       return 
(text.IndexOfAny(InvalidTextChars) < 0);
                                }
                        }
***************
*** 378,386 ****
                                get
                                {
!                                       return text;
                                }
                                set
                                {
!                                       if(!IsValidText(value))
                                        {
                                                throw new 
ArgumentException(_("Arg_InvalidXMLText"));
--- 386,394 ----
                                get
                                {
!                                       return Unescape(text);
                                }
                                set
                                {
!                                       if(value != null && !IsValidText(value))
                                        {
                                                throw new 
ArgumentException(_("Arg_InvalidXMLText"));





reply via email to

[Prev in Thread] Current Thread [Next in Thread]