mirror of
https://github.com/YGGverse/YGGo.git
synced 2025-01-24 21:44:59 +00:00
read sitemap location in user-agent:* only
This commit is contained in:
parent
051bfb2e81
commit
a5a48f37f7
@ -16,6 +16,12 @@ class Robots {
|
||||
|
||||
$row = strtolower(trim($row));
|
||||
|
||||
// User-agent * begin
|
||||
if (preg_match('!^user-agent:\s?\*!', $row)) {
|
||||
$read = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Parse sitemap address
|
||||
if (preg_match('!^sitemap:\s?(.*)!', $row, $matches)) {
|
||||
|
||||
@ -25,12 +31,6 @@ class Robots {
|
||||
}
|
||||
}
|
||||
|
||||
// User-agent * begin
|
||||
if (preg_match('!^user-agent:\s?\*!', $row)) {
|
||||
$read = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($read) {
|
||||
$part = explode(' ', $row);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user