influxdata/influxdb-php

Backslashes need to be escaped in Point values

Opened this issue · 1 comments

zorac commented

Backslashes need to be escaped in point values where they immediately precede a double quote, or where they're the last character of the value. Example errors:

value=a b

value=a\b

value=a"b
Warning: Uncaught InfluxDB\Exception: HTTP Code 400 {"error":"unable to parse 'test value="a\\"b"': unbalanced quotes"}
in /app/vendor/influxdb/influxdb-php/src/InfluxDB/Database.php:177
Stack trace:
#0 /app/vendor/influxdb/influxdb-php/src/InfluxDB/Database.php(142): InfluxDB\Database->writePayload(Array, 'n', NULL)

value=a b
Warning: Uncaught InfluxDB\Exception: HTTP Code 400 {"error":"unable to parse 'test value="a b\"': unbalanced quotes"}
in /app/vendor/influxdb/influxdb-php/src/InfluxDB/Database.php:177
Stack trace:
#0 /app/vendor/influxdb/influxdb-php/src/InfluxDB/Database.php(142): InfluxDB\Database->writePayload(Array, 'n', NULL)

zorac commented

PR #156 contains a fix for this.