Jump to content

[SOLVED] Prestashop 1.6.0.9 spam my error.log. No needed slash


sofree

Recommended Posts

Hello!

 

I upgraded Prestashop 1.6.0.6 -> 1.6.0.9 and now on every page load I saw in error.log file:

 

[Mon Aug 11 23:32:01.520296 2014] [:error] [pid 29189] PHP Warning:  tempnam(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/var/www/html/prestashop) in /var/www/html/prestashop/www/classes/PrestaShopAutoload.php on line 151
[Mon Aug 11 23:32:01.520560 2014] [:error] [pid 29189] Cannot write temporary file
[Mon Aug 11 23:32:02.116625 2014] [:error] [pid 29215] PHP Warning:  tempnam(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/var/www/html/prestashop) in /var/www/html/prestashop/www/classes/PrestaShopAutoload.php on line 151
[Mon Aug 11 23:32:02.116823 2014] [:error] [pid 29215] Cannot write temporary file
[Mon Aug 11 23:38:23.750937 2014] [:error] [pid 30307] PHP Warning:  tempnam(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/var/www/html/prestashop) in /var/www/html/prestashop/www/classes/PrestaShopAutoload.php on line 151
[Mon Aug 11 23:38:23.751080 2014] [:error] [pid 30307] Cannot write temporary file
[Mon Aug 11 23:38:24.180804 2014] [:error] [pid 30308] PHP Warning:  tempnam(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/var/www/html/prestashop) in /var/www/html/prestashop/www/classes/PrestaShopAutoload.php on line 151

 

I examined source code and I think I found a bug. For example I added after 151 line:

 

error_log($filename);
error_log(dirname($filename));

 

And log now looks:

 

[Mon Aug 11 23:43:48.392805 2014] [:error] [pid 31257] PHP Warning:  tempnam(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/var/www/html/prestashop) in /var/www/html/prestashop/www/classes/PrestaShopAutoload.php on line 151
[Mon Aug 11 23:43:48.393787 2014] [:error] [pid 31257] /var/www/html/prestashop/wwwcache/class_index.php
[Mon Aug 11 23:43:48.394011 2014] [:error] [pid 31257] /var/www/html/prestashop/wwwcache
[Mon Aug 11 23:43:48.394172 2014] [:error] [pid 31257] Cannot write temporary file

 

WARNING! no slash after www.

Actual: /var/www/html/prestashop/wwwcache/class_index.php

Expected: /var/www/html/prestashop/www/cache/class_index.php

 

I found related bug in bug tracking system:

https://github.com/PrestaShop/PrestaShop/commit/664705149641661c494779ac197749239d916b42

 

Why you do not fixed?

 

If this persist in many installations, error.log file grow and grow...

And unfortunately file class_index.php doesn't created anymore.

Edited by sofree (see edit history)
  • Like 1
Link to comment
Share on other sites

Hello. I confirm. No spam in error.log anymore.

 

But, why so complicated function normalizeDirectory?

 

Simplest variant:

	private function normalizeDirectory($directory)
	{
		return rtrim($directory, "/\"") . DIRECTORY_SEPARATOR;
	}

Think about it!

Link to comment
Share on other sites

×
×
  • Create New...