Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support PHP 8.1 for version 2.6: Fix deprecated warning when calling strftime for template compiling #745

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libs/Smarty_Compiler.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ function _compile_file($resource_name, $source_content, &$compiled_content)
}

// put header at the top of the compiled template
$template_header = "<?php /* Smarty version ".$this->_version.", created on ".strftime("%Y-%m-%d %H:%M:%S")."\n";
$template_header = "<?php /* Smarty version ".$this->_version.", created on ".date("Y-m-d H:i:s")."\n";
$template_header .= " compiled from ".strtr(urlencode($resource_name), array('%2F'=>'/', '%3A'=>':'))." */ ?>\n";

/* Emit code to load needed plugins. */
Expand Down
2 changes: 1 addition & 1 deletion libs/internals/core.write_compiled_include.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function smarty_core_write_compiled_include($params, &$smarty)
if (count($_match_source)==0) return;

// convert the matched php-code to functions
$_include_compiled = "<?php /* Smarty version ".$smarty->_version.", created on ".strftime("%Y-%m-%d %H:%M:%S")."\n";
$_include_compiled = "<?php /* Smarty version ".$smarty->_version.", created on ".date("Y-m-d H:i:s")."\n";
$_include_compiled .= " compiled from " . strtr(urlencode($params['resource_name']), array('%2F'=>'/', '%3A'=>':')) . " */\n\n";

$_compile_path = $params['include_file_path'];
Expand Down