From f696d91690075a8e0ff01326ea6c632e86cdb351 Mon Sep 17 00:00:00 2001 From: Dieter Adriaenssens Date: Tue, 15 Jan 2013 14:22:45 +0100 Subject: [PATCH 1/4] don't use tabs for indenting --- libraries/display_change_password.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/display_change_password.lib.php b/libraries/display_change_password.lib.php index 70c594f06d..f6355c76a3 100644 --- a/libraries/display_change_password.lib.php +++ b/libraries/display_change_password.lib.php @@ -89,7 +89,7 @@ function PMA_getHtmlForChangePassword($username, $hostname) { . '' . '' . '' . ''; return $html; From a33515a155950da15f2db4b25b89f6117517b0d7 Mon Sep 17 00:00:00 2001 From: Dieter Adriaenssens Date: Tue, 15 Jan 2013 14:24:48 +0100 Subject: [PATCH 2/4] use require when including a file unconditionally --- db_tracking.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db_tracking.php b/db_tracking.php index 92391c3eac..e95a7e0a5f 100644 --- a/db_tracking.php +++ b/db_tracking.php @@ -18,7 +18,7 @@ $scripts->addFile('db_structure.js'); /** * If we are not in an Ajax request, then do the common work and show the links etc. */ -include 'libraries/db_common.inc.php'; +require 'libraries/db_common.inc.php'; $url_query .= '&goto=tbl_tracking.php&back=db_tracking.php'; // Get the database structure From b1431bae58273a85b2cb101cf7e00cf5ad3fdb85 Mon Sep 17 00:00:00 2001 From: Dieter Adriaenssens Date: Tue, 15 Jan 2013 14:29:16 +0100 Subject: [PATCH 3/4] improve coding style : correct syntax with if-then-else statements --- tbl_chart.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tbl_chart.php b/tbl_chart.php index 5031b63799..b866c4a1e6 100644 --- a/tbl_chart.php +++ b/tbl_chart.php @@ -15,14 +15,13 @@ require_once 'libraries/common.inc.php'; * Execute the query and return the result */ -if(isset($_REQUEST['ajax_request']) && isset($_REQUEST['pos']) && isset($_REQUEST['session_max_rows'])) { +if (isset($_REQUEST['ajax_request']) && isset($_REQUEST['pos']) && isset($_REQUEST['session_max_rows'])) { $response = PMA_Response::getInstance(); if (strlen($GLOBALS['table']) && strlen($GLOBALS['db'])) { include './libraries/tbl_common.inc.php'; - } - else { + } else { $response->isSuccess(false); $response->addJSON('message', __('Error')); exit; @@ -36,7 +35,7 @@ if(isset($_REQUEST['ajax_request']) && isset($_REQUEST['pos']) && isset($_REQUES $data[] = $row; } - if(empty($data)) { + if (empty($data)) { $response->isSuccess(false); $response->addJSON('message', __('No data to display')); exit; From 42dc425c0b695470481169b028fc626025282438 Mon Sep 17 00:00:00 2001 From: Dieter Adriaenssens Date: Tue, 15 Jan 2013 14:31:56 +0100 Subject: [PATCH 4/4] wrap long lines --- tbl_chart.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tbl_chart.php b/tbl_chart.php index b866c4a1e6..94e24854fd 100644 --- a/tbl_chart.php +++ b/tbl_chart.php @@ -15,8 +15,10 @@ require_once 'libraries/common.inc.php'; * Execute the query and return the result */ -if (isset($_REQUEST['ajax_request']) && isset($_REQUEST['pos']) && isset($_REQUEST['session_max_rows'])) { - +if (isset($_REQUEST['ajax_request']) + && isset($_REQUEST['pos']) + && isset($_REQUEST['session_max_rows']) +) { $response = PMA_Response::getInstance(); if (strlen($GLOBALS['table']) && strlen($GLOBALS['db'])) { @@ -27,7 +29,8 @@ if (isset($_REQUEST['ajax_request']) && isset($_REQUEST['pos']) && isset($_REQUE exit; } - $sql_limit_to_append = ' LIMIT ' . $_REQUEST['pos'] . ', ' . $_REQUEST['session_max_rows'] . " "; + $sql_limit_to_append = ' LIMIT ' . $_REQUEST['pos'] . ', ' + . $_REQUEST['session_max_rows'] . " "; $sql_query .= $sql_limit_to_append; $data = array(); $result = PMA_DBI_try_query($sql_query); @@ -170,9 +173,12 @@ url_query = ''; foreach ($keys as $idx => $key) { if (in_array($fields_meta[$idx]->type, $numeric_types)) { if ($idx == $yaxis) { - echo ''; + echo ''; } else { - echo ''; + echo ''; } } }