From: Martin Vidner Date: Wed, 22 Aug 2007 17:00:36 +0000 (+0000) Subject: Do not use "a-z" in regexes. Fixes "Invalid Url scheme 'http'" in X-Git-Tag: BASE-SuSE-Linux-10_3-Branch~228 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f45a4d53547a366eb018beab08a65c5fd4d4cb60;p=platform%2Fupstream%2Flibzypp.git Do not use "a-z" in regexes. Fixes "Invalid Url scheme 'http'" in the Estonian locale (#302525). --- diff --git a/package/libzypp.changes b/package/libzypp.changes index aed7b67..1d161d8 100644 --- a/package/libzypp.changes +++ b/package/libzypp.changes @@ -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 diff --git a/zypp/url/UrlBase.cc b/zypp/url/UrlBase.cc index b50bcbf..68ee0e0 100644 --- a/zypp/url/UrlBase.cc +++ b/zypp/url/UrlBase.cc @@ -23,13 +23,17 @@ #include +// 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})+$"); }