Skip to content

Commit 5156ab8

Browse files
fix: resolve php-cs-fixer formatting and undefined function
- Auto-fix php-cs-fixer issues in lib/rrd.php and lib/poller.php - Replace undefined cacti_redirect() with header()+exit in oauth2.php Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
1 parent 6cf8e05 commit 5156ab8

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

lib/poller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ function exec_poll_php(string $command, bool $using_proc_function, array $pipes,
113113
* exec_background - executes a program in the background so that php can continue
114114
* to execute code in the foreground.
115115
*
116-
* @param string $filename The full pathname to the script to execute
116+
* @param string $filename The full pathname to the script to execute
117117
* @param string|array $args Any additional arguments. Arrays are escaped per-element via cacti_escapeshellarg.
118118
* @param string|array $redirect_args Any additional arguments for file re-direction. Otherwise output goes to /dev/null
119119
*

lib/rrd.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,11 @@ function rrdtool_execute() : mixed {
308308
/**
309309
* Execute an RRDtool command and return the output.
310310
*
311-
* @param string|array $command_line The RRDtool command to execute
312-
* @param bool $log_to_stdout Whether to echo output to stdout
313-
* @param int $output_flag Output format constant (RRDTOOL_OUTPUT_*)
314-
* @param mixed $rrdtool_pipe An open RRDtool pipe resource, or null
315-
* @param string $logopt Logging context identifier
311+
* @param string|array $command_line The RRDtool command to execute
312+
* @param bool $log_to_stdout Whether to echo output to stdout
313+
* @param int $output_flag Output format constant (RRDTOOL_OUTPUT_*)
314+
* @param mixed $rrdtool_pipe An open RRDtool pipe resource, or null
315+
* @param string $logopt Logging context identifier
316316
*
317317
* @return mixed The command output in the requested format
318318
*/

oauth2.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@
9292
if (!isrv('code')) { // If we don't have an authorization code then get one
9393
$authUrl = $provider->getAuthorizationUrl($options);
9494
$_SESSION['oauth2state'] = $provider->getState();
95-
cacti_redirect($authUrl, false);
95+
header('Location: ' . $authUrl);
96+
97+
exit;
9698

9799
// Check given state against previously stored one to mitigate CSRF attack
98100
}

0 commit comments

Comments
 (0)