Download & Extend

Invalid xml due to incorrectly encoded greater-than symbol

Project:Views Datasource
Version:5.x-1.0-alpha2
Component:Code
Category:bug report
Priority:normal
Assigned:allisterbeharry
Status:closed (fixed)

Issue Summary

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.

Comments

#1

Version:5.x-1.0-alpha1» 5.x-1.0-alpha2
Status:active» needs review

@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.

AttachmentSize
286715_invalid_xml.patch 2.57 KB

#2

Assigned to:Anonymous» allisterbeharry

Thanks. Will be fixed in the next release.

#3

Status:needs review» reviewed & tested by the community

Confirmed that the patch works and is an appropriate fix.

#4

Title:Invalid xml» Invalid xml due to incorrectly encoded greater-than symbol

#5

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

#6

Status:reviewed & tested by the community» fixed

Fixed in ALPHA-3
http://drupalcode.org/viewvc/drupal/contributions/modules/views_datasour...

#7

Status:fixed» closed (fixed)

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