From 802939eea703b95eee68bc196847ee62552d12d2 Mon Sep 17 00:00:00 2001 From: Artem Date: Tue, 18 Dec 2012 17:17:44 +0200 Subject: [PATCH] Update framework/web/CClientScript.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Сompromise solution. If we has a we use him, else we use --- framework/web/CClientScript.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/framework/web/CClientScript.php b/framework/web/CClientScript.php index 7e1d7fe64..6bee84a12 100644 --- a/framework/web/CClientScript.php +++ b/framework/web/CClientScript.php @@ -371,8 +371,11 @@ class CClientScript extends CApplicationComponent if($html!=='') { - $count=0; - $output=preg_replace('/<\\/title\s*>/is','$1<###head###>',$output,1,$count); + $count=0; + $output=preg_replace('/<\\/head\s*>/is','<###head###>$1',$output,1,$count); + if(!$count) + $output=preg_replace('/<\\/title\s*>/is','$1<###head###>',$output,1,$count); + if($count) $output=str_replace('<###head###>',$html,$output); else