Exemple #1
0
 /**
  * @param \Magento\Framework\App\RequestInterface $request
  * @param UrlRewrite $rewrite
  * @return \Magento\Framework\App\ActionInterface|null
  */
 protected function processRedirect($request, $rewrite)
 {
     $target = $rewrite->getTargetPath();
     if ($rewrite->getEntityType() !== Rewrite::ENTITY_TYPE_CUSTOM || ($prefix = substr($target, 0, 6)) !== 'http:/' && $prefix !== 'https:') {
         $target = $this->url->getUrl('', ['_direct' => $target]);
     }
     return $this->redirect($request, $target, $rewrite->getRedirectType());
 }
 /**
  * @param UrlRewrite $url
  * @return bool
  */
 protected function isCorrectUrl(UrlRewrite $url)
 {
     $metadata = $url->getMetadata();
     return $url->getEntityType() == ProductUrlRewriteGenerator::ENTITY_TYPE && !empty($metadata['category_id']) && $url->getIsAutogenerated();
 }