diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/phinde/Helper.php | 6 | ||||
| -rw-r--r-- | src/phinde/LinkExtractor/Html.php | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/phinde/Helper.php b/src/phinde/Helper.php index 43345ba..8e30a19 100644 --- a/src/phinde/Helper.php +++ b/src/phinde/Helper.php @@ -31,6 +31,12 @@ class Helper return 'http://' . $url; } + public static function removeAnchor($url) + { + $parts = explode('#', $url, 2); + return $parts[0]; + } + public static function sanitizeTitle($str) { return trim( diff --git a/src/phinde/LinkExtractor/Html.php b/src/phinde/LinkExtractor/Html.php index 7b987e3..b3a9ea6 100644 --- a/src/phinde/LinkExtractor/Html.php +++ b/src/phinde/LinkExtractor/Html.php @@ -8,7 +8,7 @@ class Html { public function extract(\HTTP_Request2_Response $res) { - $url = $res->getEffectiveUrl(); + $url = Helper::removeAnchor($res->getEffectiveUrl()); $linkInfos = array(); |
