diff --git a/classes/robot/crawler.php b/classes/robot/crawler.php index 1273d58..f9e35fa 100644 --- a/classes/robot/crawler.php +++ b/classes/robot/crawler.php @@ -129,12 +129,12 @@ public function auto_create_bot() { * @return string absolute url */ public function absolute_url($base, $rel) { - /* return if already absolute URL */ + // Return if already absolute URL. if (parse_url($rel, PHP_URL_SCHEME) != '') { return $rel; } - /* queries and anchors */ + // Handle links which are only queries or anchors. if ($rel[0] == '#' || $rel[0] == '?') { return $base.$rel; } diff --git a/tests/robot_crawler_test.php b/tests/robot_crawler_test.php index dadf887..94f14d5 100644 --- a/tests/robot_crawler_test.php +++ b/tests/robot_crawler_test.php @@ -48,6 +48,15 @@ protected function setUp() { */ public function provider() { return array( + // Issue 30 + // array( + // 'base' => 'http://test.com', + // 'links' => array( + // '/file.php' => 'http://test.com/file.php', + // '#hash' => 'http://test.com/#hash', + // 'http://foo.com' => 'http://foo.com/', + // ) + // ), array( 'base' => 'http://test.com/sub/', 'links' => array(