@core_helper
def url_is_local(url):
 if ((not url) or url.startswith('//')):
  return False
 parsed = urlparse.urlparse(url)
 if parsed.scheme:
  domain = urlparse.urlparse(url_for('/', qualified=True)).netloc
  if (domain != parsed.netloc):
   return False
 return True

@ core_helper def url_is_local ( url ) : if ( ( not url ) or url . startswith ( '//' ) ) : return False parsed = urlparse . urlparse ( url ) if parsed . scheme : domain = urlparse . urlparse ( url_for ( '/' , qualified = True ) ) . netloc if ( domain != parsed . netloc ) : return False return True
returns true if url is local .