Geeklog-Core / geeklog

Geeklog - The Secure CMS.
https://www.geeklog.net
24 stars 19 forks source link

Article Editor Errors if Article image is missing #1001

Closed eSilverStrike closed 4 years ago

eSilverStrike commented 4 years ago

I was trying to clean up some articles on Geeklog.net that are missing the images which was set by the editor. There are records for the images in the article image table but the actual files do not exist in the images/articles directory

https://www.geeklog.net/article.php/2002061823354985

https://www.geeklog.net/article.php/20020423190847759

Trying to edit these articles produces this error:

E_WARNING(2) - finfo::file(/images/articles/2002061823354985_1.gif): failed to open stream: No such file or directory @ /geeklog/system/classes/upload.class.php line 1522
Call Stack
#   Function    File    Line
1   file    /system/classes/upload.class.php    1522
2   createThumbnail     /geeklog/public_html/admin/article.php  919
3   createThumbnail     /geeklog/public_html/admin/article.php  781
4   storyeditor     /geeklog/public_html/admin/article.php  1018

array(3) {
  ["src_fname"]=>
  string(22) "2002061823354985_1.gif"
  ["src_path"]=>
  string(61) "/geeklog/images/articles/2002061823354985_1.gif"
  ["finfo"]=>
  object(finfo)#21 (0) {
  }
}

If the images do not exist the editor should still load. Once in the editor they should not be able to save the article until the image issue is fixed.

eSilverStrike commented 4 years ago

Better error handling added. Editor will now load even if image is missing.

Does not stop user from resaving though if image is missing.