作者 刘锟

小语种自定义跳转域名

... ... @@ -375,16 +375,21 @@ class DomainInfoLogic extends BaseLogic
}
//域名是否都已经解析
if(empty($this->param['custom_domain'])){
$this->fail('自定义跳转域名不能为空');
if(strpos($this->param['custom_domain'],'//') === false){
$this->param['custom_domain'] = '//'.$this->param['custom_domain'];
}
if(strpos($this->param['custom_domain'],'http') !== false){
$domain_arr = parse_url($this->param['custom_domain']);
$this->param['custom_domain'] = $domain_arr['host'];
$domain_arr = parse_url($this->param['custom_domain']);
if(!isset($domain_arr['host'])){
$this->fail('自定义域名填写错误');
}
$this->param['custom_domain'] = $domain_arr['host'];
if(!$this->check_cname($this->param['custom_domain'], $server_info)){
$this->fail('域名' . $this->param['custom_domain'] . '未解析至目标服务器');
}
}else{
$this->param['custom_domain'] = str_replace('https://','',$this->param['custom_domain']);
$this->param['custom_domain'] = str_replace('http://','',$this->param['custom_domain']);
$this->param['custom_domain'] = str_replace('//','',$this->param['custom_domain']);
}
$custom_model = new CountryCustom();
... ...