Nischayn22 has submitted this change and it was merged.

Change subject: (bug 35520) Don't wikilink input that is already likely to be 
wikicode
......................................................................


(bug 35520) Don't wikilink input that is already likely to be wikicode

The author field is normaly used as text for the wikilink to your
username. Many users, however, have their own ways to form their
attribution.

This will use raw wikicode for the author field if the user adds
'[' or '{' in the author field. If they don't, the field input
will still be used as the text for the wikilink to the username.

Change-Id: I0a6580e953754b290abd0844b2bb95e2f62c0333
---
M resources/mw.UploadWizardDeed.js
1 file changed, 5 insertions(+), 1 deletion(-)

Approvals:
  Matmarex: Looks good to me, but someone else must approve
  Nischayn22: Verified; Looks good to me, approved



diff --git a/resources/mw.UploadWizardDeed.js b/resources/mw.UploadWizardDeed.js
index c4a274d..f61da0a 100644
--- a/resources/mw.UploadWizardDeed.js
+++ b/resources/mw.UploadWizardDeed.js
@@ -111,7 +111,11 @@
                                author = _this.$authorInput2.val();
                        }
 
-                       return "[[User:" + mw.config.get( 'wgUserName' ) + '|' 
+ author + ']]';
+                       if ( author.indexOf( '[' ) >= 0 || author.indexOf( '{' 
) >= 0 ) {
+                               return author;
+                       }
+
+                       return '[[User:' + mw.config.get( 'wgUserName' ) + '|' 
+ author + ']]';
                },
 
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0a6580e953754b290abd0844b2bb95e2f62c0333
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: TheDJ <[email protected]>
Gerrit-Reviewer: Lupo <[email protected]>
Gerrit-Reviewer: Matmarex <[email protected]>
Gerrit-Reviewer: Nischayn22 <[email protected]>
Gerrit-Reviewer: TheDJ <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to