Fix multiple bugs related to GPC parameters pollution from code
authorJehan-Guillaume (ioguix) de Rorthais <ioguix@free.fr>
Mon, 18 Feb 2013 22:35:42 +0000 (23:35 +0100)
committerJehan-Guillaume (ioguix) de Rorthais <ioguix@free.fr>
Wed, 20 Feb 2013 10:15:43 +0000 (11:15 +0100)
Was introduced by me in e1a5b9c54f3ea112a0ce5b2f0f3a0ace9583a354 while
trying to make parameter more plugin friendly. display.php code default
code use a defined set of GPC parameter and make them persitent between
two call (while paging or sorting data). Any other parameter is ignored
and doesn't survive a new call. This patch attempted to make plugin
specific GPC parameters persistants, but was making ALL parameters
persitants, introducing a bunch of bug.

This one revert part of this previous patch but keep the small
house-cleaning.

display.php

index a0504dd485e3ce8be636392008ee4784d5c50a5a..242d45c5e3f02d84d9bcd374018a3f6859051091 100644 (file)
 
                $fkey_information =& getFKInfo();
 
-               // Build array OF parameters for sorts/pages links
-               $_gets = $_REQUEST;
-               unset($_gets['query']);
-               unset($_gets['MAX_FILE_SIZE']);
+               // Build strings for GETs in array
+               $_gets = array(
+                       'server' => $_REQUEST['server'],
+                       'database' => $_REQUEST['database']
+               );
+
+               if (isset($_REQUEST['schema'])) $_gets['schema'] = $_REQUEST['schema'];
+               if (isset($object)) $_gets[$subject] = $object;
+               if (isset($subject)) $_gets['subject'] = $subject;
+               if (isset($_REQUEST['query'])) $_gets['query'] = $_REQUEST['query'];
+               if (isset($_REQUEST['count'])) $_gets['count'] = $_REQUEST['count'];
+               if (isset($_REQUEST['return'])) $_gets['return'] = $_REQUEST['return'];
+               if (isset($_REQUEST['search_path'])) $_gets['search_path'] = $_REQUEST['search_path'];
+               if (isset($_REQUEST['table'])) $_gets['table'] = $_REQUEST['table'];
+               if (isset($_REQUEST['sortkey'])) $_gets['sortkey'] = $_REQUEST['sortkey'];
+               if (isset($_REQUEST['sortdir'])) $_gets['sortdir'] = $_REQUEST['sortdir'];
+               $_gets['strings'] = $_REQUEST['strings'];
 
                if ($save_history && is_object($rs) && ($type == 'QUERY')) //{
                        $misc->saveScriptHistory($_REQUEST['query']);