From 3b0b9d5c4163b0de1c50da311fc483b44bc547b2 Mon Sep 17 00:00:00 2001
From: Tomasz Wolniewicz <twoln@umk.pl>
Date: Mon, 22 Jan 2024 12:31:19 +0100
Subject: [PATCH] Fixes to API

(cherry picked from commit 0ef461385037423b39cf903be2545aa363860f03)
---
 lib/API.php | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/API.php b/lib/API.php
index 3966dfc..aeeb509 100644
--- a/lib/API.php
+++ b/lib/API.php
@@ -101,7 +101,7 @@ class API {
         foreach ($supportedOptions as $opt) {
             $this->assignOpt($opt);
         }
-//        print_r($this->opts);
+        Utils::debug(5, $this->opts, "OPTS: ", "\n");
     }
 
     private function optionError($optName) {
@@ -300,15 +300,18 @@ class API {
                 if ($optValue != 1 && $optValue != 2) {
                     $optValue = 0;
                 }
+                break;
             case 'details':
                 if ($optValue != 1) {
                     $optValue = 0;
                 }
+                break;
             case 'valid_sec':
                 $optValue = filter_var($optValue, FILTER_SANITIZE_NUMBER_INT);
                 if ($optValue == '') {
                     $optValue = 0;
                 }
+                break;
             default:
         }
         $this->opts[$optName] = $optValue;
@@ -608,7 +611,6 @@ class API {
         if ($this->opts['help'] == 1) {
             return "";
         }
-        Utils::debug(5, $this->opts, "OPTS: ", "\n");
         $edugain = new eduGAIN(5, $this->fed_id, true);
         $edugain->load_federations_state();
         if ($this->opts['only_errors'] > 0) {
-- 
GitLab