huhwt / huhwt-cce

Webtrees - ClippingsCart Enhanced - Webtrees-2.1 Version -
GNU General Public License v3.0
5 stars 1 forks source link

Use new webtrees Validator #4

Closed hartenthaler closed 2 years ago

hartenthaler commented 2 years ago

All $xref = $request->getQueryParams()['xref'] ?? ''; should be replaced by $xref = Validator::attributes($request)->isXref()->string('xref');

huhwt commented 2 years ago

Nope, it doesn't work like that, it's a parameter and not an attribute ... but I found that with the validator also parameters can be drawn - is changed accordingly, see next release. By the way, in the original ClippingsCartModule the parameters are also still explicitly queried via getQueryParams - probably because the query via the Validator requires the parameter to be mandatory, so you can't set it alternatively depending on the context.

hartenthaler commented 2 years ago

I had a security problem (from an unknown IP address, maybe a crawler) and MagicSunday solved it using the new function Validator:: in his modules.