summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-05-20 15:35:49 +0100
committerLester Caine <lester@lsces.co.uk>2026-05-20 15:35:49 +0100
commitd1b0b7c2e2c2a21da6282bc772fdd312ccf2ed52 (patch)
tree6a47d8c1ec802212d566e5e3fd145a1a4df8a466
parentc46f0d990ac840fc48d59c6cbc119664d56a7dca (diff)
downloadsmarty-d1b0b7c2e2c2a21da6282bc772fdd312ccf2ed52.tar.gz
smarty-d1b0b7c2e2c2a21da6282bc772fdd312ccf2ed52.tar.bz2
smarty-d1b0b7c2e2c2a21da6282bc772fdd312ccf2ed52.zip
Suppress E_DEPRECATED warnings for PHP 8.x compatibilityHEADmaster
- Debug.php, Smarty.php: add ~E_DEPRECATED to error_reporting masks - DefaultExtension.php: comment out trigger_error for implode deprecation - libs/Smarty.class.php: minor style cleanup (require_once without parens) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
-rw-r--r--libs/Smarty.class.php4
-rw-r--r--src/Debug.php2
-rw-r--r--src/Extension/DefaultExtension.php4
-rw-r--r--src/Smarty.php2
4 files changed, 6 insertions, 6 deletions
diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php
index 459fe2cf..e1cdea1e 100644
--- a/libs/Smarty.class.php
+++ b/libs/Smarty.class.php
@@ -16,7 +16,7 @@
define('__SMARTY_DIR', __DIR__ . '/../src/');
// Global function declarations
-require_once(__SMARTY_DIR . "/functions.php");
+require_once __SMARTY_DIR . "/functions.php";
spl_autoload_register(function ($class) {
// Class prefix
@@ -37,6 +37,6 @@ spl_autoload_register(function ($class) {
// If the file exists, require it
if (file_exists($file)) {
- require_once($file);
+ require_once $file;
}
});
diff --git a/src/Debug.php b/src/Debug.php
index ab1a8877..732423f9 100644
--- a/src/Debug.php
+++ b/src/Debug.php
@@ -198,7 +198,7 @@ class Debug extends Data
$debObj->security_policy = null;
$debObj->debugging = false;
$debObj->debugging_ctrl = 'NONE';
- $debObj->error_reporting = E_ALL & ~E_NOTICE;
+ $debObj->error_reporting = E_ALL & ~E_DEPRECATED & ~E_NOTICE;
$debObj->debug_tpl = $smarty->debug_tpl ?? 'file:' . __DIR__ . '/debug.tpl';
$debObj->registered_resources = array();
$debObj->escape_html = true;
diff --git a/src/Extension/DefaultExtension.php b/src/Extension/DefaultExtension.php
index b5f38f6c..b0321377 100644
--- a/src/Extension/DefaultExtension.php
+++ b/src/Extension/DefaultExtension.php
@@ -559,8 +559,8 @@ class DefaultExtension extends Base {
public function smarty_modifier_implode($values, $separator = '')
{
- trigger_error("Using implode is deprecated. " .
- "Use join using the array first, separator second.", E_USER_DEPRECATED);
+// trigger_error("Using implode is deprecated. " .
+// "Use join using the array first, separator second.", E_USER_DEPRECATED);
if (is_array($separator)) {
return implode((string) ($values ?? ''), (array) $separator);
diff --git a/src/Smarty.php b/src/Smarty.php
index 5665ff45..9bbbdccd 100644
--- a/src/Smarty.php
+++ b/src/Smarty.php
@@ -1679,7 +1679,7 @@ class Smarty extends \Smarty\TemplateBase {
*/
public function writeFile($_filepath, $_contents) {
$_error_reporting = error_reporting();
- error_reporting($_error_reporting & ~E_NOTICE & ~E_WARNING);
+ error_reporting($_error_reporting & ~E_DEPRECATED & ~E_NOTICE & ~E_WARNING);
$_dirpath = dirname($_filepath);
// if subdirs, create dir structure
if ($_dirpath !== '.') {