
23.03.2010, 23:13
|
|
Он хакер.
Регистрация: 01.11.2008
Сообщений: 1,756
С нами:
9223466
Репутация:
3171
|
|
Сообщение от SeNaP
А как тогда с этим бороться?
class скручен с DLE
PHP код:
public function load_template($tpl_name) {
$time_before = $this->get_real_time();
if ($tpl_name == '' || !file_exists($this->dir . DIRECTORY_SEPARATOR . $tpl_name)) { die ("Невозможно загрузить шаблон: ". $tpl_name); return false;}
$this->template = file_get_contents($this->dir . DIRECTORY_SEPARATOR . $tpl_name);
if ( stristr( $this->template, "{include file=" ) ) {
$this->template = preg_replace( "#\\{include file=['\"](.+?)['\"]\\}#ies","\$this->sub_load_template('\\1')", $this->template);
}
$this->copy_template = $this->template;
$this->template_parse_time += $this->get_real_time() - $time_before;
return true;
}
Можно прикрутить поиск шаблоного тега,и замены через Eval.
В шаблоне пишеш что-то вроде:
Код:
{php}$var=val;if()..else()..{/php}
В шаблонизаторе ищешь эти теги,и заменяеш на eval() ихнего значения. Ну это самое первое что приходит в голову.
|
|
|