array_walk does not work like that, apparently input is trimmed later on

This commit is contained in:
Ultra2D
2016-03-04 15:51:49 +01:00
parent 99cd9f96cf
commit 488f7f44c4
2 changed files with 1 additions and 2 deletions

View File

@@ -119,7 +119,6 @@ function process_syslog($entry, $update) {
}
$entry['program'] = strtoupper($entry['program']);
array_walk($entry, 'trim');
if ($update) {
dbInsert(

View File

@@ -137,7 +137,7 @@ class SyslogTest extends \PHPUnit_Framework_TestCase
);
$testdata[] = $this->createData(
"1.1.1.1||authpriv||notice||notice||55||2016-02-28 00:23:34|| root : TTY=pts/1 ; PWD=/opt/librenms ; USER=librenms ; COMMAND=/usr/bin/git status||sudo",
array('device_id'=>1, 'program'=>'SUDO', 'msg'=>'root : TTY=pts/1 ; PWD=/opt/librenms ; USER=librenms ; COMMAND=/usr/bin/git status')
array('device_id'=>1, 'program'=>'SUDO', 'msg'=>' root : TTY=pts/1 ; PWD=/opt/librenms ; USER=librenms ; COMMAND=/usr/bin/git status')
);