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

PHP 8.1 compatibility - deprecated warnings #383

Closed
scr4bble opened this issue Jan 4, 2022 · 1 comment
Closed

PHP 8.1 compatibility - deprecated warnings #383

scr4bble opened this issue Jan 4, 2022 · 1 comment

Comments

@scr4bble
Copy link

scr4bble commented Jan 4, 2022

There are multiple parts of the library that started producing warnings after upgrading PHP to version 8.1
One of these warnings is:

PHP Deprecated:  htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /paxflow/templatesc/__Mustache_365e16969d0bf799e38423c6770dd045.php on line 693

Generated by:

   691	                $buffer .= $indent . '				<td>';
   692	                $value = $this->resolveValue($context->find('mail'), $context);
   693	                $buffer .= htmlspecialchars($value, 2, 'UTF-8');
   694	                $buffer .= '</td>
   695	';

From template:

	<td>{{mail}}</td>

For now we are fixing this by converting null values to empty string (to silence the warnings) but that feels bad.
Probably an easy fix in the library, right?

@scr4bble
Copy link
Author

@bobthecow any thoughts on this? Should I make a PR with fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant