Merge "Improve docs for Title::getInternalURL/getCanonicalURL"
[lhc/web/wiklou.git] / includes / specials / pagers / BlockListPager.php
index 8fc586b..71cf787 100644 (file)
@@ -32,7 +32,6 @@ use Wikimedia\Rdbms\IResultWrapper;
 class BlockListPager extends TablePager {
 
        protected $conds;
-       protected $page;
 
        /**
         * Array of restrictions.
@@ -46,7 +45,6 @@ class BlockListPager extends TablePager {
         * @param array $conds
         */
        public function __construct( $page, $conds ) {
-               $this->page = $page;
                $this->conds = $conds;
                $this->mDefaultDirection = IndexPager::DIR_DESCENDING;
                parent::__construct( $page->getContext() );
@@ -163,7 +161,7 @@ class BlockListPager extends TablePager {
                                        $formatted .= '<br />' . $this->msg(
                                                'ipb-blocklist-duration-left',
                                                $language->formatDuration(
-                                                       $timestamp->getTimestamp() - time(),
+                                                       $timestamp->getTimestamp() - MWTimestamp::time(),
                                                        // reasonable output
                                                        [
                                                                'minutes',
@@ -193,10 +191,8 @@ class BlockListPager extends TablePager {
                        case 'ipb_params':
                                $properties = [];
 
-                               if ( $this->getConfig()->get( 'EnablePartialBlocks' ) ) {
-                                       if ( $row->ipb_sitewide ) {
-                                               $properties[] = htmlspecialchars( $msg['blocklist-editing-sitewide'] );
-                                       }
+                               if ( $this->getConfig()->get( 'EnablePartialBlocks' ) && $row->ipb_sitewide ) {
+                                       $properties[] = htmlspecialchars( $msg['blocklist-editing-sitewide'] );
                                }
 
                                if ( !$row->ipb_sitewide && $this->restrictions ) {
@@ -262,11 +258,13 @@ class BlockListPager extends TablePager {
 
                        switch ( $restriction->getType() ) {
                                case PageRestriction::TYPE:
-                                       $items[$restriction->getType()][] = HTML::rawElement(
-                                               'li',
-                                               [],
-                                               Linker::link( $restriction->getTitle() )
-                                       );
+                                       if ( $restriction->getTitle() ) {
+                                               $items[$restriction->getType()][] = Html::rawElement(
+                                                       'li',
+                                                       [],
+                                                       Linker::link( $restriction->getTitle() )
+                                               );
+                                       }
                                        break;
                                case NamespaceRestriction::TYPE:
                                        $text = $restriction->getValue() === NS_MAIN
@@ -274,7 +272,7 @@ class BlockListPager extends TablePager {
                                                : $this->getLanguage()->getFormattedNsText(
                                                        $restriction->getValue()
                                                );
-                                       $items[$restriction->getType()][] = HTML::rawElement(
+                                       $items[$restriction->getType()][] = Html::rawElement(
                                                'li',
                                                [],
                                                Linker::link(