Menu

#2 Protect Search result

open
nobody
None
5
2007-01-24
2007-01-24
321soft.de
No

If users search for some textphrases they always can read text extracts even from protected articles which this user is not allowed to read.
So the smart ones could get the content of the whole article by just searching for the right words.

My solution:
In the file includes/SpecialSearch.php in function showHit( $result, $terms ) just replace the last line:

return "<li>{$link} ({$size}){$extract}</li>\n";

by following lines:

$art_id=$revision->getPage();
$title=Title::newFromId($art_id);
if ($title->userCanRead())
{
return "<li>{$link} ({$size}){$extract}</li>\n";
}

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.