mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Also added sanitizing to 'ImageDownloader'
This commit is contained in:
parent
7f93bbf397
commit
ca0f1c49c9
@ -67,6 +67,7 @@ class ImageDownloader(BaseImageConverter):
|
||||
if basename == '' or len(basename) > MAX_FILENAME_LEN:
|
||||
filename, ext = os.path.splitext(node['uri'])
|
||||
basename = sha1(filename.encode()).hexdigest() + ext
|
||||
basename = re.sub(CRITICAL_PATH_CHAR_RE, "_", basename)
|
||||
|
||||
dirname = node['uri'].replace('://', '/').translate({ord("?"): "/",
|
||||
ord("&"): "/"})
|
||||
|
Loading…
Reference in New Issue
Block a user