]> git.mxchange.org Git - friendica.git/commitdiff
Just some more fixing for issue 1642
authorMichael Vogel <icarus@dabo.de>
Mon, 22 Jun 2015 21:47:08 +0000 (23:47 +0200)
committerMichael Vogel <icarus@dabo.de>
Mon, 22 Jun 2015 21:47:08 +0000 (23:47 +0200)
include/text.php
mod/ping.php

index 2d265e6eee285de8c2f659c664193d94e28fbe4d..5c6ab588f1ba2b4cb011bd575622eaaf5afcdb1f 100644 (file)
@@ -220,7 +220,7 @@ function xmlify($str) {
        $buffer = mb_ereg_replace("<", "&lt;", $buffer);
        $buffer = mb_ereg_replace(">", "&gt;", $buffer);
        */
-       $buffer = htmlspecialchars($str, ENT_QUOTES);
+       $buffer = htmlspecialchars($str, ENT_QUOTES, "UTF-8");
        $buffer = trim($buffer);
 
        return($buffer);
index 8119840bbd2910ec214bfd79de3209a5b76b79ba..97a3070d8486fdfcb0e76946f428d68b25a4ae3e 100644 (file)
@@ -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 = '<note href="%s" name="%s" url="%s" photo="%s" date="%s" seen="%s" >%s</note>';
+                       $notsxml = '<note href="%s" name="%s" url="%s" photo="%s" date="%s" seen="%s" >%s</note>'."\n";
                        return sprintf ( $notsxml,
                                xmlify($href), xmlify($name), xmlify($url), xmlify($photo), xmlify($date), xmlify($seen), xmlify($message)
                        );