[ticket/10035] ACP template edit feature allows to read any files on webserver.

... and to upload/execute any script on it. Use preg_replace to filter filename

PHPBB3-10035
This commit is contained in:
rxu 2011-03-07 21:22:33 +07:00
parent f08cbc73de
commit 9a9b156a8e

View file

@ -716,7 +716,7 @@ parse_css_file = {PARSE_CSS_FILE}
$save_changes = (isset($_POST['save'])) ? true : false;
// make sure template_file path doesn't go upwards
$template_file = str_replace('..', '.', $template_file);
$template_file = preg_replace('#\.{2,}#', '.', $template_file);
// Retrieve some information about the template
$sql = 'SELECT template_storedb, template_path, template_name