Ignore:
Timestamp:
Oct 2, 2014, 9:49:30 PM (10 years ago)
Author:
rvelices
Message:

rv_gmaps fix kml xml encoding for some special chars

Location:
extensions/rv_gmaps/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/rv_gmaps/trunk/kml.php

    r28598 r29863  
    164164  $dataTpl->assign( 'region', $bounds );
    165165
     166$dataTpl->smarty->registerPlugin( 'modifier', 'xmle', 'rvm_xmle');
     167function rvm_xmle($s) {
     168        if( strcspn($s, '&<') != strlen($s))
     169                return "<![CDATA[$s]]>";
     170        return $s;
     171}
     172
    166173/*header('Cache-Control: public' );
    167174header('Expires: '.gmdate('D, d M Y H:i:s', time()+600).' GMT');
  • extensions/rv_gmaps/trunk/template/earth_kml.tpl

    r23083 r29863  
    7272                <visibility>1</visibility>
    7373                <open>1</open>
    74                 <name><![CDATA[{$img.TITLE}]]></name>
    75                 <Snippet>{$img.DESCRIPTION|@strip_tags:false|@truncate:80}</Snippet>
     74                <name>{$img.TITLE|xmle}</name>
     75                <Snippet>{$img.DESCRIPTION|@strip_tags:false|@truncate:80|xmle}</Snippet>
    7676                <description><![CDATA[
    7777{$img.DESCRIPTION}<br/>
Note: See TracChangeset for help on using the changeset viewer.