X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FTitle.php;h=b64144855eb74b544013b1978d874f215e911219;hb=64281b6c524f54863174768c025dfe698948fc3f;hp=3bf87c28f9576a73cf01d0615e8cfd335fee88ae;hpb=174e8ccc6918d7db3a512976a9d74f96072e938b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Title.php b/includes/Title.php index 3bf87c28f9..b64144855e 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -2068,16 +2068,18 @@ class Title implements LinkTarget, IDBAccessObject { $url = false; $matches = []; - if ( !empty( $wgActionPaths ) + $articlePaths = PathRouter::getActionPaths( $wgActionPaths, $wgArticlePath ); + + if ( $articlePaths && preg_match( '/^(.*&|)action=([^&]*)(&(.*)|)$/', $query, $matches ) ) { $action = urldecode( $matches[2] ); - if ( isset( $wgActionPaths[$action] ) ) { + if ( isset( $articlePaths[$action] ) ) { $query = $matches[1]; if ( isset( $matches[4] ) ) { $query .= $matches[4]; } - $url = str_replace( '$1', $dbkey, $wgActionPaths[$action] ); + $url = str_replace( '$1', $dbkey, $articlePaths[$action] ); if ( $query != '' ) { $url = wfAppendQuery( $url, $query ); } @@ -2955,7 +2957,7 @@ class Title implements LinkTarget, IDBAccessObject { } $dbr = wfGetDB( DB_REPLICA ); - $conds['page_namespace'] = $this->mNamespace; + $conds = [ 'page_namespace' => $this->mNamespace ]; $conds[] = 'page_title ' . $dbr->buildLike( $this->mDbkeyform . '/', $dbr->anyString() ); $options = []; if ( $limit > -1 ) { @@ -3212,6 +3214,7 @@ class Title implements LinkTarget, IDBAccessObject { // splitTitleString method, but the only implementation (MediaWikiTitleCodec) does /** @var MediaWikiTitleCodec $titleCodec */ $titleCodec = MediaWikiServices::getInstance()->getTitleParser(); + '@phan-var MediaWikiTitleCodec $titleCodec'; // MalformedTitleException can be thrown here $parts = $titleCodec->splitTitleString( $this->mDbkeyform, $this->mDefaultNamespace ); @@ -3532,7 +3535,7 @@ class Title implements LinkTarget, IDBAccessObject { $method = $auth ? 'moveSubpagesIfAllowed' : 'moveSubpages'; $result = $mp->$method( $wgUser, $reason, $createRedirect, $changeTags ); - if ( !$result->isOk() ) { + if ( !$result->isOK() ) { return $result->getErrorsArray(); }