function robotstxt_update_7102 in RobotsTxt 7
Add 3 missing exclusions introduced by latest robots.txt update.
File
- ./
robotstxt.install, line 120 - Install, update and uninstall functions for the robotstxt module.
Code
function robotstxt_update_7102() {
$robotstxt = variable_get('robotstxt');
$robotstxt = preg_replace("/Disallow:\\s\\/INSTALL.pgsql.txt(\r\n?|\n)Disallow:\\s\\/install.php(\r\n?|\n)/", "Disallow: /INSTALL.pgsql.txt\nDisallow: /INSTALL.sqlite.txt\nDisallow: /install.php\n", $robotstxt);
$robotstxt = preg_replace("/Disallow:\\s\\/comment\\/reply\\/(\r\n?|\n)Disallow:\\s\\/node\\/add\\/(\r\n?|\n)/", "Disallow: /comment/reply/\nDisallow: /filter/tips/\nDisallow: /node/add/\n", $robotstxt);
$robotstxt = preg_replace("/Disallow:\\s\\/\\?q=comment\\/reply\\/(\r\n?|\n)Disallow:\\s\\/\\?q=node\\/add\\/(\r\n?|\n)/", "Disallow: /?q=comment/reply/\nDisallow: /?q=filter/tips/\nDisallow: /?q=node/add/\n", $robotstxt);
variable_set('robotstxt', $robotstxt);
return t("Added 'INSTALL.sqlite.txt' and '/filter/tips/' exclusions.");
}