Originally Posted by M1th
A bug with the INSERT query. When an image file contains a " ' " character, it results in a query execution error. To fix this find:
PHP Code:
$sql="INSERT INTO ".TABLE_PREFIX."vbimghost ( `imgid` , `userid` , `imgfile` , `imgname` , `imgfilesize` , `imgwidth` , `imgheight` , `imgdate` , `imgprivate` ) VALUES ('', '".$userid."', '".$imguname."', '".$upfilename."', '".$upfilesize."', '".$dime[0]."', '".$dime[1]."', '".TIMENOW."', '1')";
replace with
PHP Code:
$sql="INSERT INTO ".TABLE_PREFIX."vbimghost ( `imgid` , `userid` , `imgfile` , `imgname` , `imgfilesize` , `imgwidth` , `imgheight` , `imgdate` , `imgprivate` ) VALUES ('', '".$userid."', '".$imguname."', '". str_replace("'","",$upfilename)."', '".$upfilesize."', '".$dime[0]."', '".$dime[1]."', '".TIMENOW."', '1')";
Notice that I've wrapped the str_replace() function around $upfilename to strip out any 's from the file name before inserting it into database.
|