diff options
13 files changed, 88 insertions, 45 deletions
diff --git a/config/global.ini.php b/config/global.ini.php index 5b73f6c2f1..c2f969582a 100644 --- a/config/global.ini.php +++ b/config/global.ini.php @@ -938,7 +938,7 @@ default_time_one_page_visit = 0 ; Comma separated list of URL query string variable names that will be removed from your tracked URLs ; By default, Matomo will remove the most common parameters which are known to change often (eg. session ID parameters) -url_query_parameter_to_exclude_from_url = "gclid,fbclid,fb_xd_fragment,fb_comment_id,phpsessid,jsessionid,sessionid,aspsessionid,doing_wp_cron,sid,pk_vid" +url_query_parameter_to_exclude_from_url = "gclid,fbclid,msclkid,yclid,fb_xd_fragment,fb_comment_id,phpsessid,jsessionid,sessionid,aspsessionid,doing_wp_cron,sid,pk_vid" ; If set to 1, Matomo will use the default provider if no other provider is configured. ; In addition the default provider will be used as a fallback when the configure provider does not return any results. diff --git a/core/Archive/ArchiveInvalidator/InvalidationResult.php b/core/Archive/ArchiveInvalidator/InvalidationResult.php index ca7aae5fda..2b30e1b058 100644 --- a/core/Archive/ArchiveInvalidator/InvalidationResult.php +++ b/core/Archive/ArchiveInvalidator/InvalidationResult.php @@ -1,4 +1,5 @@ <?php + /** * Matomo - free/libre analytics platform * @@ -21,14 +22,14 @@ class InvalidationResult * * @var array */ - public $warningDates = array(); + public $warningDates = []; /** * Dates that were successfully invalidated. * * @var array */ - public $processedDates = array(); + public $processedDates = []; /** * The day of the oldest log entry. @@ -40,9 +41,9 @@ class InvalidationResult /** * @return string[] */ - public function makeOutputLogs() + public function makeOutputLogs(): array { - $output = array(); + $output = []; if ($this->warningDates) { $output[] = 'Warning: the following Dates have not been invalidated, because they are earlier than your Log Deletion limit: ' . implode(", ", $this->warningDates) . @@ -53,4 +54,4 @@ class InvalidationResult $output[] = "Success. The following dates were invalidated successfully: " . implode(", ", $this->processedDates); return $output; } -}
\ No newline at end of file +} diff --git a/core/DataAccess/LogAggregator.php b/core/DataAccess/LogAggregator.php index 61479f39d0..883dcf763d 100644 --- a/core/DataAccess/LogAggregator.php +++ b/core/DataAccess/LogAggregator.php @@ -321,7 +321,7 @@ class LogAggregator return; } - $insertIntoStatement = 'INSERT INTO ' . $table . ' (idvisit) ' . $segmentSelectSql; + $insertIntoStatement = 'INSERT IGNORE INTO ' . $table . ' (idvisit) ' . $segmentSelectSql; $readerDb->query($insertIntoStatement, $segmentSelectBind); $transactionLevel->restorePreviousStatus(); diff --git a/plugins/CoreAdminHome/Commands/InvalidateReportData.php b/plugins/CoreAdminHome/Commands/InvalidateReportData.php index cdb1f3240e..4b10f9e2c3 100644 --- a/plugins/CoreAdminHome/Commands/InvalidateReportData.php +++ b/plugins/CoreAdminHome/Commands/InvalidateReportData.php @@ -1,4 +1,5 @@ <?php + /** * Matomo - free/libre analytics platform * @@ -109,7 +110,9 @@ class InvalidateReportData extends ConsoleCommand false, $plugin, $ignoreLogDeletionLimit); if ($output->getVerbosity() > OutputInterface::VERBOSITY_NORMAL) { - $logger->info($invalidationResult->makeOutputLogs()); + foreach ($invalidationResult->makeOutputLogs() as $outputLog) { + $logger->info($outputLog); + } } } } diff --git a/plugins/CoreHome/vue/dist/CoreHome.umd.js b/plugins/CoreHome/vue/dist/CoreHome.umd.js index 97eb1a568c..0f3ee68220 100644 --- a/plugins/CoreHome/vue/dist/CoreHome.umd.js +++ b/plugins/CoreHome/vue/dist/CoreHome.umd.js @@ -5824,44 +5824,44 @@ PeriodDatePickervue_type_script_lang_ts.render = PeriodDatePickervue_type_templa directiveName: 'piwikPeriodDatePicker', restrict: 'E' })); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/SiteSelector/SiteSelector.vue?vue&type=template&id=0ec42be5 +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/SiteSelector/SiteSelector.vue?vue&type=template&id=c62be528 -var SiteSelectorvue_type_template_id_0ec42be5_hoisted_1 = ["value", "name"]; -var SiteSelectorvue_type_template_id_0ec42be5_hoisted_2 = ["title"]; -var SiteSelectorvue_type_template_id_0ec42be5_hoisted_3 = ["textContent"]; -var SiteSelectorvue_type_template_id_0ec42be5_hoisted_4 = { +var SiteSelectorvue_type_template_id_c62be528_hoisted_1 = ["value", "name"]; +var SiteSelectorvue_type_template_id_c62be528_hoisted_2 = ["title"]; +var SiteSelectorvue_type_template_id_c62be528_hoisted_3 = ["textContent"]; +var SiteSelectorvue_type_template_id_c62be528_hoisted_4 = { key: 1, class: "placeholder" }; -var SiteSelectorvue_type_template_id_0ec42be5_hoisted_5 = { +var SiteSelectorvue_type_template_id_c62be528_hoisted_5 = { class: "dropdown" }; -var SiteSelectorvue_type_template_id_0ec42be5_hoisted_6 = { +var SiteSelectorvue_type_template_id_c62be528_hoisted_6 = { class: "custom_select_search" }; -var SiteSelectorvue_type_template_id_0ec42be5_hoisted_7 = ["placeholder"]; -var SiteSelectorvue_type_template_id_0ec42be5_hoisted_8 = { +var SiteSelectorvue_type_template_id_c62be528_hoisted_7 = ["placeholder"]; +var SiteSelectorvue_type_template_id_c62be528_hoisted_8 = { key: 0 }; -var SiteSelectorvue_type_template_id_0ec42be5_hoisted_9 = { +var SiteSelectorvue_type_template_id_c62be528_hoisted_9 = { class: "custom_select_container" }; -var SiteSelectorvue_type_template_id_0ec42be5_hoisted_10 = ["onClick"]; -var SiteSelectorvue_type_template_id_0ec42be5_hoisted_11 = ["innerHTML", "href", "title"]; -var SiteSelectorvue_type_template_id_0ec42be5_hoisted_12 = { +var SiteSelectorvue_type_template_id_c62be528_hoisted_10 = ["onClick"]; +var SiteSelectorvue_type_template_id_c62be528_hoisted_11 = ["innerHTML", "href", "title"]; +var SiteSelectorvue_type_template_id_c62be528_hoisted_12 = { class: "ui-autocomplete ui-front ui-menu ui-widget ui-widget-content ui-corner-all\n siteSelect" }; -var SiteSelectorvue_type_template_id_0ec42be5_hoisted_13 = { +var SiteSelectorvue_type_template_id_c62be528_hoisted_13 = { class: "ui-menu-item" }; -var SiteSelectorvue_type_template_id_0ec42be5_hoisted_14 = { +var SiteSelectorvue_type_template_id_c62be528_hoisted_14 = { class: "ui-corner-all", tabindex: "-1" }; var _hoisted_15 = { key: 1 }; -function SiteSelectorvue_type_template_id_0ec42be5_render(_ctx, _cache, $props, $setup, $data, $options) { +function SiteSelectorvue_type_template_id_c62be528_render(_ctx, _cache, $props, $setup, $data, $options) { var _ctx$displayedModelVa, _ctx$displayedModelVa2, _ctx$displayedModelVa3, _ctx$displayedModelVa4; var _component_AllSitesLink = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("AllSitesLink"); @@ -5880,7 +5880,7 @@ function SiteSelectorvue_type_template_id_0ec42be5_render(_ctx, _cache, $props, type: "hidden", value: (_ctx$displayedModelVa = _ctx.displayedModelValue) === null || _ctx$displayedModelVa === void 0 ? void 0 : _ctx$displayedModelVa.id, name: _ctx.name - }, null, 8, SiteSelectorvue_type_template_id_0ec42be5_hoisted_1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + }, null, 8, SiteSelectorvue_type_template_id_c62be528_hoisted_1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { ref: "selectorLink", onClick: _cache[0] || (_cache[0] = function () { return _ctx.onClickSelector && _ctx.onClickSelector.apply(_ctx, arguments); @@ -5902,7 +5902,7 @@ function SiteSelectorvue_type_template_id_0ec42be5_render(_ctx, _cache, $props, }, null, 2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, [(_ctx$displayedModelVa2 = _ctx.displayedModelValue) !== null && _ctx$displayedModelVa2 !== void 0 && _ctx$displayedModelVa2.name || !_ctx.placeholder ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", { key: 0, textContent: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(((_ctx$displayedModelVa3 = _ctx.displayedModelValue) === null || _ctx$displayedModelVa3 === void 0 ? void 0 : _ctx$displayedModelVa3.name) || _ctx.firstSiteName) - }, null, 8, SiteSelectorvue_type_template_id_0ec42be5_hoisted_3)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), !((_ctx$displayedModelVa4 = _ctx.displayedModelValue) !== null && _ctx$displayedModelVa4 !== void 0 && _ctx$displayedModelVa4.name) && _ctx.placeholder ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", SiteSelectorvue_type_template_id_0ec42be5_hoisted_4, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.placeholder), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])], 42, SiteSelectorvue_type_template_id_0ec42be5_hoisted_2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteSelectorvue_type_template_id_0ec42be5_hoisted_5, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteSelectorvue_type_template_id_0ec42be5_hoisted_6, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + }, null, 8, SiteSelectorvue_type_template_id_c62be528_hoisted_3)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), !((_ctx$displayedModelVa4 = _ctx.displayedModelValue) !== null && _ctx$displayedModelVa4 !== void 0 && _ctx$displayedModelVa4.name) && _ctx.placeholder ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", SiteSelectorvue_type_template_id_c62be528_hoisted_4, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.placeholder), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])], 42, SiteSelectorvue_type_template_id_c62be528_hoisted_2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteSelectorvue_type_template_id_c62be528_hoisted_5, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteSelectorvue_type_template_id_c62be528_hoisted_6, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { type: "text", onClick: _cache[2] || (_cache[2] = function ($event) { _ctx.searchTerm = ''; @@ -5915,7 +5915,7 @@ function SiteSelectorvue_type_template_id_0ec42be5_render(_ctx, _cache, $props, tabindex: "4", class: "websiteSearch inp browser-default", placeholder: _ctx.translate('General_Search') - }, null, 8, SiteSelectorvue_type_template_id_0ec42be5_hoisted_7), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vModelText"], _ctx.searchTerm], [_directive_focus_if, {}, _ctx.shouldFocusOnSearch]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("img", { + }, null, 8, SiteSelectorvue_type_template_id_c62be528_hoisted_7), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vModelText"], _ctx.searchTerm], [_directive_focus_if, {}, _ctx.shouldFocusOnSearch]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("img", { title: "Clear", onClick: _cache[4] || (_cache[4] = function ($event) { _ctx.searchTerm = ''; @@ -5924,13 +5924,13 @@ function SiteSelectorvue_type_template_id_0ec42be5_render(_ctx, _cache, $props, }), class: "reset", src: "plugins/CoreHome/images/reset_search.png" - }, null, 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.searchTerm]])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.autocompleteMinSites <= _ctx.sites.length || _ctx.searchTerm]]), _ctx.allSitesLocation === 'top' && _ctx.showAllSitesItem ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", SiteSelectorvue_type_template_id_0ec42be5_hoisted_8, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_AllSitesLink, { + }, null, 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.searchTerm]])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.autocompleteMinSites <= _ctx.sites.length || _ctx.searchTerm]]), _ctx.allSitesLocation === 'top' && _ctx.showAllSitesItem ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", SiteSelectorvue_type_template_id_c62be528_hoisted_8, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_AllSitesLink, { href: _ctx.urlAllSites, "all-sites-text": _ctx.allSitesText, onClick: _cache[5] || (_cache[5] = function ($event) { return _ctx.onAllSitesClick($event); }) - }, null, 8, ["href", "all-sites-text"])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteSelectorvue_type_template_id_0ec42be5_hoisted_9, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", { + }, null, 8, ["href", "all-sites-text"])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteSelectorvue_type_template_id_c62be528_hoisted_9, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", { class: "custom_select_ul_list", onClick: _cache[7] || (_cache[7] = function ($event) { return _ctx.showSitesList = false; @@ -5951,8 +5951,8 @@ function SiteSelectorvue_type_template_id_0ec42be5_render(_ctx, _cache, $props, tabindex: "4", href: _ctx.getUrlForSiteId(site.idsite), title: site.name - }, null, 8, SiteSelectorvue_type_template_id_0ec42be5_hoisted_11)], 8, SiteSelectorvue_type_template_id_0ec42be5_hoisted_10)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !(!_ctx.showSelectedSite && "".concat(_ctx.activeSiteId) === "".concat(site.idsite))]]); - }), 128))]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", SiteSelectorvue_type_template_id_0ec42be5_hoisted_12, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", SiteSelectorvue_type_template_id_0ec42be5_hoisted_13, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", SiteSelectorvue_type_template_id_0ec42be5_hoisted_14, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_NotFound') + ' ' + _ctx.searchTerm), 1)])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !_ctx.sites.length && _ctx.searchTerm]])]), _ctx.allSitesLocation === 'bottom' && _ctx.showAllSitesItem ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_15, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_AllSitesLink, { + }, null, 8, SiteSelectorvue_type_template_id_c62be528_hoisted_11)], 8, SiteSelectorvue_type_template_id_c62be528_hoisted_10)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !(!_ctx.showSelectedSite && "".concat(_ctx.activeSiteId) === "".concat(site.idsite))]]); + }), 128))]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", SiteSelectorvue_type_template_id_c62be528_hoisted_12, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", SiteSelectorvue_type_template_id_c62be528_hoisted_13, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", SiteSelectorvue_type_template_id_c62be528_hoisted_14, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_NotFound') + ' ' + _ctx.searchTerm), 1)])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !_ctx.sites.length && _ctx.searchTerm]])]), _ctx.allSitesLocation === 'bottom' && _ctx.showAllSitesItem ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_15, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_AllSitesLink, { href: _ctx.urlAllSites, "all-sites-text": _ctx.allSitesText, onClick: _cache[8] || (_cache[8] = function ($event) { @@ -5962,7 +5962,7 @@ function SiteSelectorvue_type_template_id_0ec42be5_render(_ctx, _cache, $props, blur: _ctx.onBlur }]]); } -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/SiteSelector/SiteSelector.vue?vue&type=template&id=0ec42be5 +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/SiteSelector/SiteSelector.vue?vue&type=template&id=c62be528 // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/SiteSelector/AllSitesLink.vue?vue&type=template&id=45607d28 @@ -6053,11 +6053,13 @@ var SitesStore_SitesStore = /*#__PURE__*/function () { value: function loadInitialSites() { var _this2 = this; + var onlySitesWithAdminAccess = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + if (this.state.isInitialized) { return Promise.resolve(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["readonly"])(this.state.initialSites)); } - return this.searchSite('%').then(function (sites) { + return this.searchSite('%', onlySitesWithAdminAccess).then(function (sites) { _this2.state.isInitialized = true; if (sites !== null) { @@ -6425,7 +6427,7 @@ function debounce(fn) { loadInitialSites: function loadInitialSites() { var _this2 = this; - return SiteSelector_SitesStore.loadInitialSites().then(function (sites) { + return SiteSelector_SitesStore.loadInitialSites(this.onlySitesWithAdminAccess).then(function (sites) { _this2.sites = sites || []; }); }, @@ -6464,7 +6466,7 @@ function debounce(fn) { -SiteSelectorvue_type_script_lang_ts.render = SiteSelectorvue_type_template_id_0ec42be5_render +SiteSelectorvue_type_script_lang_ts.render = SiteSelectorvue_type_template_id_c62be528_render /* harmony default export */ var SiteSelector = (SiteSelectorvue_type_script_lang_ts); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/SiteSelector/SiteSelector.adapter.ts diff --git a/plugins/CoreHome/vue/dist/CoreHome.umd.min.js b/plugins/CoreHome/vue/dist/CoreHome.umd.min.js index 2029ad2a9e..c058909a14 100644 --- a/plugins/CoreHome/vue/dist/CoreHome.umd.min.js +++ b/plugins/CoreHome/vue/dist/CoreHome.umd.min.js @@ -330,7 +330,7 @@ function On(e){return{restrict:"A",priority:10,link:function(t,n,r){var i={insta * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */var qi=function(){function e(){var t=this;_i(this,e),Ui(this,"state",Object(o["reactive"])({initialSites:[],isInitialized:!1})),Ui(this,"currentRequestAbort",null),Ui(this,"limitRequest",void 0),Ui(this,"initialSites",Object(o["computed"])((function(){return Object(o["readonly"])(t.state.initialSites)})))}return Hi(e,[{key:"loadInitialSites",value:function(){var e=this;return this.state.isInitialized?Promise.resolve(Object(o["readonly"])(this.state.initialSites)):this.searchSite("%").then((function(t){return e.state.isInitialized=!0,null!==t&&(e.state.initialSites=t),t}))}},{key:"loadSite",value:function(e){"all"===e?Ee.updateUrl(Object.assign(Object.assign({},Ee.urlParsed.value),{},{module:"MultiSites",action:"index",date:Ee.parsed.value.date,period:Ee.parsed.value.period})):Ee.updateUrl(Object.assign(Object.assign({},Ee.urlParsed.value),{},{segment:"",idSite:e}),Object.assign(Object.assign({},Ee.hashParsed.value),{},{segment:"",idSite:e}))}},{key:"searchSite",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e?(this.currentRequestAbort&&this.currentRequestAbort.abort(),this.limitRequest||(this.limitRequest=Ze.fetch({method:"SitesManager.getNumWebsitesToDisplayPerPage"})),this.limitRequest.then((function(r){var i=r.value,o="SitesManager.getPatternMatchSites";return n&&(o="SitesManager.getSitesWithAdminAccess"),t.currentRequestAbort=new AbortController,Ze.fetch({method:o,limit:i,pattern:e},{abortController:t.currentRequestAbort})})).then((function(e){return e?t.processWebsitesList(e):null})).finally((function(){t.currentRequestAbort=null}))):this.loadInitialSites()}},{key:"processWebsitesList",value:function(e){var t=e;return t&&t.length?(t=t.map((function(e){return Object.assign(Object.assign({},e),{},{name:e.group?"[".concat(e.group,"] ").concat(e.name):e.name})})),t.sort((function(e,t){return e.name.toLowerCase()<t.name.toLowerCase()?-1:e.name.toLowerCase()>t.name.toLowerCase()?1:0})),t):[]}}]),e}(),Wi=new qi,Ji=300;function Gi(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ji;return function(){for(var r=this,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];t&&clearTimeout(t),t=setTimeout((function(){e.call.apply(e,[r].concat(o))}),n)}}var zi=Object(o["defineComponent"])({props:{modelValue:Object,showSelectedSite:{type:Boolean,default:!1},showAllSitesItem:{type:Boolean,default:!0},switchSiteOnSelect:{type:Boolean,default:!0},onlySitesWithAdminAccess:{type:Boolean,default:!1},name:{type:String,default:""},allSitesText:{type:String,default:C("General_MultiSitesSummary")},allSitesLocation:{type:String,default:"bottom"},placeholder:String,defaultToFirstSite:Boolean},emits:["update:modelValue","blur"],components:{AllSitesLink:Fi},directives:{FocusAnywhereButHere:xt,FocusIf:Rt},watch:{searchTerm:function(){this.onSearchTermChanged()}},data:function(){return{searchTerm:"",activeSiteId:"".concat(S.idSite),showSitesList:!1,isLoading:!1,sites:[],autocompleteMinSites:parseInt(S.config.autocomplete_min_sites,10)}},created:function(){this.searchSite=Gi(this.searchSite),!this.modelValue&&S.idSite&&this.$emit("update:modelValue",{id:S.idSite,name:S.helper.htmlDecode(S.siteName)})},mounted:function(){var e=this;window.initTopControls(),this.loadInitialSites().then((function(){e.shouldDefaultToFirstSite&&e.$emit("update:modelValue",{id:e.sites[0].idsite,name:e.sites[0].name})}));var t=C("CoreHome_ShortcutWebsiteSelector");S.helper.registerShortcut("w",t,(function(t){if(!t.altKey){t.preventDefault?t.preventDefault():t.returnValue=!1;var n=e.$refs.selectorLink;n&&(n.click(),n.focus())}}))},computed:{shouldFocusOnSearch:function(){return this.showSitesList&&this.autocompleteMinSites<=this.sites.length||this.searchTerm},selectorLinkTitle:function(){var e;return this.hasMultipleSites?C("CoreHome_ChangeCurrentWebsite",(null===(e=this.modelValue)||void 0===e?void 0:e.name)||this.firstSiteName):""},hasMultipleSites:function(){return Wi.initialSites.value&&Wi.initialSites.value.length>1},firstSiteName:function(){var e=Wi.initialSites.value;return e&&e.length>0?e[0].name:""},urlAllSites:function(){var e=Ee.stringify(Object.assign(Object.assign({},Ee.urlParsed.value),{},{module:"MultiSites",action:"index",date:Ee.parsed.value.date,period:Ee.parsed.value.period}));return"?".concat(e)},shouldDefaultToFirstSite:function(){var e;return!(null!==(e=this.modelValue)&&void 0!==e&&e.id)&&(!this.hasMultipleSites||this.defaultToFirstSite)&&this.sites[0]},displayedModelValue:function(){return this.modelValue?this.modelValue:S.idSite?{id:S.idSite,name:S.helper.htmlDecode(S.siteName)}:this.shouldDefaultToFirstSite?{id:this.sites[0].idsite,name:this.sites[0].name}:null}},methods:{onSearchTermChanged:function(){this.searchTerm?(this.isLoading=!0,this.searchSite(this.searchTerm)):(this.isLoading=!1,this.loadInitialSites())},onAllSitesClick:function(e){this.switchSite({id:"all",name:this.$props.allSitesText},e),this.showSitesList=!1},switchSite:function(e,t){var n=-1!==navigator.userAgent.indexOf("Mac OS X")?t.metaKey:t.ctrlKey;t&&n&&t.target&&t.target.href?window.open(t.target.href,"_blank"):(this.$emit("update:modelValue",{id:e.id,name:e.name}),this.switchSiteOnSelect&&this.activeSiteId!==e.id&&Wi.loadSite(e.id))},onBlur:function(){this.showSitesList=!1,this.$emit("blur")},onClickSelector:function(){this.hasMultipleSites&&(this.showSitesList=!this.showSitesList,this.isLoading||this.searchTerm||this.loadInitialSites())},onPressEnter:function(e){"Enter"===e.key&&(e.preventDefault(),this.showSitesList=!this.showSitesList,this.showSitesList&&!this.isLoading&&this.loadInitialSites())},getMatchedSiteName:function(e){var t=e.toUpperCase().indexOf(this.searchTerm.toUpperCase());if(-1===t||this.isLoading)return S.helper.htmlEntities(e);var n=S.helper.htmlEntities(e.substring(0,t)),r=S.helper.htmlEntities(e.substring(t+this.searchTerm.length));return"".concat(n,'<span class="autocompleteMatched">').concat(this.searchTerm,"</span>").concat(r)},loadInitialSites:function(){var e=this;return Wi.loadInitialSites().then((function(t){e.sites=t||[]}))},searchSite:function(e){var t=this;this.isLoading=!0,Wi.searchSite(e,this.onlySitesWithAdminAccess).then((function(n){e===t.searchTerm&&n&&(t.sites=n)})).finally((function(){t.isLoading=!1}))},getUrlForSiteId:function(e){var t=Ee.stringify(Object.assign(Object.assign({},Ee.urlParsed.value),{},{segment:"",idSite:e})),n=Ee.stringify(Object.assign(Object.assign({},Ee.hashParsed.value),{},{segment:"",idSite:e}));return"?".concat(t,"#?").concat(n)}}});zi.render=xi;var Yi=zi; + */var qi=function(){function e(){var t=this;_i(this,e),Ui(this,"state",Object(o["reactive"])({initialSites:[],isInitialized:!1})),Ui(this,"currentRequestAbort",null),Ui(this,"limitRequest",void 0),Ui(this,"initialSites",Object(o["computed"])((function(){return Object(o["readonly"])(t.state.initialSites)})))}return Hi(e,[{key:"loadInitialSites",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.state.isInitialized?Promise.resolve(Object(o["readonly"])(this.state.initialSites)):this.searchSite("%",t).then((function(t){return e.state.isInitialized=!0,null!==t&&(e.state.initialSites=t),t}))}},{key:"loadSite",value:function(e){"all"===e?Ee.updateUrl(Object.assign(Object.assign({},Ee.urlParsed.value),{},{module:"MultiSites",action:"index",date:Ee.parsed.value.date,period:Ee.parsed.value.period})):Ee.updateUrl(Object.assign(Object.assign({},Ee.urlParsed.value),{},{segment:"",idSite:e}),Object.assign(Object.assign({},Ee.hashParsed.value),{},{segment:"",idSite:e}))}},{key:"searchSite",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e?(this.currentRequestAbort&&this.currentRequestAbort.abort(),this.limitRequest||(this.limitRequest=Ze.fetch({method:"SitesManager.getNumWebsitesToDisplayPerPage"})),this.limitRequest.then((function(r){var i=r.value,o="SitesManager.getPatternMatchSites";return n&&(o="SitesManager.getSitesWithAdminAccess"),t.currentRequestAbort=new AbortController,Ze.fetch({method:o,limit:i,pattern:e},{abortController:t.currentRequestAbort})})).then((function(e){return e?t.processWebsitesList(e):null})).finally((function(){t.currentRequestAbort=null}))):this.loadInitialSites()}},{key:"processWebsitesList",value:function(e){var t=e;return t&&t.length?(t=t.map((function(e){return Object.assign(Object.assign({},e),{},{name:e.group?"[".concat(e.group,"] ").concat(e.name):e.name})})),t.sort((function(e,t){return e.name.toLowerCase()<t.name.toLowerCase()?-1:e.name.toLowerCase()>t.name.toLowerCase()?1:0})),t):[]}}]),e}(),Wi=new qi,Ji=300;function Gi(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ji;return function(){for(var r=this,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];t&&clearTimeout(t),t=setTimeout((function(){e.call.apply(e,[r].concat(o))}),n)}}var zi=Object(o["defineComponent"])({props:{modelValue:Object,showSelectedSite:{type:Boolean,default:!1},showAllSitesItem:{type:Boolean,default:!0},switchSiteOnSelect:{type:Boolean,default:!0},onlySitesWithAdminAccess:{type:Boolean,default:!1},name:{type:String,default:""},allSitesText:{type:String,default:C("General_MultiSitesSummary")},allSitesLocation:{type:String,default:"bottom"},placeholder:String,defaultToFirstSite:Boolean},emits:["update:modelValue","blur"],components:{AllSitesLink:Fi},directives:{FocusAnywhereButHere:xt,FocusIf:Rt},watch:{searchTerm:function(){this.onSearchTermChanged()}},data:function(){return{searchTerm:"",activeSiteId:"".concat(S.idSite),showSitesList:!1,isLoading:!1,sites:[],autocompleteMinSites:parseInt(S.config.autocomplete_min_sites,10)}},created:function(){this.searchSite=Gi(this.searchSite),!this.modelValue&&S.idSite&&this.$emit("update:modelValue",{id:S.idSite,name:S.helper.htmlDecode(S.siteName)})},mounted:function(){var e=this;window.initTopControls(),this.loadInitialSites().then((function(){e.shouldDefaultToFirstSite&&e.$emit("update:modelValue",{id:e.sites[0].idsite,name:e.sites[0].name})}));var t=C("CoreHome_ShortcutWebsiteSelector");S.helper.registerShortcut("w",t,(function(t){if(!t.altKey){t.preventDefault?t.preventDefault():t.returnValue=!1;var n=e.$refs.selectorLink;n&&(n.click(),n.focus())}}))},computed:{shouldFocusOnSearch:function(){return this.showSitesList&&this.autocompleteMinSites<=this.sites.length||this.searchTerm},selectorLinkTitle:function(){var e;return this.hasMultipleSites?C("CoreHome_ChangeCurrentWebsite",(null===(e=this.modelValue)||void 0===e?void 0:e.name)||this.firstSiteName):""},hasMultipleSites:function(){return Wi.initialSites.value&&Wi.initialSites.value.length>1},firstSiteName:function(){var e=Wi.initialSites.value;return e&&e.length>0?e[0].name:""},urlAllSites:function(){var e=Ee.stringify(Object.assign(Object.assign({},Ee.urlParsed.value),{},{module:"MultiSites",action:"index",date:Ee.parsed.value.date,period:Ee.parsed.value.period}));return"?".concat(e)},shouldDefaultToFirstSite:function(){var e;return!(null!==(e=this.modelValue)&&void 0!==e&&e.id)&&(!this.hasMultipleSites||this.defaultToFirstSite)&&this.sites[0]},displayedModelValue:function(){return this.modelValue?this.modelValue:S.idSite?{id:S.idSite,name:S.helper.htmlDecode(S.siteName)}:this.shouldDefaultToFirstSite?{id:this.sites[0].idsite,name:this.sites[0].name}:null}},methods:{onSearchTermChanged:function(){this.searchTerm?(this.isLoading=!0,this.searchSite(this.searchTerm)):(this.isLoading=!1,this.loadInitialSites())},onAllSitesClick:function(e){this.switchSite({id:"all",name:this.$props.allSitesText},e),this.showSitesList=!1},switchSite:function(e,t){var n=-1!==navigator.userAgent.indexOf("Mac OS X")?t.metaKey:t.ctrlKey;t&&n&&t.target&&t.target.href?window.open(t.target.href,"_blank"):(this.$emit("update:modelValue",{id:e.id,name:e.name}),this.switchSiteOnSelect&&this.activeSiteId!==e.id&&Wi.loadSite(e.id))},onBlur:function(){this.showSitesList=!1,this.$emit("blur")},onClickSelector:function(){this.hasMultipleSites&&(this.showSitesList=!this.showSitesList,this.isLoading||this.searchTerm||this.loadInitialSites())},onPressEnter:function(e){"Enter"===e.key&&(e.preventDefault(),this.showSitesList=!this.showSitesList,this.showSitesList&&!this.isLoading&&this.loadInitialSites())},getMatchedSiteName:function(e){var t=e.toUpperCase().indexOf(this.searchTerm.toUpperCase());if(-1===t||this.isLoading)return S.helper.htmlEntities(e);var n=S.helper.htmlEntities(e.substring(0,t)),r=S.helper.htmlEntities(e.substring(t+this.searchTerm.length));return"".concat(n,'<span class="autocompleteMatched">').concat(this.searchTerm,"</span>").concat(r)},loadInitialSites:function(){var e=this;return Wi.loadInitialSites(this.onlySitesWithAdminAccess).then((function(t){e.sites=t||[]}))},searchSite:function(e){var t=this;this.isLoading=!0,Wi.searchSite(e,this.onlySitesWithAdminAccess).then((function(n){e===t.searchTerm&&n&&(t.sites=n)})).finally((function(){t.isLoading=!1}))},getUrlForSiteId:function(e){var t=Ee.stringify(Object.assign(Object.assign({},Ee.urlParsed.value),{},{segment:"",idSite:e})),n=Ee.stringify(Object.assign(Object.assign({},Ee.hashParsed.value),{},{segment:"",idSite:e}));return"?".concat(t,"#?").concat(n)}}});zi.render=xi;var Yi=zi; /*! * Matomo - free/libre analytics platform * diff --git a/plugins/CoreHome/vue/src/SiteSelector/SiteSelector.vue b/plugins/CoreHome/vue/src/SiteSelector/SiteSelector.vue index a2f3f95360..41d66f7601 100644 --- a/plugins/CoreHome/vue/src/SiteSelector/SiteSelector.vue +++ b/plugins/CoreHome/vue/src/SiteSelector/SiteSelector.vue @@ -361,7 +361,7 @@ export default defineComponent({ return `${previousPart}<span class="autocompleteMatched">${this.searchTerm}</span>${lastPart}`; }, loadInitialSites() { - return SitesStore.loadInitialSites().then((sites) => { + return SitesStore.loadInitialSites(this.onlySitesWithAdminAccess).then((sites) => { this.sites = sites || []; }); }, diff --git a/plugins/CoreHome/vue/src/SiteSelector/SitesStore.ts b/plugins/CoreHome/vue/src/SiteSelector/SitesStore.ts index 4a45b37799..536103494e 100644 --- a/plugins/CoreHome/vue/src/SiteSelector/SitesStore.ts +++ b/plugins/CoreHome/vue/src/SiteSelector/SitesStore.ts @@ -32,12 +32,12 @@ class SitesStore { public readonly initialSites = computed(() => readonly(this.state.initialSites)); - loadInitialSites(): Promise<DeepReadonly<Site[]>|null> { + loadInitialSites(onlySitesWithAdminAccess = false): Promise<DeepReadonly<Site[]>|null> { if (this.state.isInitialized) { return Promise.resolve(readonly(this.state.initialSites)); } - return this.searchSite('%').then((sites) => { + return this.searchSite('%', onlySitesWithAdminAccess).then((sites) => { this.state.isInitialized = true; if (sites !== null) { this.state.initialSites = sites; diff --git a/plugins/CorePluginsAdmin/Controller.php b/plugins/CorePluginsAdmin/Controller.php index 32d7ed4851..24d109b638 100644 --- a/plugins/CorePluginsAdmin/Controller.php +++ b/plugins/CorePluginsAdmin/Controller.php @@ -205,6 +205,9 @@ class Controller extends Plugin\ControllerAdmin $view = $this->configureView('@CorePluginsAdmin/' . $template); + $this->securityPolicy->addPolicy('img-src', '*.matomo.org'); + $this->securityPolicy->addPolicy('default-src', '*.matomo.org'); + $view->updateNonce = Nonce::getNonce(MarketplaceController::UPDATE_NONCE); $view->activateNonce = Nonce::getNonce(static::ACTIVATE_NONCE); $view->uninstallNonce = Nonce::getNonce(static::UNINSTALL_NONCE); diff --git a/plugins/UsersManager/tests/UI/UsersManager_spec.js b/plugins/UsersManager/tests/UI/UsersManager_spec.js index 52ff9e2246..75a0e9a697 100644 --- a/plugins/UsersManager/tests/UI/UsersManager_spec.js +++ b/plugins/UsersManager/tests/UI/UsersManager_spec.js @@ -234,7 +234,10 @@ describe("UsersManager", function () { const modal = await page.waitForSelector('.modal.open', { visible: true }); await page.focus('.modal.open #currentUserPassword'); await page.waitForTimeout(250); - expect(await modal.screenshot()).to.matchImage('invite_confirm'); + expect(await modal.screenshot()).to.matchImage({ + imageName: 'invite_confirm', + comparisonThreshold: 0.025 + }); }); it('should show the edit user form when user has been invited', async function () { @@ -564,7 +567,7 @@ describe("UsersManager", function () { await (await page.jQuery('.resend-invite-confirm-modal .modal-close:not(.modal-no):visible')).click(); await page.waitForSelector('#notificationContainer .notification'); await page.waitForNetworkIdle(); - expect(await page.screenshotSelector('.usersManager, #notificationContainer .notification')).to.matchImage('resend_success'); + expect(await page.screenshotSelector('#notificationContainer .notification')).to.matchImage('resend_success'); }); diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_resend_success.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_resend_success.png index 624c0abd58..9fcda34574 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_resend_success.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_resend_success.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0956675e38a3ce34f49164629ad353014bf36964c5ec286f673cb74a0bf412fe -size 187399 +oid sha256:af4f5be1fc93e7cd36bc800dba847a9b7ef401507d3c0560c7fe2284954bcb17 +size 6769 diff --git a/tests/PHPUnit/Integration/Tracker/ActionTest.php b/tests/PHPUnit/Integration/Tracker/ActionTest.php index afb43e806e..5031d91597 100644 --- a/tests/PHPUnit/Integration/Tracker/ActionTest.php +++ b/tests/PHPUnit/Integration/Tracker/ActionTest.php @@ -170,6 +170,37 @@ class ActionTest extends IntegrationTestCase $this->assertEquals($filteredUrl[0], PageUrl::excludeQueryParametersFromUrl($url, $idSite)); } + public function getTestAdvertisingClickIdUrls() + { + return [ + ['https://www.example.com?gclid=1234', 'https://www.example.com'], + ['https://www.example.com?fbclid=1234', 'https://www.example.com'], + ['https://www.example.com?msclkid=1234', 'https://www.example.com'], + ['https://www.example.com?yclid=1234', 'https://www.example.com'], + ['https://www.example.com/path1?gclid=1234', 'https://www.example.com/path1'], + ['https://www.example.com/path2?fbclid=1234', 'https://www.example.com/path2'], + ['https://www.example.com/path3?msclkid=1234', 'https://www.example.com/path3'], + ['https://www.example.com/path4?yclid=1234', 'https://www.example.com/path4'], + ['https://www.example.com?random=1234', 'https://www.example.com?random=1234'], + ['https://www.example.com?random=1234&yclid=qwerty', 'https://www.example.com?random=1234'], + ]; + } + + /** + * No excluded query parameters specified, apart from the standard "session" parameters, always excluded + * + * @dataProvider getTestAdvertisingClickIdUrls + */ + public function testExcludeQueryParametersAdvertisingClickIds($url, $filteredUrl) + { + $this->setUpRootAccess(); + $idSite = API::getInstance()->addSite("site1", array('http://example.org'), $ecommerce = 0, + $siteSearch = 1, $searchKeywordParameters = null, $searchCategoryParameters = null, + $excludedIps = '', $excludedQueryParameters = '', $timezone = null, $currency = null, + $group = null, $startDate = null, $excludedUserAgents = null, $keepURLFragments = 1); + $this->assertEquals($filteredUrl, PageUrl::excludeQueryParametersFromUrl($url, $idSite)); + } + public function getTestUrlsHashtag() { $urls = array( diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_admin_diagnostics_configfile.png b/tests/UI/expected-screenshots/UIIntegrationTest_admin_diagnostics_configfile.png index db5f9c01cb..a7fe494209 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_admin_diagnostics_configfile.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_admin_diagnostics_configfile.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8070b7f6ca8a558942190f28c4bb5c5d53aa36e0411b06a25afab0dffc26d2b6 -size 5237083 +oid sha256:c21000b35f17b1990557090297b7817cc13f0b29e8e2dcbd1e0b966bdede9337 +size 5236295 |