I'm having serious issues with my hosting where I've got WowRoster located. The open_basedir restriction is in effect and the upload directory isn't located there so as a result it can't parse the uploaded file.
We've tried to get it working my adding the upload directory to the open_basedir, but it doesn't seem to be working and we have no idea why.
While I would love to get it working correctly as it should, it doesn't look like it's going to happen any time soon, and I want this working, so it looks like I'm going to have to edit the code.
I've done a bit of investigating, and it looks like all I have to do is use the move_uploaded_file function to move the file from the upload directory to a directory allowed by the open_basedir, and everything should work. The problem is that I don't know enough about php to be confident about doing it without some help.
From the looks of it, I would need to put the function call somewhere in the following section of update.php, probably immediatly before the foreach:
- Code: Select all
// Loop through each posted file
foreach ($_FILES as $filefield => $file)
{
$filename = $file['tmp_name'];
$filemode = '';
if( substr_count($file['name'],'.gz') > 0 ) // If the file is gzipped
$filemode = 'gz';
foreach( $filefields as $acceptedfile ) // Itterate through all the possible filefields
{
if( $acceptedfile == $file['name'] || $acceptedfile.'.gz' == $file['name'] )
{
// Filefield is 1 of the kind we accept.
if( $roster_conf['authenticated_user'] )
{
$uploadFound = true;
// Parse the lua file into a php array that we can use
$data = ParseLuaFile( $filename , $filemode );
// If pvp data is there, assign it to $uploadData['PvpLogData']
if( isset($data['PurgeLogData']) )
{
$uploadData['PvpLogData'] = $data;
}
// If CP data is there, assign it to $uploadData['myProfile']
if( isset($data['myProfile']) )
{
$uploadData['myProfile'] = $data['myProfile'];
}
// Clear the $data variable
unset($data);
}
}
}
@unlink($filename); // Done with the file, we don't need it anymore
}
Is this right? Anything else you can think of?
All help greatly appreciated. I'm getting really frustrated about not being able to get this working.