Thomas--F / BotTracker

BotTracker-Plugin for Piwik
GNU General Public License v3.0
33 stars 14 forks source link

Some characters are not quoted properly #32

Closed ercpe closed 9 years ago

ercpe commented 9 years ago

Some characters are not quoted properly in the "Bot-Name" and "Keyword" column on the administration page and in the legend of the pie chart:

When one enters something like foo'n'bar into either of the fields, after saving the value becomes foo'n'bar in both, the administration page and the legend of the chart. Haven't testet whether the correct value is use for the detection, though.

Thomas--F commented 9 years ago

Sorry for the late answer. I was on vacation.... I will try to test the use of sinlge quotes or other unsusual characters. If the detection is OK, I have to find a way to convert the characters before they come to the screen.

Which browser and what version of PHP do you use?

Thomas--F commented 9 years ago

I found a way to store the correct values to the databese. The output is fine on all tables, but the pie-chart is a mess....

Thomas--F commented 9 years ago

The pie-chart is still ugly, but the rest works fine.

Can you test the changes before I commit a new release?

ercpe commented 9 years ago

Yes, saving and loading works as expected. Editing already saved entries is a bit clumsy as it requires to change more than the single quote, but works.

From what i see, the chart issue is a limitation/feature of the ViewDataTable in Piwik as it is also designed to render HTML tables.

On a side note, i would suggest using mb_decode_numericentity to decode the html entities. Using preg_replace and mb_convert_encoding seems a bit odd.

Thomas--F commented 9 years ago

Thanks for testing.

I just took the sample in the php-manual: http://php.net/manual/de/function.html-entity-decode.php#104617

Thomas--F commented 9 years ago

I know, this issue ist not solved completely, but the rest is just an optical issue in the pie-chart.