X-Git-Url: https://git.cweiske.de/phinde.git/blobdiff_plain/226508cd8d3e8c147ad314a0de483e08be71c254..cd02bac646f42a0cb402ff2dc8240aa01f1f0fb8:/src/phinde/Helper.php?ds=sidebyside diff --git a/src/phinde/Helper.php b/src/phinde/Helper.php index 4863961..40ea751 100644 --- a/src/phinde/Helper.php +++ b/src/phinde/Helper.php @@ -11,5 +11,24 @@ class Helper } return true; } + + public static function noSchema($url) + { + return str_replace( + array('http://', 'https://'), + '', + $url + ); + } + + public static function addSchema($url) + { + if (substr($url, 0, 7) == 'http://' + || substr($url, 0, 8) == 'https://' + ) { + return $url; + } + return 'http://' . $url; + } } ?>