1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

SmartyでPHP側で定義した関数を呼べなくするには

Posted at

http://qiita.com/items/48219e6b80bafbd50fa5
は情報が古かったようなので訂正。

Smarty3系では下記を参考にすると良さそうだ。
http://www.smarty.net/docs/ja/advanced.features.tpl#id3148392

抜粋すると、下記のクラスを使わないやり方が取り回しがしやすそうなので活用。

require 'Smarty.class.php';
$smarty = new Smarty();
$my_security_policy = new Smarty_Security($smarty);
// すべての PHP 関数を無効にします
$my_security_policy->php_functions = null;
// PHP タグを除去します
$my_security_policy->php_handling = Smarty::PHP_REMOVE;
// すべての修飾子を使えるようにします
$my_security_policy->$modifiers = array();
// セキュリティを有効にします
$smarty->enableSecurity($my_security_policy);
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?