Merge "Unscrew something that doesn't make sense"
[lhc/web/wiklou.git] / includes / specials / SpecialProtectedpages.php
index d580d62..bc4f3bb 100644 (file)
@@ -29,7 +29,7 @@
 class SpecialProtectedpages extends SpecialPage {
 
        protected $IdLevel = 'level';
-       protected $IdType  = 'type';
+       protected $IdType = 'type';
 
        public function __construct() {
                parent::__construct( 'Protectedpages' );
@@ -83,6 +83,12 @@ class SpecialProtectedpages extends SpecialPage {
                }
 
                $title = Title::makeTitleSafe( $row->page_namespace, $row->page_title );
+               if( !$title ) {
+                       return Html::rawElement( 'li', array(),
+                               Html::element( 'span', array( 'class' => 'mw-invalidtitle' ),
+                                       Linker::getInvalidTitleDescription( $this->getContext(), $row->page_namespace, $row->page_title ) ) ) . "\n";
+               }
+
                $link = Linker::link( $title );
 
                $description_items = array ();
@@ -146,9 +152,9 @@ class SpecialProtectedpages extends SpecialPage {
 
        /**
         * @param $namespace Integer
-        * @param $type String: restriction type
-        * @param $level String: restriction level
-        * @param $sizetype String: "min" or "max"
+        * @param string $type restriction type
+        * @param string $level restriction level
+        * @param string $sizetype "min" or "max"
         * @param $size Integer
         * @param $indefOnly Boolean: only indefinie protection
         * @param $cascadeOnly Boolean: only cascading protection
@@ -202,16 +208,14 @@ class SpecialProtectedpages extends SpecialPage {
         * @return string Formatted HTML
         */
        protected function getExpiryCheck( $indefOnly ) {
-               return
-                       Xml::checkLabel( $this->msg( 'protectedpages-indef' )->text(), 'indefonly', 'indefonly', $indefOnly ) . "\n";
+               return Xml::checkLabel( $this->msg( 'protectedpages-indef' )->text(), 'indefonly', 'indefonly', $indefOnly ) . "\n";
        }
 
        /**
         * @return string Formatted HTML
         */
        protected function getCascadeCheck( $cascadeOnly ) {
-               return
-                       Xml::checkLabel( $this->msg( 'protectedpages-cascade' )->text(), 'cascadeonly', 'cascadeonly', $cascadeOnly ) . "\n";
+               return Xml::checkLabel( $this->msg( 'protectedpages-cascade' )->text(), 'cascadeonly', 'cascadeonly', $cascadeOnly ) . "\n";
        }
 
        /**
@@ -220,8 +224,7 @@ class SpecialProtectedpages extends SpecialPage {
        protected function getSizeLimit( $sizetype, $size ) {
                $max = $sizetype === 'max';
 
-               return
-                       Xml::radioLabel( $this->msg( 'minimum-size' )->text(), 'sizetype', 'min', 'wpmin', !$max ) .
+               return Xml::radioLabel( $this->msg( 'minimum-size' )->text(), 'sizetype', 'min', 'wpmin', !$max ) .
                        ' ' .
                        Xml::radioLabel( $this->msg( 'maximum-size' )->text(), 'sizetype', 'max', 'wpmax', $max ) .
                        ' ' .
@@ -290,6 +293,10 @@ class SpecialProtectedpages extends SpecialPage {
                                array( 'id' => $this->IdLevel, 'name' => $this->IdLevel ),
                                implode( "\n", $options ) ) . "</span>";
        }
+
+       protected function getGroupName() {
+               return 'maintenance';
+       }
 }
 
 /**