jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/334597 )

Change subject: Fix for adding external links with umlauts
......................................................................


Fix for adding external links with umlauts

When a link with umlauts is added in VisualEditor, decodeURI function
fails. I dont know if this is the best solution, but this, in case of
umlauted URI, falls back to unescape() which can handle it

ERM: #5357

Needs cherry-picking to REL1_27 and master

Change-Id: Icae786204bbf097879955e667e5a56e2781e41e8
---
M VisualEditor/resources/tiny_mce_plugins/bswikicode/plugin.js
1 file changed, 5 insertions(+), 1 deletion(-)

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



diff --git a/VisualEditor/resources/tiny_mce_plugins/bswikicode/plugin.js 
b/VisualEditor/resources/tiny_mce_plugins/bswikicode/plugin.js
index 3434a24..fb6e2fa 100644
--- a/VisualEditor/resources/tiny_mce_plugins/bswikicode/plugin.js
+++ b/VisualEditor/resources/tiny_mce_plugins/bswikicode/plugin.js
@@ -650,7 +650,11 @@
                                        continue;
                                }
                                if (hrefAttr) {
-                                       target = decodeURI( hrefAttr[1] );
+                                       try {
+                                               target = decodeURI( hrefAttr[1] 
);
+                                       } catch ( e ) {
+                                               target = unescape( hrefAttr[1] 
);
+                                       }
                                        // 03.03.2014 STM ??? target = target; 
//unescape(target);
                                }
                                // @todo <br /> br-tags bereits in insertLink 
abfangen oder hier einfügen

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icae786204bbf097879955e667e5a56e2781e41e8
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: REL1_23
Gerrit-Owner: ItSpiderman <[email protected]>
Gerrit-Reviewer: Dvogel hallowelt <[email protected]>
Gerrit-Reviewer: ItSpiderman <[email protected]>
Gerrit-Reviewer: Ljonka <[email protected]>
Gerrit-Reviewer: Mglaser <[email protected]>
Gerrit-Reviewer: Pwirth <[email protected]>
Gerrit-Reviewer: Robert Vogel <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to