Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Html::encodeJsVar #116

Merged
merged 3 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading