From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: development@lists.ipfire.org Subject: Re: [PATCH] general-functions.pl: Fix for bug#12937 Date: Wed, 28 Dec 2022 13:47:22 +0100 Message-ID: <9474665A-E686-4CB4-95BF-AC512549A8B3@ipfire.org> In-Reply-To: <20221219085446.2304-1-adolf.belka@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5779467133306724095==" List-Id: --===============5779467133306724095== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hello, I am not entirely sure whether this is a change that I can approve of or not. > On 19 Dec 2022, at 09:54, Adolf Belka wrote: >=20 > - The check for validwildcarddomainname did not allow wildcards of the form > *.ipfire.org* which is the example given on the proxy.cgi page for exclud= ed url's > for the wpad file. > - A forum user sufferred from this problem and the bug was raised for it. > https://community.ipfire.org/t/proxy-cgi-error-message-when-use-wildcard-= in-wpad-excluded-url-s/8597 > forum user has tested the patch change and confirmed it solves the proble= m. I find it a little bit less than optimal that a user has to consider where th= is string goes that they enter. They should not really care about whether it = goes to squid.conf which uses a different syntax than wpad. Users should have one universal language across the distribution and nothing = else. I realise that we don=E2=80=99t do that too well, but at least on the s= ame page, we should have a unified syntax. Instead, we should add an extra * if it is needed so that the user does not h= ave to mind. Is that an option in this case? -Michael >=20 > Fixes: Bug#12937 > Suggested-by: Bernhard Bitsch > Signed-off-by: Adolf Belka > --- > config/cfgroot/general-functions.pl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/config/cfgroot/general-functions.pl b/config/cfgroot/general-f= unctions.pl > index 98bedb4b9..06c160e05 100644 > --- a/config/cfgroot/general-functions.pl > +++ b/config/cfgroot/general-functions.pl > @@ -760,7 +760,7 @@ sub validwildcarddomainname($) { > my $domainname =3D shift; >=20 > # Ignore any leading dots > - if ($domainname =3D~ m/^\*\.(.*)/) { > + if ($domainname =3D~ m/^\*\.([^\*]*)\*?/ > $domainname =3D $1; > } >=20 > --=20 > 2.39.0 >=20 --===============5779467133306724095==--