jmontoyaa 8 éve
szülő
commit
08f3634c1c

+ 6 - 2
main/document/create_document.php

@@ -495,8 +495,12 @@ if ($form->validate()) {
     }
 
 	if ($fp = @fopen($filepath.$filename.'.'.$extension, 'w')) {
-		//$content = str_replace(api_get_path(WEB_COURSE_PATH), $_configuration['url_append'].'/courses/', $content);
-		$content = str_replace(api_get_path(WEB_COURSE_PATH), $_configuration['url_append'].api_get_path(REL_COURSE_PATH), $content);
+
+		$content = str_replace(
+		    api_get_path(WEB_COURSE_PATH),
+            api_get_configuration_value('url_append').api_get_path(REL_COURSE_PATH),
+            $content
+        );
 
 		fputs($fp, $content);
 		fclose($fp);

+ 2 - 4
main/document/document_slideshow.inc.php

@@ -25,8 +25,6 @@
  *	too much things in one file , I decided to put the code for document.php here and to include this
  *	file into document.php
  */
-$accepted_extensions = array('.jpg', '.jpeg', '.gif', '.png', '.bmp','.svg');
-
 // Resetting the images of the slideshow = destroying the slideshow
 if (isset($_GET['action']) && $_GET['action'] == 'exit_slideshow') {
 	$_SESSION['image_files_only'] = null;
@@ -66,14 +64,14 @@ if ($tablename_column == 0) {
 } else {
 	$tablename_column = intval($tablename_column) - 1;
 }
-$tablename_direction = isset($_GET['tablename_direction']) ? Security::remove_XSS($_GET['tablename_direction']) : 'ASC';
 
 $image_files_only = sort_files($array_to_search);
 $_SESSION['image_files_only'] = $image_files_only;
 
 function sort_files($table)
 {
-    global $tablename_direction, $accepted_extensions;
+    $tablename_direction = isset($_GET['tablename_direction']) ? Security::remove_XSS($_GET['tablename_direction']) : 'ASC';
+    $accepted_extensions = array('.jpg', '.jpeg', '.gif', '.png', '.bmp','.svg');
     $temp = array();
 
     foreach ($table as & $file_array) {