Jump to content

Warning: file_exists(): open_basedir restriction in effect.


Minds

Recommended Posts

Hi,

I deleted a language (International - Localization - Languages - Delete ("language record").

this error has occurred

 

Warning: file_exists(): open_basedir restriction in effect. 
File(/var/www/vhosts/prestahopTest/modules/index.php/mails/fr/) is not within the allowed path(s): (/var/www/vhosts/prestahopTest:/tmp)

 

The php instruction located in "classes/Language.php" (line 545):

Tools::deleteDirectory(_PS_MODULE_DIR_ . $mod . '/mails/' . $this->iso_code);

has executed this command:

ToolsCore::deleteDirectory('/var/www/vhosts/prestashopTest/modules/index.php/mails/fr/')

the code with error is:

Symfony\Component\Debug\Exception\
ContextErrorException

in classes/Tools.php (line 1091)

 * @param string $dirname Directory name
 */
public static function deleteDirectory($dirname, $delete_self = true)
{
	$dirname = rtrim($dirname, '/') . '/';
		if (file_exists($dirname)) { 		<------------------------------------------------
			if ($files = scandir($dirname, SCANDIR_SORT_NONE)) {
				foreach ($files as $file) {
					if ($file != '.' && $file != '..' && $file != '.svn') {
						if (is_dir($dirname . $file)) {
							Tools::deleteDirectory($dirname . $file);

 

my question is: how does the command "file_exists" search on a path that contains ".../modules/index.php/mails/..." ?

 

this path will never exist!

 

Thanks

 

2019-07-10-16-50-prestashop.mindsagency.jpg

Link to comment
Share on other sites

  • 4 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...