forked from laruence/yaf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
039.phpt
44 lines (40 loc) · 840 Bytes
/
039.phpt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
--TEST--
Check for Yaf_View_Simple recursive render error message outputing
--SKIPIF--
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.library="/php/global/dir"
log_errors=0
display_errors=1
yaf.use_namespace=0
--FILE--
<?php
require "build.inc";
startup();
$view = new Yaf_View_Simple(DIR_ROOT);
$view->assign("name", "laruence");
$tpl = APPLICATION_PATH . '/tpls/foo.phtml';
$tpl2 = APPLICATION_PATH . '/tpls/foo2.phtml';
file_put_contents($tpl, <<<HTML
<?php
echo \$this->render(\$tpl);
?>
HTML
);
file_put_contents($tpl2, <<<HTML
<?php
if ((1) { //syntax error
}
?>
HTML
);
echo $view->render($tpl, array('tpl' => $tpl2));
?>
--CLEAN--
<?php
/* unlink foo2.phtml permission denied */
require "build.inc";
shutdown();
?>
--EXPECTF--
Parse error: syntax error, unexpected '{' in %sfoo2.phtml on line %d