@param Redirect $redirect

@return bool
770151
private function isWildcardRedirect(Redirect $redirect)
    {
        $origin = $redirect->getOrigin();
        $matchSegment = substr($origin, 0, -1);
        if (substr($origin, -2) == '/*') {
            return $this->isPathInfoWildcardMatch($matchSegment);
        }

        return false;
    }
1157319
public function withRedirectUrls($redirects)
    {
        if (isset($redirects['success'])) {
            $this->returnUrlSuccess = $redirects['success'];
        }

        if (isset($redirects['cancel'])) {
            $this->returnUrlCancel = $redirects['cancel'];
        }

        if (isset($redirects['back'])) {
            $this->returnUrlBack = $redirects['back'];
        }

        return $this;
    }
734117
public function execDelete($redirectAction = false)
    {
        // database translations
        $this->loadTranslations('database', sprintf('private/global/locales/%s/database.ini', LANGUAGE));
        //validate and extract input
        $input = $this->processSaveInput(filter_input_array(INPUT_POST, $this->configuration['subjects'][$this->name]['CRUD']['inputFields']));
        if($input) {
            //extract primary key value
            $primaryKeyValue = $this->extractPrimaryKeyValue($input, 'a');
            try{
                //ORM insert
                $this->delete($primaryKeyValue);
                $this->messages->save('cookies','success',sprintf($this->translations[$this->name]['CRUD']['delete-success'], $this->translations[$this->name]['singular']));
            } catch(\PDOException $exception) {
                $this->messages->save('cookies', 'danger', $this->handleError($exception));
                $redirectAction = 'deleteForm/' . $this->extractPrimaryKeyValue($input, 's');
            }
        }
        //redirect
        $redirectAction = $redirectAction ? $redirectAction : 'list';
        $this->httpResponse = $this->httpResponse->withHeader('Location', $redirectAction);
    }
1320188
public function showListItemAction(Redirection $redirection)
    {
        $form = $this->getRedirectionForm($redirection, sprintf('#redirection-%d-item-container', $redirection->getId()));

        return $this->render('@VictoireSeo/Redirection/_newItem.html.twig', [
            'redirection' => $redirection,
            'form'        => $form->createView(),
        ]);
    }
394391
protected function verifyRedirect($redirectUrl, $options)
    {
        if (strlen($redirectUrl) > 2048) {
            throw new \Exception('Too long redirectUrl argument passed');
        }
        if ($redirectUrl !== '') {
            // The below check is to prevent possible redirect attack
            // (if someone tries to redirect user to another domain).
            $uri = new Uri($redirectUrl);
            if (!$uri->isValid() || $uri->getHost() !== null) {
                throw new \Exception('Incorrect redirect URL: ' . $redirectUrl);
            }
            $options = ArrayUtils::merge($options, ['query' => ['redirect' => $redirectUrl]]);
        }
        return $options;
    }
1142023
public function setRedirectUrl($redirectUrl)
    {
        if (!empty($redirectUrl) && ctype_print($redirectUrl)) {
            $this->redirectUrl = trim($redirectUrl);
        }

        return $this;
    }
939550
private function compareUris($redirect_uri, $clientRedirectUri)
    {
        if (!$redirect_uri || !$clientRedirectUri) {
            return false;
        }

        $wanted = array_fill_keys(['scheme', 'host', 'port', 'path'], true);

        // gets only scheme, host, port, path from uri
        $redirect_uri = array_intersect_key(parse_url($redirect_uri), $wanted);
        $clientRedirectUri = array_intersect_key(parse_url($clientRedirectUri), $wanted);

        return strcmp(implode($redirect_uri), implode($clientRedirectUri)) === 0;
    }
284628
private function buildRedirect( $redirectUrl, $redirectCode )
	{
		if ( is_null( $redirectCode ) )
		{
			return new Redirect( $redirectUrl );
		}
		else
		{
			return new Redirect( $redirectUrl, $redirectCode );
		}
	}
