Browse Source

Convert localhost to 127.0.0.1 before determining the host_type.

markjcrane 9 năm trước cách đây
mục cha
commit
60555f220f
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      core/install/resources/classes/install_switch.php

+ 1 - 1
core/install/resources/classes/install_switch.php

@@ -381,13 +381,13 @@ include "root.php";
 					}
 					elseif ($this->global_settings->db_type() == "pgsql") {
 						$db_host = $this->global_settings->db_host();
+						if($db_host == 'localhost') { $db_host = '127.0.0.1'; } // lua cannot resolve localhost
 						if (filter_var($db_host, FILTER_VALIDATE_IP)) {
 							$host_type = "hostaddr";
 						}
 						else {
 							$host_type = "host";
 						}
-						if($db_host == 'localhost') { $db_host = '127.0.0.1'; } // lua cannot resolve localhost
 						$tmp .= "	database[\"system\"] = \"pgsql://".$host_type."=".$db_host." port=".$this->global_settings->db_port()." dbname=".$this->global_settings->db_name()." user=".$this->global_settings->db_username()." password=".$this->global_settings->db_password()." options='' application_name='".$this->global_settings->db_name()."'\";\n";
 						$tmp .= "	database[\"switch\"] = \"pgsql://".$host_type."=".$db_host." port=".$this->global_settings->db_port()." dbname=freeswitch user=".$this->global_settings->db_username()." password=".$this->global_settings->db_password()." options='' application_name='freeswitch'\";\n";
 					}