HTMLPurifier/URIFilter/HostBlacklist.php Quellcode

HostBlacklist.php
gehe zur Dokumentation dieser Datei
1 <?php
2 
3 // It's not clear to me whether or not Punycode means that hostnames
4 // do not have canonical forms anymore. As far as I can tell, it's
5 // not a problem (punycoding should be identity when no Unicode
6 // points are involved), but I'm not 100% sure
8 {
12  public $name = 'HostBlacklist';
13 
17  protected $blacklist = array();
18 
23  public function prepare($config)
24  {
25  $this->blacklist = $config->get('URI.HostBlacklist');
26  return true;
27  }
28 
35  public function filter(&$uri, $config, $context)
36  {
37  foreach ($this->blacklist as $blacklisted_host_fragment) {
38  if (strpos($uri->host, $blacklisted_host_fragment) !== false) {
39  return false;
40  }
41  }
42  return true;
43  }
44 }
45 
46 // vim: et sw=4 sts=4




Korrekturen, Hinweise und Ergänzungen

Bitte scheuen Sie sich nicht und melden Sie, was auf dieser Seite sachlich falsch oder irreführend ist, was ergänzt werden sollte, was fehlt usw. Dazu bitte oben aus dem Menü Seite den Eintrag Support Forum wählen. Es ist eine kostenlose Anmeldung erforderlich, um Anmerkungen zu posten. Unpassende Postings, Spam usw. werden kommentarlos entfernt.