MCPcopy Index your code
hub / github.com/pyload/pyload / _makeSafeAbsoluteURI

Function _makeSafeAbsoluteURI

module/lib/feedparser.py:2472–2485  ·  view source on GitHub ↗
(base, rel=None)

Source from the content-addressed store, hash-verified

2470 return p.output()
2471
2472def _makeSafeAbsoluteURI(base, rel=None):
2473 # bail if ACCEPTABLE_URI_SCHEMES is empty
2474 if not ACCEPTABLE_URI_SCHEMES:
2475 return _urljoin(base, rel or u'')
2476 if not base:
2477 return rel or u''
2478 if not rel:
2479 if base.strip().split(':', 1)[0] not in ACCEPTABLE_URI_SCHEMES:
2480 return u''
2481 return base
2482 uri = _urljoin(base, rel)
2483 if uri.strip().split(':', 1)[0] not in ACCEPTABLE_URI_SCHEMES:
2484 return u''
2485 return uri
2486
2487class _HTMLSanitizer(_BaseHTMLProcessor):
2488 acceptable_elements = ['a', 'abbr', 'acronym', 'address', 'area',

Callers 4

unknown_starttagMethod · 0.85
_end_newlocationMethod · 0.85
resolveURIMethod · 0.85
parseFunction · 0.85

Calls 2

_urljoinFunction · 0.85
splitMethod · 0.80

Tested by

no test coverage detected