Jump to content

[FIX] Stats module causes Google to crawl many bad URLs


rocky

Recommended Posts

To temporarily solve this problem until PrestaShop incorporates a solution, just replace two lines in two different files.

Change line 80 of modules/statsdata/statsdata.php from:

$token = $blowfish->encrypt($tokenArray['id_connections'].'|'.$tokenArray['id_page'].'|'.$tokenArray['time_start']);



to:

$token = str_replace('/','STATS',$blowfish->encrypt($tokenArray['id_connections'].'|'.$tokenArray['id_page'].'|'.$tokenArray['time_start']));



and line 19 of statistics.php from:

$token = $blowfish->decrypt($_POST['token']);



to:

$token = $blowfish->decrypt(str_replace('STATS', '/', $_POST['token']));

Link to comment
Share on other sites

  • 11 months later...

Hi Rocky on 1.3.2 I have

    // Ajax request sending the time spend on the page
       $token = sha1((int)$tokenArray['id_connections'].(int)$tokenArray['id_page'].$tokenArray['time_start']._COOKIE_KEY_);
       $this->_html .= '

In mt statsdata.php. Will the fix work on tis versiona as I get odd Googles too!

Thanks Baz

Link to comment
Share on other sites

I'm not sure whether it will work, but you can certainly try:

// Ajax request sending the time spend on the page
       $token = str_replace(/', 'STATS', sha1((int)$tokenArray['id_connections'].(int)$tokenArray['id_page'].$tokenArray['time_start']._COOKIE_KEY_));
       $this->_html .=  

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...