martinm76 / zabbix-pdf-report

Reporting tool in PHP for the Zabbix Monitoring Platform. Rather versatile reporting on hosts and host groups.
https://www.zabbix.com/forum/zabbix-cookbook/25368-zabbix-dynamic-pdf-report-generation?filter_time=time_lastmonth
GNU General Public License v3.0
52 stars 55 forks source link

clarification about renaming #12

Closed ironbishop closed 4 years ago

ironbishop commented 4 years ago

I don't understand

The issue arises when you loop through hosts and try to download the relative report: the label corresponds to the Visible Name in Zabbix, but the URL doesn't.

During creation:

https://github.com/martinm76/zabbix-pdf-report/blob/521fb25e305efe31558e2a41cca7d60e4671fa5a/createpdf.php#L172

https://github.com/martinm76/zabbix-pdf-report/blob/521fb25e305efe31558e2a41cca7d60e4671fa5a/createpdf.php#L184-L185

During display:

https://github.com/martinm76/zabbix-pdf-report/blob/521fb25e305efe31558e2a41cca7d60e4671fa5a/inc/index.functions.php#L55-L56

martinm76 commented 4 years ago

Well for starters, you can't have a filename that contains '/'. Spaces may be able to be handled better, but since space is usually a delimiter in for operations and other similar situations, I find it better to avoid having to deal with them.

I choose to present them in the 'nice' way at the end, but could just as easily have left it at _ and --

ironbishop commented 4 years ago

Thank you. Then I'm going to use rawurlencode()/rawurldecode() and call it a day.

ironbishop commented 4 years ago

ps pavlik spotted something similar too https://github.com/Pavlik-PIP/zabbix-pdf-report/commit/e9378613cb6786dfbd7175cecc5565e3b32c598c