Skip to content
Snippets Groups Projects
Commit 80cd4510 authored by Jonas Wallden's avatar Jonas Wallden
Browse files

<!-- robots:noindex --> didn't properly exclude some HTML elements such as

<h1>-<h3> and <title>. Fixes [RT#9018].

Rev: lib/modules/Search.pmod/Filter.pmod/HTML.pmod:1.42
parent 11b2ed2b
No related branches found
No related tags found
No related merge requests found
// This file is part of Roxen Search
// Copyright 2000,2001 Roxen IS. All rights reserved.
//
// $Id: HTML.pmod,v 1.41 2006/11/17 10:41:41 stewa Exp $
// $Id: HTML.pmod,v 1.42 2007/03/16 14:45:38 jonasw Exp $
// Filter for text/html
......@@ -102,8 +102,10 @@ static string clean(string data) {
};
#endif
array parse_meta(Parser.HTML p, mapping m )
array parse_meta(Parser.HTML p, mapping m, mapping e)
{
if (e->noindex)
return ({ });
string n = m->name||m["http-equiv"];
switch(lower_case(n || ""))
{
......@@ -134,7 +136,9 @@ static string clean(string data) {
low_ladd(Parser.parse_html_entities(html_href, 1));
};
array(string) parse_title(Parser.HTML p, mapping m, string c) {
array(string) parse_title(Parser.HTML p, mapping m, string c, mapping e) {
if (e->noindex)
return ({ });
res->fields->title = clean(c);
return ({c});
};
......@@ -250,8 +254,10 @@ static string clean(string data) {
return ({});
};
array parse_headline(Parser.HTML p, mapping m, string c)
array parse_headline(Parser.HTML p, mapping m, string c, mapping e)
{
if (e->noindex)
return ({ });
if(!res->fields->headline)
res->fields->headline = "";
res->fields->headline += " " + clean(c);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment