????Noah Sussman ????д???????? ??????ò???????????????????嵥??????嵥???????????????а?????????????????????????????????????????
??????????????????????????????????????????????????д??????????????????з????????????
???????????????????????????????????“?????”?????????????????????Щ?????? bug??
???????????Ч?????????Easy Programming????????“???????????????? bug”??????????′??????????????
???????????????????????????????? bug?????????????????“?e????????????????????? bug ???б?????”????????????“????????????????????????? bug ???????????”
????????????????г????Щ???????в????
??????????? bug?????? SQL ?????? XSS ?????? Django ????????????? SQL ???? XSS ????д????????????? Django ?????????? bug ????????????????????? SQL ???????? HTML ?? API ?????????????????????????????????????????????κ?????? bug??
????????????????????????ú?в??????????????? bug ?????????????? XSS ????????м??ζ??е??????Щ???????? XSS ?????????????? HTML ????
????????????? Python ???????????????????????????????????????????????????д?????????????????????д????? HTML ???????
???????????????????????????????“???”??“??????????????????д HTML”?????????“?????? API ???????????????????????????”???????????????????????????????μ? API?????????Щ??????????????????
????????????????Щ????????????д???Щ??????????????????????????????????????????:
????Python
????from django.core.urlresolvers import reverse
????from django.template import Library
????from django.utils.html import escape
????from django.utils.safestring import mark_safe
????register = Library()
????@register.filter
????def account_link(account):
????return mark_safe(u'<a href="%s" title="%s %s">%s</a>' % (
????escape(reverse('account_stats'?? args=(account.username??)))??
????escape(account.first_name)??
????escape(account.last_name)??
????escape(account.username)??
????))
????from django.core.urlresolvers import reverse
????from django.template import Library
????from django.utils.html import escape
????from django.utils.safestring import mark_safe
????register = Library()
????@register.filter
????def account_link(account):
????return mark_safe(u'<a href="%s" title="%s %s">%s</a>' % (
????escape(reverse('account_stats'?? args=(account.username??)))??
????escape(account.first_name)??
????escape(account.last_name)??
????escape(account.username)??
????))
??????????????????????????ü?????????????????塣?????д??????? Django ????? API ?????????????????????????????????д??
????Python
????from django.core.urlresolvers import reverse
????from django.template import Library
????from somewhere import html_fragment
????register = Library()
????@register.filter
????def account_link(account):
????return html_fragment(u'<a href="%s" title="%s %s">%s</a>'??
????reverse('account_stats'?? args=(account.username??))??
????account.first_name??
????account.last_name??
????account.username??
????)
????from django.core.urlresolvers import reverse
????from django.template import Library
????from somewhere import html_fragment
????register = Library()
????@register.filter
????def account_link(account):
????return html_fragment(u'<a href="%s" title="%s %s">%s</a>'??
????reverse('account_stats'?? args=(account.username??))??
????account.first_name??
????account.last_name??
????account.username??
????)
???????д??? API??html_fragment?? ????д???????
????Python
????from django.utils.html import escape
????from django.utils.safestring import mark_safe?? conditional_escape
????def html_fragment(template?? *args):
????return mark_safe(template % tuple(map(conditional_escape?? args)))
????from django.utils.html import escape
????from django.utils.safestring import mark_safe?? conditional_escape
????def html_fragment(template?? *args):
????return mark_safe(template % tuple(map(conditional_escape?? args)))
?????????? django-devs ???????????????????????????????????? Django 1.5 ???????’django.utils.html.format_html’ ?????????????Щ????
?????????????????????????????????д?????????????????????????(???????????? html_fragment ???????????)???????????????????????——????С?? html ????? html_fragment?? ??????? Django ????? API?????????????????
????????????????????????????п???????????? SQL ?????? XSS ????????????????????????????????????顣?????????????? API ??÷?????λ??
?????????????? -“?????????? null ?? NaN?? ???????????????????????????????????????”??????????????????????ε??磬????????????????????????????????????????????????????????????????????????????????????????????????????????洦?????????????“???????????????”
????????????????t???????????????????????????2??????У?????????????????????
??????????? bug???? Noah ?????????г?????????????????? bug ???????????????????Щ?????????????????????“???????????????????????????????????????????”
?????????????????“?????????Щ?????????????????”
??????????????????????????????????????????????????????磬Python ?? decimal ????????????????????????????????????е??????????????????п???? bug ??????
??????λ??????????и??????????? bug ????????????“???????????????????????????????????Щ bug ???”
????????????????в?????????????????????????λ?????????????й?????? Haskell ?к?????????“3??”???????“2??” ??????????????????????????????
???????? Python?????? magnitude ?? units ?????????????????е??????????????
???????????????????????????Щ???????????????Щ????????????????????????????????????????????????????????????λ???????
????????ó????????????????????λ????????????????????????????ж??????Щ????????????????????????????????? API ??????????????????????????????
???????????????????????????????м???????????????飬??????????????????????????????????????????д?????????????????????????д???????????????????????????????????????????Щ?????????
????????——???? unicode ??????? ASCII ?????в??????????????????????????????????—— ???κε?????? unicode ——??????????? bug??
????Python 2.x ????????????????——?????????? unicode ???????????????????????????в?????????????? bug??
?????????????????д????????——???????????????——??????????????????????? Python3 ?б???????
???????????????????? Noah ???б??????????????е???????????????????????????????????????????????????? :-)????????????????????????? bug ???????????????????????????????????????????????
????????????????????????????б?????????Щ?????????——???綹??????????????????????????????????????????? bug????????????????????????????д??????????????????????д?????????????????????????????????? bug??
????????????????????????????????????Щ bug д?????????????????????? bug ?????????????????????????????????????????????? bug ???Σ????????????д??????????????????????д?????????????????????Σ????????????н????????????
?????????? bug ????????????? bug ?б??У??????????????????????????????????????????????????????Щ?????????/???????/????