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

  Coverage
  Classes Methods Lines
Total
100.00 %100.00%
100.00% 1 / 1
0.00 %0.00%
0.00% 0 / 2
11.11 %11.11%
11.11% 1 / 9
 
HTMLPurifier_URIFilter_DisableExternal
100.00 %100.00%
100.00% 1 / 1
0.00 %0.00%
0.00% 0 / 2
11.11 %11.11%
11.11% 1 / 9
 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)
0.00 %0.00%
0.00% 0 / 1
0.00 %0.00%
0.00% 0 / 8


       1                 : <?php                                                                                        
       2                 :                                                                                              
       3               1 : class HTMLPurifier_URIFilter_DisableExternal extends HTMLPurifier_URIFilter                  
       4                 : {                                                                                            
       5                 :     public $name = 'DisableExternal';                                                        
       6                 :     protected $ourHostParts = false;                                                         
       7                 :     public function prepare($config) {                                                       
       8                 :         $our_host = $config->get('URI', 'Host');                                             
       9                 :         if ($our_host !== null) $this->ourHostParts = array_reverse(explode('.', $our_host));
      10                 :     }                                                                                        
      11                 :     public function filter(&$uri, $config, $context) {                                       
      12               0 :         if (is_null($uri->host)) return true;                                                
      13               0 :         if ($this->ourHostParts === false) return false;                                     
      14               0 :         $host_parts = array_reverse(explode('.', $uri->host));                               
      15               0 :         foreach ($this->ourHostParts as $i => $x) {                                          
      16               0 :             if (!isset($host_parts[$i])) return false;                                       
      17               0 :             if ($host_parts[$i] != $this->ourHostParts[$i]) return false;                    
      18               0 :         }                                                                                    
      19               0 :         return true;                                                                         
      20                 :     }                                                                                        
      21                 : }                                                                                            
      22                 :                                                                                              

Generated by PHPUnit 3.2.20 and Xdebug 2.0.3 at Sat Jun 7 16:15:42 CEST 2008.