From f8df9e5f00f12f9ff383fa4484965ff92fc2f992 Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Fri, 2 Jun 2023 13:29:57 +0200 Subject: [PATCH] Berry `webclient.url_encode()` is now a static class method, no change required to existing code (#18775) --- CHANGELOG.md | 1 + lib/libesp32/berry_tasmota/src/be_webclient_lib.c | 2 +- tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_webclient.ino | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f833e28c1..f902a3802 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ All notable changes to this project will be documented in this file. - InfluxDb resolves DNS name before request (#18015) - Shutter sliders in WEBGUI automatically appear and disappear during configuration and update during movement (#18701) - AdafruitFingerprint library from v2.0.4 to v2.1.0 +- Berry `webclient.url_encode()` is now a static class method, no change required to existing code ### Fixed - ESP32 InfluxDb initial connection delays using HTTPClient (#18015) diff --git a/lib/libesp32/berry_tasmota/src/be_webclient_lib.c b/lib/libesp32/berry_tasmota/src/be_webclient_lib.c index a5c888d01..6458169a5 100644 --- a/lib/libesp32/berry_tasmota/src/be_webclient_lib.c +++ b/lib/libesp32/berry_tasmota/src/be_webclient_lib.c @@ -45,7 +45,7 @@ class be_class_webclient (scope: global, name: webclient) { .w, var init, func(wc_init) deinit, func(wc_deinit) - url_encode, func(wc_urlencode) + url_encode, static_func(wc_urlencode) begin, func(wc_begin) set_timeouts, func(wc_set_timeouts) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_webclient.ino b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_webclient.ino index 17d590879..f81326570 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_webclient.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_webclient.ino @@ -153,12 +153,12 @@ extern "C" { be_return_nil(vm); } - // wc.url_encode(string) -> string + // wc.url_encode(string) -> string (static method) int32_t wc_urlencode(struct bvm *vm); int32_t wc_urlencode(struct bvm *vm) { int32_t argc = be_top(vm); - if (argc >= 2 && be_isstring(vm, 2)) { - const char * s = be_tostring(vm, 2); + if (argc >= 1 && be_isstring(vm, 1)) { + const char * s = be_tostring(vm, 1); String url = wc_UrlEncode(String(s)); be_pushstring(vm, url.c_str()); be_return(vm); /* return self */