67998
protected function hasRedirectUrl($url)
    {
        if (null === $this->redirectApi && 0 === strpos($url, $this->getRepositoryApiUrl())) {
            $this->redirectApi = $this->getNewRepositoryUrl();

            if (\is_string($this->redirectApi)) {
                $this->cache->write('redirect-api', $this->redirectApi);
            }
        }

        return \is_string($this->redirectApi);
    }
962634
public function logout($redirectUrl)
    {
        if (!empty($this->options['revoke_token_url']) && $this->options['force_login'] === true) {
            $redirectUrl = $this->normalizeUrl(
                $this->options['revoke_token_url'],
                ['post_logout_redirect_uri' => $redirectUrl]
            );
        }

        return new RedirectResponse($redirectUrl);
    }
440255
protected function resolveInvalidRedirect()
    {
        if (empty($this->server['REDIRECT_URL'])) {
            return false;
        }

        $nodes = substr($this->server['SCRIPT_FILENAME'], strlen($this->server['DOCUMENT_ROOT']));
        $nodes = str_replace('\\', '/', $nodes);
        $nodes = substr($nodes, 0, strrpos($nodes, '/'));
        $nodes = explode('/', trim($nodes, '/'));
        $redirect = explode('/', trim($this->server['REDIRECT_URL'], '/'));

        $path = [];
        foreach ($nodes as $node) {
            if (!in_array($node, $redirect)) {
                $path[] = $node;
            }
        }

        return empty($path) ? false : '/' . implode('/', $path);
    }
456416
public function redirect($url, $autoRedirect = true)
    {
        if (!$this->config->getShopNumber()) {
            return '';
        }

        $url .= $this->processQueryString($url);

        if (
            !$this->isRedirectAllowed() || !$this->isMobileRequest() ||
            !$autoRedirect || (($this->redirectType == 'default') && !$this->enableDefaultRedirect)
        ) {
            return $this->getJsHeader($url);
        }

        // validate url
        if (!preg_match('#^(http|https)\://#', $url)) {
            return $this->getJsHeader();
        }

        // perform redirect
        header("Location: " . $url, true, 301);
        exit;
    }
936874
public static function permanentRedirect($url, $externalRedirect = false) {
		/** @var Response $response */
		$response = new static();
		$response->redirect($url, $externalRedirect, self::HTTP_PERMANENT_REDIRECT);
		return $response;
	}
545164
public function isAdmin($redirect = false)
    {

        if (!$this->isLoggedIn()) {
            $this->di->get("response")->redirect("user/login");
            return false;
        }

        $email = $this->di->get("session")->get("user");
        $user = new User();
        $user->setDb($this->di->get("db"));
        $user->find("email", $email);
        $isAdmin = $user->admin;

        if (!$isAdmin) {
            if ($redirect) {
                $this->di->get("response")->redirect("user");
            }
            return false;
        }

        return true;
    }
64818
def is_redirect(self):
        ''''''
        if self._response:
            status_code = self._response.status_code
            return status_code in self._codes \
                or status_code in self._repeat_codes
795838
protected function checkRedirect() {
		if (!empty($this->getConfig()['forceRedirectUrl'])) {
			$this->getSite()->setRedirectUrl("{$this->getConfig()['forceRedirectUrl']}");
			$this->getSite()->redirect();
		}
	}
245038
public function AutoToggle($Sender, $Redirect = NULL) {
      $PluginName = $this->GetPluginIndex();
      $EnabledKey = "Plugins.{$PluginName}.Enabled";
      $CurrentConfig = C($EnabledKey, FALSE);
      $PassedKey = GetValue(1, $Sender->RequestArgs);
      
      if ($Sender->Form->AuthenticatedPostBack() || Gdn::Session()->ValidateTransientKey($PassedKey)) {
         $CurrentConfig = !$CurrentConfig;
         SaveToConfig($EnabledKey, $CurrentConfig);
      }
      
      if ($Sender->Form->AuthenticatedPostBack())
         $this->Controller_Index($Sender);
      else {
         if ($Redirect === FALSE) return $CurrentConfig;
         if (is_null($Redirect))
            Redirect('plugin/'.strtolower($PluginName));
         else
            Redirect($Redirect);
      }            
      return $CurrentConfig;
   }