You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
757B

  1. <?php
  2. // IPv4 test case is spliced from Feyd's IPv6 implementation
  3. // we ought to disallow non-routable addresses
  4. class HTMLPurifier_AttrDef_URI_IPv4Test extends HTMLPurifier_AttrDefHarness
  5. {
  6. public function test()
  7. {
  8. $this->def = new HTMLPurifier_AttrDef_URI_IPv4();
  9. $this->assertDef('127.0.0.1'); // standard IPv4, loopback, non-routable
  10. $this->assertDef('0.0.0.0'); // standard IPv4, unspecified, non-routable
  11. $this->assertDef('255.255.255.255'); // standard IPv4
  12. $this->assertDef('300.0.0.0', false); // standard IPv4, out of range
  13. $this->assertDef('124.15.6.89/60', false); // standard IPv4, prefix not allowed
  14. $this->assertDef('', false); // nothing
  15. }
  16. }
  17. // vim: et sw=4 sts=4