fix PHP 8.0 TypeError: strpos(): Argument #1 ($haystack) must be of type string, array given

This commit is contained in:
Ralf Becker 2021-11-10 12:14:58 +01:00
parent dfdd3b918b
commit aca63345ca

View File

@ -403,8 +403,8 @@ class History
*/
public static function needs_diff($name, $value)
{
// No diff on encrypted content
if(strpos($value, static::BEGIN_PGP) == 0 && strpos($value, static::END_PGP) !== FALSE)
// No diff on arrays or encrypted content
if (is_array($value) || strpos($value, static::BEGIN_PGP) == 0 && strpos($value, static::END_PGP) !== FALSE)
{
return false;
}