[Mapbender-commits] r8611 - trunk/mapbender/http/php
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Tue Apr 30 00:07:07 PDT 2013
Author: armin11
Date: 2013-04-30 00:07:06 -0700 (Tue, 30 Apr 2013)
New Revision: 8611
Modified:
trunk/mapbender/http/php/mod_validateInspire.php
Log:
Bugfix for new INSPIRE Validation service - use absolute urls to inspire documentation
Modified: trunk/mapbender/http/php/mod_validateInspire.php
===================================================================
--- trunk/mapbender/http/php/mod_validateInspire.php 2013-04-29 12:14:42 UTC (rev 8610)
+++ trunk/mapbender/http/php/mod_validateInspire.php 2013-04-30 07:07:06 UTC (rev 8611)
@@ -23,6 +23,8 @@
//$validatorUrl = 'http://inspire-geoportal.ec.europa.eu/GeoportalProxyWebServices/resources/INSPIREResourceTester';
if (defined("INSPIRE_VALIDATOR_URL") && INSPIRE_VALIDATOR_URL != '') {
$validatorUrl = INSPIRE_VALIDATOR_URL;
+ $urlParts = parse_url($validatorUrl);
+ $inspireHost = $urlParts['host'];
} else {
echo "No validation service defined! Please check your mapbender.conf";
die();
@@ -70,6 +72,7 @@
$response = @file_get_contents($validatorUrl, FILE_TEXT, $context);
header("Content-type: text/html; charset=UTF-8");
$repl = str_replace('/schemas/altova/inspireResource.css', 'http://inspire-geoportal.ec.europa.eu/schemas/altova/inspireResource.css', trim($response));
+ $repl = str_replace("/documentation/", "http://".$inspireHost."/documentation/", $repl);
echo $repl;
}
@@ -104,6 +107,10 @@
//$data = http_build_query($data);
//check proxy connections
if (defined("CONNECTION_PROXY") && CONNECTION_PROXY != "") {
+ if (defined("CONNECTION_USER") && CONNECTION_USER != "") {
+ $auth = base64_encode('$CONNECTION_USER:$CONNECTION_PASSWORD');
+ $header .= 'Proxy-Authorization: Basic '.$auth;
+ }
$context_options = array (
'http' => array (
'proxy' => "tcp://".CONNECTION_PROXY.":".CONNECTION_PORT,
More information about the Mapbender_commits
mailing list