Using the raw_xml output option results in invalid xml code - there's a typo in the code

<?php
  $output = str_replace('<', '&lt;', $output); //encode left angle bracket
  $output = str_replace('>', '&rt;', $output); //encode right angle bracket
?>

should read

<?php
  $output = str_replace('<', '&lt;', $output); //encode less than
  $output = str_replace('>', '&gt;', $output); //encode greater than
?>

There's similar code in the other views_datasource modules and this also needs fixing.

CommentFileSizeAuthor
#1 286715_invalid_xml.patch2.57 KBksenzee

Comments

ksenzee’s picture

Version: 5.x-1.0-alpha1 » 5.x-1.0-alpha2
Status: Active » Needs review
StatusFileSize
new2.57 KB

@kehan - Thanks for tracking this down. It saved me a bunch of time.

Here's a patch rolled against 5.x-1.0-alpha2 that fixes this bug in all the views_datasource modules.

allisterbeharry’s picture

Assigned: Unassigned » allisterbeharry

Thanks. Will be fixed in the next release.

dalin’s picture

Status: Needs review » Reviewed & tested by the community

Confirmed that the patch works and is an appropriate fix.

dalin’s picture

Title: Invalid xml » Invalid xml due to incorrectly encoded greater-than symbol
volocuga’s picture

Another typo:

Views_xml module (may be not only here):

Line 215 $output = str_replace("'", '&pos;', $output); //encode apostrophe

Should be

$output = str_replace("'", '&apos;', $output); //encode apostrophe

allisterbeharry’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.