diff --git a/ChangeLog b/ChangeLog
index a00f52055f4..2c0e2377f61 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -54,8 +54,10 @@ For users:
suppliers invoice, orders, customers orders, proposals and social contributions.
- New: All professional id can contains up to 128 chars instead of 32.
- New: [ task #176 ] Allow to use ODT templates for proposals and orders like it's done for invoices
+- New: Add hidden option MAIN_ADD_PDF_BACKGROUND to add a PDF as background of invoice/order generated PDF.
- Fix: Can use POS module with several concurrent users.
- Fix: Installer don't fails with Mysql version that added a ssl_cypher field.
+- Fix: Sanitize input parameters.
For developers:
- New: Can add a left menu into an existing top menu or left menu.
diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php
index 973762b780c..bd5f0f66894 100644
--- a/htdocs/adherents/agenda.php
+++ b/htdocs/adherents/agenda.php
@@ -37,7 +37,7 @@ $langs->load("members");
$mesg=isset($_GET["mesg"])?'
'.$_GET["mesg"].'
':'';
-$id = GETPOST("id");
+$id = GETPOST('id','int');
// Security check
if (! $user->rights->adherent->lire) accessforbidden();
diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php
index 4291d998559..a831ec46a2e 100644
--- a/htdocs/adherents/card_subscriptions.php
+++ b/htdocs/adherents/card_subscriptions.php
@@ -141,10 +141,10 @@ if ($action == 'setsocid')
$error=0;
if (! $error)
{
- if (GETPOST("socid") != $adh->fk_soc) // If link differs from currently in database
+ if (GETPOST('socid','int') != $adh->fk_soc) // If link differs from currently in database
{
$sql ="SELECT rowid FROM ".MAIN_DB_PREFIX."adherent";
- $sql.=" WHERE fk_soc = '".GETPOST("socid")."'";
+ $sql.=" WHERE fk_soc = '".GETPOST('socid','int')."'";
$resql = $db->query($sql);
if ($resql)
{
@@ -154,7 +154,7 @@ if ($action == 'setsocid')
$othermember=new Adherent($db);
$othermember->fetch($obj->rowid);
$thirdparty=new Societe($db);
- $thirdparty->fetch(GETPOST("socid"));
+ $thirdparty->fetch(GETPOST('socid','int'));
$error++;
$mesg=''.$langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name).'
';
}
@@ -162,7 +162,7 @@ if ($action == 'setsocid')
if (! $error)
{
- $result=$adh->setThirdPartyId(GETPOST("socid"));
+ $result=$adh->setThirdPartyId(GETPOST('socid','int'));
if ($result < 0) dol_print_error($adh->db,$adh->error);
$_POST['action']='';
$action='';
diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php
index c7e596fe1a1..f62b7781be8 100644
--- a/htdocs/adherents/document.php
+++ b/htdocs/adherents/document.php
@@ -37,7 +37,7 @@ $langs->load('other');
$mesg = "";
// Security check
-$id = GETPOST('id');
+$id = GETPOST('id','int');
if ($user->societe_id > 0)
{
$id = $user->societe_id;
diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php
index 3278d89ae44..27acbae6c54 100644
--- a/htdocs/adherents/fiche.php
+++ b/htdocs/adherents/fiche.php
@@ -782,7 +782,7 @@ if ($action == 'create')
{
foreach($extrafields->attribute_label as $key=>$label)
{
- $value=(GETPOST('options_'.$key,'alpha')?GETPOST('options_'.$key,'alpha'):$object->array_options["options_".$key]);
+ $value=(isset($_POST["options_".$key])?GETPOST('options_'.$key,'alpha'):$object->array_options["options_".$key]);
print '| '.$label.' | ';
print $extrafields->showInputField($key,$value);
print ' |
'."\n";
diff --git a/htdocs/adherents/ldap.php b/htdocs/adherents/ldap.php
index 5e3456c2cfd..304e0664225 100644
--- a/htdocs/adherents/ldap.php
+++ b/htdocs/adherents/ldap.php
@@ -34,7 +34,7 @@ $langs->load("members");
$langs->load("ldap");
$langs->load("admin");
-$rowid = GETPOST("id");
+$rowid = GETPOST('id','int');
$action = GETPOST('action');
// Protection
diff --git a/htdocs/adherents/note.php b/htdocs/adherents/note.php
index 7a2b9c3aca3..0cae0490222 100644
--- a/htdocs/adherents/note.php
+++ b/htdocs/adherents/note.php
@@ -28,7 +28,7 @@ require_once(DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php');
require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent_type.class.php");
$action=GETPOST('action');
-$id=GETPOST("id");
+$id=GETPOST('id','int');
$langs->load("companies");
$langs->load("members");
diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php
index c3486f5aeb1..8c5484d3e92 100644
--- a/htdocs/adherents/stats/index.php
+++ b/htdocs/adherents/stats/index.php
@@ -31,8 +31,8 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/member.lib.php");
$WIDTH=500;
$HEIGHT=200;
-$userid=GETPOST('userid'); if ($userid < 0) $userid=0;
-$socid=GETPOST('socid'); if ($socid < 0) $socid=0;
+$userid=GETPOST('userid','int'); if ($userid < 0) $userid=0;
+$socid=GETPOST('socid','int'); if ($socid < 0) $socid=0;
// Security check
if ($user->societe_id > 0)
{
diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php
index 65f1fc4f64a..3b5baa48d1e 100644
--- a/htdocs/admin/dict.php
+++ b/htdocs/admin/dict.php
@@ -296,7 +296,7 @@ complete_dictionnary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort
// Define elementList and sourceList (used for dictionnary "type of contacts")
$elementList = array();
$sourceList=array();
-if (GETPOST("id") == 11)
+if (GETPOST('id','int') == 11)
{
$langs->load("orders");
$langs->load("contracts");
@@ -702,7 +702,7 @@ if ($_GET["id"])
if ($num > $listlimit)
{
print '| ';
- print_fleche_navigation($page,$_SERVER["PHP_SELF"],'&id='.GETPOST('id'),($num > $listlimit),$langs->trans("Page").' '.($page+1));
+ print_fleche_navigation($page,$_SERVER["PHP_SELF"],'&id='.GETPOST('id','int'),($num > $listlimit),$langs->trans("Page").' '.($page+1));
print ' |
';
}
@@ -737,10 +737,10 @@ if ($_GET["id"])
// Affiche nom du champ
if ($showfield)
{
- print_liste_field_titre($valuetoshow,"dict.php",$fieldlist[$field],($page?'page='.$page.'&':'').'&id='.GETPOST("id"),"","",$sortfield,$sortorder);
+ print_liste_field_titre($valuetoshow,"dict.php",$fieldlist[$field],($page?'page='.$page.'&':'').'&id='.GETPOST('id','int'),"","",$sortfield,$sortorder);
}
}
- print_liste_field_titre($langs->trans("Status"),"dict.php","active",($page?'page='.$page.'&':'').'&id='.GETPOST("id"),"",'align="center"',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("Status"),"dict.php","active",($page?'page='.$page.'&':'').'&id='.GETPOST('id','int'),"",'align="center"',$sortfield,$sortorder);
print ' | ';
print '';
@@ -756,7 +756,7 @@ if ($_GET["id"])
{
print '