]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/RobotsTxt.php
Update function / rearrange tab order
[friendica.git] / src / Module / RobotsTxt.php
index 9297c98de7b0d99d1387e1cbf2a7d85f4f9c3e0d..a084c1f4a6caf97c168b501e7df2f2daa11a8b86 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -22,6 +22,7 @@
 namespace Friendica\Module;
 
 use Friendica\BaseModule;
+use Friendica\Core\System;
 
 /**
  * Return the default robots.txt
@@ -30,20 +31,31 @@ class RobotsTxt extends BaseModule
 {
        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: GPTBot' . PHP_EOL;
+               echo 'Disallow: /' . PHP_EOL;
+
+               System::exit();
        }
 }