This is what I needed to finish to make phpBB compatible with PHP

4.2.3/Apache2.  I dunno exactly why it won't work as-is, but this patch
should fix it.  I will do minor testing here.


git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@3151 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
dougk_ff7 2002-11-29 05:46:17 +00:00
parent 2e7c2d987c
commit d37ab45ff3
7 changed files with 11 additions and 11 deletions

View file

@ -903,7 +903,7 @@ if( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) )
// a hackers attempt at getting us to process a local system // a hackers attempt at getting us to process a local system
// file. // file.
// //
if( file_exists($backup_file_tmpname) ) if( file_exists(realpath($backup_file_tmpname)) )
{ {
if( preg_match("/^(text\/[a-zA-Z]+)|(application\/(x\-)?gzip(\-compressed)?)|(application\/octet-stream)$/is", $backup_file_type) ) if( preg_match("/^(text\/[a-zA-Z]+)|(application\/(x\-)?gzip(\-compressed)?)|(application\/octet-stream)$/is", $backup_file_type) )
{ {

View file

@ -72,7 +72,7 @@ $dir = @opendir($phpbb_root_path . $board_config['smilies_path']);
while($file = @readdir($dir)) while($file = @readdir($dir))
{ {
if( !@is_dir($phpbb_root_path . $board_config['smilies_path'] . '/' . $file) ) if( !@is_dir(realpath($phpbb_root_path . $board_config['smilies_path'] . '/' . $file)) )
{ {
$img_size = @getimagesize($phpbb_root_path . $board_config['smilies_path'] . '/' . $file); $img_size = @getimagesize($phpbb_root_path . $board_config['smilies_path'] . '/' . $file);

View file

@ -134,7 +134,7 @@ switch( $mode )
{ {
while( $sub_dir = @readdir($dir) ) while( $sub_dir = @readdir($dir) )
{ {
if( !is_file($phpbb_root_path . 'templates/' .$sub_dir) && !is_link($phpbb_root_path . 'templates/' .$sub_dir) && $sub_dir != "." && $sub_dir != ".." && $sub_dir != "CVS" ) if( !is_file(realpath($phpbb_root_path . 'templates/' .$sub_dir)) && !is_link(realpath($phpbb_root_path . 'templates/' .$sub_dir)) && $sub_dir != "." && $sub_dir != ".." && $sub_dir != "CVS" )
{ {
if( @file_exists(@realpath($phpbb_root_path. "templates/" . $sub_dir . "/theme_info.cfg")) ) if( @file_exists(@realpath($phpbb_root_path. "templates/" . $sub_dir . "/theme_info.cfg")) )
{ {
@ -551,7 +551,7 @@ switch( $mode )
$s_template_select = '<select name="template_name">'; $s_template_select = '<select name="template_name">';
while( $file = @readdir($dir) ) while( $file = @readdir($dir) )
{ {
if( !is_file($phpbb_root_path . 'templates/' . $file) && !is_link($phpbb_root_path . 'templates/' . $file) && $file != "." && $file != ".." && $file != "CVS" ) if( !is_file(realpath($phpbb_root_path . 'templates/' . $file)) && !is_link(realpath($phpbb_root_path . 'templates/' . $file)) && $file != "." && $file != ".." && $file != "CVS" )
{ {
if($file == $selected['template_name']) if($file == $selected['template_name'])
{ {
@ -792,7 +792,7 @@ switch( $mode )
$s_template_select = '<select name="export_template">'; $s_template_select = '<select name="export_template">';
while( $file = @readdir($dir) ) while( $file = @readdir($dir) )
{ {
if( !is_file($phpbb_root_path . 'templates/' . $file) && !is_link($phpbb_root_path . 'templates/' .$file) && $file != "." && $file != ".." && $file != "CVS" ) if( !is_file(realpath($phpbb_root_path . 'templates/' . $file)) && !is_link(realpath($phpbb_root_path . 'templates/' .$file)) && $file != "." && $file != ".." && $file != "CVS" )
{ {
$s_template_select .= '<option value="' . $file . '">' . $file . "</option>\n"; $s_template_select .= '<option value="' . $file . '">' . $file . "</option>\n";
} }

View file

@ -828,7 +828,7 @@ if( $mode == 'edit' || $mode == 'save' && ( isset($HTTP_POST_VARS['username']) |
$avatar_images = array(); $avatar_images = array();
while( $file = @readdir($dir) ) while( $file = @readdir($dir) )
{ {
if( $file != "." && $file != ".." && !is_file("./../" . $board_config['avatar_gallery_path'] . "/" . $file) && !is_link("./../" . $board_config['avatar_gallery_path'] . "/" . $file) ) if( $file != "." && $file != ".." && !is_file(realpath("./../" . $board_config['avatar_gallery_path'] . "/" . $file)) && !is_link(realpath("./../" . $board_config['avatar_gallery_path'] . "/" . $file)) )
{ {
$sub_dir = @opendir("../" . $board_config['avatar_gallery_path'] . "/" . $file); $sub_dir = @opendir("../" . $board_config['avatar_gallery_path'] . "/" . $file);

View file

@ -34,7 +34,7 @@ $dir = opendir($dirname);
while ( $file = readdir($dir) ) while ( $file = readdir($dir) )
{ {
if ( ereg('^lang_', $file) && !is_file($dirname . '/' . $file) && !is_link($dirname . '/' . $file) ) if ( ereg('^lang_', $file) && !is_file(realpath($dirname . '/' . $file)) && !is_link(realpath($dirname . '/' . $file)) )
{ {
include($dirname . '/' . $file . '/lang_main.php'); include($dirname . '/' . $file . '/lang_main.php');
@ -42,7 +42,7 @@ while ( $file = readdir($dir) )
while ( $email = readdir($lang_dir) ) while ( $email = readdir($lang_dir) )
{ {
if ( ereg('\.tpl$', $email) && is_file($dirname . '/' . $file . '/email/' . $email) ) if ( ereg('\.tpl$', $email) && is_file(realpath($dirname . '/' . $file . '/email/' . $email)) )
{ {
$fp = fopen($dirname . '/' . $file . '/email/' . $email, 'r+'); $fp = fopen($dirname . '/' . $file . '/email/' . $email, 'r+');

View file

@ -36,7 +36,7 @@ $dir = opendir($dirname);
while ( $file = readdir($dir) ) while ( $file = readdir($dir) )
{ {
if ( ereg("^lang_", $file) && !is_file($dirname . "/" . $file) && !is_link($dirname . "/" . $file) ) if ( ereg("^lang_", $file) && !is_file(realpath($dirname . "/" . $file)) && !is_link(realpath($dirname . "/" . $file)) )
{ {
foreach($vars as $lang_file => $lang_var) foreach($vars as $lang_file => $lang_var)
{ {

View file

@ -90,7 +90,7 @@ class emailer
$this->tpl_file = @realpath($phpbb_root_path . 'language/lang_' . $template_lang . '/email/' . $template_file . '.tpl'); $this->tpl_file = @realpath($phpbb_root_path . 'language/lang_' . $template_lang . '/email/' . $template_file . '.tpl');
if ( !file_exists($this->tpl_file) ) if ( !file_exists(realpath($this->tpl_file)) )
{ {
message_die(GENERAL_ERROR, 'Could not find email template file ' . $template_file, '', __LINE__, __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) function encode_file($sourcefile)
{ {
if (is_readable($sourcefile)) if (is_readable(realpath($sourcefile)))
{ {
$fd = fopen($sourcefile, "r"); $fd = fopen($sourcefile, "r");
$contents = fread($fd, filesize($sourcefile)); $contents = fread($fd, filesize($sourcefile));