RobotsTxt : The Crawldelay must not be set to 3s if it doesn't exists in the content of the Robots file

This commit is contained in:
2021-05-13 22:31:52 +02:00
parent 03ede5c375
commit adafd14564

View File

@@ -31,9 +31,9 @@ class Robotstxt
*/ */
private $sitemaps = array (); private $sitemaps = array ();
/** The crawldelay defined in the file (3s if not defined) /** The crawldelay defined in the file
*/ */
private $crawldelay = 3; private $crawldelay = null;
/** The host can be specified as default website /** The host can be specified as default website
*/ */
@@ -125,7 +125,7 @@ class Robotstxt
elseif (stripos ($line, "crawl-delay:") === 0) elseif (stripos ($line, "crawl-delay:") === 0)
{ {
$val = $this->getValueFromLine ($line); $val = $this->getValueFromLine ($line);
if ($val > 1 && $val < 60 && $this->crawldelay === 3) if ($val > 1 && $val < 60 && $this->crawldelay === null)
$this->crawldelay = intval ($val); $this->crawldelay = intval ($val);
else else
$this->errors[$i] = dgettext ("domframework", $this->errors[$i] = dgettext ("domframework",