Invalid xml due to incorrectly encoded greater-than symbol
kehan - July 24, 2008 - 13:54
| Project: | Views Datasource |
| Version: | 5.x-1.0-alpha2 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | allisterbeharry |
| Status: | reviewed & tested by the community |
Description
Using the raw_xml output option results in invalid xml code - there's a typo in the code
<?php
$output = str_replace('<', '<', $output); //encode left angle bracket
$output = str_replace('>', '&rt;', $output); //encode right angle bracket
?>should read
<?php
$output = str_replace('<', '<', $output); //encode less than
$output = str_replace('>', '>', $output); //encode greater than
?>There's similar code in the other views_datasource modules and this also needs fixing.

#1
@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.
#2
Thanks. Will be fixed in the next release.
#3
Confirmed that the patch works and is an appropriate fix.
#4
#5
Another typo:
Views_xml module (may be not only here):
Line 215
$output = str_replace("'", '&pos;', $output); //encode apostropheShould be
$output = str_replace("'", ''', $output); //encode apostrophe