renlok / WeBid

The official WeBid github fork
http://www.webidsupport.com
114 stars 125 forks source link

Images stop showing #518

Open MESWEB opened 5 years ago

MESWEB commented 5 years ago

Warning [2] fopen(o_1cobirdfddfsdf1e2nrpgmh9hud.jpg): failed to open stream: No such file or directory on public_html/getthumb.php line 27

renlok commented 5 years ago

Any more details? Are any images loading? What version are you using?

MESWEB commented 5 years ago

Last version. I was download updatef files and run in my localhost server. This code is faulty: if (!isset($_GET['fromfile']) || !isset($_GET['auction_id']) || !is_numeric($auction_id)) { ErrorPNG($ERR_716); exit; } elseif (!file_exists($_GET['fromfile']) && !fopen($_GET['fromfile'], 'r')) { ErrorPNG($ERR_716); exit; }

If I delete this code pictures are showing again.

hungryfrankie commented 3 years ago

on the 1.2.2.2 this problem is caused because it is only checking with the filename and it dose not have the path. if (!isset($_GET['fromfile']) || !isset($_GET['auction_id']) || !is_numeric($auction_id)) { ErrorPNG($ERR_716); exit; } elseif (!file_exists($_GET['fromfile']) && !fopen($_GET['fromfile'], 'r')) { ErrorPNG($ERR_716) you have to bring this code up if ($fromfile != '') { // clean fromfile $fromfile = basename($fromfile); // build file path $file_path = UPLOAD_FOLDER . $auction_id . '/' . $fromfile; } else { // if empty filename just show default image $file_path = MAIN_PATH . 'images/email_alerts/default_item_img.jpg'; } and put it to around line 20 and change $fromfile to $file_path in the if statement mentioned