Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When creating an XML view, if the body of a node contains a , that body XML element will be blank, rather than containing the actual content. Stripping html tags in the field makes no difference. Other html entities such as & do not cause the issue.
Comment | File | Size | Author |
---|---|---|---|
#7 | views_datasource-filter-nbsp-990540-7.patch | 2.41 KB | clemens.tolboom |
Comments
Comment #1
nd987 CreditAttribution: nd987 commentedUPDATE -- this only occurs when the 'plaintext output' option is checked in the output style options.
Comment #2
atomicjeep CreditAttribution: atomicjeep commentedThis also happens when you expose a default node body field
Comment #3
atomicjeep CreditAttribution: atomicjeep commentedI think this seems to relate to the optimisation of check_plain() which was added as of Drupal Core 6.17
Comment #4
lhugg CreditAttribution: lhugg commentedThis is also true for the JSON module. Both the Body and Teaser fields are = " ", even if plaintext is checked. The raw output option will output the content, which leads me to believe that comment 3 above is correct. Of course, raw output leaves us (or the recipient of the JSON file) open to vulnerabilities.
Can this be fixed in this module, or do we need to look elsewhere or somehow override within our own app?
Also, should this be a separate issue for JSON, or is it OK here?
Comment #5
IncrediblyKenzi CreditAttribution: IncrediblyKenzi commentedAs I recall, doesn't have a default entity in XML, so it needs to be defined as part of the dtd.   is the alternative, and works without the schema.
Comment #6
clemens.tolboomI don't get the following grep on the code where
function _views_xml_xmlEntities($str)
is supposed to replace entities by their numeric variant.Only when not $check_plain the call to
function _views_xml_xmlEntities($str)
is done.Based on this observation I managed to run strip tags on the node.teaser and leave XML config not to checkplain.
Comment #7
clemens.tolboomThe attached patch solve the nbsp problem by always apply the _views_xml_xmlEntities call as we _are_ in an xml context right?
Comment #8
ZeiP CreditAttribution: ZeiP as a volunteer commentedThis isn't happening for me in the D7 version. As D6 has been EOL for a few years now, closing the issue as outdated.