VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: blendable on October 15, 2015, 15:07:36 PM

Title: Cant add items to cart
Post by: blendable 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
Title: Re: Cant add items to cart
Post by: olidomama 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
Title: Re: Cant add items to cart
Post by: Studio 42 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

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

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.