API Transport - Empty lines handling (#10431)

* API Transport - Empty lines handling

* Handle empty lines

* Update Api.php
This commit is contained in:
PipoCanaja
2019-07-11 06:23:45 +02:00
committed by Tony Murray
parent d4c109232a
commit ef637a7c77

View File

@ -48,7 +48,7 @@ class Api extends Transport
$host = explode("?", $api, 2)[0]; //we don't use the parameter part, cause we build it out of options.
//get each line of key-values and process the variables;
foreach (preg_split("/\\r\\n|\\r|\\n/", $options) as $current_line) {
foreach (preg_split("/\\r\\n|\\r|\\n/", $options, -1, PREG_SPLIT_NO_EMPTY) as $current_line) {
list($u_key, $u_val) = explode('=', $current_line, 2);
// Replace the values