Skip to content
Snippets Groups Projects
Commit c8849a95 authored by Alexander Hass's avatar Alexander Hass
Browse files

Issue #1923328 by larowlan: Fragment check fails when source page

contains spaces between attribute name, equals and value.
parent b580073f
No related branches found
No related tags found
No related merge requests found
linkchecker 6.x-dev, nightly
----------------------------
* Issue #1923328 by larowlan: Fragment check fails when source page contains spaces between attribute name, equals and value.
* Issue #1926558 by hass: Block extraction re-scans fail.
linkchecker 6.x-2.7, February 14, 2012
......
......@@ -515,7 +515,7 @@ function _linkchecker_status_handling(&$response, $link) {
// element (naming it with the name attribute), or by any other element
// (naming with the id attribute).
// See http://www.w3.org/TR/html401/struct/links.html
if ($response->code == 200 && !empty($response->uri['fragment']) && (!empty($response->data) && !preg_match('/(\s[^>]*(name|id)=["\'])('. preg_quote($response->uri['fragment'], '/') .')(["\'][^>]*>)/i', $response->data))) {
if ($response->code == 200 && !empty($response->uri['fragment']) && (!empty($response->data) && !preg_match('/(\s[^>]*(name|id)(\s+)?=(\s+)?["\'])('. preg_quote($response->uri['fragment'], '/') .')(["\'][^>]*>)/i', $response->data))) {
// Override status code 200 with status code 404 so it can be handled with
// default status code 404 logic and custom error text.
$response->code = 404;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment