Skip to content

Commit

Permalink
QA: Restore rendering of SVG on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
TheWitness committed Aug 8, 2023
1 parent 2f178a9 commit 6745567
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 0 additions & 3 deletions include/global.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,6 @@
if ($config['cacti_server_os'] == 'win32') {
$config['base_path'] = str_replace("\\", "/", substr(dirname(__FILE__),0,-8));
$config['library_path'] = $config['base_path'] . '/lib';

/* used for php-snmp support */
putenv('MIB_DIRS=c:/usr/share/snmp/mibs');
} else {
$config['base_path'] = preg_replace("/(.*)[\/]include/", "\\1", dirname(__FILE__));
$config['library_path'] = preg_replace("/(.*[\/])include/", "\\1lib", dirname(__FILE__));
Expand Down
12 changes: 9 additions & 3 deletions lib/rrd.php
Original file line number Diff line number Diff line change
Expand Up @@ -419,16 +419,22 @@ function __rrd_execute($command_line, $log_to_stdout, $output_flag, $rrdtool_pip
}

function rrdtool_trim_output(&$output) {
global $config;

/* When using RRDtool with proc_open for long strings
* and using the '-' to handle standard in from inside
* the process, RRDtool automatically appends stderr
* to stdout for batch programs to parse the output
* string. So, therefore, we have to prune that
* output.
*/
$okpos = strrpos($output, 'OK u:');
if ($okpos !== false) {
$output = substr($output, 0, $okpos);
if ($config['cacti_server_os'] == 'win32') {
$output = rtrim($output, "OK \n\r");
} else {
$okpos = strrpos($output, 'OK u:');
if ($okpos !== false) {
$output = substr($output, 0, $okpos);
}
}
}

Expand Down

0 comments on commit 6745567

Please sign in to comment.