̈6rrg;E=Kk3RzdeD;+70=s4RWΙěrq#8 >sޚӉtx~^/& `+Eq'=9Y-6ﴘ?`]@Hy8`f-'hv8BG|J+&Ҡ(}"0Xf &<ճ5s WPBHv̵&:(y Uw郗؂I4+h'ү[2ٷbN)G\^ 4QD1]j~ck_t=\"k(ŃrC "^ 9P! )~М܅,\8+^p ?jymUǡ{ڃ?^bBgBɞ3qp I?^cދfd].6_mu s'ߍaWsiG ma授6@ +?~Ǥ9'^Y1M&:ZG֨ >O3pQ#\OoP#9A՘az?q.5v+PcTiW0 v5u?4pvvI4a7"*l1f;f7(_(ÏAl}#o='nW6dar)8FkES{ކFKZ6_֛A|ۨ'-dŖ/#={XY]gmLv Ji9^z'NſݿiZ9AȖ_VU R4 Ox\7m4'h~{w(u(g3VaٳeΏVl134,I/GVVq~K̆>FuR4@Lm] [5X,PtVHQq~HjYG J57 ĢQ$3V^!BXl y5OS=+CCIH@c ĢQ$3ίn^Vn+l\zk&%G >%mntyϪo R_Z#sîd ^dJFDj1p "dqփl;LIaL #eJi['DͦWy!F&Q͒%~3!Su$W7C|Rd91 ĢQ$3#kx,=y ;TrGmPtxkȇ/Jy0py1 O ͌nڳ4lFpߛg%[Mjxh~n,W%BLIO$)ݶV7r^rwG|G~޶Ap;K\aٳeΏV>.#3N6C(@ ĢQ$3WQ#I0 ^͋CڭN+睅<2 Q_%t ĢQ$3<& ֶu( ĢQ$3ʾ8 {d.]ǂ) jgŁ8-ۻ:Ao v>ExYGS.`7 ĢQ$3S׳G^Of|~d7&ZoC>@Jh5M ĢQ$3( ZrRrj{P1[U6 ĢQ$3R!%jzw ĢQ$3UXZhR' ĢQ$3oMG|8f@_O]@WK8`[H^ ĢQ$3u|0M˞aٳeΏV $e->send( E_ERROR, 'Strategy_RemoveForeignElements: Missing required attribute', $name ); } continue; } $token->armor['ValidateAttributes'] = true; } if (isset($hidden_elements[$token->name]) && $token instanceof HTMLPurifier_Token_Start) { $textify_comments = $token->name; } elseif ($token->name === $textify_comments && $token instanceof HTMLPurifier_Token_End) { $textify_comments = false; } } elseif ($escape_invalid_tags) { // invalid tag, generate HTML representation and insert in if ($e) { $e->send(E_WARNING, 'Strategy_RemoveForeignElements: Foreign element to text'); } $token = new HTMLPurifier_Token_Text( $generator->generateFromToken($token) ); } else { // check if we need to destroy all of the tag's children // CAN BE GENERICIZED if (isset($hidden_elements[$token->name])) { if ($token instanceof HTMLPurifier_Token_Start) { $remove_until = $token->name; } elseif ($token instanceof HTMLPurifier_Token_Empty) { // do nothing: we're still looking } else { $remove_until = false; } if ($e) { $e->send(E_ERROR, 'Strategy_RemoveForeignElements: Foreign meta element removed'); } } else { if ($e) { $e->send(E_ERROR, 'Strategy_RemoveForeignElements: Foreign element removed'); } } continue; } } elseif ($token instanceof HTMLPurifier_Token_Comment) { // textify comments in script tags when they are allowed if ($textify_comments !== false) { $data = $token->data; $token = new HTMLPurifier_Token_Text($data); } elseif ($trusted || $check_comments) { // always cleanup comments $trailing_hyphen = false; if ($e) { // perform check whether or not there's a trailing hyphen if (substr($token->data, -1) == '-') { $trailing_hyphen = true; } } $token->data = rtrim($token->data, '-'); $found_double_hyphen = false; while (strpos($token->data, '--') !== false) { $found_double_hyphen = true; $token->data = str_replace('--', '-', $token->data); } if ($trusted || !empty($comment_lookup[trim($token->data)]) || ($comment_regexp !== null && preg_match($comment_regexp, trim($token->data)))) { // OK good if ($e) { if ($trailing_hyphen) { $e->send( E_NOTICE, 'Strategy_RemoveForeignElements: Trailing hyphen in comment removed' ); } if ($found_double_hyphen) { $e->send(E_NOTICE, 'Strategy_RemoveForeignElements: Hyphens in comment collapsed'); } } } else { if ($e) { $e->send(E_NOTICE, 'Strategy_RemoveForeignElements: Comment removed'); } continue; } } else { // strip comments if ($e) { $e->send(E_NOTICE, 'Strategy_RemoveForeignElements: Comment removed'); } continue; } } elseif ($token instanceof HTMLPurifier_Token_Text) { } else { continue; } $result[] = $token; } if ($remove_until && $e) { // we removed tokens until the end, throw error $e->send(E_ERROR, 'Strategy_RemoveForeignElements: Token removed to end', $remove_until); } $context->destroy('CurrentToken'); return $result; } } // vim: et sw=4 sts=4