プロジェクト

全般

プロフィール

QA #1227

奈良 裕記 さんがほぼ3年前に更新

h3. ■現象/要望 

 Redmine4.2にて、引数付きのimage_url表示が機能しなくなった 
 Matomoなどのアクセスログ解析にて、イメージトラッカーコードとして引数付きの画像URL利用する場合、 
 4.2ではその画像のアクセスが行われず、元のイメージタグが表示される。 

 例 
 <pre> 
 !https://unofficial-redmine.org/matomo/matomo.png?idsite=1&rec=1208! 
 </pre> 

 h3. ■解決策 

 調査中 

 下記が関連すると思われる。 
 lib/redmine/wiki_formatting/textile/redcloth3.rb  
 def inline_textile_link( text )  

 下記のSEC修正にて発生した可能性がある。 
 (SEC修正のため表示不可)    https://www.redmine.org/issues/32934 

 https://github.com/redmine/redmine/commit/895fc12d56c17a9f125e9ad591656281c5fda908#diff-7fd35a152b4d6f80a5c756100ef0ab7435852c04a2c473e9d8d0b016203b5a33 
 HOW DO I ENABLE TRACKING FOR VISITORS WHEN JAVASCRIPT CANNOT BE USED ON A PAGE (OR FOR VISITORS THAT HAVE DISABLED JAVASCRIPT)? 
 https://matomo.org/faq/how-to/faq_176/ 

 下記のrecとidsiteの両方が無いと、Matomo側は記録しない仕様の模様 
 > The following parameters can also be passed to the image URL: 
 > rec – (required) The parameter &rec=1 is required to force the request to be recorded 
 > idsite – (required) Defines the Website ID being tracked 

 <pre> 
 途中に半角の&が存在すると、イメージタグとみなされず、テキストで表示される? 

 テキスト表示される 
 !https://unofficial-redmine.org/matomo/matomo.php?rec=1227! 

 テキスト表示されない。idsiteが無いとmatomo側に記録されない仕様 

 !https://unofficial-redmine.org/matomo/matomo.php?rec=1227!  
 !https://unofficial-redmine.org/matomo/matomo.php?idsite=1&rec=1227!  
 
 !https://unofficial-redmine.org/matomo/matomo.php?idsite=1227! 
 </pre> 

 h3. ■対応状況 

 サーバ内のMatomo側ソースを弄って、idsite=1を常時指定された状態にし、recだけの指定で記録させればよいかな。 
 所詮unofficialcooking手元の環境が動作すれば良い訳で。。 
 (自サイトならimagetagの利用など不要だし) 

 matomoの変更点 
 core/Tracker/Request.php    getIdSiteUnverified() にて、強制的に1を返すだけで対応できた。 

 <pre> 
     public function getIdSiteUnverified() 
     { 
         /* $idSite = Common::getRequestVar('idsite', 0, 'int', $this->params); */ 
         $idSite = 1; 
 </pre> 

 h3. ■補足 


 !https://unofficial-redmine.org/matomo/matomo.php?rec=1227! 

 !https://unofficial-redmine.org/matomo/matomo.php?idsite=1227! 

戻る