git.cweiske.de
/
phinde.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
90d2e0f
)
Respect <meta name="robots" content="noindex"/>
author
Christian Weiske
<cweiske@cweiske.de>
Mon, 29 Aug 2016 20:59:16 +0000
(22:59 +0200)
committer
Christian Weiske
<cweiske@cweiske.de>
Mon, 29 Aug 2016 20:59:16 +0000
(22:59 +0200)
Fixes: #1
bin/index.php
patch
|
blob
|
history
diff --git
a/bin/index.php
b/bin/index.php
index 5a55427b6fbc15cd70e0ac3f4195fc723e8a8a00..5985a3e9bfb2e0a8e1d3103c6e351f8a1d6d6a66 100755
(executable)
--- a/
bin/index.php
+++ b/
bin/index.php
@@
-90,6
+90,17
@@
if ($xbase) {
);
}
);
}
+$meta = $dx->evaluate('/html/head/meta[@name="robots" and @content]')
+ ->item(0);
+if ($meta) {
+ $robots = $meta->attributes->getNamedItem('content')->textContent;
+ foreach (explode(',', $robots) as $value) {
+ if (trim($value) == 'noindex') {
+ echo "URL does not want to be indexed: $url\n";
+ exit(0);
+ }
+ }
+}
//remove script tags
removeTags($doc, 'script');
//remove script tags
removeTags($doc, 'script');