Skip to content

Commit 470258a

Browse files
committed
Fix FirebaseJson leading CRLF parsing issue
1 parent aa4a940 commit 470258a

File tree

11 files changed

+43
-71
lines changed

11 files changed

+43
-71
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 mobizt
3+
Copyright (c) 2025 mobizt
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,27 +1592,18 @@ bool search(String *response, <string> spreadsheetId, FirebaseJsonArray *dataFil
15921592

15931593
## License
15941594

1595-
The MIT License (MIT)
1595+
The codes and examples in this repository are licensed under the MIT License.
15961596

1597-
Copyright (C) 2024 K. Suwatchai (Mobizt)
1597+
Copyright (c) 2025, Suwatchai K. All rights reserved.
15981598

1599+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
15991600

1600-
Permission is hereby granted, free of charge, to any person returning a copy of
1601-
this software and associated documentation files (the "Software"), to deal in
1602-
the Software without restriction, including without limitation the rights to
1603-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
1604-
the Software, and to permit persons to whom the Software is furnished to do so,
1605-
subject to the following conditions:
1601+
*The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.*
16061602

1607-
The above copyright notice and this permission notice shall be included in all
1608-
copies or substantial portions of the Software.
1603+
`THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.`
1604+
1605+
*Last updated 2025-08-11 UTC.*
16091606

1610-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1611-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
1612-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
1613-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
1614-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
1615-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16161607

16171608

16181609

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ESP-Google-Sheet-Client",
3-
"version": "1.4.9",
3+
"version": "1.4.10",
44
"keywords": "communication, REST, esp32, esp8266, raspberrypi, arduino",
55
"description": "Arduino Google Sheet REST client library for Arduino devices. This library allows devices to communicate with Google Sheet API to read, edit and delete the spreadsheets",
66
"repository": {

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name=ESP-Google-Sheet-Client
22

3-
version=1.4.9
3+
version=1.4.10
44

55
author=Mobizt
66

src/ESP_Google_Sheet_Client.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/**
2-
* Google Sheet Client, ESP_GOOGLE_SHEET_CLIENT_Google_Sheet_Client.cpp v1.4.9
2+
* Google Sheet Client, ESP_GOOGLE_SHEET_CLIENT_Google_Sheet_Client.cpp v1.4.10
33
*
44
* This library supports Espressif ESP8266 and ESP32 MCUs
55
*
6-
* Created April 15, 2025
6+
* Created August 11, 2025
77
*
88
* The MIT License (MIT)
9-
* Copyright (c) 2023 K. Suwatchai (Mobizt)
9+
* Copyright (c) 2025 K. Suwatchai (Mobizt)
1010
*
1111
*
1212
* Permission is hereby granted, free of charge, to any person returning a copy of

src/ESP_Google_Sheet_Client.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#ifndef ESP_GOOGLE_SHEET_CLIENT_VERSION
2-
#define ESP_GOOGLE_SHEET_CLIENT_VERSION "1.4.9"
2+
#define ESP_GOOGLE_SHEET_CLIENT_VERSION "1.4.10"
33
#endif
44

55
/**
6-
* Google Sheet Client, ESP_Google_Sheet_Client.h v1.4.9
6+
* Google Sheet Client, ESP_Google_Sheet_Client.h v1.4.10
77
*
88
* This library supports Espressif ESP8266 and ESP32 MCUs
99
*
10-
* Created April 15, 2025
10+
* Created August 11, 2025
1111
*
1212
* The MIT License (MIT)
13-
* Copyright (c) 2023 K. Suwatchai (Mobizt)
13+
* Copyright (c) 2025 K. Suwatchai (Mobizt)
1414
*
1515
*
1616
* Permission is hereby granted, free of charge, to any person returning a copy of

src/json/FirebaseJson.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/*
2-
* FirebaseJson, version 3.0.10
2+
* FirebaseJson, version 3.0.9
33
*
44
* The Easiest Arduino library to parse, create and edit JSON object using a relative path.
55
*
6-
* Created March 25, 2024
6+
* Created June 20, 2024
77
*
88
* Features
99
* - Using path to access node element in search style e.g. json.get(result,"a/b/c")
@@ -80,8 +80,8 @@ bool FirebaseJsonBase::setRaw(const char *raw)
8080

8181
if (raw)
8282
{
83-
size_t i = 0;
84-
while (i < strlen(raw) && raw[i] == ' ')
83+
size_t i = 0, len = strlen(raw);
84+
while (i < len && (raw[i] == ' ' || raw[i] == '\t' || raw[i] == '\r' || raw[i] == '\n'))
8585
{
8686
i++;
8787
}

src/json/FirebaseJson.h

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/*
2-
* FirebaseJson, version 3.0.10
2+
* FirebaseJson, version 3.0.9
33
*
44
* The Easiest Arduino library to parse, create and edit JSON object using a relative path.
55
*
6-
* Created March 25, 2024
6+
* Created June 20, 2024
77
*
88
* Features
99
* - Using path to access node element in search style e.g. json.get(result,"a/b/c")
@@ -128,10 +128,6 @@
128128
#endif
129129
#endif
130130

131-
#if defined(FIREBASEJSON_USE_PSRAM) || defined(FIREBASE_USE_PSRAM)
132-
#define MB_STRING_USE_PSRAM
133-
#endif
134-
135131
#include "MB_String.h"
136132

137133
using namespace mb_string;
@@ -166,7 +162,7 @@ extern "C"
166162

167163
#define Serial_Printf Serial.printf
168164

169-
#elif defined(ARDUINO_UNOWIFIR4) || defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) || defined(ARDUINO_ARCH_STM32F4) || defined(__AVR__)
165+
#elif defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) || defined(ARDUINO_ARCH_STM32F4) || defined(__AVR__)
170166

171167
#include "extras/print/fb_json_print.h"
172168

@@ -221,7 +217,7 @@ static void *fb_js_malloc(size_t len)
221217
void *p;
222218
size_t newLen = getReservedLen(len);
223219

224-
#if defined(BOARD_HAS_PSRAM) && defined(MB_STRING_USE_PSRAM)
220+
#if defined(BOARD_HAS_PSRAM)
225221
if (ESP.getPsramSize() > 0)
226222
p = (void *)ps_malloc(newLen);
227223
else
@@ -256,7 +252,7 @@ static void fb_js_free(void *ptr)
256252
static void *fb_js_realloc(void *ptr, size_t sz)
257253
{
258254
size_t newLen = getReservedLen(sz);
259-
#if defined(BOARD_HAS_PSRAM) && defined(MB_STRING_USE_PSRAM)
255+
#if defined(BOARD_HAS_PSRAM)
260256
if (ESP.getPsramSize() > 0)
261257
ptr = (void *)ps_realloc(ptr, newLen);
262258
else
@@ -879,7 +875,7 @@ class FirebaseJsonBase
879875
{
880876
void *p;
881877
size_t newLen = getReservedLen(len);
882-
#if defined(BOARD_HAS_PSRAM) && defined(MB_STRING_USE_PSRAM)
878+
#if defined(BOARD_HAS_PSRAM)
883879
if (ESP.getPsramSize() > 0)
884880
p = (void *)ps_malloc(newLen);
885881
else

src/json/MB_JSON/MB_JSON.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
All original static cJSON functions and static variables will be prefixed with MB_JSON_.
55
6-
Created December 20, 2021
6+
Created December 20, 2022
77
88
Copyright (c) 2023 Mobizt (K. Suwatchai)
99

src/json/MB_JSON/MB_JSON.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
All original static cJSON functions and static variables will be prefixed with MB_JSON_.
55
6-
Created December 20, 2021
6+
Created December 20, 2022
77
88
Copyright (c) 2023 Mobizt (K. Suwatchai)
99

0 commit comments

Comments
 (0)