]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/RobotsTxt.php
Merge pull request #13599 from Raroun/Fix_for_Pull_Request_#13596_missing_a_hidden...
[friendica.git] / src / Module / RobotsTxt.php
index 934a7a46e0e79739026ed9a3248927d49f215bc3..96a2451ad24625f9ce4f18302262a08160730e4a 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
 namespace Friendica\Module;
 
 use Friendica\BaseModule;
+use Friendica\Core\System;
 
 /**
  * Return the default robots.txt
  */
 class RobotsTxt extends BaseModule
 {
-       public static function rawContent(array $parameters = [])
+       protected function rawContent(array $request = [])
        {
-               $allDisalloweds = [
+               $allDisallowed = [
                        '/settings/',
                        '/admin/',
                        '/message/',
                        '/search',
                        '/help',
                        '/proxy',
+                       '/photo',
+                       '/avatar',
                ];
 
                header('Content-Type: text/plain');
                echo 'User-agent: *' . PHP_EOL;
-               foreach ($allDisalloweds as $disallowed) {
+               foreach ($allDisallowed as $disallowed) {
                        echo 'Disallow: ' . $disallowed . PHP_EOL;
                }
-               exit();
+
+               echo PHP_EOL;
+               echo 'User-agent: ChatGPT-User' . PHP_EOL;
+               echo 'Disallow: /' . PHP_EOL;
+
+               echo PHP_EOL;
+               echo 'User-agent: Google-Extended' . PHP_EOL;
+               echo 'Disallow: /' . PHP_EOL;
+
+               echo PHP_EOL;
+               echo 'User-agent: GPTBot' . PHP_EOL;
+               echo 'Disallow: /' . PHP_EOL;
+
+               System::exit();
        }
 }