Closed guspower closed 3 months ago
Thank you for the pull request !
I am not a huge fan of duplicating the entire query string (which can be large) into memory just for the use of one new function...
What would you think about taking the variables as an argument, in the form of a json object ? That would make the function more generally useful, and one would still be able to do
sqlpage.query_string(sqlpage.variables('get'))
Yep that seems reasonable - in fact it was what I started out doing but then realized that I'd have to take a perspective on both ordering and encoding. Let me rework this later in the week and come back to you with something that fits.
@guspower , what do you think about doing this instead: https://github.com/lovasoa/SQLpage/pull/494 ?
Yep that looks good to me. Much cleaner +1
Adds the
sqlpage.query_string()
SQLPage function.There are a few auth-related scenarios where it is useful to be able to directly access the query string and propagate it, for example when redirecting to a login page from a url with query string, and then redirecting the user back to that url on successful login.
There may be better ways to do this, but here is a simple
query_string
function for your consideration.