mò DµMc @sãdZdklZdklZdklZdklZdkl Z dk l Z dgZ d„Z d efd „ƒYZd d d ddddddddddg hd ddg<dddg<d dg and & and, for good measure, :tquotet:s:N(tescapettexttTruetreplace(R((t9/home/camdpams_www/Products_Activation/gluon/sanitizer.pyt xssescapest XssCleanerc BsÔtZddddddddd d d d d g hdddg<dddg<ddg|tjo|id|7_n|itd|ƒ7_dS(Ns&%s;s&%s(R"R-R1t entitydefsR$R(R"R1((Rthandle_entityrefWs   cCs:|iodSn%|o|itd|ƒ7_ndS(Ns (R"R-tcommentR$R(R"R6((Rthandle_comment_s cCs³||ijo4|io t|_q¯|itd|ƒ7_nld|}||i joåt |ƒ}g}|i |D]5}||jo"t||ƒdjo ||q|q|~|_xƒ|iD]t}|dddgjo4|i||ƒo|d|||f7}q;qÇ|dt|ƒt||ƒf7}qÇWn|d jp |d jodSn||ijo|d 7}n|d 7}|i|7_|iid|ƒdS( Ns<%s>t(ttagR"R'R+RR-R$RtbtR)tdicttattrsR&txR0tallowed_attributes_heret attributeturl_is_acceptablet quoteattrR(R%tinsert(R"R;tmethodR>R&RAR<R?((Rthandle_starttages*    S  , cCsd|}||ijo0|io t|_q}|it|ƒ7_n4||i jo#|i|7_|i i |ƒndS(Ns( R;t bracketedR"R'R+R,R-R$RR%tremove(R"R;R>RG((Rt handle_endtag‡s   cCs|i|d|ƒdS(N(R"RFR;tNonet attributes(R"R;RK((Rtunknown_starttag’scCs|i|dƒdS(N(R"RIR;RJ(R"R;((Rtunknown_endtag•scCsSt|ƒ}|d|ijod|djp"|ddjo|didƒS(s4 Accepts relative and absolute urls it.iRiRN(turlparseturltparsedR"R*t startswith(R"RPRQ((RRB˜s cCs¸t|tƒpt|ƒSnx+|iD] }|id|d|ƒ}q(W|p t|_ nd|_ |i |ƒx8|i D]-}||ijo|i d|7_ q€q€W|i S(sø Returns the argument stripped of potentially harmful HTML or Javascript code @type escape: boolean @param escape: If True (default) it escapes the potentially harmful content, otherwise remove it s<%s/>s<%s />RsN(t isinstancet rawstringtstrR"R(R;RRRR+R$tfeedR%tendtag(R"RTRRWR;((Rtstrip¡s     cCs‚d}xit|iƒD]X}|d|7}||ijo*x'|i|D]}|d|7}qHWn|d7}qWt|iƒƒS(sV Returns a printable string informing the user which tags are allowed RR8s %s=""s> N( ttgtsortedR"R'R?R)tyRRX(R"R?R[RY((Rtxtags·s(t__name__t __module__tAbstractFormatterR,R!R/R3R5R7RFRIRLRMRBRRXR\(((RR sf)     "   R R R sbr/R RRRRRRRsimg/RRRRRRcCs=t|tƒpt|ƒSntd|d|ƒi||ƒS(NR'R)(RSRRUR R'R)RXR(RR'R)R((RRÆs N(t__doc__thtmllibR tcgiRROt formatterR_thtmlentitydefsR4txml.sax.saxutilsRCt__all__RR RR( RfRROR_R4R RRRCR ((Rt? s        ¦