Skip to content

Commit

Permalink
Check that settings aren't closures before sending them through eval()
Browse files Browse the repository at this point in the history
This resolves rollbar#89
  • Loading branch information
squatto committed Nov 7, 2019
1 parent 7582a2a commit aee958f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,8 @@ public function buildPHPConfig()
$config['timeout'] = intval($this->settings['timeout']);

foreach (UI::settingsOfType(UI::SETTING_INPUT_TYPE_PHP) as $setting) {
if (isset($config[$setting])) {

if (isset($config[$setting]) && ! ($config[$setting] instanceof \Closure)) {

$code = is_string($config[$setting]) ?: 'return ' . var_export($config[$setting], true) . ';';

Expand Down

0 comments on commit aee958f

Please sign in to comment.