From a1666c72c607922ed60c44adfb794b7d2176f9c8 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Wed, 11 Apr 2018 14:10:33 -0500 Subject: [PATCH] Internal: Exit stylesheet upload if name_stylesheet is not properly defined --- main/admin/settings.lib.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main/admin/settings.lib.php b/main/admin/settings.lib.php index bc1f17214c..486697ecfd 100755 --- a/main/admin/settings.lib.php +++ b/main/admin/settings.lib.php @@ -521,6 +521,10 @@ function uploadStylesheet($values, $picture) $result = false; // Valid name for the stylesheet folder. $style_name = api_preg_replace('/[^A-Za-z0-9]/', '', $values['name_stylesheet']); + if (empty($style_name) or is_array($style_name)) { + // The name of the uploaded stylesheet doesn't have the expected format + return $result; + } $cssToUpload = CSS_UPLOAD_PATH; // Check if a virtual instance vchamilo is used