original_string: private function addTrustedHosts($siteUrl)
      {
          $trustedHosts = array();
  
          // extract host from the request header
          if (($host = $this->extractHost('http://' . Url::getHost())) !== false) {
              $trustedHosts[] = $host;
          }
  
          // extract host from first web site
          if (($host = $this->extractHost(urldecode($siteUrl))) !== false) {
              $trustedHosts[] = $host;
          }
  
          $trustedHosts = array_unique($trustedHosts);
          if (count($trustedHosts)) {
  
              $general = Config::getInstance()->General;
              $general['trusted_hosts'] = $trustedHosts;
              Config::getInstance()->General = $general;
  
              Config::getInstance()->forceSave();
          }
      }
code: private function addTrustedHosts($siteUrl)
      {
          $trustedHosts = array();
  
          // extract host from the request header
          if (($host = $this->extractHost('http://' . Url::getHost())) !== false) {
              $trustedHosts[] = $host;
          }
  
          // extract host from first web site
          if (($host = $this->extractHost(urldecode($siteUrl))) !== false) {
              $trustedHosts[] = $host;
          }
  
          $trustedHosts = array_unique($trustedHosts);
          if (count($trustedHosts)) {
  
              $general = Config::getInstance()->General;
              $general['trusted_hosts'] = $trustedHosts;
              Config::getInstance()->General = $general;
  
              Config::getInstance()->forceSave();
          }
      }
code_tokens: private function addTrustedHosts ( $ siteUrl ) { $ trustedHosts = array ( ) ; // extract host from the request header if ( ( $ host = $ this -> extractHost ( 'http://' . Url :: getHost ( ) ) ) !== false ) { $ trustedHosts [ ] = $ host ; } // extract host from first web site if ( ( $ host = $ this -> extractHost ( urldecode ( $ siteUrl ) ) ) !== false ) { $ trustedHosts [ ] = $ host ; } $ trustedHosts = array_unique ( $ trustedHosts ) ; if ( count ( $ trustedHosts ) ) { $ general = Config :: getInstance ( ) -> General ; $ general [ 'trusted_hosts' ] = $ trustedHosts ; Config :: getInstance ( ) -> General = $ general ; Config :: getInstance ( ) -> forceSave ( ) ; } }
docstring: Add trusted hosts
docstring_tokens: Add trusted hosts