Fix compatibility with Debian and PHP 7

This commit is contained in:
bastianonm 2016-11-02 08:30:56 +00:00
parent c8c31a268f
commit 18843363b2
3 changed files with 17 additions and 18 deletions

View File

@ -5,7 +5,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
Tags: maps, gpx, gps, graph, chart, google maps, track, garmin, image, nextgen-gallery, nextgen, exif, OpenStreetMap, OpenCycleMap, Hike&Bike, heart rate, heartrate, cadence Tags: maps, gpx, gps, graph, chart, google maps, track, garmin, image, nextgen-gallery, nextgen, exif, OpenStreetMap, OpenCycleMap, Hike&Bike, heart rate, heartrate, cadence
Requires at least: 2.0.0 Requires at least: 2.0.0
Tested up to: 4.4.1 Tested up to: 4.4.1
Stable tag: 1.3.11 Stable tag: 1.3.10
Draws a gpx track with altitude graph. You can also display your nextgen gallery images in the map. Draws a gpx track with altitude graph. You can also display your nextgen gallery images in the map.
@ -154,8 +154,8 @@ Yes!
1. Altitude & Speed & Hearth rate 1. Altitude & Speed & Hearth rate
== Changelog == == Changelog ==
= 1.3.10 = = 1.3.12 =
* new Slovak language (thanks to Dan) * Fix incompatibility with Debian PHP7 (thanks to phbaer) https://github.com/devfarm-it/wp-gpx-maps/pull/5
= 1.3.10 = = 1.3.10 =
* Improved german translations (thanks to Konrad) http://tadesse.de/7882/2015-wanderung-ostrov-tisa-ii/ * Improved german translations (thanks to Konrad) http://tadesse.de/7882/2015-wanderung-ostrov-tisa-ii/
= 1.3.9 = = 1.3.9 =

View File

@ -3,7 +3,7 @@
Plugin Name: WP-GPX-Maps Plugin Name: WP-GPX-Maps
Plugin URI: http://www.devfarm.it/ Plugin URI: http://www.devfarm.it/
Description: Draws a GPX track with altitude chart Description: Draws a GPX track with altitude chart
Version: 1.3.11 Version: 1.3.12
Author: Bastianon Massimo Author: Bastianon Massimo
Author URI: http://www.pedemontanadelgrappa.it/ Author URI: http://www.pedemontanadelgrappa.it/
*/ */

View File

@ -216,12 +216,11 @@
if($gpx === FALSE) if($gpx === FALSE)
return; return;
$gpx->registerXPathNamespace('10', 'http://www.topografix.com/GPX/1/0'); $gpx->registerXPathNamespace('a', 'http://www.topografix.com/GPX/1/0');
$gpx->registerXPathNamespace('11', 'http://www.topografix.com/GPX/1/1'); $gpx->registerXPathNamespace('b', 'http://www.topografix.com/GPX/1/1');
$gpx->registerXPathNamespace('gpxtpx', 'http://www.garmin.com/xmlschemas/TrackPointExtension/v1'); $gpx->registerXPathNamespace('gpxtpx', 'http://www.garmin.com/xmlschemas/TrackPointExtension/v1');
$nodes = $gpx->xpath('//trk | //10:trk | //11:trk');
$nodes = $gpx->xpath('//trk | //a:trk | //b:trk');
//normal gpx //normal gpx
if ( count($nodes) > 0 ) if ( count($nodes) > 0 )
@ -232,11 +231,11 @@
$trk = simplexml_load_string($_trk->asXML()); $trk = simplexml_load_string($_trk->asXML());
$trk->registerXPathNamespace('10', 'http://www.topografix.com/GPX/1/0'); $trk->registerXPathNamespace('a', 'http://www.topografix.com/GPX/1/0');
$trk->registerXPathNamespace('11', 'http://www.topografix.com/GPX/1/1'); $trk->registerXPathNamespace('b', 'http://www.topografix.com/GPX/1/1');
$trk->registerXPathNamespace('gpxtpx', 'http://www.garmin.com/xmlschemas/TrackPointExtension/v1'); $trk->registerXPathNamespace('gpxtpx', 'http://www.garmin.com/xmlschemas/TrackPointExtension/v1');
$trkpts = $trk->xpath('//trkpt | //10:trkpt | //11:trkpt'); $trkpts = $trk->xpath('//trkpt | //a:trkpt | //b:trkpt');
$lastLat = 0; $lastLat = 0;
$lastLon = 0; $lastLon = 0;
@ -498,7 +497,7 @@
//gpx strange case //gpx strange case
$nodes = $gpx->xpath('//rtept | //10:rtept | //11:rtept'); $nodes = $gpx->xpath('//rtept | //a:rtept | //b:rtept');
if ( count($nodes) > 0 ) if ( count($nodes) > 0 )
{ {
@ -581,9 +580,9 @@
return $points; return $points;
} }
$gpx->registerXPathNamespace('10', 'http://www.topografix.com/GPX/1/0'); $gpx->registerXPathNamespace('a', 'http://www.topografix.com/GPX/1/0');
$gpx->registerXPathNamespace('11', 'http://www.topografix.com/GPX/1/1'); $gpx->registerXPathNamespace('b', 'http://www.topografix.com/GPX/1/1');
$nodes = $gpx->xpath('//wpt | //10:wpt | //11:wpt'); $nodes = $gpx->xpath('//wpt | //a:wpt | //b:wpt');
global $wpdb; global $wpdb;
if ( count($nodes) > 0 ) if ( count($nodes) > 0 )
@ -689,4 +688,4 @@
?> ?>