作者 刘锟

合并分支 'akun' 到 'master'

update



查看合并请求 !771
@@ -179,17 +179,15 @@ class DomainInfoLogic extends BaseLogic @@ -179,17 +179,15 @@ class DomainInfoLogic extends BaseLogic
179 $this->fail('域名' . $info['domain'] . '未解析至目标服务器'); 179 $this->fail('域名' . $info['domain'] . '未解析至目标服务器');
180 } 180 }
181 $domain_301 = ''; 181 $domain_301 = '';
182 - $other_domain = [];  
183 - foreach ($this->param['other_domain']??[] as $vo){  
184 - if(!$vo){  
185 - continue;  
186 - }  
187 - if(substr($vo,0,2) == '*.' || $this->check_cname($vo,$serversIpInfo)){  
188 - $other_domain[] = $vo;  
189 - }elseif($this->check_a($vo,DomainInfo::SERVER_IP_301)){  
190 - $domain_301 = $vo; 182 + foreach ($this->param['other_domain']??[] as $other_domain){
  183 + if($other_domain && substr($other_domain,0,2) != '*.'){
  184 + if($this->check_a($other_domain,DomainInfo::SERVER_IP_301)){
  185 + $domain_301 = $other_domain;
191 }else{ 186 }else{
192 - $this->fail('域名' . $vo . '未解析至目标服务器'); 187 + if(!$this->check_cname($other_domain, $serversIpInfo)){
  188 + $this->fail('域名' . $other_domain . '未解析至目标服务器');
  189 + }
  190 + }
193 } 191 }
194 } 192 }
195 193
@@ -233,7 +231,7 @@ class DomainInfoLogic extends BaseLogic @@ -233,7 +231,7 @@ class DomainInfoLogic extends BaseLogic
233 231
234 //保存301跳转数据+其他域名 232 //保存301跳转数据+其他域名
235 $data = [ 233 $data = [
236 - 'other_domain'=>json_encode($other_domain), 234 + 'other_domain'=>json_encode(array_filter($this->param['other_domain'] ?? [])),
237 'extend_config'=>json_encode($extend_config), 235 'extend_config'=>json_encode($extend_config),
238 'type'=>$this->param['type'], 236 'type'=>$this->param['type'],
239 'private_key' => $this->param['key'] ?? '', 237 'private_key' => $this->param['key'] ?? '',