summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorSimon Wisselink <wisskid@users.noreply.github.com>2022-11-23 23:26:24 +0100
committerGitHub <noreply@github.com>2022-11-23 23:26:24 +0100
commit044647bd71cd101d214e16e9aee435a1ed8d0d1e (patch)
tree846a7c71b0251054319b6c59e612ff5ce81fce08 /libs
parentc02e9e135ea719b91f457a0072748ded0e852e7d (diff)
downloadsmarty-044647bd71cd101d214e16e9aee435a1ed8d0d1e.tar.gz
smarty-044647bd71cd101d214e16e9aee435a1ed8d0d1e.tar.bz2
smarty-044647bd71cd101d214e16e9aee435a1ed8d0d1e.zip
Also mute php7 notices for undefined array indexes when muteUndefinedOrNullWarnings is activated. (#829)
Fixes #736
Diffstat (limited to 'libs')
-rw-r--r--libs/Smarty.class.php5
-rw-r--r--libs/sysplugins/smarty_internal_errorhandler.php2
2 files changed, 3 insertions, 4 deletions
diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php
index 5d2e3a4b..5351b579 100644
--- a/libs/Smarty.class.php
+++ b/libs/Smarty.class.php
@@ -1386,8 +1386,7 @@ class Smarty extends Smarty_Internal_TemplateBase
}
/**
- * Activates PHP7 compatibility mode:
- * - converts E_WARNINGS for "undefined array key" and "trying to read property of null" errors to E_NOTICE
+ * Mutes errors for "undefined index", "undefined array key" and "trying to read property of null".
*
* @void
*/
@@ -1396,7 +1395,7 @@ class Smarty extends Smarty_Internal_TemplateBase
}
/**
- * Indicates if PHP7 compatibility mode is set.
+ * Indicates if Smarty will mute errors for "undefined index", "undefined array key" and "trying to read property of null".
* @bool
*/
public function isMutingUndefinedOrNullWarnings(): bool {
diff --git a/libs/sysplugins/smarty_internal_errorhandler.php b/libs/sysplugins/smarty_internal_errorhandler.php
index c2b653ef..f5abbf28 100644
--- a/libs/sysplugins/smarty_internal_errorhandler.php
+++ b/libs/sysplugins/smarty_internal_errorhandler.php
@@ -71,7 +71,7 @@ class Smarty_Internal_ErrorHandler
}
if ($this->allowUndefinedArrayKeys && preg_match(
- '/^(Undefined array key|Trying to access array offset on value of type null)/',
+ '/^(Undefined index|Undefined array key|Trying to access array offset on value of type null)/',
$errstr
)) {
return; // suppresses this error