Skip to content

Commit a1732ca

Browse files
authored
Merge pull request #2426 from elcreator/ref-remove-eval-from-browser
ref(manager): Removed eval from browser.php
2 parents a488e6e + d80c396 commit a1732ca

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

‎manager/media/browser/mcpuk/core/browser.php‎

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,15 +1224,10 @@ protected function output($data = null, $template = null)
12241224

12251225
if (file_exists("tpl/tpl_$template.php")) {
12261226
ob_start();
1227-
$eval = "unset(\$data);unset(\$template);unset(\$eval);";
1228-
$_ = $data;
1229-
foreach (array_keys($data) as $key) {
1230-
if (preg_match('/^[a-z\d_]+$/i', $key)) {
1231-
$eval .= "\$$key=\$_['$key'];";
1232-
}
1233-
}
1234-
$eval .= "unset(\$_);require \"tpl/tpl_$template.php\";";
1235-
eval($eval);
1227+
// EXTR_SKIP keeps $data/$template/$this from being clobbered by a data key.
1228+
extract($data, EXTR_SKIP);
1229+
unset($data);
1230+
require "tpl/tpl_$template.php";
12361231

12371232
return ob_get_clean();
12381233
}

0 commit comments

Comments
 (0)