$path .= str_repeat('../', $depth);
}
-
$content['text'] = format_content($content['text'], $content['formatting'], $glossary, $path);
/* add HTML header and footers to the files */
if (!empty($test_zipped_files) && in_array($file_path, $test_zipped_files)){
$content_files .= str_replace('{FILE}', $file, $ims_template_xml['file']);
} else {
- if (preg_match('/^http[s]?\:/', $file) == 1){
+ if (strpos($file, 'mailto:')!==false){
+ //email exists in <a href=''> links but is not a file.
+ continue;
+ } elseif (preg_match('/^http[s]?\:/', $file) == 1){
$content_files .= str_replace('{FILE}', $file, $ims_template_xml['xml']);
} else {
$content_files .= str_replace('{FILE}', $content['content_path'] . $file, $ims_template_xml['file']);
closedir($handler);
}
//takes care of the condition where the whole package doesn't have any contents but question banks
+//also is the case of urls
if(is_array($all_package_base_path)){
$all_package_base_path = implode('/', $all_package_base_path);
}
-
-if (@rename($import_path.$all_package_base_path, AT_CONTENT_DIR .$_SESSION['course_id'].'/'.$package_base_name) === false) {
- if (!$msg->containsErrors()) {
- $msg->addError('IMPORT_FAILED');
- }
+if(strpos($all_package_base_path, 'http://')===false){
+ if (@rename($import_path.$all_package_base_path, AT_CONTENT_DIR .$_SESSION['course_id'].'/'.$package_base_name) === false) {
+ if (!$msg->containsErrors()) {
+ exit;
+ $msg->addError('IMPORT_FAILED');
+ }
+ }
}
//check if there are still resources missing
foreach($items as $idetails){