diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 91446f38070..812353591ed 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -7874,11 +7874,6 @@ abstract class CommonObject
$out .= ($display_type=='card' ? '' : '');
- /*for($ii = 0; $ii < ($colspan - 1); $ii++)
- {
- $out .='
';
- }*/
-
if (!empty($conf->global->MAIN_EXTRAFIELDS_USE_TWO_COLUMS) && (($e % 2) == 1)) {
$out .= ($display_type=='card' ? '' : '');
} else {
@@ -8887,7 +8882,7 @@ abstract class CommonObject
$sql = "SELECT ".$objectline->getFieldList('l');
$sql .= " FROM ".MAIN_DB_PREFIX.$objectline->table_element." as l";
- $sql .= " WHERE l.fk_".$this->element." = ".((int) $this->id);
+ $sql .= " WHERE l.fk_".$this->db->escape($this->element)." = ".((int) $this->id);
if ($morewhere) {
$sql .= $morewhere;
}
diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php
index 45bc622b9db..ea8618c8b92 100644
--- a/htdocs/core/class/fileupload.class.php
+++ b/htdocs/core/class/fileupload.class.php
@@ -222,7 +222,7 @@ class FileUpload
protected function setFileDeleteUrl($file)
{
$file->delete_url = $this->options['script_url']
- .'?file='.rawurlencode($file->name).'&fk_element='.$this->fk_element.'&element='.$this->element;
+ .'?file='.urlencode($file->name).'&fk_element='.urlencode($this->fk_element).'&element='.urlencode($this->element);
$file->delete_type = $this->options['delete_type'];
if ($file->delete_type !== 'DELETE') {
$file->delete_url .= '&_method=DELETE';