[GH-ISSUE #581] SSID list does not escape HTML #484

Closed
opened 2026-02-28 01:25:31 +03:00 by kerem · 3 comments
Owner

Originally created by @astfgl on GitHub (Apr 2, 2018).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/581

Basic Infos

A SSID containing HTML does not display correctly in list. May make AP name invisible and un-clickable.

Hardware

WiFimanager Branch/Release: Development

Esp8266/Esp32: Esp8266

Hardware: WeMos D1 Mini / ESP-12

Core Version: 2.4.0

Description

When a SSID has a name consisting of a HTML-looking tag, the access point may be unuseable. For example a name of <NULL> will not be visible in the list. The line for that access point is there, however there is nothing on the line which is clickable, and so the access point is not selectable.

Multiple SSID variants have been tested and all work with other CLI and graphical configuration tools on all platforms tested - Windows, Linux, Android, iOS, etc.

Settings in IDE

Module: Wemos D1 R2 & mini

Additional libraries: NIL

Sketch


#include <Arduino.h>
#include <WiFiManager.h>

void setup() {
  WiFiManager wifiManager;
}

void loop() {

}

Debug Messages

NIL

Originally created by @astfgl on GitHub (Apr 2, 2018). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/581 ### Basic Infos A SSID containing HTML does not display correctly in list. May make AP name invisible and un-clickable. #### Hardware WiFimanager Branch/Release: Development Esp8266/Esp32: Esp8266 Hardware: WeMos D1 Mini / ESP-12 Core Version: 2.4.0 ### Description When a SSID has a name consisting of a HTML-looking tag, the access point may be unuseable. For example a name of **&lt;NULL&gt;** will not be visible in the list. The line for that access point is there, however there is nothing on the line which is clickable, and so the access point is not selectable. Multiple SSID variants have been tested and all work with other CLI and graphical configuration tools on all platforms tested - Windows, Linux, Android, iOS, etc. ### Settings in IDE Module: Wemos D1 R2 & mini Additional libraries: NIL ### Sketch ```cpp #include <Arduino.h> #include <WiFiManager.h> void setup() { WiFiManager wifiManager; } void loop() { } ``` ### Debug Messages NIL
kerem 2026-02-28 01:25:31 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@tablatronix commented on GitHub (Apr 2, 2018):

Thanks I was meaning to add encoding/decoding/escaping to the lib and forgot to make an issue for it.

<!-- gh-comment-id:377837902 --> @tablatronix commented on GitHub (Apr 2, 2018): Thanks I was meaning to add encoding/decoding/escaping to the lib and forgot to make an issue for it.
Author
Owner

@tablatronix commented on GitHub (Apr 5, 2018):

give it a try now

added

String WiFiManager::htmlEntities(String str) {
  str.replace("&","&amp;");
  str.replace("<","&lt;");
  str.replace(">","&gt;");
  // str.replace("'","&#39;");
  // str.replace("\"","&quot;");
  // str.replace("/": "&#x2F;");
  // str.replace("`": "&#x60;");
  // str.replace("=": "&#x3D;");
return str;
}
<!-- gh-comment-id:379019109 --> @tablatronix commented on GitHub (Apr 5, 2018): give it a try now added ```cpp String WiFiManager::htmlEntities(String str) { str.replace("&","&amp;"); str.replace("<","&lt;"); str.replace(">","&gt;"); // str.replace("'","&#39;"); // str.replace("\"","&quot;"); // str.replace("/": "&#x2F;"); // str.replace("`": "&#x60;"); // str.replace("=": "&#x3D;"); return str; } ```
Author
Owner

@astfgl commented on GitHub (Apr 6, 2018):

Works perfectly! Thanks very much for the quick turnaround, much appreciated.

<!-- gh-comment-id:379184607 --> @astfgl commented on GitHub (Apr 6, 2018): Works perfectly! Thanks very much for the quick turnaround, much appreciated.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#484
No description provided.