diff options
author | dizzy <diosmosis@users.noreply.github.com> | 2022-05-25 03:39:57 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-25 03:39:57 +0300 |
commit | 023676b4edbcc501d2659fcfaaeeff22fb8931e5 (patch) | |
tree | 6a878d2f64050f69a9120208a78bbac1c09ef29c /plugins/CoreHome | |
parent | 6fdb64ae3ee6d3a790bf6d7a832f82784496c9f7 (diff) |
make sure segment is not double encoded in sparkline url (#19260)
Diffstat (limited to 'plugins/CoreHome')
-rw-r--r-- | plugins/CoreHome/vue/dist/CoreHome.umd.js | 18 | ||||
-rw-r--r-- | plugins/CoreHome/vue/dist/CoreHome.umd.min.js | 2 | ||||
-rw-r--r-- | plugins/CoreHome/vue/src/Sparkline/Sparkline.vue | 4 |
3 files changed, 16 insertions, 8 deletions
diff --git a/plugins/CoreHome/vue/dist/CoreHome.umd.js b/plugins/CoreHome/vue/dist/CoreHome.umd.js index 42354451cf..15c432b01c 100644 --- a/plugins/CoreHome/vue/dist/CoreHome.umd.js +++ b/plugins/CoreHome/vue/dist/CoreHome.umd.js @@ -11491,15 +11491,15 @@ function piwikReportExport($timeout) { } piwikReportExport.$inject = ['$timeout']; window.angular.module('piwikApp').directive('piwikReportExport', piwikReportExport); -// 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/Sparkline/Sparkline.vue?vue&type=template&id=693cd955 +// 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/Sparkline/Sparkline.vue?vue&type=template&id=25e2c9f0 -var Sparklinevue_type_template_id_693cd955_hoisted_1 = ["src"]; -function Sparklinevue_type_template_id_693cd955_render(_ctx, _cache, $props, $setup, $data, $options) { +var Sparklinevue_type_template_id_25e2c9f0_hoisted_1 = ["src"]; +function Sparklinevue_type_template_id_25e2c9f0_render(_ctx, _cache, $props, $setup, $data, $options) { return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("img", { src: _ctx.sparklineUrl - }, null, 8, Sparklinevue_type_template_id_693cd955_hoisted_1); + }, null, 8, Sparklinevue_type_template_id_25e2c9f0_hoisted_1); } -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Sparkline/Sparkline.vue?vue&type=template&id=693cd955 +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Sparkline/Sparkline.vue?vue&type=template&id=25e2c9f0 // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./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/Sparkline/Sparkline.vue?vue&type=script&lang=ts @@ -11541,7 +11541,11 @@ function Sparklinevue_type_template_id_693cd955_render(_ctx, _cache, $props, $se showtitle: '1', colors: colors, random: Date.now(), - date: this.defaultDate + date: this.defaultDate, + // mixinDefaultGetParams() will use the raw, encoded value from the URL (legacy behavior), + // which means MatomoUrl.stringify() will end up double encoding it if we don't set it + // ourselves here. + segment: src_MatomoUrl_MatomoUrl.parsed.value.segment }; var helper = new AjaxHelper_AjaxHelper(); var urlParams = helper.mixinDefaultGetParams(Object.assign(Object.assign({}, defaultParams), params)); // Append the token_auth to the URL if it was set (eg. embed dashboard) @@ -11578,7 +11582,7 @@ function Sparklinevue_type_template_id_693cd955_render(_ctx, _cache, $props, $se -Sparklinevue_type_script_lang_ts.render = Sparklinevue_type_template_id_693cd955_render +Sparklinevue_type_script_lang_ts.render = Sparklinevue_type_template_id_25e2c9f0_render /* harmony default export */ var Sparkline = (Sparklinevue_type_script_lang_ts); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Sparkline/Sparkline.adapter.ts diff --git a/plugins/CoreHome/vue/dist/CoreHome.umd.min.js b/plugins/CoreHome/vue/dist/CoreHome.umd.min.js index 1cdbf9308e..e1908bf9b7 100644 --- a/plugins/CoreHome/vue/dist/CoreHome.umd.min.js +++ b/plugins/CoreHome/vue/dist/CoreHome.umd.min.js @@ -510,7 +510,7 @@ window.angular.module("piwikApp.service").factory("reportMetadataModel",(functio * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -function Zs(e){return{restrict:"A",scope:{reportTitle:"@",requestParams:"@",reportFormats:"@",apiMethod:"@",maxFilterLimit:"@"},link:function(t,n){var r={instance:null,value:{reportTitle:t.reportTitle,requestParams:t.requestParams,reportFormats:"string"===typeof t.reportFormats?JSON.parse(t.reportFormats):t.reportFormats,apiMethod:t.apiMethod,maxFilterLimit:parseInt(t.maxFilterLimit,10),onClose:function(){e((function(){window.angular.element(document).injector().get("$rootScope").$apply()}),10)}},oldValue:null,modifiers:{},dir:{}};Xs.mounted(n[0],r)}}}Zs.$inject=["$timeout"],window.angular.module("piwikApp").directive("piwikReportExport",Zs);var eu=["src"];function tu(e,t,n,r,i,o){return Object(a["openBlock"])(),Object(a["createElementBlock"])("img",{src:e.sparklineUrl},null,8,eu)}var nu=Object(a["defineComponent"])({props:{seriesIndices:Array,params:Object},data:function(){return{isWidget:!1}},mounted:function(){this.isWidget=!!this.$el.closest("[widgetId]")},computed:{sparklineUrl:function(){var e=this.seriesIndices,t=this.params,n=S.getSparklineColors();e&&(n.lineColor=n.lineColor.filter((function(t,n){return-1!==e.indexOf(n)})));var r=JSON.stringify(n),i={forceView:"1",viewDataTable:"sparkline",widget:this.isWidget?"1":"0",showtitle:"1",colors:r,random:Date.now(),date:this.defaultDate},a=new Ze,o=a.mixinDefaultGetParams(Object.assign(Object.assign({},i),t)),l=Ee.parsed.value.token_auth;return l&&l.length&&S.shouldPropagateTokenAuth&&(o.token_auth=l),"?".concat(Ee.stringify(o))},defaultDate:function(){if("range"===S.period)return"".concat(S.startDateString,",").concat(S.endDateString);var e=H.getLastNRange(S.period,30,S.currentDateString).getDateRange(),t=new Date(S.minDateYear,S.minDateMonth-1,S.minDateDay);e[0]<t&&(e[0]=t);var n=D(e[0]),r=D(e[1]);return"".concat(n,",").concat(r)}}});nu.render=tu;var ru=nu,iu=(kt({component:ru,scope:{seriesIndices:{angularJsBind:"<"},params:{angularJsBind:"<"}},directiveName:"piwikSparkline",restrict:"E"}),{class:"progressbar"}),au={class:"progress"},ou=Object(a["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",style:{"margin-right":"3.5px"}},null,-1),lu=["innerHTML"]; +function Zs(e){return{restrict:"A",scope:{reportTitle:"@",requestParams:"@",reportFormats:"@",apiMethod:"@",maxFilterLimit:"@"},link:function(t,n){var r={instance:null,value:{reportTitle:t.reportTitle,requestParams:t.requestParams,reportFormats:"string"===typeof t.reportFormats?JSON.parse(t.reportFormats):t.reportFormats,apiMethod:t.apiMethod,maxFilterLimit:parseInt(t.maxFilterLimit,10),onClose:function(){e((function(){window.angular.element(document).injector().get("$rootScope").$apply()}),10)}},oldValue:null,modifiers:{},dir:{}};Xs.mounted(n[0],r)}}}Zs.$inject=["$timeout"],window.angular.module("piwikApp").directive("piwikReportExport",Zs);var eu=["src"];function tu(e,t,n,r,i,o){return Object(a["openBlock"])(),Object(a["createElementBlock"])("img",{src:e.sparklineUrl},null,8,eu)}var nu=Object(a["defineComponent"])({props:{seriesIndices:Array,params:Object},data:function(){return{isWidget:!1}},mounted:function(){this.isWidget=!!this.$el.closest("[widgetId]")},computed:{sparklineUrl:function(){var e=this.seriesIndices,t=this.params,n=S.getSparklineColors();e&&(n.lineColor=n.lineColor.filter((function(t,n){return-1!==e.indexOf(n)})));var r=JSON.stringify(n),i={forceView:"1",viewDataTable:"sparkline",widget:this.isWidget?"1":"0",showtitle:"1",colors:r,random:Date.now(),date:this.defaultDate,segment:Ee.parsed.value.segment},a=new Ze,o=a.mixinDefaultGetParams(Object.assign(Object.assign({},i),t)),l=Ee.parsed.value.token_auth;return l&&l.length&&S.shouldPropagateTokenAuth&&(o.token_auth=l),"?".concat(Ee.stringify(o))},defaultDate:function(){if("range"===S.period)return"".concat(S.startDateString,",").concat(S.endDateString);var e=H.getLastNRange(S.period,30,S.currentDateString).getDateRange(),t=new Date(S.minDateYear,S.minDateMonth-1,S.minDateDay);e[0]<t&&(e[0]=t);var n=D(e[0]),r=D(e[1]);return"".concat(n,",").concat(r)}}});nu.render=tu;var ru=nu,iu=(kt({component:ru,scope:{seriesIndices:{angularJsBind:"<"},params:{angularJsBind:"<"}},directiveName:"piwikSparkline",restrict:"E"}),{class:"progressbar"}),au={class:"progress"},ou=Object(a["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",style:{"margin-right":"3.5px"}},null,-1),lu=["innerHTML"]; /*! * Matomo - free/libre analytics platform * diff --git a/plugins/CoreHome/vue/src/Sparkline/Sparkline.vue b/plugins/CoreHome/vue/src/Sparkline/Sparkline.vue index 37f9008d0e..869d26dc09 100644 --- a/plugins/CoreHome/vue/src/Sparkline/Sparkline.vue +++ b/plugins/CoreHome/vue/src/Sparkline/Sparkline.vue @@ -51,6 +51,10 @@ export default defineComponent({ colors, random: Date.now(), date: this.defaultDate, + // mixinDefaultGetParams() will use the raw, encoded value from the URL (legacy behavior), + // which means MatomoUrl.stringify() will end up double encoding it if we don't set it + // ourselves here. + segment: MatomoUrl.parsed.value.segment as string, }; const helper = new AjaxHelper(); |