mirror of
https://github.com/danieldemus/openhab-core.git
synced 2025-01-25 11:45:49 +01:00
String translations for IP add-on finder (#4232)
Translate backslash sequences in requestPlain. See String.translateEscapes(). Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
This commit is contained in:
parent
945900b52a
commit
43b57eb9e9
@ -123,7 +123,8 @@ import org.slf4j.LoggerFactory;
|
||||
* <td>{@code requestPlain}</td>
|
||||
* <td>description of request frame as plaintext string</td>
|
||||
* <td>dynamic replacement of variables $srcIp, $srcPort and $uuid, no others implemented yet;
|
||||
* there are five XML special characters which need to be escaped:
|
||||
* standard backslash sequences will be translated, and in addition to {@code \}, there are five
|
||||
* XML special characters which need to be escaped:
|
||||
*
|
||||
* <pre>{@code
|
||||
* & - &
|
||||
@ -507,7 +508,7 @@ public class IpAddonFinder extends BaseAddonFinder implements NetworkAddressChan
|
||||
|
||||
@Nullable
|
||||
String reqUnEscaped = StringUtils.unEscapeXml(req.toString());
|
||||
return reqUnEscaped != null ? reqUnEscaped.getBytes() : new byte[0];
|
||||
return reqUnEscaped != null ? reqUnEscaped.translateEscapes().getBytes() : new byte[0];
|
||||
}
|
||||
|
||||
// build from hex string
|
||||
|
Loading…
Reference in New Issue
Block a user