centreon / centreon-archived

Centreon is a network, system and application monitoring tool. Centreon is the only AIOps Platform Providing Holistic Visibility to Complex IT Workflows from Cloud to Edge.
https://www.centreon.com
GNU General Public License v2.0
574 stars 240 forks source link

Graphs incomplete with mbstring #3397

Closed centreon closed 9 years ago

centreon commented 10 years ago

Author Name: Francesco Usseglio Gaudi (Francesco Usseglio Gaudi) Original Redmine Issue: 5908, https://forge.centreon.com/issues/5908 Original Date: 2014-10-24


Hi, I had incomplete graphs (the bottom line was missing). I have checked the class centreonGraph.class.php in the displayImageFlow() function. At line 1288 the setHeaders use strlen but this function returns bad image size (shorter). I have changed the strlen to mb_strlen($str,'8bit') and now i have correct image graphs size.

--- class/centreonGraph.class.php   2014-10-23 16:10:04.000000000 +0200
+++ class/centreonGraph.class.php.orig  2014-10-23 16:10:42.000000000 +0200
@@ -1285,9 +1285,8 @@
                 $return_value = proc_close($process);

                 /* Force no compress for image */
-                $this->setHeaders(false, mb_strlen($str,'8bit'));
+                $this->setHeaders(false, strlen($str));
                 print $str;
             }
         } else {
             return $commandLine;
Tpo76 commented 9 years ago

OK