Fixes #294
This commit is contained in:
Fraenkiman 2024-01-02 17:56:28 +01:00
parent d85dc9ae43
commit a29052ba38
2 changed files with 7 additions and 2 deletions

View File

@ -34,7 +34,11 @@
* @param array formvars form var values * @param array formvars form var values
*/ */
function smarty_validate_criteria_notEmpty($value, $empty, &$params, &$formvars) { function smarty_validate_criteria_notEmpty($value, $empty, &$params, &$formvars) {
// Return a message if value is empty
if(empty($value)) {
echo "Smarty plugin: value is empty!";
} else {
return strlen($value) > 0; return strlen($value) > 0;
}
} }
?> ?>

View File

@ -302,6 +302,7 @@ class StringParser {
} }
$this->_text = $this->_applyPrefilters($text); $this->_text = $this->_applyPrefilters($text);
$this->_output = null; $this->_output = null;
$this->_text = $this->_text ?? '';
$this->_length = strlen($this->_text); $this->_length = strlen($this->_text);
$this->_cpos = 0; $this->_cpos = 0;
unset($this->_stack); unset($this->_stack);