Open nanasess opened 4 months ago
admin/products/product_class_confirm.tpl で array_key_exists が使われてます。
empty や is_array は登録なしで利用できているようなのですがどうしてなのでしょう?
file_exists、is_numeric、array_key_exists 等は登録しないと利用できませんが、違いってなんでしょうか?
@bbkids まだ調べられてないのですが、 Smarty 側で許可されている関数があるのだと思われます
こちらで設定されているようですね
https://github.com/smarty-php/smarty/blob/master/src/Extension/DefaultExtension.php#L21-L48
@nanasess なるほど、Smarty側で設定されてるんですね。有難う御座います。
refs #876 refs https://github.com/EC-CUBE/ec-cube2/issues/684
Smarty5 から Smarty テンプレートで PHP 関数を利用する場合、
Smarty::registerPlugin()
を使用して、 modifier の登録が必須となります。 https://smarty-php.github.io/smarty/stable/upgrading/#using-native-php-functions-or-userland-functions-in-your-templatesEC-CUBE本体で使用している PHP 関数は以下にて登録済みですが、互換性維持のため、プラグインや決済モジュールの Smarty テンプレートで利用している PHP 関数があればコメントにてお知らせください https://github.com/EC-CUBE/ec-cube2/blob/13a6dacb0693500f413cc164413516f99c328766/data/class/SC_View.php#L61-L65