Jason.ji has uploaded a new change for review.
https://gerrit.wikimedia.org/r/231154
Change subject: Fix VikiSemanticTitle to support HTML special chars in the
semantic title, specifically ampersand, single quote, double quote, less than,
and greater than.
......................................................................
Fix VikiSemanticTitle to support HTML special chars in the semantic title,
specifically ampersand, single quote, double quote, less than, and greater than.
Change-Id: I516025724d67a3001bfe54ccfda59dc0866ae47a
---
M VikiSemanticTitle.js
M VikiSemanticTitle.php
2 files changed, 6 insertions(+), 1 deletion(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VikiSemanticTitle
refs/changes/54/231154/1
diff --git a/VikiSemanticTitle.js b/VikiSemanticTitle.js
index 9179442..efc66ea 100644
--- a/VikiSemanticTitle.js
+++ b/VikiSemanticTitle.js
@@ -93,6 +93,11 @@
*/
processDisplayTitle: function( vikiObject, data, node ) {
var semanticTitle = data.getSemanticTitle[0].result;
+ semanticTitle = semanticTitle.replace(/&/g, '&')
+
.replace(/</g, '<')
+
.replace(/>/g, '>')
+
.replace(/"/g, '"')
+
.replace(/'/g, '\'');
if ( node.semanticTitle !== semanticTitle ) {
node.displayName = semanticTitle.length < 20 ?
semanticTitle : semanticTitle.substring( 0, 20 ) + "...";
diff --git a/VikiSemanticTitle.php b/VikiSemanticTitle.php
index cb587ea..5dea311 100644
--- a/VikiSemanticTitle.php
+++ b/VikiSemanticTitle.php
@@ -54,7 +54,7 @@
$wgExtensionCredits['parserhook'][] = array (
'name' => 'VikiSemanticTitle',
- 'version' => '1.1',
+ 'version' => '1.1.1',
'author' => '[http://www.mediawiki.org/wiki/User:Jji Jason Ji]',
'descriptionmsg' => 'vikisemantictitle-desc',
'path' => __FILE__,
--
To view, visit https://gerrit.wikimedia.org/r/231154
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I516025724d67a3001bfe54ccfda59dc0866ae47a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VikiSemanticTitle
Gerrit-Branch: master
Gerrit-Owner: Jason.ji <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits