[Mapbender-commits] r10014 - trunk/mapbender/http/php
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Fri Dec 14 03:01:34 PST 2018
Author: armin11
Date: 2018-12-14 03:01:33 -0800 (Fri, 14 Dec 2018)
New Revision: 10014
Modified:
trunk/mapbender/http/php/mod_mobileClientQr.php
Log:
allow invocation from other path
Modified: trunk/mapbender/http/php/mod_mobileClientQr.php
===================================================================
--- trunk/mapbender/http/php/mod_mobileClientQr.php 2018-12-14 08:19:16 UTC (rev 10013)
+++ trunk/mapbender/http/php/mod_mobileClientQr.php 2018-12-14 11:01:33 UTC (rev 10014)
@@ -17,6 +17,18 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
require_once dirname(__FILE__) . "/../../core/globalSettings.php";
require_once dirname(__FILE__) . "/../extensions/phpqrcode/phpqrcode.php";
+$pathExtension = "";
+if (isset($_REQUEST["pathExtension"]) & $_REQUEST["pathExtension"] != "") {
+ //validate to de, en, fr
+ $testMatch = $_REQUEST["pathExtension"];
+ if (!($testMatch == '../../mapbender/tmp/' or $testMatch == '../mapbender/tmp/')){
+ //echo 'languageCode: <b>'.$testMatch.'</b> is not valid.<br/>';
+ echo 'Parameter <b>pathExtension</b> is not valid ("../../mapbender/tmp/","../mapbender/tmp/").<br/>';
+ die();
+ }
+ $pathExtension = $testMatch;
+ $testMatch = NULL;
+}
$filename = "qr_mobileclient.png";
//generate qr on the fly in tmp folder
//link to invoke wmc per get api if wrapper path isset
@@ -23,7 +35,7 @@
if (defined("MAPBENDER_PATH") && MAPBENDER_PATH != "") {
$invokeLink = MAPBENDER_PATH."/extensions/mobilemap2/index.html";
QRcode::png($invokeLink,TMPDIR."/".$filename);
- $htmlElement = "<a href = '".$invokeLink."'><img src='".TMPDIR."/".$filename."'></a>";
+ $htmlElement = "<a href = '".$invokeLink."'><img src='$pathExtension".TMPDIR."/".$filename."'></a>";
} else {
echo "MAPBENDER_PATH not defined in mapbender.conf - please define it to activate linkage and qr code!";
die();
More information about the Mapbender_commits
mailing list