mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-13 17:27:20 +00:00
Fix "Fatal error: Call to undefined method WikiPage::getCount"
This was removed in MediaWiki 1.25 (90d90dad6e).
Bug: T104100
Change-Id: I25edf9e9f10cd3e14e02e63cab86fb5164af8d1a
(cherry picked from commit abb31b0023
)
This commit is contained in:
parent
ec5723fcc2
commit
c02d9aafae
|
@ -324,9 +324,16 @@ class AbuseFilter {
|
|||
$vars->setVar( $prefix . '_NAMESPACE', $title->getNamespace() );
|
||||
$vars->setVar( $prefix . '_TEXT', $title->getText() );
|
||||
$vars->setVar( $prefix . '_PREFIXEDTEXT', $title->getPrefixedText() );
|
||||
|
||||
global $wgDisableCounters;
|
||||
if ( !$wgDisableCounters && !$title->isSpecialPage() ) {
|
||||
$vars->setVar( $prefix . '_VIEWS', WikiPage::factory( $title )->getCount() );
|
||||
// Support: MediaWiki 1.24 and earlier
|
||||
if ( method_exists( 'WikiPage', 'getCount' ) ) {
|
||||
$vars->setVar( $prefix . '_VIEWS', WikiPage::factory( $title )->getCount() );
|
||||
// Support: MediaWiki 1.25+ with HitCounters extension
|
||||
} elseif ( method_exists( 'HitCounters\HitCounters', 'getCount' ) ) {
|
||||
$vars->setVar( $prefix . '_VIEWS', HitCounters\HitCounters::getCount( $title ) );
|
||||
}
|
||||
}
|
||||
|
||||
// Use restrictions.
|
||||
|
|
Loading…
Reference in a new issue