瀏覽代碼

FIX #yogosha4426

Laurent Destailleur 4 年之前
父節點
當前提交
d0c02f3714
共有 3 個文件被更改,包括 3 次插入4 次删除
  1. 1 1
      htdocs/core/class/html.formfile.class.php
  2. 2 2
      htdocs/ecm/file_card.php
  3. 0 1
      htdocs/ecm/index.php

+ 1 - 1
htdocs/core/class/html.formfile.class.php

@@ -1207,7 +1207,7 @@ class FormFile
 						$editline = 1;
 					} else {
 						$filenametoshow = preg_replace('/\.noexe$/', '', $file['name']);
-						print dol_trunc($filenametoshow, 200);
+						print dol_escape_htmltag(dol_trunc($filenametoshow, 200));
 						print '</a>';
 					}
 					// Preview link

+ 2 - 2
htdocs/ecm/file_card.php

@@ -1,5 +1,5 @@
 <?php
-/* Copyright (C) 2008-2017 Laurent Destailleur  <eldy@users.sourceforge.net>
+/* Copyright (C) 2008-2020 Laurent Destailleur  <eldy@users.sourceforge.net>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -126,7 +126,7 @@ if ($action == 'update')
     $error = 0;
 
     $oldlabel = GETPOST('urlfile', 'alpha');
-    $newlabel = GETPOST('label', 'alpha');
+    $newlabel = dol_sanitizeFileName(GETPOST('label', 'alpha'));
 	$shareenabled = GETPOST('shareenabled', 'alpha');
 
     //$db->begin();

+ 0 - 1
htdocs/ecm/index.php

@@ -127,7 +127,6 @@ if ($action == 'confirm_deletefile')
 
 		$upload_dir = $conf->ecm->dir_output.($relativepath ? '/'.$relativepath : '');
 		$file = $upload_dir."/".GETPOST('urlfile', 'alpha');
-
 		$ret = dol_delete_file($file); // This include also the delete from file index in database.
 		if ($ret)
 		{