cubecart / v6

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

Code Review: Gravatar Queried Regardless #3527

Closed bhsmither closed 6 months ago

bhsmither commented 6 months ago

In element.product_reviews.php, near line 34, the <div> has the class attribute of "review_row" (which has no corresponding CSS rule), and a rel attribute - which is incomplete when Gravatar is disabled.

In 2.cubecart.js, near line 14, there is a function that is executed on each "review_row" which makes an ajax HEAD query to gravatar.com using that incomplete rel attribute.

This happens even though the store settings has set Product Reviews to "Enabled (Gravatar Disabled)".

Suggest in element.product_reviews.php:

From:
<div class="row review_row" rel="{$review.id}_{$review.gravatar}">

To:
<div class="row{if $review.gravatar_exists} review_row{/if}" rel="{$review.id}_{$review.gravatar}">

Or (if wanting to keep review_row undisturbed):
<div class="row review_row{if $review.gravatar_exists} gravatar_prep{/if}" rel="{$review.id}_{$review.gravatar}">
and the relevant javascript, from:
$('#element-reviews .review_row').each(function() {
To:
$('#element-reviews .gravatar_prep').each(function() {
abrookbanks commented 6 months ago

Thank you.