Beispiel #1
0
 /**
  * Make given string a proper URL
  *
  * @author Krzysztof Kalkhoff
  *        
  * @param string $url            
  * @return string
  */
 public static function makeUrl(string $url) : string
 {
     if (!preg_match("~^(?:f|ht)tps?://~i", $url)) {
         $url = 'http' . (Server::isSecure() ? 's' : '') . "://" . $url;
     }
     return $url;
 }