Matmarex has uploaded a new change for review.

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


Change subject: (bug 46837) fix Bugzilla wikilinking to sections
......................................................................

(bug 46837) fix Bugzilla wikilinking to sections

Followup to Ie3dbf0a6. Just don't url_quote the fragment part.

Change-Id: I1eadfecacc5abb7a3c12b0ee5e2ffdfffe1abd81
---
M bugzilla-4.2/extensions/Wikimedia/Extension.pm
1 file changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/bugzilla/modifications 
refs/changes/01/60701/1

diff --git a/bugzilla-4.2/extensions/Wikimedia/Extension.pm 
b/bugzilla-4.2/extensions/Wikimedia/Extension.pm
index c566b3e..37c7943 100644
--- a/bugzilla-4.2/extensions/Wikimedia/Extension.pm
+++ b/bugzilla-4.2/extensions/Wikimedia/Extension.pm
@@ -86,8 +86,12 @@
        my $match_str = $1;
        my $tail = $2;
        my $linktext = html_quote($match_str);
-       my $searchstring = html_quote(url_quote($match_str));
-       my $wikipedia_link = "[[<a 
href=\"https://en.wikipedia.org/w/index.php?title=Special:Search&go=Go&search=$searchstring\";>$linktext</a>$tail";
+       
+       my @parts = split(/#/, $match_str, 2);
+       my $searchstring = html_quote(url_quote(@parts[0]));
+       my $fragment = $#array != 0 ? html_quote('#' . @parts[1]) : '';
+       
+       my $wikipedia_link = "[[<a 
href=\"https://en.wikipedia.org/w/index.php?title=Special:Search&go=Go&search=$searchstring$fragment\";>$linktext</a>$tail";
        return $wikipedia_link;
 };
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1eadfecacc5abb7a3c12b0ee5e2ffdfffe1abd81
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/bugzilla/modifications
Gerrit-Branch: master
Gerrit-Owner: Matmarex <[email protected]>

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

Reply via email to