Category: Articles
Posted: Feb 2, 2010
Synopsis: Prevent x-cart review spam by disabling the posting of urls in your x-cart product reviews.
X-Cart product reviews are frequently used by spammers to post junk to your product reviews. We unquestionably recommend adding an X-Cart Review Approval mod to prevent open posting to your website, however declining large amounts of spam still becomes an x-cart administration burden.
The following code change in your x-cart will restrict the posting of urls in your product reviews, and in our case has limited the spam we receive from 50 a week to 0.
OPEN vote.php
FIND:
} elseif ($result) {
$review_store_place = false;
func_header_location("/error_message.php?error_review_exists");
AFTER ADD:
// WCM - Spam Check - Disallow Urls
} elseif (substr_count($review_message, "https:") > 0 OR substr_count($review_message, "http:") > 0 OR substr_count($review_message, "href=") > 0) {
$top_message["content"] = "Your comments could not be added because the ability to post website urls has been disabled. Please make the necessary changes below.";
$top_message["type"] = "E";
$review_store_place['author'] = $review_author;
$review_store_place['message'] = $review_message;
$review_store_place['error'] = true;
// / WCM - Spam Check - Disallow Urls