X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2FTitle.php;h=0728065c3051f0cbfaa83ba0bef0475c225c3582;hp=c9f09f79e20b16068888ff3ea352cf552fd1672d;hb=61d9828a88940e223461eb4d628b32295201ffbb;hpb=46ef5f96caad712628908681afbead5b07514e3c diff --git a/includes/Title.php b/includes/Title.php index c9f09f79e2..0728065c30 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -1020,12 +1020,25 @@ class Title implements LinkTarget { } /** - * Could this title have a corresponding talk page? + * Can this title have a corresponding talk page? * - * @return bool + * @deprecated since 1.30, use canHaveTalkPage() instead. + * + * @return bool True if this title either is a talk page or can have a talk page associated. */ public function canTalk() { - return MWNamespace::canTalk( $this->mNamespace ); + return $this->canHaveTalkPage(); + } + + /** + * Can this title have a corresponding talk page? + * + * @see MWNamespace::hasTalkNamespace + * + * @return bool True if this title either is a talk page or can have a talk page associated. + */ + public function canHaveTalkPage() { + return MWNamespace::hasTalkNamespace( $this->mNamespace ); } /** @@ -3159,7 +3172,7 @@ class Title implements LinkTarget { if ( $limit > -1 ) { $options['LIMIT'] = $limit; } - $this->mSubpages = TitleArray::newFromResult( + return TitleArray::newFromResult( $dbr->select( 'page', [ 'page_id', 'page_namespace', 'page_title', 'page_is_redirect' ], $conds, @@ -3167,7 +3180,6 @@ class Title implements LinkTarget { $options ) ); - return $this->mSubpages; } /** @@ -3722,8 +3734,8 @@ class Title implements LinkTarget { * @return array|bool True on success, getUserPermissionsErrors()-like array on failure */ public function moveTo( &$nt, $auth = true, $reason = '', $createRedirect = true, - array $changeTags = [] ) { - + array $changeTags = [] + ) { global $wgUser; $err = $this->isValidMoveOperation( $nt, $auth, $reason ); if ( is_array( $err ) ) { @@ -3760,8 +3772,8 @@ class Title implements LinkTarget { * no pages were moved */ public function moveSubpages( $nt, $auth = true, $reason = '', $createRedirect = true, - array $changeTags = [] ) { - + array $changeTags = [] + ) { global $wgMaximumMovedPages; // Check permissions if ( !$this->userCan( 'move-subpages' ) ) {