From 727fc871c6522cf37fe01a8b2aaafb2b36d8cca6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 29 Aug 2010 18:29:19 +0000 Subject: [PATCH] Replace javascript by jQuery --- htdocs/core/class/html.form.class.php | 2 +- htdocs/lib/functions.lib.php | 10 ++++++++++ htdocs/main.inc.php | 5 +++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 31954ef9da3..45601f3b6b0 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -565,7 +565,7 @@ class Form } else { - print ''; if ($showempty) print ''; $num = $this->db->num_rows($resql); $i = 0; diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index c0a444fcc84..62809091b9b 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -37,6 +37,16 @@ if (! defined('DOL_DOCUMENT_ROOT')) define('DOL_DOCUMENT_ROOT', '..'); if (! defined('ADODB_DATE_VERSION')) include_once(DOL_DOCUMENT_ROOT."/includes/adodbtime/adodb-time.inc.php"); +/** + * \brief Return value of a param into get or post variable + * \param paramname Name of parameter to found + * \return string Value found + */ +function GETPOST($paramname) +{ + return isset($_GET[$paramname])?$_GET[$paramname]:(isset($_POST[$paramname])?$_POST[$paramname]:''); +} + /** * \brief Create a clone of instance of object (new instance with same properties) * This function works for both PHP4 and PHP5 diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 8d89b8b3d76..365a6ac97ae 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -57,7 +57,7 @@ if (function_exists('get_magic_quotes_gpc')) // magic_quotes_* removed in PHP6 { $_GET = array_map('stripslashes_deep', $_GET); $_POST = array_map('stripslashes_deep', $_POST); - $_REQUEST = array_map('stripslashes_deep', $_REQUEST); +// $_REQUEST = array_map('stripslashes_deep', $_REQUEST); $_COOKIE = array_map('stripslashes_deep', $_COOKIE); } @set_magic_quotes_runtime(0); @@ -231,7 +231,8 @@ if (! empty($conf->global->MAIN_SECURITY_CSRF)) // Check validity of token, only } // Disable modules (this must be after session_start and after conf has been loaded) -if (! empty($_REQUEST["disablemodules"])) $_SESSION["disablemodules"]=$_REQUEST["disablemodules"]; +if (! empty($_GET["disablemodules"])) $_SESSION["disablemodules"]=$_GET["disablemodules"]; +if (! empty($_POST["disablemodules"])) $_SESSION["disablemodules"]=$_POST["disablemodules"]; if (! empty($_SESSION["disablemodules"])) { $disabled_modules=explode(',',$_SESSION["disablemodules"]);