use Hooks;
use HtmlArmor;
use MediaWiki\Linker\LinkRenderer;
+use MediaWiki\MediaWikiServices;
use SearchResult;
use SpecialSearch;
use 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 (really?).
- if ( !$result->getTitle()->userCan( 'read', $this->specialPage->getUser() ) ) {
+ $permissionManager = MediaWikiServices::getInstance()->getPermissionManager();
+ if ( !$permissionManager->userCan(
+ 'read', $this->specialPage->getUser(), $result->getTitle()
+ ) ) {
return "<li>{$link}</li>";
}
"</table>";
}
- return "<li>{$html}</li>";
+ return "<li class='mw-search-result'>{$html}</li>";
}
/**