mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/12724] Add Squiz.PHP.Eval in the legacy ruleset
PHPBB3-12724
This commit is contained in:
parent
3a96c5b753
commit
5a320adc75
5 changed files with 25 additions and 0 deletions
|
@ -41,6 +41,9 @@
|
||||||
</rule>
|
</rule>
|
||||||
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterHint" />
|
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterHint" />
|
||||||
|
|
||||||
|
<!-- The eval() function MUST NOT be used. -->
|
||||||
|
<rule ref="Squiz.PHP.Eval" />
|
||||||
|
|
||||||
<!-- There MUST NOT be trailing whitespace at the end of lines. -->
|
<!-- There MUST NOT be trailing whitespace at the end of lines. -->
|
||||||
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace" />
|
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace" />
|
||||||
|
|
||||||
|
|
|
@ -1287,7 +1287,9 @@ function restore_config($schema)
|
||||||
{
|
{
|
||||||
$var = (empty($m[2]) || empty($convert_config[$m[2]])) ? "''" : "'" . addslashes($convert_config[$m[2]]) . "'";
|
$var = (empty($m[2]) || empty($convert_config[$m[2]])) ? "''" : "'" . addslashes($convert_config[$m[2]]) . "'";
|
||||||
$exec = '$config_value = ' . $m[1] . '(' . $var . ');';
|
$exec = '$config_value = ' . $m[1] . '(' . $var . ');';
|
||||||
|
// @codingStandardsIgnoreStart
|
||||||
eval($exec);
|
eval($exec);
|
||||||
|
// @codingStandardsIgnoreEnd
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -456,7 +456,9 @@ class p_master
|
||||||
);
|
);
|
||||||
|
|
||||||
$is_auth = false;
|
$is_auth = false;
|
||||||
|
// @codingStandardsIgnoreStart
|
||||||
eval('$is_auth = (int) (' . $module_auth . ');');
|
eval('$is_auth = (int) (' . $module_auth . ');');
|
||||||
|
// @codingStandardsIgnoreEnd
|
||||||
|
|
||||||
return $is_auth;
|
return $is_auth;
|
||||||
}
|
}
|
||||||
|
|
|
@ -752,12 +752,16 @@ class module
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'select':
|
case 'select':
|
||||||
|
// @codingStandardsIgnoreStart
|
||||||
eval('$s_options = ' . str_replace('{VALUE}', $value, $options) . ';');
|
eval('$s_options = ' . str_replace('{VALUE}', $value, $options) . ';');
|
||||||
|
// @codingStandardsIgnoreEnd
|
||||||
$tpl = '<select id="' . $name . '" name="' . $name . '">' . $s_options . '</select>';
|
$tpl = '<select id="' . $name . '" name="' . $name . '">' . $s_options . '</select>';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'custom':
|
case 'custom':
|
||||||
|
// @codingStandardsIgnoreStart
|
||||||
eval('$tpl = ' . str_replace('{VALUE}', $value, $options) . ';');
|
eval('$tpl = ' . str_replace('{VALUE}', $value, $options) . ';');
|
||||||
|
// @codingStandardsIgnoreEnd
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -1021,7 +1021,9 @@ class install_convert extends module
|
||||||
// Now process queries and execute functions that have to be executed prior to the conversion
|
// Now process queries and execute functions that have to be executed prior to the conversion
|
||||||
if (!empty($convert->convertor['execute_first']))
|
if (!empty($convert->convertor['execute_first']))
|
||||||
{
|
{
|
||||||
|
// @codingStandardsIgnoreStart
|
||||||
eval($convert->convertor['execute_first']);
|
eval($convert->convertor['execute_first']);
|
||||||
|
// @codingStandardsIgnoreEnd
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($convert->convertor['query_first']))
|
if (!empty($convert->convertor['query_first']))
|
||||||
|
@ -1091,7 +1093,9 @@ class install_convert extends module
|
||||||
// process execute_first and query_first for this table...
|
// process execute_first and query_first for this table...
|
||||||
if (!empty($schema['execute_first']))
|
if (!empty($schema['execute_first']))
|
||||||
{
|
{
|
||||||
|
// @codingStandardsIgnoreStart
|
||||||
eval($schema['execute_first']);
|
eval($schema['execute_first']);
|
||||||
|
// @codingStandardsIgnoreEnd
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($schema['query_first']))
|
if (!empty($schema['query_first']))
|
||||||
|
@ -1156,7 +1160,9 @@ class install_convert extends module
|
||||||
// it gets split because of time restrictions
|
// it gets split because of time restrictions
|
||||||
if (!empty($schema['execute_always']))
|
if (!empty($schema['execute_always']))
|
||||||
{
|
{
|
||||||
|
// @codingStandardsIgnoreStart
|
||||||
eval($schema['execute_always']);
|
eval($schema['execute_always']);
|
||||||
|
// @codingStandardsIgnoreEnd
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -1667,13 +1673,17 @@ class install_convert extends module
|
||||||
{
|
{
|
||||||
if (!is_array($convert->convertor['execute_last']))
|
if (!is_array($convert->convertor['execute_last']))
|
||||||
{
|
{
|
||||||
|
// @codingStandardsIgnoreStart
|
||||||
eval($convert->convertor['execute_last']);
|
eval($convert->convertor['execute_last']);
|
||||||
|
// @codingStandardsIgnoreEnd
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
while ($last_statement < sizeof($convert->convertor['execute_last']))
|
while ($last_statement < sizeof($convert->convertor['execute_last']))
|
||||||
{
|
{
|
||||||
|
// @codingStandardsIgnoreStart
|
||||||
eval($convert->convertor['execute_last'][$last_statement]);
|
eval($convert->convertor['execute_last'][$last_statement]);
|
||||||
|
// @codingStandardsIgnoreEnd
|
||||||
|
|
||||||
$template->assign_block_vars('checks', array(
|
$template->assign_block_vars('checks', array(
|
||||||
'TITLE' => $convert->convertor['execute_last'][$last_statement],
|
'TITLE' => $convert->convertor['execute_last'][$last_statement],
|
||||||
|
@ -2035,7 +2045,9 @@ class install_convert extends module
|
||||||
|
|
||||||
$execution = str_replace('{RESULT}', '$value', $execution);
|
$execution = str_replace('{RESULT}', '$value', $execution);
|
||||||
$execution = str_replace('{VALUE}', '$value', $execution);
|
$execution = str_replace('{VALUE}', '$value', $execution);
|
||||||
|
// @codingStandardsIgnoreStart
|
||||||
eval($execution);
|
eval($execution);
|
||||||
|
// @codingStandardsIgnoreEnd
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2082,7 +2094,9 @@ class install_convert extends module
|
||||||
|
|
||||||
$execution = str_replace('{RESULT}', '$value', $execution);
|
$execution = str_replace('{RESULT}', '$value', $execution);
|
||||||
$execution = str_replace('{VALUE}', '$value', $execution);
|
$execution = str_replace('{VALUE}', '$value', $execution);
|
||||||
|
// @codingStandardsIgnoreStart
|
||||||
eval($execution);
|
eval($execution);
|
||||||
|
// @codingStandardsIgnoreEnd
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue