set_http 함수 코드 수정

This commit is contained in:
thisgun
2022-11-21 11:47:32 +09:00
parent d3561623aa
commit a93008d392

View File

@ -269,12 +269,12 @@ function url_auto_link($str)
// url에 http:// 를 붙인다 // url에 http:// 를 붙인다
function set_http($url) function set_http($url, $protocol="http://")
{ {
if (!trim($url)) return; if (!trim($url)) return;
if (!preg_match("/^(http|https|ftp|telnet|news|mms)\:\/\//i", $url)) if (!preg_match("/^(http|https|ftp|telnet|news|mms)\:\/\//i", $url))
$url = "http://" . $url; $url = $protocol. $url;
return $url; return $url;
} }