Deletes NotFound entities for a Redirect's path.

@param Redirect $redirect
768391
public function removeForRedirect(Redirect $redirect)
    {
        $notFounds = $this->om->getRepository($this->class)->findBy(array('path' => $redirect->getSource()));

        foreach ($notFounds as $notFound) {
            $this->om->remove($notFound);
        }

        $this->om->flush();
    }
750156
public function registerAndLogin($user, $redirect)
    {
        $loginUser = $this->findOrRegister($user);
        $this->login($loginUser, $redirect);
        return false;
    }
382483
public function setRedirectUrl($redirect = null, $key = null) {
		if (empty($redirect)) {
			$redirect = $this->_controller->request->referer(true);
		} elseif ($redirect === true) {
			$redirect = $this->_controller->request->here(true);
		}
		if (empty($redirect) || $this->_controller->request->is('popup') ||
			$this->_controller->request->is('print')) {
			return false;
		}
		$cacheKey = $this->_getSessionKeyRedirect($key);
		$data = CakeSession::read($cacheKey);
		if (!empty($data) && (md5((string)$data) === md5((string)$redirect))) {
			return false;
		}

		return CakeSession::write($cacheKey, $redirect);
	}
740137
protected function redirectPath()
    {
        if (method_exists($this, 'redirectTo')) {
            return $this->redirectTo();
        }

        return property_exists($this, 'redirectTo') ? $this->redirectTo : config('admin.route.prefix');
    }
1360602
public function setRedirect($redirect)
    {
        /**
         * Changing the redirect also changes the secure[data] parameter. Since we
         * base our signature off of this it cannot be changed once the signature
         * has been generated.
         */
        if (isset($this->requestSignature)) {
            throw new BadMethodCallException('The signature for this request has already been generated.');
        }

        $this->redirect = $redirect;
        $this->mergeRedirect();
    }
786348
public function redirect($url = null)
    {
        if (null === $url) {
            $url = $this->getServer('HTTP_ORIGIN');
        }
        ob_start();
        header('Location: ' . $url);
        ob_end_clean();
        Security::getInstance()->updateSession();
        exit(t('Redireccionando...'));
    }
1331303
private function createWildcardRoute(Redirect $redirect)
    {
        $origin = $redirect->getOrigin();
        $target = $redirect->getTarget();
        $url = $this->context->getPathInfo();

        $origin = substr($origin, 0, -1);
        $target = substr($target, 0, -1);
        $pathInfo = str_replace($origin, $target, $url);

        $this->context->setPathInfo($pathInfo);

        return new Route(
            $url, array(
                    '_controller' => 'FrameworkBundle:Redirect:urlRedirect',
                    'path' => $url,
                    'permanent' => $redirect->isPermanent(),
                ));
    }
170880
protected function _commandDelete($command)
    {
        $entity = $this->getController()->getItem();

        $command->append(array('label' => AnTranslator::_('LIB-AN-ACTION-DELETE')))
        ->href(route($entity->getURL()))
        ->setAttribute('data-action', 'delete')
        ->setAttribute('data-redirect', route('index.php?option=com_locations&view=locations'))
        ->class('action-delete');
    }
136248
public function setRedirectUri($redirect_uri)
    {
        // $redirect_uri = trim(urldecode($redirect_uri));
        $redirect_uri = trim($redirect_uri);
        if (filter_var($redirect_uri, FILTER_VALIDATE_URL) === false) {
            throw new Exception('$redirect_uri无效');
        }
        $this->_redirect_uri = urlencode($redirect_uri);
    }
495476
public function delete($url) {

        // Convert to a path
        $path = $this->helpers->path($url);

        // Delete the path if it still exists
        if ($this->manager->has('disk://'.$path)) $this->manager->delete('disk://'.$path);
    }
542873
static function RedirectRelative($target, $noExit = false)
    {
        session_write_close();
        $dirName =  dirname($_SERVER["PHP_SELF"]);
        if ($dirName == "/")
            $dirName = "";
        header("Location: " .  "http://" . $_SERVER["HTTP_HOST"]
            . $dirName
            . "/" .  $target);
        if (!$noExit)
        {
            exit();
        }
    }
1136900
protected function redirect($path)
	{
		$path = str_replace('//', '/', $this->app->baseURL . $path);

		$this->app->redirect($path);
	}
968481
protected function resolveRedirectRoute()
    {
        if (empty($this->redirectRoute)) return;

        $route = $this->system->router()->getRouteByName($this->redirectRoute);

        if (empty($route))
        {
            $this->setNotReady("Unable to find route " . $this->redirectRoute);
            return;
        }

        $this->redirectURL = $route->getPath($this->redirectParameters);
    }
292665
public function redirect($url)
    {
        $location = $this->_request->getBasePath();
        $location = str_replace('//', '/', "{$location}/{$url}");
        $this->_response->setStatusCode(302);
        $header = new GenericHeader('Location', $location);
        $this->_response->getHeaders()->addHeader($header);
        return $this->disableRendering();
    }
391397
public static function cleanUrl($url, $headerRedirect = false) {
		if ($url === '' || $url === 'http://' || $url === 'http://www' || $url === 'http://www.') {
			$url = '';
		} else {
			$url = static::autoPrefixUrl($url, 'http://');
		}

		if ($headerRedirect && !empty($url)) {
			$headers = static::getHeaderFromUrl($url);
			if ($headers !== false) {
				$headerString = implode("\n", $headers);

				if ((bool)preg_match('#^HTTP/.*\s+[(301)]+\s#i', $headerString)) {
					foreach ($headers as $header) {
						if (mb_strpos($header, 'Location:') === 0) {
							$url = trim(hDec(mb_substr($header, 9))); // rawurldecode/urldecode ?
						}
					}
				}
			}
		}

		$length = mb_strlen($url);
		while (!empty($url) && mb_strrpos($url, '/') === $length - 1) {
			$url = mb_substr($url, 0, $length - 1);
			$length--;
		}
		return $url;
	}
61496
public static function checkAuthentication($redirect = true)
    {
        if(static::isAuthenticated()) {
            return;
        }

        if ($redirect) {
            Http\Server::getInstance()->redirect(RouteCollection::getInstance()->get('login')->getUri());
        } else {
            throw new LoginException();
        }
    }
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;
    }