From 9c6f78b046962c13584f1c35ba253749f1cb9585 Mon Sep 17 00:00:00 2001
From: "mykola.salomatin" <mykola.salomatin@globallogic.com>
Date: Tue, 19 Jan 2021 17:01:46 +0200
Subject: =?UTF-8?q?[MTX-3785]=20mPower=20R.5.4:=20GP-971=20-=20Device=20sh?=
 =?UTF-8?q?all=20implement=20file=20type=20restrictions=20for=20all=20?=
 =?UTF-8?q?=E2=80=9Cupload=E2=80=9D=20sections=20on=20the=20UI=20LoRaWAN?=
 =?UTF-8?q?=20components:=20LoraLicense=20(.lic),=20LoraFotaFile=20(.bin),?=
 =?UTF-8?q?=20LoraMulticast=20(.bin=20for=20Binary,=20.txt=20for=20Hexadec?=
 =?UTF-8?q?imal=20and=20Base64),=20LoraGroup=20(.json)=20validated=20by=20?=
 =?UTF-8?q?file=20extension.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/MTS_Text.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

(limited to 'src/MTS_Text.cpp')

diff --git a/src/MTS_Text.cpp b/src/MTS_Text.cpp
index d823bfe..8dcb85f 100644
--- a/src/MTS_Text.cpp
+++ b/src/MTS_Text.cpp
@@ -699,3 +699,10 @@ bool Text::parseHex(uint64_t& value, const std::string& str) {
     return ((uint8_t) ss.rdstate() == RDSTATE_SUCCESS_MASK);
 }
 
+std::string Text::getFileExtension(const std::string& filename) {
+   size_t pos = filename.rfind('.', filename.length());
+   if (pos != std::string::npos) {
+      return (filename.substr(pos + 1, filename.length() - pos));
+   }
+   return ("");
+}
-- 
cgit v1.2.3


From da261ffdee9e0a49d1e3ec9e06fa3b6828596dd5 Mon Sep 17 00:00:00 2001
From: "mykola.salomatin" <mykola.salomatin@globallogic.com>
Date: Thu, 4 Feb 2021 18:42:16 +0200
Subject: =?UTF-8?q?[MTX-3785]=20mPower=20R.5.4:=20GP-971=20-=20Device=20sh?=
 =?UTF-8?q?all=20implement=20file=20type=20restrictions=20for=20all=20?=
 =?UTF-8?q?=E2=80=9Cupload=E2=80=9D=20sections=20on=20the=20UI?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/MTS_Text.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/MTS_Text.cpp')

diff --git a/src/MTS_Text.cpp b/src/MTS_Text.cpp
index 8dcb85f..8672acb 100644
--- a/src/MTS_Text.cpp
+++ b/src/MTS_Text.cpp
@@ -702,7 +702,7 @@ bool Text::parseHex(uint64_t& value, const std::string& str) {
 std::string Text::getFileExtension(const std::string& filename) {
    size_t pos = filename.rfind('.', filename.length());
    if (pos != std::string::npos) {
-      return (filename.substr(pos + 1, filename.length() - pos));
+      return (filename.substr(pos + 1));
    }
    return ("");
 }
-- 
cgit v1.2.3