summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reid2018-04-25 16:51:20 (GMT)
committerDave Reid2018-04-25 16:51:20 (GMT)
commit1cd77ffa9c2cf96d80b76d47318179a8a82f0d46 (patch)
treea86a8d72a1e4d41fcf01ffb0f14cf980e19b4486
parent0d6a770444d7061a179caf61e6b0da7d5b3fac5e (diff)
Sanitize form parents before using them.7.x-2.19
-rw-r--r--media.module3
1 files changed, 3 insertions, 0 deletions
diff --git a/media.module b/media.module
index 31895a4..cccf879 100644
--- a/media.module
+++ b/media.module
@@ -248,6 +248,9 @@ function media_ajax_upload() {
$form_parents = func_get_args();
$form_build_id = (string) array_pop($form_parents);
+ // Sanitize form parents before using them.
+ $form_parents = array_filter($form_parents, 'element_child');
+
if (empty($_POST['form_build_id']) || $form_build_id != $_POST['form_build_id']) {
// Invalid request.
drupal_set_message(t('An unrecoverable error occurred. The uploaded file likely exceeded the maximum file size (@size) that this server supports.', array('@size' => format_size(file_upload_max_size()))), 'error');