pear2 / Net_RouterOS

This package allows you to read and write information from a RouterOS host using the MikroTik RouterOS API protocol.
http://pear2.php.net/PEAR2_Net_RouterOS
241 stars 116 forks source link

Caracters <> doesnt show ? #63

Closed xmaxmex closed 3 years ago

xmaxmex commented 4 years ago

Hi,

sample code:

$util->setMenu('/queue simple');
echo '<div style="margin-top: 10px;"><b>Queue Ativas:</b> '.$util->count().'</div>';

foreach ($util->getAll() as $item) {

echo 'name: ', $item->getProperty('name'),
     '<br>target: ', $item->getProperty('target'),
     '<br>maxlimit: ', $item->getProperty('max-limit'),
     '<br>priority: ', $item->getProperty('priority'),
     '<br>queue: ', $item->getProperty('queue'),
     "<br><br>";

}

Item with <> in names, return NULL ??

Example: $item->getProperty('name'), return

Return null. Any help ?

boenrobot commented 4 years ago

I see you're outputting directly into HTML, so... replace $item->getProperty('name') with htmlspecialchars($item->getProperty('name')).

xmaxmex commented 4 years ago

Thanks,

It Works ;)

Claudemir P. da Luz Jr. Consultor GNU Linux / Software Livre Cel:(91) 98236-4209 msn: xmaxmex@yahoo.com.br

Em qua., 26 de fev. de 2020 às 03:22, Vasil Rangelov < notifications@github.com> escreveu:

I see you're outputting directly into HTML, so... replace $item->getProperty('name') with htmlspecialchars($item->getProperty('name')).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pear2/Net_RouterOS/issues/63?email_source=notifications&email_token=ACVFJFJ5UNLZ7EHQTPI4J3DREYDAXA5CNFSM4K3YSB42YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEM6625Q#issuecomment-591261046, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACVFJFM3LIPIZ4QWODCVOVTREYDAXANCNFSM4K3YSB4Q .