diff options
-rw-r--r-- | Tests/Auth/OpenID/TrustRoot.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Tests/Auth/OpenID/TrustRoot.php b/Tests/Auth/OpenID/TrustRoot.php index 80fa93b..09c5578 100644 --- a/Tests/Auth/OpenID/TrustRoot.php +++ b/Tests/Auth/OpenID/TrustRoot.php @@ -63,7 +63,8 @@ function Tests_Auth_OpenID_parseHeadings($data, $c) $offset = 0; $headings = array(); while (true) { - preg_match($heading_pat, $data, $matches, PREG_OFFSET_CAPTURE, $offset); + preg_match($heading_pat, substr($data, $offset), $matches, + PREG_OFFSET_CAPTURE); if (!$matches) { break; } @@ -71,10 +72,10 @@ function Tests_Auth_OpenID_parseHeadings($data, $c) $heading = $matches[2][0]; $end = $matches[3][1]; $headings[] = array('heading' => $heading, - 'start' => $start, - 'end' => $end, + 'start' => $offset + $start, + 'end' => $offset + $end, ); - $offset = $end; + $offset += $end; } return $headings; } |