HTMLPurifier 4.4.0
/home/ezyang/Dev/htmlpurifier/library/HTMLPurifier/Injector/DisplayLinkURI.php
Go to the documentation of this file.
00001 <?php
00002 
00006 class HTMLPurifier_Injector_DisplayLinkURI extends HTMLPurifier_Injector
00007 {
00008 
00009     public $name = 'DisplayLinkURI';
00010     public $needed = array('a');
00011 
00012     public function handleElement(&$token) {
00013     }
00014 
00015     public function handleEnd(&$token) {
00016         if (isset($token->start->attr['href'])){
00017             $url = $token->start->attr['href'];
00018             unset($token->start->attr['href']);
00019             $token = array($token, new HTMLPurifier_Token_Text(" ($url)"));
00020         } else {
00021             // nothing to display
00022         }
00023     }
00024 }
00025 
00026 // vim: et sw=4 sts=4