09-Aug-2010, 08:34 PM
If you add Commentics to an index.php file then it can usually be accessed by two different URLs:
1. domain.com/
2. domain.com/index.php
This will be an issue when trying to submit a comment as you may be banned for 'incorrect referrer'.
The following is the solution for Commentics v1.1:
Find this function in comments/includes/functions/processor.php (line 1145):
1. domain.com/
2. domain.com/index.php
This will be an issue when trying to submit a comment as you may be banned for 'incorrect referrer'.
The following is the solution for Commentics v1.1:
Find this function in comments/includes/functions/processor.php (line 1145):
PHP Code:
<?php
function clean_url ($url) { //cleans up a URL
$url = strtolower($url); //convert to lowercase
if (stripos($url, "?") !== false) { //remove any parameters
$parameter = substr($url, stripos($url, "?"));
$url = str_ireplace($parameter, "", $url);
}
$url = urldecode($url); //decode any special characters
return $url; //return cleaned URL
} //end of clean-url function
Replace with:
PHP Code:
<?php
function clean_url ($url) { //cleans up a URL
$url = strtolower($url); //convert to lowercase
if (stripos($url, "?") !== false) { //remove any parameters
$parameter = substr($url, stripos($url, "?"));
$url = str_ireplace($parameter, "", $url);
}
$url = str_ireplace("index.php", "", $url); //remove index.php if there
$url = urldecode($url); //decode any special characters
return $url; //return cleaned URL
} //end of clean-url function