Do not use "a-z" in regexes. Fixes "Invalid Url scheme 'http'" in
authorMartin Vidner <mvidner@suse.cz>
Wed, 22 Aug 2007 17:00:36 +0000 (17:00 +0000)
committerMartin Vidner <mvidner@suse.cz>
Wed, 22 Aug 2007 17:00:36 +0000 (17:00 +0000)
the Estonian locale (#302525).

package/libzypp.changes
zypp/url/UrlBase.cc

index aed7b67..1d161d8 100644 (file)
@@ -1,4 +1,10 @@
 -------------------------------------------------------------------
+Wed Aug 22 18:58:44 CEST 2007 - mvidner@suse.cz
+
+- Do not use "a-z" in regexes. Fixes "Invalid Url scheme 'http'" in
+  the Estonian locale (#302525).
+
+-------------------------------------------------------------------
 Wed Aug 22 17:59:39 CEST 2007 - aschnell@suse.de
 
 - added remembering of exception history at various places
index b50bcbf..68ee0e0 100644 (file)
 
 #include <iostream>
 
+// in the Estonian locale, a-z excludes t, for example. #302525
+// http://en.wikipedia.org/wiki/Estonian_alphabet
+#define a_zA_Z "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
+
 // ---------------------------------------------------------------
 /*
 ** authority = //[user [:password] @ ] host [:port]
 **
 ** host      = hostname | IPv4 | "[" IPv6-IP "]" | "[v...]"
 */
-#define RX_VALID_SCHEME    "^[a-zA-Z][a-zA-Z0-9\\.+-]*$"
+#define RX_VALID_SCHEME    "^[" a_zA_Z "][" a_zA_Z "0-9\\.+-]*$"
 
 #define RX_VALID_PORT      "^[0-9]{1,5}$"
 
@@ -269,14 +273,14 @@ namespace zypp
       // n=no  (don't encode 2. slash if authority present)
       config("path_encode_slash2", "n");
 
-      config("rx_username",     "^([a-zA-Z0-9!$&'\\(\\)*+=,;~\\._-]|%[a-fA-F0-9]{2})+$");
-      config("rx_password",     "^([a-zA-Z0-9!$&'\\(\\)*+=,:;~\\._-]|%[a-fA-F0-9]{2})+$");
+      config("rx_username",     "^([" a_zA_Z "0-9!$&'\\(\\)*+=,;~\\._-]|%[a-fA-F0-9]{2})+$");
+      config("rx_password",     "^([" a_zA_Z "0-9!$&'\\(\\)*+=,:;~\\._-]|%[a-fA-F0-9]{2})+$");
 
-      config("rx_pathname",     "^([a-zA-Z0-9!$&'\\(\\)*+=,:@/~\\._-]|%[a-fA-F0-9]{2})+$");
-      config("rx_pathparams",   "^([a-zA-Z0-9!$&'\\(\\)*+=,:;@/~\\._-]|%[a-fA-F0-9]{2})+$");
+      config("rx_pathname",     "^([" a_zA_Z "0-9!$&'\\(\\)*+=,:@/~\\._-]|%[a-fA-F0-9]{2})+$");
+      config("rx_pathparams",   "^([" a_zA_Z "0-9!$&'\\(\\)*+=,:;@/~\\._-]|%[a-fA-F0-9]{2})+$");
 
-      config("rx_querystr",     "^([a-zA-Z0-9!$&'\\(\\)*+=,:;@/?~\\._-]|%[a-fA-F0-9]{2})+$");
-      config("rx_fragment",     "^([a-zA-Z0-9!$&'\\(\\)*+=,:;@/?~\\._-]|%[a-fA-F0-9]{2})+$");
+      config("rx_querystr",     "^([" a_zA_Z "0-9!$&'\\(\\)*+=,:;@/?~\\._-]|%[a-fA-F0-9]{2})+$");
+      config("rx_fragment",     "^([" a_zA_Z "0-9!$&'\\(\\)*+=,:;@/?~\\._-]|%[a-fA-F0-9]{2})+$");
     }