Open scott8035 opened 11 months ago
In https://github.com/bopoda/robots-txt-parser/blob/master/src/RobotsTxtParser/RobotsTxtValidator.php, there's a chunk of code at line 47:
$hasAllowDirectives = true; foreach ($orderedDirectives as $directiveRow) { if ($directiveRow['directive'] == 'allow') { $hasAllowDirectives = true; break; } }
Shouldn't that be:
$hasAllowDirectives = **false**; foreach ($orderedDirectives as $directiveRow) { if ($directiveRow['directive'] == 'allow') { $hasAllowDirectives = true; break; } }
Yes, you are right @scott8035 . The initial intention was as in code you provided. In general it should work, but extra condition does not give profit. Will have a look at this class later to improve.
In https://github.com/bopoda/robots-txt-parser/blob/master/src/RobotsTxtParser/RobotsTxtValidator.php, there's a chunk of code at line 47:
Shouldn't that be: