Skip to content

Commit

Permalink
Bugfix (#7)
Browse files Browse the repository at this point in the history
* Fixed error on empty robots.txt file

Co-authored-by: Mariia <[email protected]>
  • Loading branch information
devCollaboratorPro and Mariia authored Aug 27, 2020
1 parent 96b5cac commit 2042e4d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Parser/RobotsTxtParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ private function parseTxt($txt)
{
$result = [];
$lines = array_map('trim', mb_split('\r\n|\n|\r', $txt));
// If robots txt is empty
if (empty($lines)) {
return false;
}
// Parse each line individually
foreach ($lines as $key => $line) {
// Limit rule length
Expand Down

0 comments on commit 2042e4d

Please sign in to comment.