URIHarness.php 836 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. class HTMLPurifier_URIHarness extends HTMLPurifier_Harness
  3. {
  4. /**
  5. * Prepares two URIs into object form
  6. * @param &$uri Reference to string input URI
  7. * @param &$expect_uri Reference to string expectation URI
  8. * @note If $expect_uri is false, it will stay false
  9. */
  10. protected function prepareURI(&$uri, &$expect_uri) {
  11. $parser = new HTMLPurifier_URIParser();
  12. if ($expect_uri === true) $expect_uri = $uri;
  13. $uri = $parser->parse($uri);
  14. if ($expect_uri !== false) {
  15. $expect_uri = $parser->parse($expect_uri);
  16. }
  17. }
  18. /**
  19. * Generates a URI object from the corresponding string
  20. */
  21. protected function createURI($uri) {
  22. $parser = new HTMLPurifier_URIParser();
  23. return $parser->parse($uri);
  24. }
  25. }
  26. // vim: et sw=4 sts=4