]> git.mxchange.org Git - friendica.git/commitdiff
use mb_strlen when iterating utf8
authorFriendika <info@friendika.com>
Fri, 19 Aug 2011 02:14:13 +0000 (19:14 -0700)
committerFriendika <info@friendika.com>
Fri, 19 Aug 2011 02:14:13 +0000 (19:14 -0700)
include/items.php
include/text.php

index ec519ad9bf564830285277271b5f67159eaf0c81..39a61c4ad0bf3463dda4d3659d323989518b5858 100644 (file)
@@ -1635,7 +1635,7 @@ function atom_entry($item,$type,$author,$owner,$comment = false) {
        $o .= '<published>' . xmlify(datetime_convert('UTC','UTC',$item['created'] . '+00:00',ATOM_TIME)) . '</published>' . "\r\n";
        $o .= '<updated>' . xmlify(datetime_convert('UTC','UTC',$item['edited'] . '+00:00',ATOM_TIME)) . '</updated>' . "\r\n";
        $o .= '<dfrn:env>' . base64url_encode($body, true) . '</dfrn:env>' . "\r\n";
-       $o .= '<content type="' . $type . '" >' . xmlify(($type === 'html') ? bbcode($body) : $body) . '</content>' . "\r\n";
+       $o .= '<content type="' . $type . '" >' . xmlify((($type === 'html') ? bbcode($body) : $body)) . '</content>' . "\r\n";
        $o .= '<link rel="alternate" type="text/html" href="' . xmlify($a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id']) . '" />' . "\r\n";
        if($comment)
                $o .= '<dfrn:comment-allow>' . intval($item['last-child']) . '</dfrn:comment-allow>' . "\r\n";
index 803bf0e510f5ae37c8a82dbde2e46480166cfa12..b13cf980f22ee46009eaec1ad0d7fa1244df07a3 100644 (file)
@@ -147,7 +147,7 @@ if(! function_exists('xmlify')) {
 function xmlify($str) {
        $buffer = '';
        
-       for($x = 0; $x < strlen($str); $x ++) {
+       for($x = 0; $x < mb_strlen($str); $x ++) {
                $char = $str[$x];
         
                switch( $char ) {