django.utils.text.smart_split() does not properly handle unmatched quotes
|Reported by:||ivan.chelubeev@…||Owned by:||adrian|
|Cc:||serg@…||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
django.utils.text.smart_split() does not properly handle unmatched quotes.
smart_split() eats up last character of the word that begins with an unmatched quote and that quote character itself:
>> text.smart_split("one 'two three") ['one', 'tw', 'three']
Of course unmatched quote in a tag argument string most probably is an error. But result produced by smart_split() ("'two" -> "tw") doesn't leave chances to notice or detect this error until actual use at render time (and may be even further).
Also smart_split()'s doctest still produce syntax error (in spite of #3035).
Change History (5)
Changed 9 years ago by ivan.chelubeev@…
comment:1 Changed 9 years ago by Simon G. <dev@…>
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Ready for checkin
comment:3 Changed 9 years ago by mtredinnick
- Resolution set to fixed
- Status changed from new to closed