1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?php if (!defined('PmWiki')) exit();
- SDV($MetaRobots,
- ($action!='browse' || preg_match('#^PmWiki[./](?!PmWiki$)|^Site[./]#',
- $pagename)) ? 'noindex,nofollow' : 'index,follow');
- if ($MetaRobots)
- $HTMLHeaderFmt['robots'] =
- " <meta name='robots' content='\$MetaRobots' />\n";
- SDV($RobotPattern,'Googlebot|Slurp|msnbot|Teoma|ia_archiver|BecomeBot|HTTrack|MJ12bot');
- SDV($IsRobotAgent,
- $RobotPattern && preg_match("!$RobotPattern!", @$_SERVER['HTTP_USER_AGENT']));
- if (!$IsRobotAgent) return;
- SDVA($RobotActions, array('browse' => 1, 'rss' => 1, 'dc' => 1));
- if (!@$RobotActions[$action]) {
- header("HTTP/1.1 403 Forbidden");
- print("<h1>Forbidden</h1>");
- exit();
- }
- if (IsEnabled($EnableRobotCloakActions, 0)) {
- $p = create_function('$a', 'return (boolean)$a;');
- $p = join('|', array_keys(array_filter($RobotActions, $p)));
- $FmtP["/(\\\$ScriptUrl[^#\"'\\s<>]+)\?action=(?!$p)\\w+/"] = '$1';
- }
|