BenMenking / routeros-api

Client API for RouterOS/Mikrotik
338 stars 270 forks source link

parseResponse ignore script source after equal (=) symbol #33

Closed nozarc closed 5 years ago

nozarc commented 6 years ago

Hello, i have found trouble (or bug maybe) when parseResponse parsing result of my hotspot user profile on-login script here the result before i parse it =on-login=/system scheduler add name="remove-user-$user" interval="1d" on-even="/ip hotspot active remove [find user=$user];/ip hotspot user remove [find name=$user];/system scheduler remove [find name=remove-user-$user]" and after i parse it with parseResponse, parseResponse remove some of the result and it becomes like this [on-login] => /system scheduler add name

after i try to look into the routeros_api.class.php, i found the problem is because parseResponse() assumed that the regex only had 2 results which are $MATCHES[0][0] and $MATCHES[0][1]. but in my case, the regex have more than 2 results, so the results except $MATCHES[0][0] and $MATCHES[0][1] are ignored. ps: i'm not sure about my issue title

BenMenking commented 5 years ago

Doesn't appear to be a bug? Can't replicate.