osCommerce / oscommerce2

osCommerce Online Merchant v2.x
http://www.oscommerce.com
MIT License
281 stars 222 forks source link

URL decoded link targeted in rendering so nothing shows in previews #655

Open tgely opened 4 years ago

tgely commented 4 years ago

https://github.com/osCommerce/oscommerce2/blob/de0e97d15d43ac6a9a6cfb2847134a82a0148f2b/catalog/admin/banner_manager.php#L472

Template link is urldecoded.

Use

  var fetchStatsUrl = 'https://website/catalog/admin/banner_manager.php?action=fetchStats&banners_id={{id}}';

instead of URL encoded {{}} template definition

  var fetchStatsUrl = 'https://website/catalog/admin/banner_manager.php?action=fetchStats&banners_id=%7B%7Bid%7D%7D';

One possible solution...

<script>
$(function() {
  var fetchStatsUrl = '<?= urldecode(addslashes(OSCOM::link('banner_manager.php', 'action=fetchStats&banners_id={{id}}'))); ?>';