From b148b7c52600e624a412ae82cfa29e21000c7939 Mon Sep 17 00:00:00 2001 From: Daniel Winzen Date: Wed, 11 Nov 2020 19:56:07 +0100 Subject: [PATCH] Fixed PHP7 compatibility --- chat.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/chat.php b/chat.php index 9cc7bc9..8b0675c 100644 --- a/chat.php +++ b/chat.php @@ -1211,7 +1211,7 @@ function send_sessions(){ print_end(); } -function check_filter_match(int &$reg) : string|bool { +function check_filter_match(int &$reg) : string { global $I; $_POST['match']=htmlspecialchars($_POST['match']); if(isset($_POST['regex']) && $_POST['regex']==1){ @@ -1226,14 +1226,14 @@ function check_filter_match(int &$reg) : string|bool { if(mb_strlen($_POST['match'])>255){ return "$I[matchtoolong]
$I[prevmatch]: " . htmlspecialchars($_POST['match']); } - return false; + return ''; } function manage_filter() : string { global $db, $memcached; if(isset($_POST['id'])){ $reg=0; - if($tmp=check_filter_match($reg)){ + if(($tmp=check_filter_match($reg)) !== ''){ return $tmp; } if(isset($_POST['allowinpm']) && $_POST['allowinpm']==1){ @@ -1274,7 +1274,7 @@ function manage_linkfilter() : string { global $db, $memcached; if(isset($_POST['id'])){ $reg=0; - if($tmp=check_filter_match($reg)){ + if(($tmp=check_filter_match($reg)) !== ''){ return $tmp; } if(preg_match('/^[0-9]+$/', $_POST['id'])){