正在显示
1 个修改的文件
包含
15 行增加
和
6 行删除
| @@ -297,12 +297,21 @@ class MailFun { | @@ -297,12 +297,21 @@ class MailFun { | ||
| 297 | * @author:dc | 297 | * @author:dc |
| 298 | * @time 2024/3/6 9:21 | 298 | * @time 2024/3/6 9:21 |
| 299 | */ | 299 | */ |
| 300 | - public static function getHostPort($host,$port = 465){ | ||
| 301 | - list($h,$p) = explode(":",$host.':'.$port); | ||
| 302 | - return [ | ||
| 303 | - 'host' => $h, | ||
| 304 | - 'port' => $p, | ||
| 305 | - ]; | 300 | + public static function getHostPort($host,$port=0){ |
| 301 | + $arr = explode(":",$host); | ||
| 302 | + if(str_contains($host, '//')){ | ||
| 303 | + return [ | ||
| 304 | + 'host' => $arr[0].':'.$arr[1], | ||
| 305 | + 'port' => empty($arr[2]) ? $port : $arr[2], | ||
| 306 | + ]; | ||
| 307 | + }else{ | ||
| 308 | + | ||
| 309 | + return [ | ||
| 310 | + 'host' => $arr[0], | ||
| 311 | + 'port' => empty($arr[1]) ? $port : $arr[1], | ||
| 312 | + ]; | ||
| 313 | + } | ||
| 314 | + | ||
| 306 | } | 315 | } |
| 307 | 316 | ||
| 308 | 317 |
-
请 注册 或 登录 后发表评论