<commit_before><?php

namespace keygenqt\lastPage;

use Yii;
use yii\web\Controller;

/**
 * LastPage controller
 */
class LastPage extends Controller
{
    public function beforeAction($action)
    {
        $result = parent::beforeAction($action);
        if (empty($_FILES)) {
            $request = Yii::$app->request;
            if ((!$request->isAjax || !empty($_GET['ajax'])) && strpos($request->getUrl(), '.') === false) {
                if (($oldUrl = Yii::$app->session->get('user.url')) !== null) {
                    if (($newUrl = Yii::$app->session->get('user.new-url')) != $request->getUrl()) {
                        Yii::$app->session->set('user.new-url', $request->getUrl());
                        Yii::$app->session->set('user.url', $newUrl);
                    }
                } else {
                    Yii::$app->session->set('user.new-url', $request->getUrl());
                    Yii::$app->session->set('user.url', '/');
                }
                Yii::$app->user->setReturnUrl(Yii::$app->session->get('user.url'));
            }<commit_msg>fix [ajax]<commit_after><?php

namespace keygenqt\lastPage;

use Yii;
use yii\web\Controller;

/**
 * LastPage controller
 */
class LastPage extends Controller
{
    public function beforeAction($action)
    {
        $result = parent::beforeAction($action);
        if (empty($_FILES)) {
            $request = Yii::$app->request;
            if (!$request->isAjax && strpos($request->getUrl(), '.') === false && empty($_GET['ajax'])) {
                if (($oldUrl = Yii::$app->session->get('user.url')) !== null) {
                    if (($newUrl = Yii::$app->session->get('user.new-url')) != $request->getUrl()) {
                        Yii::$app->session->set('user.new-url', $request->getUrl());
                        Yii::$app->session->set('user.url', $newUrl);
                    }
                } else {
                    Yii::$app->session->set('user.new-url', $request->getUrl());
                    Yii::$app->session->set('user.url', '/');
                }
                Yii::$app->user->setReturnUrl(Yii::$app->session->get('user.url'));
            }
{'fraction_non_alphanumeric': 0.20933456561922367, 'fraction_numerical': 0.0, 'mean_word_length': 1.9657534246575343, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5121224', 'n_tokens_mistral': 639, 'n_tokens_neox': 638, 'n_words': 89}