From a7cf3639f004661955724b054bac8cef87c2b8ed Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Mon, 22 Jun 2015 23:47:08 +0200 Subject: [PATCH] Just some more fixing for issue 1642 --- include/text.php | 2 +- mod/ping.php | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/text.php b/include/text.php index 2d265e6eee..5c6ab588f1 100644 --- a/include/text.php +++ b/include/text.php @@ -220,7 +220,7 @@ function xmlify($str) { $buffer = mb_ereg_replace("<", "<", $buffer); $buffer = mb_ereg_replace(">", ">", $buffer); */ - $buffer = htmlspecialchars($str, ENT_QUOTES); + $buffer = htmlspecialchars($str, ENT_QUOTES, "UTF-8"); $buffer = trim($buffer); return($buffer); diff --git a/mod/ping.php b/mod/ping.php index 8119840bbd..97a3070d84 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -167,6 +167,9 @@ function ping_init(&$a) { require_once("mod/proxy.php"); $photo = proxy_url($photo); + $message = html_entity_decode($message, ENT_COMPAT | ENT_HTML401, "UTF-8"); + $name = html_entity_decode($name, ENT_COMPAT | ENT_HTML401, "UTF-8"); + // Are the nofications calles from the regular process or via the friendica app? $regularnotifications = (intval($_GET['uid']) AND intval($_GET['_'])); @@ -175,10 +178,9 @@ function ping_init(&$a) { if ($a->is_friendica_app() OR !$regularnotifications) $message = str_replace("{0}", $name, $message); - $data = array('href' => &$href, 'name' => &$name, 'url'=>&$url, 'photo'=>&$photo, 'date'=>&$date, 'seen'=>&$seen, 'messsage'=>&$message); call_hooks('ping_xmlize', $data); - $notsxml = '%s'; + $notsxml = '%s'."\n"; return sprintf ( $notsxml, xmlify($href), xmlify($name), xmlify($url), xmlify($photo), xmlify($date), xmlify($seen), xmlify($message) );