Skip to content

Commit 02bdd73

Browse files
dariusstefanrazvancrainea
authored andcommitted
Remove the use of extract.
Replace it with explicit variable assignments.
1 parent f3b1293 commit 02bdd73

File tree

37 files changed

+318
-140
lines changed

37 files changed

+318
-140
lines changed

web/common/tools/tviewer/custom_actions/add.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
if ($action=="add")
88
{
9-
extract($_POST);
109
if(!$_SESSION['read_only'])
1110
{
1211
require("template/".$page_id.".add.php");

web/common/tools/tviewer/custom_actions/details.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
#################
66
if ($action=="details")
77
{
8-
9-
extract($_POST);
108
foreach ($custom_config[$module_id][$_SESSION[$module_id]['submenu_item_id']]['custom_table_column_defs'] as $key => $value)
119
$_SESSION[$key] = $_POST[$key];
1210

web/common/tools/tviewer/custom_actions/edit.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
{
88

99
if(!$_SESSION['read_only']){
10-
11-
extract($_POST);
1210
foreach ($custom_config[$module_id][$_SESSION[$module_id]['submenu_item_id']]['custom_table_column_defs'] as $key => $value)
1311
$_SESSION[$key] = $_POST[$key];
1412

web/common/tools/tviewer/custom_actions/search.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
if ($action=="dp_act")
99
{
10+
$search = $_POST['search'];
11+
$show_all = $_POST['show_all'];
1012

11-
extract($_GET);
12-
extract($_POST);
1313
if (isset($show_all) && $show_all=="Show All") {
1414
foreach ($custom_config[$module_id][$_SESSION[$module_id]['submenu_item_id']]['custom_table_column_defs'] as $key => $value){
1515
unset($_SESSION[$key]);

web/tools/admin/boxes_config/boxes_config.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
if ($action=="modify_params")
4545
{
4646
if(!$_SESSION['read_only']){
47-
extract($_POST);
4847
$box_id = $_GET['box_id'];
4948
$current_tool=$_GET['tool'];
5049
$box_params=get_boxes_params();
@@ -119,7 +118,6 @@
119118

120119
if ($action=="add")
121120
{
122-
extract($_POST);
123121
if(!$_SESSION['read_only'])
124122
{
125123
require("template/".$page_id.".add.php");
@@ -133,7 +131,6 @@
133131

134132
if ($action == "add_verify") {
135133
if(!$_SESSION['read_only']){
136-
extract($_POST);
137134
$box_params=get_boxes_params();
138135
$params_names = "";
139136
$unknowns ="";

web/tools/admin/boxes_config/lib/system_config.test.inc.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121
*/
2222

2323

24-
extract($_POST);
2524
global $config;
25+
$name = $_POST['name'];
26+
$desc = $_POST['desc'];
2627
$form_valid=true;
2728
if ($form_valid)
2829
if ($name=="") {

web/tools/admin/boxes_config/system_config.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
if ($action=="modify_params")
4545
{
4646
if(!$_SESSION['read_only']){
47-
extract($_POST);
4847
$assoc_id = $_GET['assoc_id'];
4948
$current_tool=$_GET['tool'];
5049
$system_params=get_system_params();
@@ -109,7 +108,6 @@
109108

110109
if ($action=="add")
111110
{
112-
extract($_POST);
113111
if(!$_SESSION['read_only'])
114112
{
115113
require("template/".$page_id.".add.php");
@@ -122,8 +120,7 @@
122120
}
123121

124122
if ($action == "add_verify") {
125-
if(!$_SESSION['read_only']){
126-
extract($_POST);
123+
if(!$_SESSION['read_only']) {
127124
require("lib/".$page_id.".test.inc.php");
128125
$system_params=get_system_params();
129126
$params_names = "";

web/tools/admin/db_config/db_config.details.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
* along with this program; if not, write to the Free Software
2020
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2121
*/
22-
extract($_GET);
22+
23+
$db_id = $_GET['db_id'];
2324

2425
require(__DIR__."/../../../../config/db.inc.php");
2526
require(__DIR__."/../../../../web/common/cfg_comm.php");
@@ -30,6 +31,11 @@
3031
$name = $config->db_name;
3132
$pass = $config->db_pass;
3233
} else {
34+
$host = $_GET['host'];
35+
$port = $_GET['port'];
36+
$user = $_GET['user'];
37+
$name = $_GET['name'];
38+
$pass = $_GET['pass'];
3339
}
3440
?>
3541
<table width="400" border="0">

web/tools/admin/db_config/db_config.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,13 @@
4444
if ($action=="modify_params")
4545
{
4646
if(!$_SESSION['read_only']){
47-
extract($_POST);
47+
$config_name = $_POST['config_name'];
48+
$db_host = $_POST['db_host'];
49+
$db_name = $_POST['db_name'];
50+
$db_port = $_POST['db_port'];
51+
$db_pass = $_POST['db_pass'];
52+
$db_user = $_POST['db_user'];
53+
4854
$id = $_GET['db_id'];
4955
$sql = "UPDATE ".$table." SET config_name=?, db_host=?, db_pass=?,
5056
db_user=?, db_name=?, db_port=? WHERE id=?";
@@ -104,7 +110,6 @@
104110

105111
if ($action=="add")
106112
{
107-
extract($_POST);
108113
if(!$_SESSION['read_only'])
109114
{
110115
require("template/".$page_id.".add.php");
@@ -117,7 +122,12 @@
117122

118123
if ($action == "add_verify") {
119124
if(!$_SESSION['read_only']){
120-
extract($_POST);
125+
$config_name = $_POST['config_name'];
126+
$db_host = $_POST['db_host'];
127+
$db_name = $_POST['db_name'];
128+
$db_port = $_POST['db_port'];
129+
$db_pass = $_POST['db_pass'];
130+
$db_user = $_POST['db_user'];
121131

122132
$sql = 'INSERT INTO '.$table.' (config_name, db_host, db_name,
123133
db_port, db_pass, db_user) VALUES (?,?,?,?,?,?)';

web/tools/admin/list_admins/lib/list_admins.inc.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@
2121
*/
2222

2323

24-
extract($_POST);
24+
$listfname=$_POST['list_fname'];
25+
$listlname=$_POST['list_lname'];
26+
$listuname=$_POST['list_uname'];
27+
$listpasswd=$_POST['list_passwd'];
28+
$conf_passwd=$_POST['confirm_passwd'];
29+
2530
global $config;
2631
$form_valid=true;
2732
if ($form_valid)

0 commit comments

Comments
 (0)