* Only call Title::getPageLanguage() when necessary, i.e. after "!$wgDisableLangConve...
[mediawiki.git] / includes / WikiCategoryPage.php
blob96dcef20b52f073aabf6f27c4319238233cad62b
1 <?php
2 /**
3 * Special handling for category pages
4 */
5 class WikiCategoryPage extends WikiPage {
7 public function __construct( Title $title ) {
8 $this->mTitle = $title;
11 /**
12 * Don't return a 404 for categories in use.
13 * In use defined as: either the actual page exists
14 * or the category currently has members.
16 * @return bool
18 public function hasViewableContent() {
19 if ( parent::hasViewableContent() ) {
20 return true;
21 } else {
22 $cat = Category::newFromTitle( $this->mTitle );
23 // If any of these are not 0, then has members
24 if ( $cat->getPageCount()
25 || $cat->getSubcatCount()
26 || $cat->getFileCount()
27 ) {
28 return true;
31 return false;