Author: earle Date: 2005-10-23 15:45:00 +0100 (Sun, 23 Oct 2005) New Revision: 697
Modified: trunk/Changes trunk/lib/OpenGuides/RDF.pm Log: locales also needed escaping; plus fixed strange mixture of array and reference
Modified: trunk/Changes =================================================================== --- trunk/Changes 2005-10-23 14:13:35 UTC (rev 696) +++ trunk/Changes 2005-10-23 14:45:00 UTC (rev 697) @@ -5,7 +5,7 @@ Show node summary in search results. Add "address" field that had got missed out from the RDF. Update URL for Dublin Core elements in RDF index view. - Address and summary fields now XML-escaped properly. + Locales, address and summary fields now XML-escaped properly. Fix bug that was breaking coordinate entry fields on search page if lat/lon was being used. Replace underscores in node names in redirection message with spaces.
Modified: trunk/lib/OpenGuides/RDF.pm =================================================================== --- trunk/lib/OpenGuides/RDF.pm 2005-10-23 14:13:35 UTC (rev 696) +++ trunk/lib/OpenGuides/RDF.pm 2005-10-23 14:45:00 UTC (rev 697) @@ -3,7 +3,7 @@ use strict;
use vars qw( $VERSION ); -$VERSION = '0.08'; +$VERSION = '0.071';
use CGI::Wiki::Plugin::RSS::ModWiki; use Time::Piece; @@ -75,14 +75,14 @@ my $username = $node_data{metadata}{username}[0] || ''; my $os_x = $node_data{metadata}{os_x}[0] || ''; my $os_y = $node_data{metadata}{os_y}[0] || ''; - my $catrefs = $node_data{metadata}{category}; + my @categories = @{ $node_data{metadata}{category} || [] }; my @locales = @{ $node_data{metadata}{locale} || [] }; my $summary = $node_data{metadata}{summary}[0] || '';
# replace any errant characters in data to prevent illegal XML foreach ($phone, $fax, $website, $opening_hours_text, $address, $postcode, $city, $country, $latitude, $longitude, $version, $os_x, $os_y, - $catrefs, @locales, $summary) + @categories, @locales, $summary) { if ($_) { @@ -143,8 +143,8 @@ }; $rdf .= " dc:description$summary</dc:description>\n" if $summary;
- $rdf .= "\n <!-- categories -->\n\n" if $catrefs; - $rdf .= " dc:subject$_</dc:subject>\n" foreach @{$catrefs}; + $rdf .= "\n <!-- categories -->\n\n" if @categories; + $rdf .= " dc:subject$_</dc:subject>\n" foreach @categories;
if ($is_geospatial) {