VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: simjoom on April 13, 2013, 09:32:17 AM

Title: different bug found with Safepath
Post by: simjoom on April 13, 2013, 09:32:17 AM
 
($safePath==0) return always true with $safePath string '' or 'something'

it's a php bug
see here https://bugs.php.net/bug.php?id=39579
   
> even if  vmfiles exist virtuemart return always the error message
>
> in shopfunctions.php
>
> static function checkSafePath($safePath=0){
>
>                 if($safePath==0) {
> $safePath = VmConfig::get('forSale_path',0);
>
> ....
> the problem is the condition ($safePath==0) return always true even is $safePath is a string!
>
> need to change to
> if($safePath === 0)



--------------one more
in admin/components/com_virtuemart/models/config.php
>
> around line 300
> the sale_path is bad defined
> because the checking_path check in administrator folder instead the root folder!
>
> here to correct the issue:
> $safePath=trim($config->get('forSale_path'));
> //added code
> $safePath = JPATH_ROOT.'/'.$safePath;
> //added code
>
> and why your system add DS instead of '/' ?
> because for joomla DS=='\'
> and create a second error
> i uncommented these line to correct it

Title: Re: different bug found with Safepath
Post by: K&K media production on April 13, 2013, 15:08:32 PM
if you add the correct safe path as absolute path, there is no error message
Title: Re: different bug found with Safepath
Post by: jjk on April 13, 2013, 17:31:25 PM
Concerning the safe path:
It's sometimes a little bit difficult to find out what your server requires.
In order to get a hint, you can search for "upload_tmp_dir" in your Joomla system information.
In my case it says something like /var/www/web00/phptmp/

In this case /var/www/web00 would be the server path to your root directory. So if you have a folder "files", which you want to use for the safe path, the VM2 safe path would be /var/www/web00/files/