diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php
index abbc1e038c5..044b57689d8 100755
--- a/htdocs/admin/pdf.php
+++ b/htdocs/admin/pdf.php
@@ -37,14 +37,15 @@ $langs->load("companies");
$langs->load("products");
$langs->load("members");
-if (!$user->admin)
- accessforbidden();
+if (! $user->admin) accessforbidden();
+
+$action = GETPOST('action','alpha');
/*
* Actions
*/
-if (isset($_POST["action"]) && $_POST["action"] == 'update')
+if ($action == 'update')
{
dolibarr_set_const($db, "MAIN_PDF_FORMAT", $_POST["MAIN_PDF_FORMAT"],'chaine',0,'',$conf->entity);
@@ -75,8 +76,9 @@ print_fiche_titre($langs->trans("PDF"),'','setup');
print $langs->trans("PDFDesc")."
\n";
print "
\n";
+$noCountryCode = (empty($mysoc->country_code) ? true : false);
-if (isset($_GET["action"]) && $_GET["action"] == 'edit') // Edit
+if ($action == 'edit') // Edit
{
print '