PHPIDS
Current file: /home/mario/workspace/php-ids.org/trunk/lib/IDS/vendors/htmlpurifier/HTMLPurifier/URIFilter/HostBlacklist.php
Legend: executed not executed dead code

  Coverage
  Classes Methods Lines
Total
100.00 %100.00%
100.00% 1 / 1
50.00 %50.00%
50.00% 1 / 2
50.00 %50.00%
50.00% 3 / 6
 
HTMLPurifier_URIFilter_HostBlacklist
100.00 %100.00%
100.00% 1 / 1
50.00 %50.00%
50.00% 1 / 2
50.00 %50.00%
50.00% 3 / 6
 public function prepare($config)
0.00 %0.00%
0.00% 0 / 1
100.00 %100.00%
100.00% 0 / 0
 public function filter(&$uri, $config, $context)
100.00 %100.00%
100.00% 1 / 1
40.00 %40.00%
40.00% 2 / 5


       1                 : <?php                                                                      
       2                 :                                                                            
       3               1 : class HTMLPurifier_URIFilter_HostBlacklist extends HTMLPurifier_URIFilter  
       4                 : {                                                                          
       5                 :     public $name = 'HostBlacklist';                                        
       6                 :     protected $blacklist = array();                                        
       7                 :     public function prepare($config) {                                     
       8                 :         $this->blacklist = $config->get('URI', 'HostBlacklist');           
       9                 :         return true;                                                       
      10                 :     }                                                                      
      11                 :     public function filter(&$uri, $config, $context) {                     
      12               2 :         foreach($this->blacklist as $blacklisted_host_fragment) {          
      13               0 :             if (strpos($uri->host, $blacklisted_host_fragment) !== false) {
      14               0 :                 return false;                                              
      15                 :             }                                                              
      16               0 :         }                                                                  
      17               2 :         return true;                                                       
      18                 :     }                                                                      
      19                 : }                                                                          

Generated by PHPUnit 3.3.1 and Xdebug 2.0.2 at Thu Sep 25 18:42:10 CEST 2008.