Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple allowed directories are not working #16

Open
oxbr opened this issue Oct 14, 2016 · 0 comments
Open

Multiple allowed directories are not working #16

oxbr opened this issue Oct 14, 2016 · 0 comments

Comments

@oxbr
Copy link

oxbr commented Oct 14, 2016

Dear,

When configuring multiple allowed directories, they are not validated correctly.
The problem is that in the ./classes/logstreamdisk.class.php the function Verify() has a very little problem. When looking for the string $szFileDirName in $szAllowedDir it will never work with more than 1 allowed directory configured with the way this function is called because the separator comma is in $szAllowedDir. Simply by reversing the strings it will work. Because now you are looking for the string $szAllowedDir (with comma) in string $szFileDirName (without comma). When reversing it the haystack becomes $szAllowedDir (with comma) and the needle is $szFileDirName (without comma). Using the argument names found on http://php.net/manual/en/function.strpos.php to clarify a bit.

LogAnalyzer v4.5.1 runs on NginX with php7.0-fpm.

Hopefully this wil help,

Kind regards,

Bart

public function Verify()

Problem:
if ( strpos( $szFileDirName, $szAllowedDir ) !== FALSE ){

Correction:
if ( strpos( $szAllowedDir, $szFileDirName ) !== FALSE ){

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant