mirror of
https://github.com/django/django.git
synced 2024-12-26 19:16:11 +00:00
Safely join paths in staticfiles finder.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15127 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
9c950db518
commit
e45d1e2dac
@ -6,6 +6,7 @@ from django.core.files.storage import default_storage, Storage, FileSystemStorag
|
|||||||
from django.utils.datastructures import SortedDict
|
from django.utils.datastructures import SortedDict
|
||||||
from django.utils.functional import memoize, LazyObject
|
from django.utils.functional import memoize, LazyObject
|
||||||
from django.utils.importlib import import_module
|
from django.utils.importlib import import_module
|
||||||
|
from django.utils._os import safe_join
|
||||||
|
|
||||||
from django.contrib.staticfiles import utils
|
from django.contrib.staticfiles import utils
|
||||||
from django.contrib.staticfiles.storage import AppStaticStorage
|
from django.contrib.staticfiles.storage import AppStaticStorage
|
||||||
@ -83,7 +84,7 @@ class FileSystemFinder(BaseFinder):
|
|||||||
if not path.startswith(prefix):
|
if not path.startswith(prefix):
|
||||||
return None
|
return None
|
||||||
path = path[len(prefix):]
|
path = path[len(prefix):]
|
||||||
path = os.path.join(root, path)
|
path = safe_join(root, path)
|
||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
return path
|
return path
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user