Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

25 lines (17 sloc) 0.385 kb
<?php
function normalize_url( $url )
{
$url = trim( $url );
$parts = parse_url( $url );
$scheme = isset( $parts['scheme'] ) ? $parts['scheme'] : null;
if( !$scheme )
{
$url = 'http://' . $url;
$parts = parse_url( $url );
}
$path = isset( $parts['path'] ) ? $parts['path'] : null;
if( !$path )
$url .= '/';
return $url;
}
?>
Jump to Line
Something went wrong with that request. Please try again.