From 21500757635b981fdb17e4b994ed754eb9829f0f Mon Sep 17 00:00:00 2001 From: kentico-timothyf Date: Thu, 31 Aug 2017 11:38:51 -0400 Subject: [PATCH 1/2] Fixed incorrect canonical url, fixed domain alias checks to allow all subdomains Fixed incorrect canonical url by adding in a check for DocumentUrlPath, if it is set it will use this instead, if not it will use CurrentAliasPath. fixed domain alias checks to allow all subdomains, updated the regex to be more open about subdomains and sub-subdomains... --- .../acceleratedmobilepages.ampfilter.xml | Bin 11680 -> 11680 bytes .../kentico.acceleratedmobilepages.xml | Bin 1150 -> 1238 bytes ...tico.acceleratedmobilepages@30dea1a025.xml | Bin 1030 -> 1022 bytes .../cms.settingskey/ampfilterdomainalias.xml | Bin 2286 -> 2100 bytes Kentico.AcceleratedMobilePages/AmpFilter.cs | 4 ++-- 5 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMS/App_Data/CIRepository/@global/cms.class/acceleratedmobilepages.ampfilter.xml b/CMS/App_Data/CIRepository/@global/cms.class/acceleratedmobilepages.ampfilter.xml index d31197ca33ed4d0af45bf2a7329ac860a7e52165..e3f0d6f7d48607ae4fe2c83c673f37ed5a01c120 100644 GIT binary patch delta 299 zcmY+9y$!-J6ojuMEfF1}q<0eM$FoE!lGxb-g&kNRBOuW*0Anx=-%E!qzdPT%_v5YK z`sXQMX9X>)HL6qvFX2I6NiAC9J#zywkoPLo?fwWimuaRZIs7dc(IRX?ExBF|J!@3U zj^wPbqmPrzbk$9RhR1lgyx#deTNf%D=0zsf;7o^w+6nB4wn2x(!yPZ%+2eBiWZS1E jZ~w5^a%^U#!cj3ZyMUEo1==PFeZpss>VKo}`E&dM*d{Nv delta 299 zcmY+8y$u2}429isEhjoeNgqfqA+wyWaPDUd1Us<6jetbM0F1#fd`^d=#Lw23=ePE2 z|J=1Vl_FV!co`*9qa>M`Oz4r<$yu~2WqLtnZih0`CKD&3GOvd&@CoIZEB(ST((|jp z7yKhLqjDohxym5JLpO)lyS+CgQdskHm2}i3CmfXCvZU(a>+Xe|mNh^WTy1AY1%4Ga erdlntuR9BgEL{gbqarSzs`TbG|0nwHKiePDi!oUM diff --git a/CMS/App_Data/CIRepository/@global/cms.resource/kentico.acceleratedmobilepages.xml b/CMS/App_Data/CIRepository/@global/cms.resource/kentico.acceleratedmobilepages.xml index dbb5c149fee922e83d3c6085bfdf97c476107670..40cbb5b2532642524a26d2ae226e8d26184543c6 100644 GIT binary patch delta 59 zcmeyzagB2W8_Q%JCIQJXhE#?khGK?HhJ1!R20I2r20aD?AU2x(kV%vmMRxK}=2ifs C0}d|$ delta 11 Scmcb{`Hy1*8_VQ4mI?qHvjhzQ diff --git a/CMS/App_Data/CIRepository/@global/cms.resourcesite/kentico.acceleratedmobilepages@30dea1a025.xml b/CMS/App_Data/CIRepository/@global/cms.resourcesite/kentico.acceleratedmobilepages@30dea1a025.xml index 6d490caf1152b181e89661d7df6ac92767d76023..0858ca08be3808d33785f707cecab80b5e5eda5a 100644 GIT binary patch delta 141 zcmZqU_{Y9MiAm6jA%`K6A&()OA($bPp@boIvN@BlD26D54TJvVLMGwK8<-SalNgK{ z41w5`A(g=ls9TpIjllp6bs0>6VkQj9Kru^(6tEgypgK#SXey9z0>qXK7C@XdIi68= M@*XCx$u`WV0Mc?B9{>OV delta 149 zcmeyz-o~*(iAmgrA(0`EA(o1%?WSJfKy&7={290@axU S9RYHj%H-edzLUK;mH+@HLLbcl delta 401 zcmdlY@J?{U1h#q&1_+F1NMz7usA6ygl2Ht?4Al&V47CiJ3^hP`>~h#e@#`=Enr?|~ zdOg^9RAJ%`hUr7q0TI<@h=*FF!(ayX3^rBuu|Pj+GQ=?GVfCjG14wf%Fch$9)&*Mt wQe(_u08|As1yvm=93k?cumpuo4nsaeGBB)j7&3sY;>n@x){L5y``MQQ04gCt*Z=?k diff --git a/Kentico.AcceleratedMobilePages/AmpFilter.cs b/Kentico.AcceleratedMobilePages/AmpFilter.cs index c0dc6f5..f719831 100644 --- a/Kentico.AcceleratedMobilePages/AmpFilter.cs +++ b/Kentico.AcceleratedMobilePages/AmpFilter.cs @@ -69,7 +69,7 @@ private string AppendAmpHtmlLink(string finalHtml) { string ampLink = (CMSHttpContext.Current.Request.IsSecureConnection ? Constants.P_HTTPS : Constants.P_HTTP) + SettingsKeyInfoProvider.GetValue(SiteContext.CurrentSiteName + ".AMPFilterDomainAlias") + - DocumentContext.CurrentAliasPath + + (DocumentContext.CurrentPageInfo.DocumentUrlPath ?? DocumentContext.CurrentAliasPath) + SettingsKeyInfoProvider.GetValue(SiteContext.CurrentSiteName + ".CMSFriendlyURLExtension"); string metaTag = String.Format(Constants.AMP_AMP_HTML_LINK, ampLink) + Constants.NEW_LINE; // Insert meta tag @@ -235,7 +235,7 @@ private string InsertCompulsoryMarkupAndCss(string finalHtml) // Create a link pointing to the regular HTML version of the page string canonicalLink = (CMSHttpContext.Current.Request.IsSecureConnection ? Constants.P_HTTPS : Constants.P_HTTP) + - SiteContext.CurrentSite.DomainName + DocumentContext.CurrentAliasPath + + SiteContext.CurrentSite.DomainName + (DocumentContext.CurrentPageInfo.DocumentUrlPath ?? DocumentContext.CurrentAliasPath) + SettingsKeyInfoProvider.GetValue(SiteContext.CurrentSiteName + ".CMSFriendlyURLExtension"); // Extend the tag with the compulsory markup and CSS styles From 787413448b1097d40b6475c07e30eeba33375297 Mon Sep 17 00:00:00 2001 From: kentico-timothyf Date: Thu, 31 Aug 2017 15:54:07 -0400 Subject: [PATCH 2/2] Update module version num --- .../kentico.acceleratedmobilepages.xml | Bin 1238 -> 1238 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/CMS/App_Data/CIRepository/@global/cms.resource/kentico.acceleratedmobilepages.xml b/CMS/App_Data/CIRepository/@global/cms.resource/kentico.acceleratedmobilepages.xml index 40cbb5b2532642524a26d2ae226e8d26184543c6..7c5fc2ce395f99e5e3a3bb98cb8d87d2c7b41fd2 100644 GIT binary patch delta 21 dcmcb{d5v>}9t)%K}9t)$<