diff --git a/chat.php b/chat.php index 7213502..13c4344 100644 --- a/chat.php +++ b/chat.php @@ -1354,6 +1354,7 @@ function send_inbox(){ } }else{ $injectRedirect=false; + $redirect=''; } if(get_setting('imgembed') && (!$U['embed'] || !isSet($_COOKIE[COOKIENAME]))){ $removeEmbed=true; @@ -1373,23 +1374,7 @@ function send_inbox(){ $stmt=$db->prepare('SELECT id, postdate, text FROM ' . PREFIX . 'inbox WHERE recipient=? ORDER BY id DESC;'); $stmt->execute(array($U['nickname'])); while($message=$stmt->fetch(PDO::FETCH_ASSOC)){ - if(MSGENCRYPTED){ - $message['text']=openssl_decrypt($message['text'], 'aes-256-cbc', ENCRYPTKEY, 0, '1234567890123456'); - } - if($injectRedirect){ - $message['text']=preg_replace_callback('/(.*?(?=<\/a>))<\/a>/', - function ($matched) use ($redirect){ - return "$matched[2]"; - } - , $message['text']); - } - if($removeEmbed){ - $message['text']=preg_replace_callback('/<\/a>/', - function ($matched){ - return "$matched[1]"; - } - , $message['text']); - } + prepare_message_print($message, $injectRedirect, $redirect, $removeEmbed); echo "