-
Bug
-
Resolution: Fixed
-
Blocker
-
3.0.3
-
None
-
PHP Environment: 5.1.6
Database: 5.0.45
Hello,
since the update to version 3.0.3 i'll find several error messages from phpbb in my server error log file.
This is an error:
[Wed Nov 19 14:24:28 2008] [error] [client *] PHP Fatal error: Call to undefined function phpbb_chmod() in /var/www/vhosts/kartgrid.be/httpdocs/forum/includes/acm/acm_file.php on line 96, referer: http://www.kartgrid.be/forum/viewtopic.php?f=19&t=5074
|
Before 3.0.3 I never found this error in my logs.
Some lines of the file acm_file.php:
/**
|
* Save modified objects
|
*/
|
function save()
|
{
|
if (!$this->is_modified)
|
{
|
return;
|
}
|
|
global $phpEx;
|
|
if ($fp = @fopen($this->cache_dir . 'data_global.' . $phpEx, 'wb'))
|
{
|
@flock($fp, LOCK_EX);
|
fwrite($fp, "<?php\n\$this->vars = " . var_export($this->vars, true) . ";\n\n\$this->var_expires = " . var_export($this->var_expires, true) . "\n?>");
|
@flock($fp, LOCK_UN);
|
fclose($fp);
|
|
phpbb_chmod($this->cache_dir . 'data_global.' . $phpEx, CHMOD_WRITE);
|
}
|
else
|
{
|
// Now, this occurred how often? ... phew, just tell the user then...
|
if (!@is_writable($this->cache_dir))
|
{
|
trigger_error($this->cache_dir . ' is NOT writable.', E_USER_ERROR);
|
}
|
|
trigger_error('Not able to open ' . $this->cache_dir . 'data_global.' . $phpEx, E_USER_ERROR);
|
}
|
|
$this->is_modified = false;
|
}
|
And of the file includes/functions.php
* @param $filename The file/directory to be chmodded
|
* @param $perms Permissions to set
|
* @return true on success, otherwise false
|
*
|
* @author faw, phpBB Group
|
*/
|
function phpbb_chmod($filename, $perms = CHMOD_READ)
|
{
|
// Return if the file no longer exists.
|
if (!file_exists($filename))
|
{
|
return false;
|
}
|
|
if (!function_exists('fileowner') || !function_exists('filegroup'))
|
{
|
$file_uid = $file_gid = false;
|
$common_php_owner = $common_php_group = false;
|
}
|
else
|
{
|
global $phpbb_root_path, $phpEx;
|