jenkins-bot has submitted this change and it was merged.

Change subject: Use createFragmentTarget instead of setFragment
......................................................................


Use createFragmentTarget instead of setFragment

Ic394352 switched to the deprecated Title::setFragment( $fragment ) function
but this method assumes that a leading # is present and will always remove the
first char.

Bug: T142297
Change-Id: Ibe0a4fefc14670055018b1383592f441b707ebed
(cherry picked from commit 698fedb6b46bb85579634d9c4f56adf3dfd861e4)
---
M includes/Search/Result.php
1 file changed, 1 insertion(+), 4 deletions(-)

Approvals:
  Thcipriani: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Search/Result.php b/includes/Search/Result.php
index f568739..5ca91ed 100644
--- a/includes/Search/Result.php
+++ b/includes/Search/Result.php
@@ -230,12 +230,9 @@
         * @return Title
         */
        private function findSectionTitle() {
-               $title = clone $this->getTitle();
-               $title->setFragment( Title::escapeFragmentForURL(
+               return $this->getTitle()->createFragmentTarget( 
Title::escapeFragmentForURL(
                        $this->stripHighlighting( $this->sectionSnippet )
                ) );
-
-               return $title;
        }
 
        /**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibe0a4fefc14670055018b1383592f441b707ebed
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: wmf/1.28.0-wmf.13
Gerrit-Owner: DCausse <[email protected]>
Gerrit-Reviewer: EBernhardson <[email protected]>
Gerrit-Reviewer: Gehel <[email protected]>
Gerrit-Reviewer: Manybubbles <[email protected]>
Gerrit-Reviewer: Smalyshev <[email protected]>
Gerrit-Reviewer: Thcipriani <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to