src/Bitly.php
protected function fixUrl($url, $encode){
        if(strpos($url, "http") !== 0){
            $url = "http://".$url;
        }

        if($encode){
            $url = urlencode($url);
        }

        return $url;
    }
protected function fixUrl($url, $encode){
        if(strpos($url, "http") !== 0){
            $url = "http://".$url;
        }

        if($encode){
            $url = urlencode($url);
        }

        return $url;
    }
protected function fixUrl ( $ url , $ encode ) { if ( strpos ( $ url , "http" ) !== 0 ) { $ url = "http://" . $ url ; } if ( $ encode ) { $ url = urlencode ( $ url ) ; } return $ url ; }
Returns a corrected URL
@param  string  $url    The URL to modify
@param  boolean $encode Whether or not to encode the URL
@return string          The corrected URL
Returns a corrected URL