News:

Looking for documentation? Take a look on our wiki

Main Menu

different bug found with Safepath

Started by simjoom, April 13, 2013, 09:32:17 AM

Previous topic - Next topic

simjoom

 
($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


K&K media production

if you add the correct safe path as absolute path, there is no error message

jjk

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/
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations