1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-06 16:56:44 +02:00

"Fix" for realpath and Lycos?

git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@3222 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen
2002-12-21 19:09:57 +00:00
parent 6f9d59a4a6
commit 5d8b228bb0
11 changed files with 33 additions and 37 deletions

View File

@@ -27,7 +27,7 @@ if ( !defined('IN_PHPBB') )
// Debug Level
//define('DEBUG', 1); // Debugging on
define('DEBUG', 0); // Debugging off
define('DEBUG', 1); // Debugging off
// User Levels <- Do not change the values of USER or ADMIN

View File

@@ -88,9 +88,9 @@ class emailer
$template_lang = $board_config['default_lang'];
}
$this->tpl_file = @realpath($phpbb_root_path . 'language/lang_' . $template_lang . '/email/' . $template_file . '.tpl');
$this->tpl_file = @phpbb_realpath($phpbb_root_path . 'language/lang_' . $template_lang . '/email/' . $template_file . '.tpl');
if ( !file_exists(realpath($this->tpl_file)) )
if ( !file_exists(phpbb_realpath($this->tpl_file)) )
{
message_die(GENERAL_ERROR, 'Could not find email template file ' . $template_file, '', __LINE__, __FILE__);
}
@@ -307,7 +307,7 @@ class emailer
//
function encode_file($sourcefile)
{
if (is_readable(realpath($sourcefile)))
if (is_readable(phpbb_realpath($sourcefile)))
{
$fd = fopen($sourcefile, "r");
$contents = fread($fd, filesize($sourcefile));

View File

@@ -220,7 +220,7 @@ function init_userprefs($userdata)
}
}
if ( !file_exists(@realpath($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.'.$phpEx)) )
if ( !file_exists(@phpbb_realpath($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.'.$phpEx)) )
{
$board_config['default_lang'] = 'english';
}
@@ -229,7 +229,7 @@ function init_userprefs($userdata)
if ( defined('IN_ADMIN') )
{
if( !file_exists(@realpath($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.'.$phpEx)) )
if( !file_exists(@phpbb_realpath($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.'.$phpEx)) )
{
$board_config['default_lang'] = 'english';
}
@@ -288,7 +288,7 @@ function setup_style($style)
message_die(CRITICAL_ERROR, "Could not open $template_name template config file", '', __LINE__, __FILE__);
}
$img_lang = ( file_exists(@realpath($phpbb_root_path . $current_template_path . '/images/lang_' . $board_config['default_lang'])) ) ? $board_config['default_lang'] : 'english';
$img_lang = ( file_exists(@phpbb_realpath($phpbb_root_path . $current_template_path . '/images/lang_' . $board_config['default_lang'])) ) ? $board_config['default_lang'] : 'english';
while( list($key, $value) = @each($images) )
{
@@ -681,14 +681,10 @@ function message_die($msg_code, $msg_text = '', $msg_title = '', $err_line = '',
// function. In later versions of PHP, it needs to be called
// to do checks with some functions. Older versions of PHP don't
// seem to need this, so we'll just return the original value.
//
// dougk_ff7 <October 5, 2002>
if ( !function_exists(realpath) )
function phpbb_realpath($path)
{
function realpath($path)
{
return $path;
}
return (!@function_exists('realpath') || !@realpath($phpbb_root_path . 'includes/functions.'.$phpEx)) ? $path : realpath($path);
}
function redirect($url)

View File

@@ -230,7 +230,7 @@ class Template {
// Check if it's an absolute or relative path.
if (substr($filename, 0, 1) != '/')
{
$filename = realpath($this->root . '/' . $filename);
$filename = phpbb_realpath($this->root . '/' . $filename);
}
if (!file_exists($filename))

View File

@@ -53,7 +53,7 @@ function user_avatar_delete($avatar_type, $avatar_file)
if ( $avatar_type == USER_AVATAR_UPLOAD && $avatar_file != '' )
{
if ( @file_exists(@realpath('./' . $board_config['avatar_path'] . '/' . $avatar_file)) )
if ( @file_exists(@phpbb_realpath('./' . $board_config['avatar_path'] . '/' . $avatar_file)) )
{
@unlink('./' . $board_config['avatar_path'] . '/' . $avatar_file);
}
@@ -65,7 +65,7 @@ function user_avatar_delete($avatar_type, $avatar_file)
function user_avatar_gallery($mode, &$error, &$error_msg, $avatar_filename)
{
global $board_config;
if ( file_exists(@realpath($board_config['avatar_gallery_path'] . '/' . $avatar_filename)) && ($mode == 'editprofile') )
if ( file_exists(@phpbb_realpath($board_config['avatar_gallery_path'] . '/' . $avatar_filename)) && ($mode == 'editprofile') )
{
$return = ", user_avatar = '" . str_replace("\'", "''", $avatar_filename) . "', user_avatar_type = " . USER_AVATAR_GALLERY;
}
@@ -167,7 +167,7 @@ function user_avatar_upload($mode, $avatar_mode, &$current_avatar, &$current_typ
$error_msg = ( !empty($error_msg) ) ? $error_msg . '<br />' . $l_avatar_size : $l_avatar_size;
}
}
else if ( ( file_exists(@realpath($avatar_filename)) ) && preg_match('/\.(jpg|jpeg|gif|png)$/i', $avatar_realname) )
else if ( ( file_exists(@phpbb_realpath($avatar_filename)) ) && preg_match('/\.(jpg|jpeg|gif|png)$/i', $avatar_realname) )
{
if ( $avatar_filesize <= $board_config['avatar_filesize'] && $avatar_filesize > 0 )
{
@@ -197,7 +197,7 @@ function user_avatar_upload($mode, $avatar_mode, &$current_avatar, &$current_typ
if ( $mode == 'editprofile' && $current_type == USER_AVATAR_UPLOAD && $current_avatar != '' )
{
if ( file_exists(@realpath('./' . $board_config['avatar_path'] . '/' . $current_avatar)) )
if ( file_exists(@phpbb_realpath('./' . $board_config['avatar_path'] . '/' . $current_avatar)) )
{
@unlink('./' . $board_config['avatar_path'] . '/' . $current_avatar);
}

View File

@@ -402,7 +402,7 @@ if ( isset($HTTP_POST_VARS['submit']) )
}
else if ( $user_avatar_remoteurl != '' && $board_config['allow_avatar_remote'] )
{
if ( @file_exists(@realpath('./' . $board_config['avatar_path'] . '/' . $userdata['user_avatar'])) )
if ( @file_exists(@phpbb_realpath('./' . $board_config['avatar_path'] . '/' . $userdata['user_avatar'])) )
{
@unlink('./' . $board_config['avatar_path'] . '/' . $userdata['user_avatar']);
}
@@ -410,7 +410,7 @@ if ( isset($HTTP_POST_VARS['submit']) )
}
else if ( $user_avatar_local != '' && $board_config['allow_avatar_local'] )
{
if ( @file_exists(@realpath('./' . $board_config['avatar_path'] . '/' . $userdata['user_avatar'])) )
if ( @file_exists(@phpbb_realpath('./' . $board_config['avatar_path'] . '/' . $userdata['user_avatar'])) )
{
@unlink('./' . $board_config['avatar_path'] . '/' . $userdata['user_avatar']);
}
@@ -937,7 +937,7 @@ else
{
$template->assign_block_vars('switch_avatar_block', array() );
if ( $board_config['allow_avatar_upload'] && file_exists(@realpath('./' . $board_config['avatar_path'])) )
if ( $board_config['allow_avatar_upload'] && file_exists(@phpbb_realpath('./' . $board_config['avatar_path'])) )
{
if ( $form_enctype != '' )
{
@@ -951,7 +951,7 @@ else
$template->assign_block_vars('switch_avatar_block.switch_avatar_remote_link', array() );
}
if ( $board_config['allow_avatar_local'] && file_exists(@realpath('./' . $board_config['avatar_gallery_path'])) )
if ( $board_config['allow_avatar_local'] && file_exists(@phpbb_realpath('./' . $board_config['avatar_gallery_path'])) )
{
$template->assign_block_vars('switch_avatar_block.switch_avatar_local_gallery', array() );
}