Bug #37246
closed<link> tags in RSS feeds destroyed on cached pages
0%
Description
I created an extension plugin, that produce a RSS feed output. My extension has 2 plugins with the same output. One plugin is from type USER and the other from type USER_INT. If I use the plugin with cache, the RSS feed output is invalid, because the <link> tags are broken. The code changes from <link>http://www.typo3.org</link> to <link />http://www.typo3.org</link>. The link tag is closed in the first tag. The output was changed by the system caching mechanism. My plugin definitely produce the same output.
This is my TypoScript setup for the RSS feed page:
# define rss page type rss = PAGE rss.typeNum = 444 rss.config.disableAllHeaderCode = 1 rss.config.additionalHeaders = Content-type:text/xml # configurate template rss.1 = TEMPLATE rss.1 { # include xml template template = FILE template.file = fileadmin/design1/templates/template_rss.xml # define work subpart workOnSubpart = DOCUMENT_BODY subparts.CONTENT < styles.content.get } # content configuartion tt_content.stdWrap.innerWrap > config.admPanel = 0
The template_rss.xml look linke this:
<!-- ###DOCUMENT_BODY### start --><?xml version="1.0" encoding="utf-8"?> <!-- ###CONTENT### start --> <!-- ###CONTENT### stop --> <!-- ###DOCUMENT_BODY### stop -->
Files
Updated by Steffen Gebert over 12 years ago
- Status changed from New to Needs Feedback
- Target version deleted (
4.5.16)
I'm really not sure that this is caused by parts of the Caching Framework.
Could you share a simplified extension of yours, which enables to reproduce this effect?
Thanks
Steffen
Updated by Andreas Kießling over 12 years ago
@Tobias: could you please check what your config for xhtml_cleaning is? Just had the same effect, but setting it to none solved it.
rssfeed = PAGE rssfeed{ config { additionalHeaders = Content-type:text/xml;charset=UTF-8 disableAllHeaderCode = 1 xhtml_cleaning = none disablePrefixComment = 1 } ...
Updated by Tobias Klepp over 12 years ago
@Andreas Otto †: I not configured "xhtml_cleaning". I don it now and it works! Thanks a lot.
@Steffen: I programmed a very simple extension with a cached plugin (pi1) and a non-cached plugin (pi2). If you add this plugin on a page with my posted TypoScript configuration and call the page with the xml output (&type=444), you can see the result.
Tobias
Updated by Alexander Opitz over 11 years ago
The problem sounds solved, so can we close this issue?
Updated by Tobias Klepp over 11 years ago
I can fix the problem by deactivating the config.xhtml_cleaning = all. I'm not shure, if it is a must have for xml outputs. If yes, there is no problem, because I used a misconfiguration. If no, the problem still exist. Also in the TYPO3 version 4.5.27.
Updated by Alexander Opitz over 11 years ago
The xhtml_cleaning is marked as experimental (in 6.2(!)) also it isn't on by default.
It seems that it is set to "cached" in your installation.
The option works like following options: TYPO3_CONF_VARS['FE']['tidy_option'] and $this->config['config']['prefixLocalAnchors'] thats why your problem only exists on cached. (To test you can set "xhtml_cleaning" to all, then both plugins should have the problem. ;-) ).
About the experimental state you can see following comment to the function:
* Tries to convert the content to be XHTML compliant and other stuff like that. * STILL EXPERIMENTAL. See comments below. * * What it does NOT do (yet) according to XHTML specs.: * - Wellformedness: Nesting is NOT checked * - name/id attribute issue is not observed at this point. * - Certain nesting of elements not allowed. Most interesting, <PRE> cannot contain img, big,small,sub,sup ... * - Wrapping scripts and style element contents in CDATA - or alternatively they should have entitites converted. * - Setting charsets may put some special requirements on both XML declaration/ meta-http-equiv. (C.9) * - UTF-8 encoding is in fact expected by XML!! * - stylesheet element and attribute names are NOT converted to lowercase * - ampersands (and entities in general I think) MUST be converted to an entity reference! (&s;). This may mean further conversion of non-tag content before output to page. May be related to the charset issue as a whole. * - Minimized values not allowed: Must do this: selected="selected" * * What it does at this point: * - All tags (frame,base,meta,link + img,br,hr,area,input) is ended with "/>" - others? * - Lowercase for elements and attributes * - All attributes in quotes * - Add "alt" attribute to img-tags if it's not there already.
Beside of this, it works correctly for the link tag ( http://de.selfhtml.org/html/kopfdaten/beziehungen.htm#quellen ) in xhtml.
As you are generating XML for rss and no XHTML, disabling the xhtml_cleaning is the correct solution, so no bug here.
Updated by Tobias Klepp over 11 years ago
Thanks a lot for this explanation. Please close this issue.
Updated by Alexander Opitz over 11 years ago
- Status changed from Needs Feedback to Closed