cubecart / v6

CubeCart Version 6
https://cubecart.com
72 stars 59 forks source link

Bad Javascript Replace Arguments #3508

Closed bhsmither closed 5 months ago

bhsmither commented 5 months ago

Currently, when the content for a Colorbox come from having been passed through the javascript function replace(), the arguments being passed in are (currently) "'", "'". (See documents.email.php, lines 147 and 233, for example.)

This function signature will replace only the first occurrence.

If the intent is to replace all apostrophes with the entity equivalent, the global regex signature must be used, or use the javascript function replaceAll(). (However, replaceAll() is available in javascript engines compiled in 2021 or later.)

Try: .replace(/'/g,"'");

abrookbanks commented 5 months ago

Another good find. Thank you.