public function hookIsValid(Dictionary $params)
    {
        // Validate nonce
        $form = $params['form'];
        $request = $params['request'];
        $arguments = $params['arguments'];

        $result = Nonce::validateNonce($form->getName(), $request->session, $arguments);
        $nonce_name = Nonce::getParameterName();
        if ($result === null)
        {
            $params['errors'] = [$nonce_name => [[
                'msg' => 'Nonce was not submitted for form {form}',
                'context' => ['form' => $form->getName()]
            ]]];
            $params['valid'] = false;
        }
        elseif ($result === false)
        {
            $params['errors'] = [$nonce_name => [[
                'msg' => 'Nonce was invalid for form {form}',
                'context' => ['form' => $form->getName()] 
            ]]];
            $params['valid'] = false;
        }
    }
public function hookIsValid(Dictionary $params)
    {
        // Validate nonce
        $form = $params['form'];
        $request = $params['request'];
        $arguments = $params['arguments'];

        $result = Nonce::validateNonce($form->getName(), $request->session, $arguments);
        $nonce_name = Nonce::getParameterName();
        if ($result === null)
        {
            $params['errors'] = [$nonce_name => [[
                'msg' => 'Nonce was not submitted for form {form}',
                'context' => ['form' => $form->getName()]
            ]]];
            $params['valid'] = false;
        }
        elseif ($result === false)
        {
            $params['errors'] = [$nonce_name => [[
                'msg' => 'Nonce was invalid for form {form}',
                'context' => ['form' => $form->getName()] 
            ]]];
            $params['valid'] = false;
        }
    }
public function hookIsValid ( Dictionary $ params ) { // Validate nonce $ form = $ params [ 'form' ] ; $ request = $ params [ 'request' ] ; $ arguments = $ params [ 'arguments' ] ; $ result = Nonce :: validateNonce ( $ form -> getName ( ) , $ request -> session , $ arguments ) ; $ nonce_name = Nonce :: getParameterName ( ) ; if ( $ result === null ) { $ params [ 'errors' ] = [ $ nonce_name => [ [ 'msg' => 'Nonce was not submitted for form {form}' , 'context' => [ 'form' => $ form -> getName ( ) ] ] ] ] ; $ params [ 'valid' ] = false ; } elseif ( $ result === false ) { $ params [ 'errors' ] = [ $ nonce_name => [ [ 'msg' => 'Nonce was invalid for form {form}' , 'context' => [ 'form' => $ form -> getName ( ) ] ] ] ] ; $ params [ 'valid' ] = false ; } }
The hook called when the form is validated. Is used to validate that the
received nonce is valid.
The hook called when the form is validated . Is used to validate that the received nonce is valid .