New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multibyte characters caused errors in some feeds. #91

Open
gatokichi opened this Issue Sep 20, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@gatokichi

gatokichi commented Sep 20, 2017

SyndicatedPost::content() in syndicatedpost.class.php

    if ( empty($excerpt) or $theExcerpt == $theContent ) :
        # If content is available, generate an excerpt.
        if ( strlen(trim($content)) > 0 ) :
            $excerpt = strip_tags($content);
            if (strlen($excerpt) > 255) :
                $excerpt = substr($excerpt,0,252).'...';
            endif;
        endif;
    endif;

substr() is not good with some multibyte feeds.

@radgeek

This comment has been minimized.

Show comment
Hide comment
@radgeek

radgeek Oct 4, 2017

Owner

Good point, thanks. I incorporated a change to use mb_substr (using the encoding supplied by SimplePie) to do the excerpting. It should be incorporated into the most recent version, 2017.1004. If you have a good test-case feed that I could double-check my solution against, let me know. Thanks!

Owner

radgeek commented Oct 4, 2017

Good point, thanks. I incorporated a change to use mb_substr (using the encoding supplied by SimplePie) to do the excerpting. It should be incorporated into the most recent version, 2017.1004. If you have a good test-case feed that I could double-check my solution against, let me know. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment