Esempio n. 1
0
 /**
  * Adjusts the configuration used for RealURL path decoding, depending on a specific domain disposal.
  *
  * @param array $configuration Configuration required to determine hosts while path decoding
  * @return void
  */
 protected function adjustConfigurationByHostDecode($configuration)
 {
     if (is_array($configuration)) {
         $host = strtolower($this->apiWrapper->getIndpEnv('TYPO3_HOST_ONLY'));
         $hostConfiguration = false;
         if (isset($configuration[$host])) {
             $hostConfiguration = $configuration[$host];
         } else {
             $keys = array_keys($configuration);
             foreach ($keys as $regexp) {
                 if (preg_match('/^\\/[^\\/]+\\/$/', $regexp) && preg_match($regexp, $host)) {
                     $hostConfiguration = $configuration[$regexp];
                     break;
                 }
             }
         }
         if (is_array($hostConfiguration)) {
             if (isset($hostConfiguration['GETvars']) && is_array($hostConfiguration['GETvars'])) {
                 foreach ($hostConfiguration['GETvars'] as $key => $value) {
                     if (empty($_GET[$key])) {
                         $_GET[$key] = $value;
                         $this->additionalParametersForChash[$key] = $this->apiWrapper->testInt($value) ? intval($value) : $value;
                     }
                 }
                 if (isset($hostConfiguration['useConfiguration'])) {
                     $this->setConfigurationByReference($hostConfiguration['useConfiguration']);
                 }
             }
         }
     }
 }