From 4233f8d2df154cc9f92c7224974d9330ac9d43ca Mon Sep 17 00:00:00 2001
From: Davide Vaghetti <davide.vaghetti@garr.it>
Date: Mon, 9 May 2022 18:18:33 +0200
Subject: [PATCH] Set config var with metadata_url and call it from EarcUtils
instead of env
---
.env.example | 2 +-
app/Libraries/EarcUtils.php | 2 +-
config/app.php | 3 ++-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/.env.example b/.env.example
index 8b50bd0..d01ec17 100644
--- a/.env.example
+++ b/.env.example
@@ -34,4 +34,4 @@ PUSHER_APP_ID=
PUSHER_KEY=
PUSHER_SECRET=
-METADATA_URL=‘https://mdx.idem.garr.it/edugain/entities/’
+METADATA_URL='https://mdx.idem.garr.it/edugain/entities/'
diff --git a/app/Libraries/EarcUtils.php b/app/Libraries/EarcUtils.php
index 0e63a2e..792a575 100755
--- a/app/Libraries/EarcUtils.php
+++ b/app/Libraries/EarcUtils.php
@@ -78,7 +78,7 @@ class EarcUtils
public static function getIdpMetadata($entityid)
{
$metaloader = new MetaLoader(null);
- $metaloader->loadSource(array('src' => env('‘METADATA_URL’') . urlencode($entityid)));
+ $metaloader->loadSource(array('src' => config('app.metadata_url') . urlencode($entityid)));
$metaloader->writeMetadataFiles(Configuration::getInstance()->getPathValue('metadatagenerateddir', 'metadata-generated-idp/'));
include Configuration::getInstance()->getPathValue('metadatagenerateddir', 'metadata-generated-idp/').'saml20-idp-remote.php';
diff --git a/config/app.php b/config/app.php
index eafd77b..470b3fa 100755
--- a/config/app.php
+++ b/config/app.php
@@ -145,7 +145,8 @@ return [
'http://eduid.hu' => 'https://attributes.eduid.hu',
],
-
+ 'metadata_url' => env('METADATA_URL'),
+
/*
|--------------------------------------------------------------------------
| Autoloaded Service Providers
--
GitLab