-
-
Notifications
You must be signed in to change notification settings - Fork 438
Closed
Labels
Milestone
Description
Describe the bug
Sometimes, CSRF report error as below.
2020/03/04 04:04:12 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins.php[25]:include(), /include/auth.php[28]:unknown(), /include/global.php[496]:include_once(), /include/csrf.php[31]:include_once(), /include/vendor/csrf/csrf-magic.php[580]:csrf_check(), /include/vendor/csrf/csrf-magic.php[88]:CactiErrorHandler())
2020/03/04 04:04:12 - ERROR PHP NOTICE: Array to string conversion in file: /var/www/html/cacti/include/vendor/csrf/csrf-magic.php on line: 88
To Reproduce
Not sure how to reproduce, before/after error i access several page, and uninstall/install syslog plugin
Possible Diff
--- csrf-magic.php 2020-03-04 04:13:32.712019835 +0000
+++ csrf-magic.php 2020-03-04 04:27:08.960811931 +0000
@@ -85,9 +85,6 @@
// schemes are volatile.
$tokens = $_POST[$name];
$result = csrf_check_tokens($tokens);
+ if (is_array($tokens)){
+ $tokens = implode(';', $tokens);
+ }
csrf_log(__FUNCTION__,"check_tokens($name, $tokens) returned $result");
}Reactions are currently unavailable