View Issue Details

IDProjectCategoryView StatusLast Update
0010772mantisbtrsspublic2021-01-17 04:38
Reportermantisams Assigned To 
PriorityhighSeveritymajorReproducibilityalways
Status newResolutionopen 
PlatformGoogle ChromeOSWindows XP 
Product Version1.1.8 
Summary0010772: RSS feed does not appear proper formatted in Google Chrome
Description

Check RSS feed in Google Chrome.....you will find that it will not appear properly formatted as that of other browsers.

Steps To Reproduce
  1. Click on RSS feed icon
  2. View the data which is not properly formatted in Google Chrome
Tagsadmin

Relationships

has duplicate 0011380 closeddhx RSS is broken in IE and Chrome 
related to 0008539 closeddhx Special (nominally HTML) characters are not parsed correctly in RSS feed output 
related to 0016148 acknowledged RSS feed error display on IE 8,9,10 

Activities

giallu

giallu

2009-07-28 03:27

reporter   ~0022571

Last edited: 2011-12-11 21:54

the same happen in google reader

bbufo

bbufo

2010-11-23 13:18

reporter   ~0027461

Last edited: 2011-12-11 21:54

If this is the same issue I had with Google Reader, all paragraphs become one long line concatenated by "<br />", here is my solution.

  1. Search this function in core/string_api.php file,
    function string_rss_links( $p_string ) {

  2. Add this function above it,
    /**

    • Convert <br /> to line break
    • @param string $p_string
    • @return string
      /
      function br2nl($string){
      $return=eregi_replace('<br[[:space:]]
      /?[[:space:]]*>',chr(13).chr(10),$string);
      return $return;
      }
  3. Change string_rss_links( $p_string) to,
    function string_rss_links( $p_string ) {

    rss can not start with   which spaces will be replaced into by string_display().

    $t_string = trim( $p_string );

    $t_string = event_signal( 'EVENT_DISPLAY_RSS', $t_string );

    $t_string = br2nl($t_string); //2010-11-23 VM added - to remove <br />s in rss feeds.

    another escaping to escape the special characters created by the generated links

    return string_html_specialchars( $t_string );
    }

  4. Upload an replace the string_api.php on the server.

New rss items will be formated properly.

vboctor

vboctor

2010-12-15 14:34

manager   ~0027612

Last edited: 2011-12-11 21:54

I've also reproduced this 1.2.3 release and Shrook RSS reader for Mac. The issue can be resolved by changing the string_api.php as follows:

function string_rss_links( $p_string ) {

rss can not start with   which spaces will be replaced into by string_display().

$t_string = trim( $p_string );

$t_string = event_signal( 'EVENT_DISPLAY_RSS', $t_string );

# another escaping to escape the special characters created by the generated links
return string_html_specialchars( $t_string );

}

to

function string_rss_links( $p_string ) {

rss can not start with   which spaces will be replaced into by string_display().

$t_string = trim( $p_string );

$t_string = event_signal( 'EVENT_DISPLAY_RSS', $t_string );

return $t_string;

}

The escaping of the RSS string is now only done in the MantisCoreFormatting rss() function, which looks as follows:

function rss( $p_event, $p_string ) {
    static $s_text, $s_urls, $s_buglinks, $s_vcslinks;

    $t_string = $p_string;

    if( null === $s_text ) {
        $s_text = plugin_config_get( 'process_text' );
        $s_urls = plugin_config_get( 'process_urls' );
        $s_buglinks = plugin_config_get( 'process_buglinks' );
        $s_vcslinks = plugin_config_get( 'process_vcslinks' );
    }

    if( ON == $s_text ) {
        $t_string = string_strip_hrefs( $t_string );
        $t_string = string_html_specialchars( $t_string );
        $t_string = string_restore_valid_html_tags( $t_string );
        $t_string = string_nl2br( $t_string );
    }

    if( ON == $s_urls ) {
        $t_string = string_insert_hrefs( $t_string );
    }

    if( ON == $s_buglinks ) {
        $t_string = string_process_bug_link( $t_string, /* anchor */ true, /* detailInfo */ false, /* fqdn */ true );
        $t_string = string_process_bugnote_link( $t_string, /* anchor */ true, /* detailInfo */ false, /* fqdn */ true );
    }

    if( ON == $s_vcslinks ) {
        $t_string = string_process_cvs_link( $t_string );
    }

    return $t_string;
}

The question is whether we are fixing the formatting, but breaking some escaping logic or opening some security issue.

dhx

dhx

2010-12-15 18:25

reporter   ~0027613

Last edited: 2011-12-11 21:54

Please see 0008539 as a related issue. Perhaps I forgot to fix up a usage of string_rss_links when committing those changes.

Firefox seems to render the feed OK although it does place <br /> tags into the description which seems wrong to me (malformed XML).

AFAIK Google Chrome/Chromium does not support RSS out of the box. You need a plugin to read RSS feeds in the browser. See http://code.google.com/p/chromium/issues/detail?id=84

Ideally I'd like to remove HTML tag processing support from MantisBT core as it makes the very wrong assumption that descriptions, comments, etc will always be rendered by software that interprets HTML. We have clients that communicate via SOAP and native operating system UIs. We send information to email clients that generally don't interpret HTML. We place information in RSS feeds. Twitter notifications. etc

vboctor

vboctor

2011-01-08 18:56

manager   ~0027858

Last edited: 2011-12-11 21:54

  • I was actually testing this on Firefox, I've tried on Chrome and I can see it is completely broken there, probably due to the reason @dhx mentioned above. If Chrome doesn't support RSS, then should we resolve this issue as won't fix and open another issue for tracking the new lines escaping issue for other browsers?

  • I've noticed that we string use string_rss_links() to escape the description field for issues, but non of the other one line fields. We also seem to still use it in the news_rss field. Do we need similar updates there?

  • Relating to not having formatting in the core, I guess we kind of headed this way with the formatting plugin. I assume you want to go further and have the core plugin not honor html tags at all? What is your plan for backward compatibility? Are we going to have a config option to allow reverting back to old behavior for those who really care?

SteveA

SteveA

2016-07-21 14:34

reporter   ~0053683

I know this is an old thread but the change to string_rss_links fixes the feed view in Thunderbird.