Cacti / plugin_reportit

ReportIt Plugin for Cacti
GNU General Public License v2.0
7 stars 8 forks source link

Non well formed numeric value issued by pclzip.lib.php #72

Closed ikorzha closed 5 years ago

ikorzha commented 5 years ago

netniV, last item remaining when running report from command prompt: PHP Notice: A non well formed numeric value encountered in /var/www/html/plugins/reportit/include/vendor/pclzip/pclzip.lib.php on line 1846

I did some research and found I fix referenced here, I have tested the fix and it does solve the php notice errors and error in cacti log. Can you please merge it into git development branch if allowed?

https://github.com/Piwigo/Piwigo/issues/693

Code:

diff --git a/admin/include/pclzip.lib.php b/admin/include/pclzip.lib.php
index c2d09a5..3bb44d6 100644
--- a/admin/include/pclzip.lib.php
+++ b/admin/include/pclzip.lib.php
@@ -1836,6 +1836,7 @@
     $v_memory_limit = ini_get('memory_limit');
     $v_memory_limit = trim($v_memory_limit);
     $last = strtolower(substr($v_memory_limit, -1));
+    $v_memory_limit = intval($v_memory_limit);

     if($last == 'g')
netniV commented 5 years ago

Just so you know, diffs/code should be enclosed in three backticks and where possible use the code syntax highlighter name to help get things highlighted. 👍

netniV commented 5 years ago

This has now been committed to the development code.