Author Topic: Cant add items to cart  (Read 876 times)

blendable

  • Beginner
  • *
  • Posts: 2
  • A beginner
Cant add items to cart
« on: October 15, 2015, 15:07:36 pm »
Hi there,

In product section before adding item to shopping cart im faced with an error message..

Warning: syntax error, unexpected $end, expecting TC_DOLLAR_CURLY or TC_QUOTED_STRING or '"' in /homepages/7/d580826054/htdocs/vmfiles/vmsafe/keys/151015.ini on line 8 in /homepages/7/d580826054/htdocs/venom/administrator/components/com_virtuemart/helpers/vmcrypt.php on line 102

How do i solve this problem

Cheers,

Blendable

olidomama

  • Beginner
  • *
  • Posts: 3
  • A beginner
Re: Cant add items to cart
« Reply #1 on: October 30, 2015, 16:38:58 pm »
Hi,
I solved this way:
in the control panel of joomla:

Global Configuration ---> Server ---> error report
select default
save

the error has disappeared
I hope helpful
bye

Studio 42

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2182
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Cant add items to cart
« Reply #2 on: May 14, 2017, 00:29:17 am »
I have same error.
So i checked if this really add some security.
Direct acces to this file get downloaded. So the BUG, do not prevent any read of this file.
So please change the file
JOOMLAROOT/administrator/components/com_virtuemart/helpers/vmcrypt.php

Code: [Select]
private static function _createKeyFile($keyPath, $size = 32){

$usedKey = date("ymd");
$filename = $keyPath . DS . $usedKey . '.ini';
if (!JFile::exists ($filename)) {

$key = self::crypto_rand_secure($size);

vmdebug('create key file ',$size);
$date = JFactory::getDate();
$today = $date->toUnix();
$dat = date("Y-m-d H:i:s");
$content = ';<?php die(); */
[keys]
key "'.$key.'"
unixtime "'.$today.'"
date "'.$dat.'"
b64 "0"
size "'.$size.'"
; */ ?>
';
$result = JFile::write($filename, $content);

return array('key'=>$key,'unixtime'=>$today,'date'=>$dat,'b64'=>0,'size'=>$size);
} else {
return false;
}
}

TO

Code: [Select]
private static function _createKeyFile($keyPath, $size = 32){

$usedKey = date("ymd");
$filename = $keyPath . DS . $usedKey . '.ini';
if (!JFile::exists ($filename)) {

$key = self::crypto_rand_secure($size);

vmdebug('create key file ',$size);
$date = JFactory::getDate();
$today = $date->toUnix();
$dat = date("Y-m-d H:i:s");
$content = '
[keys]
key = "'.$key.'"
unixtime = "'.$today.'"
date = "'.$dat.'"
b64 = "0"
size = "'.$size.'"
';
$result = JFile::write($filename, $content);
if($result) chmod($filename,0600);

return array('key'=>$key,'unixtime'=>$today,'date'=>$dat,'b64'=>0,'size'=>$size);
} else {
return false;
}
}

chmod 600 disable download or direct accces to this file.

If chmod 600 give some trouble, then remove the
<?php die(); */
 */?>
because this don't secure the file.