Merge "New HTMLForm size filter field; add size filter to Special:Newpages"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 27 Oct 2016 05:53:03 +0000 (05:53 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 27 Oct 2016 05:53:03 +0000 (05:53 +0000)
includes/EditPage.php
includes/libs/rdbms/database/DatabasePostgres.php

index e8ea20f..4aa87d6 100644 (file)
@@ -2885,24 +2885,9 @@ ERROR;
                global $wgOut, $wgUser, $wgMaxArticleSize, $wgLang;
                global $wgAllowUserCss, $wgAllowUserJs;
 
-               if ( $this->mTitle->isTalkPage() ) {
-                       $wgOut->addWikiMsg( 'talkpagetext' );
-               }
+               $this->addTalkPageText();
 
-               // Add edit notices
-               $editNotices = $this->mTitle->getEditNotices( $this->oldid );
-               if ( count( $editNotices ) ) {
-                       $wgOut->addHTML( implode( "\n", $editNotices ) );
-               } else {
-                       $msg = $this->context->msg( 'editnotice-notext' );
-                       if ( !$msg->isDisabled() ) {
-                               $wgOut->addHTML(
-                                       '<div class="mw-editnotice-notext">'
-                                       . $msg->parseAsBlock()
-                                       . '</div>'
-                               );
-                       }
-               }
+               $this->addEditNotices();
 
                if ( $this->isConflict ) {
                        $wgOut->wrapWikiMsg( "<div class='mw-explainconflict'>\n$1\n</div>", 'explainconflict' );
@@ -4435,4 +4420,30 @@ HTML
                // reverse the transform that we made for reversibility reasons.
                return strtr( $result, [ "&#x0" => "&#x" ] );
        }
+
+       protected function addEditNotices() {
+               global $wgOut;
+
+               $editNotices = $this->mTitle->getEditNotices( $this->oldid );
+               if ( count( $editNotices ) ) {
+                       $wgOut->addHTML( implode( "\n", $editNotices ) );
+               } else {
+                       $msg = $this->context->msg( 'editnotice-notext' );
+                       if ( !$msg->isDisabled() ) {
+                               $wgOut->addHTML(
+                                       '<div class="mw-editnotice-notext">'
+                                       . $msg->parseAsBlock()
+                                       . '</div>'
+                               );
+                       }
+               }
+       }
+
+       protected function addTalkPageText() {
+               global $wgOut;
+
+               if ( $this->mTitle->isTalkPage() ) {
+                       $wgOut->addWikiMsg( 'talkpagetext' );
+               }
+       }
 }
index 7acd8dc..b72557a 100644 (file)
@@ -1175,8 +1175,12 @@ SQL;
         * @return bool
         */
        function schemaExists( $schema ) {
-               $exists = $this->selectField( '"pg_catalog"."pg_namespace"', 1,
-                       [ 'nspname' => $schema ], __METHOD__ );
+               if ( !strlen( $schema ) ) {
+                       return false; // short-circuit
+               }
+
+               $exists = $this->selectField(
+                       '"pg_catalog"."pg_namespace"', 1, [ 'nspname' => $schema ], __METHOD__ );
 
                return (bool)$exists;
        }