From 515d9beb62081185a21074fb9bef2c78d082fe00 Mon Sep 17 00:00:00 2001 From: joomlart Date: Fri, 15 Nov 2013 11:21:07 +0700 Subject: [PATCH] T3: Fix injection after body when body tag has attribute --- source/plg_system_t3/includes/core/template.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/plg_system_t3/includes/core/template.php b/source/plg_system_t3/includes/core/template.php index de85726380..a5bbab3e90 100644 --- a/source/plg_system_t3/includes/core/template.php +++ b/source/plg_system_t3/includes/core/template.php @@ -490,7 +490,7 @@ function snippet() $places = array(); $contents = array(); - + if (($openhead = $this->getParam('snippet_open_head', ''))) { $places[] = ''; //not sure that any attritube can be place in head open tag, profile is not support in html5 $contents[] = "\n" . $openhead; @@ -500,11 +500,12 @@ function snippet() $contents[] = $closehead . "\n"; } if (($openbody = $this->getParam('snippet_open_body', ''))) { + $body = JResponse::getBody(); + if(strpos($body, '') !== false){ $places[] = ''; $contents[] = "\n" . $openbody; - } else { //in case the body has other attribute - $body = JResponse::getBody(); + } else { //in case the body has other attribute $body = preg_replace('@]*?>@msU', "$0\n" . $openbody, $body); JResponse::setBody($body); }