Example #1
0
 /**
  * @param string $text
  *
  * @return string
  */
 public function rewriteInternalUri($text)
 {
     $rootDir = str_replace('/', '\\/', $this->appPath->getWebRoot());
     $host = $this->request->getServer()->get('HTTP_HOST');
     $pattern = '/<a([^>]+)href="(http(s?):\\/\\/' . $host . ')?(' . $rootDir . ')?(index\\.php)?(\\/?)((?i:[a-z\\d_\\-]+\\/){2,})"/i';
     return preg_replace_callback($pattern, [$this, "rewriteInternalUriCallback"], $text);
 }
Example #2
0
 /**
  * @inheritdoc
  */
 public function preDispatch()
 {
     $this->setLanguage();
     // Einige Template Variablen setzen
     $this->view->assign('LANGUAGES', $this->languagesDropdown($this->translator->getLocale()));
     $this->view->assign('PHP_SELF', $this->appPath->getPhpSelf());
     $this->view->assign('REQUEST_URI', $this->request->getServer()->get('REQUEST_URI'));
     $this->view->assign('ROOT_DIR', $this->appPath->getWebRoot());
     $this->view->assign('INSTALLER_ROOT_DIR', $this->appPath->getInstallerWebRoot());
     $this->view->assign('DESIGN_PATH', $this->appPath->getDesignPathWeb());
     $this->view->assign('UA_IS_MOBILE', $this->request->getUserAgent()->isMobileBrowser());
     $this->view->assign('IS_AJAX', $this->request->isXmlHttpRequest());
     $languageInfo = simplexml_load_file($this->appPath->getInstallerModulesDir() . 'Install/Resources/i18n/' . $this->translator->getLocale() . '.xml');
     $this->view->assign('LANG_DIRECTION', isset($languageInfo->info->direction) ? $languageInfo->info->direction : 'ltr');
     $this->view->assign('LANG', $this->translator->getShortIsoCode());
 }
 /**
  * @return string
  */
 protected function getCookieDomain()
 {
     if (strpos($this->request->getServer()->get('HTTP_HOST'), '.') !== false) {
         return $this->request->getServer()->get('HTTP_HOST', '');
     }
     return '';
 }