Demon has submitted this change and it was merged.

Change subject: Private access is pointless here. Change it to protected. Also 
remove deprecated newFromURL() usage.
......................................................................


Private access is pointless here. Change it to protected.
Also remove deprecated newFromURL() usage.

Change-Id: I2737442ac19e7a77288236bb30a3d9487c356aa5
---
M Duplicator.page.php
1 file changed, 13 insertions(+), 12 deletions(-)

Approvals:
  Demon: Verified; Looks good to me, approved



diff --git a/Duplicator.page.php b/Duplicator.page.php
index 20870e9..ca82e7f 100644
--- a/Duplicator.page.php
+++ b/Duplicator.page.php
@@ -13,19 +13,19 @@
        /**
         * Title of the page we are duplicating
         */
-       private $source = '';
-       private $sourceTitle = null;
+       protected $source = '';
+       protected $sourceTitle = null;
 
        /**
         * Title of the page we are saving to
         */
-       private $dest = '';
-       private $destTitle = null;
+       protected $dest = '';
+       protected $destTitle = null;
 
        /**
         * Whether or not we're duplicating the talk page
         */
-       private $talk = true;
+       protected $talk = true;
 
        /**
         * Constructor
@@ -131,12 +131,12 @@
         * @param $request WebRequest we're running off
         * @param $title Title passed to the page
         */
-       private function setOptions( &$request, $title ) {
+       protected function setOptions( &$request, $title ) {
                $source = $request->getText( 'source' );
                $this->source = $source ? $source : ( $title ? $title : '' );
-               $this->sourceTitle = Title::newFromURL( $this->source );
+               $this->sourceTitle = Title::newFromText( $this->source );
                $this->dest = $request->getText( 'dest', '' );
-               $this->destTitle = Title::newFromURL( $this->dest );
+               $this->destTitle = Title::newFromText( $this->dest );
                $this->talk = $request->getCheck( 'talk' );
        }
 
@@ -146,7 +146,7 @@
         *
         * @return bool
         */
-       private function dealWithTalk() {
+       protected function dealWithTalk() {
                if( is_object( $this->sourceTitle ) ) {
                        if( $this->sourceTitle->isTalkPage() )
                                return false;
@@ -164,7 +164,7 @@
         *
         * @return string
         */
-       private function buildForm() {
+       protected function buildForm() {
                global $wgUser;
                $self = SpecialPage::getTitleFor( 'Duplicator' );
                $source = is_object( $this->sourceTitle ) ? 
$this->sourceTitle->getPrefixedText() : $this->source;
@@ -199,10 +199,11 @@
         * @param $dest Title to save to
         * @return bool
         */
-       private function duplicate( &$source, &$dest ) {
+       protected function duplicate( &$source, &$dest ) {
                global $wgUser, $wgBot;
-               if( !$source->exists() || $dest->exists() )
+               if( !$source->exists() || $dest->exists() ) {
                        return false; # Source doesn't exist, or destination 
does
+               }
                $dbw = wfGetDB( DB_MASTER );
                $dbw->begin();
                $sid = $source->getArticleID();

-- 
To view, visit https://gerrit.wikimedia.org/r/65976
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2737442ac19e7a77288236bb30a3d9487c356aa5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Duplicator
Gerrit-Branch: master
Gerrit-Owner: VitaliyFilippov <[email protected]>
Gerrit-Reviewer: Demon <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to