M
M
Maxim Timofeev2016-07-10 18:07:20
Yii
Maxim Timofeev, 2016-07-10 18:07:20

How to find the reason for the strange behavior of the script?

Yes, I have no idea where to dig.
There is a project on yii2
In the afterAction of all controllers, except for the authorization one, there is a
script that remembers the user's url so that return $this->goBack();

public function afterAction($action, $result)
    {
        Yii::$app->getUser()->setReturnUrl(Yii::$app->request->url);
        return parent::afterAction($action, $result);
    }

Everything works fine except for 1 case.
Only at the customer, in all browsers, only when recovering a password (everything is standard for yii2), $this->goBack() redirects him to the page:
http://domain/here-language/css/https://fonts.googleapis ...
Why can this happen?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikita, 2016-07-11
@bitver

What is a crutch?
return $this->redirect(Yii::$app->request->referrer);
GoBack is needed to return from the jungle of links (for example, filling in fields in several steps) to one selected one.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question