Changeset 7842 for trunk/src/map


Ignore:
Timestamp:
Apr 18, 2010, 10:56:54 PM (15 years ago)
Author:
Pieter Naber
Message:

Doesn't work offline. Can PHP function simplexml_load_file() deal with the header("Location: ...") redirect of kml.php?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/map/inc/kmlHandler.php

    r7827 r7842  
    44{
    55        //Check if the file exists, if it does we load it. If it doesn't we exit and return an error message
    6         if (file_exists($file))
    7         {
    8                 $xml = simplexml_load_file($file);
    9         }
    10         else
    11         {
    12                 exit('Failed to open'.$file);
     6        try {
     7                $xml = simplexml_load_file(rawurlencode($file));
     8        } catch (Exception $e) {
     9                trigger_error(SYSLOG_CRIT, 'Failed to open KML file: ' . $file, __FILE__, __LINE__);
    1310        }
    1411
Note: See TracChangeset for help on using the changeset viewer.