From: Daniel Kinzler Date: Thu, 3 May 2007 12:44:05 +0000 (+0000) Subject: don't show excerpts from non-readable articles X-Git-Tag: 1.31.0-rc.0~53108 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=57f30e2d8910c54397b8005e0b65d1c081bf3a08;p=lhc%2Fweb%2Fwiklou.git don't show excerpts from non-readable articles --- diff --git a/includes/SpecialSearch.php b/includes/SpecialSearch.php index fdaa8541a5..c347888123 100644 --- a/includes/SpecialSearch.php +++ b/includes/SpecialSearch.php @@ -320,6 +320,14 @@ class SpecialSearch { $contextchars = $wgUser->getOption( 'contextchars', 50 ); $link = $sk->makeKnownLinkObj( $t ); + + //If page content is not readable, just return the title. + //This is not quite safe, but better than showing excerpts from non-readable pages + //Note that hiding the entry entirely would screw up paging. + if (!$t->userCanRead()) { + return "
  • {$link}
  • \n"; + } + $revision = Revision::newFromTitle( $t ); $text = $revision->getText(); $size = wfMsgExt( 'nbytes', array( 'parsemag', 'escape'),