Index: branches/5.2.x/core/units/images/images.php =================================================================== diff -u -N -r14244 -r14628 --- branches/5.2.x/core/units/images/images.php (.../images.php) (revision 14244) +++ branches/5.2.x/core/units/images/images.php (.../images.php) (revision 14628) @@ -1,6 +1,6 @@ Load($id); - $local_path = FULL_PATH.$this->GetDBField('LocalPath'); - $thumb_path = FULL_PATH.$this->GetDBField('ThumbPath'); - if(file_exists($local_path)) - { - unlink($local_path); - } - if(file_exists($thumb_path)) - { - unlink($thumb_path); - } - return parent::Delete($id); + /** + * Deletes the record from database + * + * @param int $id + * @return bool + * @access public + */ + public function Delete($id) + { + $this->Load($id); + $local_path = FULL_PATH . $this->GetDBField('LocalPath'); + $thumb_path = FULL_PATH . $this->GetDBField('ThumbPath'); + + if ( file_exists($local_path) ) { + unlink($local_path); } - } \ No newline at end of file + if ( file_exists($thumb_path) ) { + unlink($thumb_path); + } + + return parent::Delete($id); + } +} \ No newline at end of file