芝麻web文件管理V1.00
编辑当前文件:/home/royashxg/bit-alphas-ltd.com/user/project/vendor/spatie/robots-txt/src/RobotsMeta.php
robotsMetaTagProperties = $this->findRobotsMetaTagProperties($html); } public function mayIndex(): bool { return ! $this->noindex(); } public function mayFollow(): bool { return ! $this->nofollow(); } public function noindex(): bool { return $this->robotsMetaTagProperties['noindex'] ?? false; } public function nofollow(): bool { return $this->robotsMetaTagProperties['nofollow'] ?? false; } protected function findRobotsMetaTagProperties(string $html): array { $metaTagLine = $this->findRobotsMetaTagLine($html); return [ 'noindex' => $metaTagLine ? strpos(strtolower($metaTagLine), 'noindex') !== false : false, 'nofollow' => $metaTagLine ? strpos(strtolower($metaTagLine), 'nofollow') !== false : false, ]; } protected function findRobotsMetaTagLine(string $html): ?string { if (preg_match('/\
/mis', $html, $matches)) { return $matches[0]; } return null; } }