WordPress.org

Ready to get started?Download WordPress

Forums

Live Blogging
Twitter Problem (3 posts)

  1. rfran1984
    Member
    Posted 1 year ago #

    Hi,

    I'm using the Live Blogging plugin, and I've done this:

    On line 1354 of live-blogging.php

    $content = filter_var($post->post_content, FILTER_SANITIZE_STRING);
    
    Change to
    $content = filter_var($post->post_content, FILTER_SANITIZE_URL);

    To make quotes and other special characters appear correctly in tweets. However, when I make a post, the Twitter post ignores any spaces I put between words, like this:

    https://twitter.com/tvlive_extra/statuses/240465072932139009

    Is there any way I can fix this? I need to use the live-blogging plugin on Monday, and don't want any problems.

    Thanks in advance.

    http://wordpress.org/extend/plugins/live-blogging/

  2. chrisnorthwood
    Member
    Plugin Author

    Posted 1 year ago #

    Well FILTER_SANITIZE_URL strips spaces (it is used to remove characters which are invalid in a URL from a string), so that's what you'd expect.

    You probably want to leave it as FILTER_SANITIZE_STRING but instead use html_entity_decode on $content as well, i.e.,

    $content = html_entity_decode(filter_var($post->post_content, FILTER_SANITIZE_STRING));

    If that solves your issue I could look into making that default in future versions of the plugin

  3. rfran1984
    Member
    Posted 1 year ago #

    Didn't work I'm afraid. Twitter's still ignoring spaces in words.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic