Umherirrender has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/109415


Change subject: Little change of readability in Title::secureAndSplit
......................................................................

Little change of readability in Title::secureAndSplit

Move init of mArticleId to bottom, where other fields are filled and
change ternary operator to a simple if for better readability.

Change-Id: Ib61435e62e883142dd0c5dcb40e0e50e7ca18439
---
M includes/Title.php
1 file changed, 8 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/15/109415/1

diff --git a/includes/Title.php b/includes/Title.php
index 79853df..86270a7 100644
--- a/includes/Title.php
+++ b/includes/Title.php
@@ -3305,10 +3305,6 @@
                        break;
                } while ( true );
 
-               # We already know that some pages won't be in the database!
-               if ( $this->isExternal() || NS_SPECIAL == $this->mNamespace ) {
-                       $this->mArticleID = 0;
-               }
                $fragment = strstr( $dbkey, '#' );
                if ( false !== $fragment ) {
                        $this->setFragment( $fragment );
@@ -3378,9 +3374,9 @@
                // there are numerous ways to present the same IP. Having 
sp:contribs scan
                // them all is silly and having some show the edits and others 
not is
                // inconsistent. Same for talk/userpages. Keep them normalized 
instead.
-               $dbkey = ( $this->mNamespace == NS_USER || $this->mNamespace == 
NS_USER_TALK )
-                       ? IP::sanitizeIP( $dbkey )
-                       : $dbkey;
+               if ( $this->mNamespace == NS_USER || $this->mNamespace == 
NS_USER_TALK ) {
+                       $dbkey = IP::sanitizeIP( $dbkey );
+               }
 
                // Any remaining initial :s are illegal.
                if ( $dbkey !== '' && ':' == $dbkey[0] ) {
@@ -3393,6 +3389,11 @@
 
                $this->mTextform = str_replace( '_', ' ', $dbkey );
 
+               # We already know that some pages won't be in the database!
+               if ( $this->isExternal() || $this->mNamespace == NS_SPECIAL ) {
+                       $this->mArticleID = 0;
+               }
+
                return true;
        }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib61435e62e883142dd0c5dcb40e0e50e7ca18439
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <[email protected]>

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

Reply via email to