3

My website is build with nopcommerce41. '+' characters are being replaced with &#x2B on runtime. Everything is working fine except for this issue.

Example: Google search results displays url look like www.demo.com?search=+apple but bing search engine display this same url look like www.demo.com?search=+apple.

If user comes from bing search engine then user can't find expected result. now I have compared the code of both versions of nopcommerce41 and nopcommerce42beta and result is as shown below:

view-source:http://nop42beta-001-site1.ftempurl.com/ (this site into 4.2beta)
e.g. <li class=facebook><a href=//www.facebook.com/+nopCommerce target=_blank>Facebook</a>

view-source:http://demo.nopcommerce.com/ (this site into 4.1)
e.g. <a href="https://plus.google.com/&#x2B;nopcommerce" target="_blank">Google+</a>

nopcommerce team already fixed this issue into nopcommrce 4.2beta but I dont want to upgrade my project. Can any one help me solve this issue?

This issue already reported into development section but this is a problematic bug so I have posted here. https://www.nopcommerce.com/boards/t/62489/plus-sign-converts-to-x2b-in-nopcommerce-versions-running-on-net-core.aspx

one example to understand this issue

one more example as below:-

In a Index.chtml file i have write code

@{ 
    Layout = null;
    var test1 = "/+apple";
}

<a href="/+apple">Sangeet1</a>
<a href="@test1">Sangeet2</a>



now i have run project then i got result as below

view-source:http://localhost:15543/


<a href="/+apple">Sangeet1</a>
<a href="/&#x2B;apple">Sangeet2</a>

second dynamic string + symbol convert into +(Unicode Hex Character Code) but first static value not converted.

Sangeet Shah
  • 3,079
  • 2
  • 22
  • 25
  • Problem is solved. using HttpCompression(AddNopWebMarkupMin) problem is solved. this method compress the code also also prevent to convert to Unicode Hex Character Code. public class NopMvcStartup : INopStartup { //add WebMarkupMin services to the services container services.AddNopWebMarkupMin(); } above method need to include into NopMvcStartup to solve this problem. – Sangeet Shah May 09 '19 at 05:23

1 Answers1

5

nocommerce is open source, you can find the changeset that fixes your issue and build a 4.1 version with this specific fix

Bacon
  • 473
  • 3
  • 9