Skip to content

Commit

Permalink
Use Html::encodeJsVar (miraheze#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
Universal-Omega authored Feb 26, 2024
1 parent e63a479 commit a2a2516
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## ChangeLog for MatomoAnalytics

### 1.1.3 (26-02-2024)
* Replace deprecated Xml::encodeJsVar with Html::encodeJsVar
* Now requires MediaWiki 1.41.0 or later

### 1.1.2 (04-02-2023)
* Add a CleanupMatomos maintenance script
* Add requireExtension() to all maintenance scripts
Expand Down
4 changes: 2 additions & 2 deletions extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
"Universal Omega"
],
"url": "https://github.com/miraheze/MatomoAnalytics",
"version": "1.1.2",
"version": "1.1.3",
"descriptionmsg": "matomoanalytics-desc",
"license-name": "GPL-3.0-or-later",
"type": "specialpage",
"requires": {
"MediaWiki": ">= 1.39.0"
"MediaWiki": ">= 1.41.0"
},
"AvailableRights": [
"noanalytics"
Expand Down
5 changes: 3 additions & 2 deletions includes/MatomoAnalyticsHooks.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php

use MediaWiki\Html\Html;
use MediaWiki\MediaWikiServices;

class MatomoAnalyticsHooks {
Expand Down Expand Up @@ -55,8 +56,8 @@ public static function matomoScript( $skin, &$text ) {
$serverurl = $config->get( 'MatomoAnalyticsServerURL' );
$title = $skin->getRelevantTitle();

$jstitle = Xml::encodeJsVar( $title->getPrefixedText() );
$dbname = Xml::encodeJsVar( $config->get( 'DBname' ) );
$jstitle = Html::encodeJsVar( $title->getPrefixedText() );
$dbname = Html::encodeJsVar( $config->get( 'DBname' ) );
$urltitle = $title->getPrefixedURL();
$userType = $user->isRegistered() ? 'User' : 'Anonymous';
$cookieDisable = (int)$config->get( 'MatomoAnalyticsDisableCookie' );
Expand Down

0 comments on commit a2a2516

Please sign in to comment.