Warning: filesize(): open_basedir restriction in effect. File(/tmp/phpG10pn8) is not within the allowed path(s): (/home/) in /home/www/trahtalk/trashUall/Now/admin/functions.php on line 1827
Hi
This is driving me mad, and I have searched the forum but cant find anything like this. This is my first time of installing the the latest Vb2 board although I have done phpBB2 boards in the past.
this error message happens when anyone tries to upload sig, pic or attatchment.
the server isnt in safemode as I checked the phpinfo.
even clicked on safe mode and made a temp folder (777) and changed the image path to it...still got the same problem
the images/avatar folders are 777
I have tried increasing the file size in admincp
phpinfo file says file uploads is on
have clicked on allow sigs avatar and attatchments in admin cp
have tried to add JPEG and GIF in bif letters as allowed file types..
have opened the functions file in notepad and line 1827 reads....
$filesize=filesize($attachment);
if ($maxattachsize!=0 and $filesize>$maxattachsize) {
// too big!
@unlink($attachment);
eval("standarderror(\"".gettemplate("error_attachtoobig")."\");");
exit;
}
if ($filesize!=$attachment_size) {
// security error
@unlink($attachment);
eval("standarderror(\"".gettemplate("error_attacherror")."\");");
exit;
}
if (strstr($attachment,"..")!="") {
//security error
@unlink($attachment);
eval("standarderror(\"".gettemplate("error_attacherror")."\");");
exit;
}
if ($extension=="gif" or $extension=="jpg" or $extension=="jpeg" or $extension=="jpe" or $extension=="png" or $extension=="swf") { // Picture file
if ([email protected]($attachment)) {
if (($maxattachwidth>0 and $imginfo[0]>$maxattachwidth) or ($maxattachheight>0 and $imginfo[1]>$maxattachheight)) {
@unlink($attachment);
eval("standarderror(\"".gettemplate("error_attachbaddimensions")."\");");
}
if (!$imginfo[2]) {
@unlink($attachment);
eval("standarderror(\"".gettemplate("error_avatarnotimage")."\");");
}
} elseif (1 or !$allowimgsizefailure) {
@unlink($attachment);
eval("standarderror(\"".gettemplate("error_avatarnotimage")."\");");
}
}
// read file
$filenum = fopen($attachment,"rb");
$filestuff = fread($filenum,$filesize);
fclose($filenum);
@unlink($attachment);
$visible = iif($moderate,0,1);
// add to db
if (!$allowduplicates) {
if ($result=$DB_site->query_first("SELECT attachmentid
FROM attachment
WHERE userid = '$bbuserinfo[userid]'
AND filedata = '".addslashes($filestuff)."'")) {
$threadresult=$DB_site->query_first("SELECT post.threadid as threadid,thread.title as title FROM post
LEFT JOIN thread ON (thread.threadid = post.threadid)
WHERE post.attachmentid=$result[attachmentid]");
$threadresult['title'] = htmlspecialchars($threadresult['title']);
eval("standarderror(\"".gettemplate("error_attachexists")."\");");
exit;
}
}
$DB_site->query("INSERT INTO attachment (attachmentid,userid,dateline,filename,filedata,visible) VALUES (NULL,$bbuserinfo[userid],".time().",'".addslashes($attachment_name)."','".addslashes($filestuff)."','$visible') ");
$attachmentid=$DB_site->insert_id();
}
return $attachmentid;
}
it doesnt seem to matter if its a pic the size of a pin head it happens.
Funny thing is and I dont know if its related, i get the same error message when I deleted vb2 and put in vb3
any help would be very much appreciated. I like vbulletin. i dont want to go back to phpBB2 if i can help it.
thanks
Sarky
Hi
This is driving me mad, and I have searched the forum but cant find anything like this. This is my first time of installing the the latest Vb2 board although I have done phpBB2 boards in the past.
this error message happens when anyone tries to upload sig, pic or attatchment.
the server isnt in safemode as I checked the phpinfo.
even clicked on safe mode and made a temp folder (777) and changed the image path to it...still got the same problem
the images/avatar folders are 777
I have tried increasing the file size in admincp
phpinfo file says file uploads is on
have clicked on allow sigs avatar and attatchments in admin cp
have tried to add JPEG and GIF in bif letters as allowed file types..

have opened the functions file in notepad and line 1827 reads....
$filesize=filesize($attachment);
if ($maxattachsize!=0 and $filesize>$maxattachsize) {
// too big!
@unlink($attachment);
eval("standarderror(\"".gettemplate("error_attachtoobig")."\");");
exit;
}
if ($filesize!=$attachment_size) {
// security error
@unlink($attachment);
eval("standarderror(\"".gettemplate("error_attacherror")."\");");
exit;
}
if (strstr($attachment,"..")!="") {
//security error
@unlink($attachment);
eval("standarderror(\"".gettemplate("error_attacherror")."\");");
exit;
}
if ($extension=="gif" or $extension=="jpg" or $extension=="jpeg" or $extension=="jpe" or $extension=="png" or $extension=="swf") { // Picture file
if ([email protected]($attachment)) {
if (($maxattachwidth>0 and $imginfo[0]>$maxattachwidth) or ($maxattachheight>0 and $imginfo[1]>$maxattachheight)) {
@unlink($attachment);
eval("standarderror(\"".gettemplate("error_attachbaddimensions")."\");");
}
if (!$imginfo[2]) {
@unlink($attachment);
eval("standarderror(\"".gettemplate("error_avatarnotimage")."\");");
}
} elseif (1 or !$allowimgsizefailure) {
@unlink($attachment);
eval("standarderror(\"".gettemplate("error_avatarnotimage")."\");");
}
}
// read file
$filenum = fopen($attachment,"rb");
$filestuff = fread($filenum,$filesize);
fclose($filenum);
@unlink($attachment);
$visible = iif($moderate,0,1);
// add to db
if (!$allowduplicates) {
if ($result=$DB_site->query_first("SELECT attachmentid
FROM attachment
WHERE userid = '$bbuserinfo[userid]'
AND filedata = '".addslashes($filestuff)."'")) {
$threadresult=$DB_site->query_first("SELECT post.threadid as threadid,thread.title as title FROM post
LEFT JOIN thread ON (thread.threadid = post.threadid)
WHERE post.attachmentid=$result[attachmentid]");
$threadresult['title'] = htmlspecialchars($threadresult['title']);
eval("standarderror(\"".gettemplate("error_attachexists")."\");");
exit;
}
}
$DB_site->query("INSERT INTO attachment (attachmentid,userid,dateline,filename,filedata,visible) VALUES (NULL,$bbuserinfo[userid],".time().",'".addslashes($attachment_name)."','".addslashes($filestuff)."','$visible') ");
$attachmentid=$DB_site->insert_id();
}
return $attachmentid;
}
it doesnt seem to matter if its a pic the size of a pin head it happens.
Funny thing is and I dont know if its related, i get the same error message when I deleted vb2 and put in vb3
any help would be very much appreciated. I like vbulletin. i dont want to go back to phpBB2 if i can help it.
thanks
Sarky
Comment