[svn r11136] Added check for differenciation between course and no-course context while uploading images in FCKEditor

skala
Yannick Warnier 19 years ago
parent c7087732bc
commit 21dc9790d4
  1. 13
      main/inc/lib/fckeditor/editor/plugins/ImageManager/Classes/ImageManager.php

@ -480,7 +480,18 @@ class ImageManager
if(!is_int($result)) if(!is_int($result))
{ {
Files::delFile($file['tmp_name']); Files::delFile($file['tmp_name']);
$this->_insertPictureInDatabase($relative, $_FILES['upload'],$result);
global $_course;
//Check if we are in a course context. Otherwise it should mean that we're
//uploading a file in the generic image upload folder, not into a course, so
//we don't need to record it into the database.
//In any case, if $_course['dbName'] is not defined, the database insertion
//will fail, so we don't loose anything compared to what we have now.
if(!empty($_course['dbName']))
{
$this->_insertPictureInDatabase($relative, $_FILES['upload'],$result);
}
Return $result; Return $result;
} }

Loading…
Cancel
Save