News:

Looking for documentation? Take a look on our wiki

Main Menu

Cant add items to cart

Started by blendable, October 15, 2015, 15:07:36 PM

Previous topic - Next topic

blendable

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

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

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.