S
S
sowich2013-04-09 20:16:35
Yii
sowich, 2013-04-09 20:16:35

Title at the top of the page. How?

Guys, for some reason Yii "sculpts" all the scripts and meta tags that I set BEFORE this tag. I need after. What is the benefit of the framework solution and how to get around it? I read on the forum how to get around this, is there really no more elegant solution?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
B
Boris Syomov, 2013-04-09
@kotomyava

Counter question - what's stopping you?

S
sowich, 2013-04-09
@sowich

Usually it was always above meta tags + the client found fault.

S
stan_jeremy, 2013-04-09
@stan_jeremy

did not google the same forum
yiiframework.ru/forum/viewtopic.php?f=3&t=2327&start=10#p18186

H
heresik, 2013-04-09
@heresik

Make your own MyClientScript class (inherit from CClientScript).
Override the renderHead method.
Namely, replace the regular expression used there preg_replace('/(<title\b[^>]*>|<\\/head\s*>)/is','<###head###>$1', $output,1,$count); to such that it inserts scripts where you need
Well, or directly change this regular expression in the framework code.

S
sefus, 2013-04-10
@sefus

What are the benefits you ask?

Modern browsers try to determine the encoding of a page on the fly and interpret html according to that encoding. If the tag is located before the tag and filled with user data, a hacker can insert a malicious html code in UTF-7 encoding, thus bypassing the filtering of characters such as < and ".[7][8]
en.wikipedia.org/ wiki/%D0%9C%D0%B5%D0%B6%D1%81%D0%B0%D0%B9%D1%82%D0%BE%D0%B2%D1%8B%D0%B9_%D1%81 %D0%BA%D1%80%D0%B8%D0%BF%D1%82%D0%B8%D0%BD%D0%B3

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question