Force write the version number in template parser v2

This commit is contained in:
Kijin Sung 2023-10-15 23:03:03 +09:00
parent bbd19c814b
commit a362f27f62

View file

@ -120,6 +120,12 @@ class TemplateParser_v2
*/
protected function _preprocess(string $content): string
{
// Force the version number.
if (!str_contains($content, '$this->config->version'))
{
$content = '<?php $this->config->version = 2; ?>' . $content;
}
// Prevent direct invocation.
$content = '<?php if (!defined("RX_VERSION")) exit(); ?>' . $content;