Reverted r111188: backport conflict fodder
[lhc/web/wiklou.git] / includes / WikiCategoryPage.php
1 <?php
2 /**
3 * Special handling for category pages
4 */
5 class WikiCategoryPage extends WikiPage {
6
7 /**
8 * Don't return a 404 for categories in use.
9 * In use defined as: either the actual page exists
10 * or the category currently has members.
11 *
12 * @return bool
13 */
14 public function hasViewableContent() {
15 if ( parent::hasViewableContent() ) {
16 return true;
17 } else {
18 $cat = Category::newFromTitle( $this->mTitle );
19 // If any of these are not 0, then has members
20 if ( $cat->getPageCount()
21 || $cat->getSubcatCount()
22 || $cat->getFileCount()
23 ) {
24 return true;
25 }
26 }
27 return false;
28 }
29 }