supress potential "Undefined index" notices
authorIan Lawrence Barwick <barwick@gmail.com>
Sat, 9 Feb 2013 00:48:44 +0000 (09:48 +0900)
committerJehan-Guillaume (ioguix) de Rorthais <ioguix@free.fr>
Tue, 5 Mar 2013 16:45:37 +0000 (17:45 +0100)
plugins/Report/plugin.php

index 9cfc5cc54291c652197c47ff37f0abfb41f683d5..467a764670a5bbec00944410e50c22fb8f5e784e 100644 (file)
@@ -519,7 +519,12 @@ class Report extends Plugin {
                        $_REQUEST['sortkey'] = isset($_REQUEST['sortkey']) ? $_REQUEST['sortkey'] : '';
                        if (preg_match('/^[0-9]+$/', $_REQUEST['sortkey']) && $_REQUEST['sortkey'] > 0) $orderby = array($_REQUEST['sortkey'] => $_REQUEST['sortdir']);
                                else $orderby = array();
-                               $_REQUEST['report_sql'] = $data->getSelectSQL($_REQUEST[$_REQUEST['subject']], array(), array(), array(), $orderby);
+
+            $subject = isset($_REQUEST['subject']) && isset($_REQUEST[$_REQUEST['subject']])
+                ? $_REQUEST[$_REQUEST['subject']]
+                : '';
+
+            $_REQUEST['report_sql'] = $data->getSelectSQL($subject, array(), array(), array(), $orderby);
                }
 
                if (isset($_REQUEST['database'])) {