Show {{DEFAULTSORT:0}} on info page
authorFomafix <fomafix@googlemail.com>
Wed, 24 Jun 2015 20:27:25 +0000 (20:27 +0000)
committerUmherirrender <umherirrender_de.wp@web.de>
Fri, 26 Jun 2015 15:24:40 +0000 (15:24 +0000)
The info page of a page with {{DEFAULTSORT:0}} shows the page title
as default sort value.

Using empty() will consider the string '0' to be false, so use isset() instead.

Bug: T103745
Change-Id: I56ea5a38dcd33e822e0fc5b8685777fe1d212b22

includes/actions/InfoAction.php

index bf86b51..0c34ddb 100644 (file)
@@ -234,7 +234,7 @@ class InfoAction extends FormlessAction {
 
                // Display title
                $displayTitle = $title->getPrefixedText();
-               if ( !empty( $pageProperties['displaytitle'] ) ) {
+               if ( isset( $pageProperties['displaytitle'] ) ) {
                        $displayTitle = $pageProperties['displaytitle'];
                }
 
@@ -259,7 +259,7 @@ class InfoAction extends FormlessAction {
 
                // Default sort key
                $sortKey = $title->getCategorySortkey();
-               if ( !empty( $pageProperties['defaultsort'] ) ) {
+               if ( isset( $pageProperties['defaultsort'] ) ) {
                        $sortKey = $pageProperties['defaultsort'];
                }