Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] Allows hyphens in variable names so can access hyphenated query vars

Mark Ellis via nginx-devel
August 07, 2017 11:18AM
Ok. How would you suggest accessing query parameters with hyphens?

e.g. `?foo-bar=123`

how would you get the value of foo-bar?

Thanks

On Mon, 7 Aug 2017, at 02:20 PM, Maxim Dounin wrote:
> Hello!
>
> On Wed, Aug 02, 2017 at 11:30:11AM +0000, Mark Ellis via nginx-devel
> wrote:
>
> > # HG changeset patch
> > # User Mark Ellis <m@rkellis.com>
> > # Date 1501670303 -3600
> > # Wed Aug 02 11:38:23 2017 +0100
> > # Node ID 08008b0d1f4ffbd017d9f50142bdd46d7c4a41d2
> > # Parent 1eb753aa8e5e9ee5059ebb544194c8919b674873
> > Allows hyphens in variable names so can access hyphenated query vars
> >
> > This patch allows hyphens in variable names so that you can access query string
> > parameters with hyphens
> >
> > Before if you had a query string param such as `?foo-bar=123` you could not
> > access it with the variable `$foo-bar` as variables could not contain hyphens.
> >
> > diff -r 1eb753aa8e5e -r 08008b0d1f4f src/http/ngx_http_script.c
> > --- a/src/http/ngx_http_script.c Tue Aug 01 19:12:10 2017 +0300
> > +++ b/src/http/ngx_http_script.c Wed Aug 02 11:38:23 2017 +0100
> > @@ -403,6 +403,7 @@
> > if ((ch >= 'A' && ch <= 'Z')
> > || (ch >= 'a' && ch <= 'z')
> > || (ch >= '0' && ch <= '9')
> > + || ch == '-'
> > || ch == '_')
> > {
> > continue;
>
> No, thanks. Such a change will break a lot of configs, not to
> mention it is counter-intuitive and contradicts how things usually
> work in other programming languages.
>
> --
> Maxim Dounin
> http://nginx.org/
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] Allows hyphens in variable names so can access hyphenated query vars

Mark Ellis via nginx-devel 502 August 02, 2017 07:32AM

Re: [PATCH] Allows hyphens in variable names so can access hyphenated query vars

Maxim Dounin 209 August 07, 2017 09:22AM

Re: [PATCH] Allows hyphens in variable names so can access hyphenated query vars

Mark Ellis via nginx-devel 252 August 07, 2017 11:18AM

Re: [PATCH] Allows hyphens in variable names so can access hyphenated query vars

Maxim Dounin 204 August 07, 2017 11:48AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 114
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready