Changeset 9161 for django/trunk/django/template
- Timestamp:
- 10/06/08 01:34:54 (3 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/template/loaders/app_directories.py
r5750 r9161 34 34 35 35 def get_template_sources(template_name, template_dirs=None): 36 """ 37 Returns the absolute paths to "template_name", when appended to each 38 directory in "template_dirs". Any paths that don't lie inside one of the 39 template dirs are excluded from the result set, for security reasons. 40 """ 36 41 if not template_dirs: 37 42 template_dirs = app_template_dirs … … 39 44 try: 40 45 yield safe_join(template_dir, template_name) 46 except UnicodeDecodeError: 47 # The template dir name was a bytestring that wasn't valid UTF-8. 48 raise 41 49 except ValueError: 42 50 # The joined path was located outside of template_dir. django/trunk/django/template/loaders/filesystem.py
r5750 r9161 8 8 9 9 def get_template_sources(template_name, template_dirs=None): 10 """ 11 Returns the absolute paths to "template_name", when appended to each 12 directory in "template_dirs". Any paths that don't lie inside one of the 13 template dirs are excluded from the result set, for security reasons. 14 """ 10 15 if not template_dirs: 11 16 template_dirs = settings.TEMPLATE_DIRS … … 13 18 try: 14 19 yield safe_join(template_dir, template_name) 20 except UnicodeDecodeError: 21 # The template dir name was a bytestring that wasn't valid UTF-8. 22 raise 15 23 except ValueError: 16 # The joined path was located outside of template_dir. 24 # The joined path was located outside of this particular 25 # template_dir (it might be inside another one, so this isn't 26 # fatal). 17 27 pass 18 28
