Skip to content

Commit

Permalink
Fix. FSWatcher. Logs path protected.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandergull committed Jan 17, 2024
1 parent 633808f commit cbb7c63
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/CleantalkSP/Common/FSWatcher/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@ private static function getCurrentDayLogPath()
{
$path = self::getLoggerDir();
return $path
? $path . DIRECTORY_SEPARATOR . date('Y-m-d') . '.log'
? $path . DIRECTORY_SEPARATOR . date('Y-m-d') . md5(__FILE__) . '.log'
: false;
}

private static function setLoggerDir()
{
return mkdir(self::$logger_dir);
$result = (
mkdir(self::$logger_dir) &&
file_put_contents(self::$logger_dir . DIRECTORY_SEPARATOR . 'index.php', '<?php //Silence is golden')
);
return $result;
}

private static function getLoggerDir()
Expand Down
1 change: 1 addition & 0 deletions lib/CleantalkSP/SpbctWP/FSWatcher/SpbctWpFSWController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ private static function getDebugState()
{
if ( defined('SPBC_FSWATCHER_DEBUG') ) {
self::$debug = (bool) SPBC_FSWATCHER_DEBUG;
parent::$debug = self::$debug;
}
}

Expand Down

0 comments on commit cbb7c63

Please sign in to comment.