Skip to content

Commit 3df25ba

Browse files
committed
[ticket/13597] Modify variable-variable syntax to be compatible with PHP7
PHPBB3-13597
1 parent c6a3715 commit 3df25ba

7 files changed

Lines changed: 14 additions & 14 deletions

File tree

phpBB/develop/add_permissions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,9 @@
198198
foreach ($prefixes as $prefix)
199199
{
200200
$var = $prefix . 'permissions';
201-
if (sizeof($$var))
201+
if (sizeof(${$var}))
202202
{
203-
foreach ($$var as $auth_option => $l_ary)
203+
foreach (${$var} as $auth_option => $l_ary)
204204
{
205205
$sql_ary = array(
206206
'auth_option' => $auth_option,

phpBB/includes/acp/acp_profile.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ function main($id, $mode)
460460

461461
if (!$cp->vars[$key] && $action == 'edit')
462462
{
463-
$cp->vars[$key] = $$key;
463+
$cp->vars[$key] = ${$key};
464464
}
465465

466466
$field_data = $cp->vars;

phpBB/includes/functions_content.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function gen_sort_selects(&$limit_days, &$sort_by_text, &$sort_days, &$sort_key,
7878
foreach ($sorts as $name => $sort_ary)
7979
{
8080
$key = $sort_ary['key'];
81-
$selected = $$sort_ary['key'];
81+
$selected = ${$sort_ary['key']};
8282

8383
// Check if the key is selectable. If not, we reset to the default or first key found.
8484
// This ensures the values are always valid. We also set $sort_dir/sort_key/etc. to the
@@ -87,12 +87,12 @@ function gen_sort_selects(&$limit_days, &$sort_by_text, &$sort_days, &$sort_key,
8787
{
8888
if ($sort_ary['default'] !== false)
8989
{
90-
$selected = $$key = $sort_ary['default'];
90+
$selected = ${$key} = $sort_ary['default'];
9191
}
9292
else
9393
{
9494
@reset($sort_ary['options']);
95-
$selected = $$key = key($sort_ary['options']);
95+
$selected = ${$key} = key($sort_ary['options']);
9696
}
9797
}
9898

phpBB/includes/functions_messenger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ function msg_email()
510510

511511
foreach ($address_ary as $which_ary)
512512
{
513-
$$type .= (($$type != '') ? ', ' : '') . (($which_ary['name'] != '') ? mail_encode($which_ary['name'], $encode_eol) . ' <' . $which_ary['email'] . '>' : $which_ary['email']);
513+
${$type} .= ((${$type} != '') ? ', ' : '') . (($which_ary['name'] != '') ? mail_encode($which_ary['name'], $encode_eol) . ' <' . $which_ary['email'] . '>' : $which_ary['email']);
514514
}
515515
}
516516

phpBB/includes/functions_privmsgs.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1415,9 +1415,9 @@ function rebuild_header($check_ary)
14151415
$_types = array('u', 'g');
14161416
foreach ($_types as $type)
14171417
{
1418-
if (sizeof($$type))
1418+
if (sizeof(${$type}))
14191419
{
1420-
foreach ($$type as $id)
1420+
foreach (${$type} as $id)
14211421
{
14221422
$address[$type][$id] = $check_type;
14231423
}

phpBB/includes/functions_user.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ function user_get_id_name(&$user_id_ary, &$username_ary, $user_type = false)
4444

4545
$which_ary = ($user_id_ary) ? 'user_id_ary' : 'username_ary';
4646

47-
if ($$which_ary && !is_array($$which_ary))
47+
if (${$which_ary} && !is_array(${$which_ary}))
4848
{
49-
$$which_ary = array($$which_ary);
49+
${$which_ary} = array(${$which_ary});
5050
}
5151

52-
$sql_in = ($which_ary == 'user_id_ary') ? array_map('intval', $$which_ary) : array_map('utf8_clean_string', $$which_ary);
53-
unset($$which_ary);
52+
$sql_in = ($which_ary == 'user_id_ary') ? array_map('intval', ${$which_ary}) : array_map('utf8_clean_string', ${$which_ary});
53+
unset(${$which_ary});
5454

5555
$user_id_ary = $username_ary = array();
5656

phpBB/install/install_convert.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ function get_convert_settings($sub)
599599
'S_EXPLAIN' => $vars['explain'],
600600
'S_LEGEND' => false,
601601
'TITLE_EXPLAIN' => ($vars['explain']) ? $lang[$vars['lang'] . '_EXPLAIN'] : '',
602-
'CONTENT' => $this->p_master->input_field($config_key, $vars['type'], $$config_key, $options),
602+
'CONTENT' => $this->p_master->input_field($config_key, $vars['type'], ${$config_key}, $options),
603603
)
604604
);
605605
}

0 commit comments

Comments
 (0)