I’m trying to normalize relative paths to full urls using simple_html_dom and Net_URL2, paths like this src="/my_path" are normalized by a script like this but paths like this: src="my_path" are not! How to normalize paths like these?
Example:
$uri = new Net_URL2("http://test.com");
print $uri->resolve('/my_path') . "\n"; // works
print $uri->resolve('my_path') . "\n"; // doesn't work!
What you describe is a known bug in Net_URL2: http://pear.php.net/bugs/bug.php?id=19176
The ticket has a patch that fixes it, but it has not yet been fixed in the pear package itself. Patch: