From 4942c9778554bcacac99c838a56bdb065e49ed32 Mon Sep 17 00:00:00 2001 From: Denis Chenu Date: Wed, 26 Apr 2017 15:39:35 +0200 Subject: [PATCH 1/4] Simple robots.txt for server 404 log --- mod/robots_txt.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 mod/robots_txt.php diff --git a/mod/robots_txt.php b/mod/robots_txt.php new file mode 100644 index 0000000000..450b854a1b --- /dev/null +++ b/mod/robots_txt.php @@ -0,0 +1,29 @@ + Date: Wed, 26 Apr 2017 17:07:24 +0200 Subject: [PATCH 2/4] Coding standards part and bad empty Disallow - Unsure PHP_EOL is the best here : PHP_EOL are not the same on *nux and win, it's not for server , but for browser - _content vs _init : seems not really a web content ? --- mod/robots_txt.php | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/mod/robots_txt.php b/mod/robots_txt.php index 450b854a1b..2af5ea5627 100644 --- a/mod/robots_txt.php +++ b/mod/robots_txt.php @@ -1,29 +1,27 @@ Date: Wed, 26 Apr 2017 17:09:10 +0200 Subject: [PATCH 3/4] Doxygen standard --- mod/robots_txt.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mod/robots_txt.php b/mod/robots_txt.php index 2af5ea5627..c0705dec61 100644 --- a/mod/robots_txt.php +++ b/mod/robots_txt.php @@ -1,11 +1,13 @@ Date: Wed, 26 Apr 2017 17:26:13 +0200 Subject: [PATCH 4/4] Coding standards : doxygen + tab + single quote --- mod/robots_txt.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/mod/robots_txt.php b/mod/robots_txt.php index c0705dec61..eaab44662f 100644 --- a/mod/robots_txt.php +++ b/mod/robots_txt.php @@ -7,23 +7,24 @@ /** - * Return at init + * @brief Return default robots.txt when init * @param App $a * @return void */ -function robots_txt_init(App $a) { +function robots_txt_init(App $a) +{ /** @var string[] globally disallowed url */ $allDisalloweds = array( - "/settings/", - "/admin/", - "/message/", + '/settings/', + '/admin/', + '/message/', ); - header("Content-Type: text/plain"); - echo "User-agent: *\n"; - foreach($allDisalloweds as $disallowed) { - echo "Disallow: {$disallowed}\n"; + header('Content-Type: text/plain'); + echo 'User-agent: *'.PHP_EOL; + foreach ($allDisalloweds as $disallowed) { + echo 'Disallow: '.$disallowed.PHP_EOL; } killme(); }