use mb_strlen when iterating utf8
This commit is contained in:
parent
2df7251b34
commit
457f8c3e95
2 changed files with 2 additions and 2 deletions
|
@ -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";
|
||||
|
|
|
@ -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 ) {
|
||||
|
|
Loading…
Reference in a new issue