Edgewall Software

Changes between Initial Version and Version 1 of Ticket #12403, comment 2


Ignore:
Timestamp:
Mar 16, 2016, 4:14:08 AM (5 years ago)
Author:
Jun Omae

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #12403, comment 2

    initial v1  
    33{{{#!diff
    44diff --git a/trac/web/api.py b/trac/web/api.py
    5 index 0ea3e05af..d004dbf11 100644
     5index 0ea3e05af..b2599330c 100644
    66--- a/trac/web/api.py
    77+++ b/trac/web/api.py
     
    1010         for value in fs.list or ():
    1111             try:
     12-                name = unicode(value.name, 'utf-8')
     13-                if not value.filename:
     14-                    value = unicode(value.value, 'utf-8')
    1215+                name = value.name
    1316+                if '\x00' in name:
    1417+                    raise HTTPBadRequest(_("Invalid request arguments."))
    15                  name = unicode(value.name, 'utf-8')
    16 -                if not value.filename:
    17 -                    value = unicode(value.value, 'utf-8')
     18+                name = unicode(name, 'utf-8')
    1819+                if value.filename:
    1920+                    if '\x00' in value.filename: