-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: directory with phar host prefix issue
Fix directory with phar host prefix issue Update Copyright year Updated bin files permissions New version 0.5.0.70 Closes 4
- Loading branch information
Marco Cesarato
committed
Mar 11, 2020
1 parent
b06e642
commit 8ddcc85
Showing
19 changed files
with
33 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
Empty file.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.5.0.69 | ||
0.5.0.70 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* PHP Antimalware Scanner. | ||
* | ||
* @author Marco Cesarato <[email protected]> | ||
* @copyright Copyright (c) 2019 | ||
* @copyright Copyright (c) 2020 | ||
* @license http://opensource.org/licenses/gpl-3.0.html GNU Public License | ||
* | ||
* @see https://github.com/marcocesarato/PHP-Antimalware-Scanner | ||
|
@@ -34,7 +34,7 @@ class Application | |
* | ||
* @var string | ||
*/ | ||
public static $VERSION = '0.5.0.69'; | ||
public static $VERSION = '0.5.0.70'; | ||
|
||
/** | ||
* Root path. | ||
|
@@ -195,11 +195,11 @@ public function __construct() | |
private function init() | ||
{ | ||
if (self::$ROOT === './') { | ||
self::$ROOT = __DIR__; | ||
self::$ROOT = self::currentDirectory(); | ||
} | ||
|
||
if (self::$SCAN_PATH === './') { | ||
self::$SCAN_PATH = __DIR__; | ||
self::$SCAN_PATH = self::currentDirectory(); | ||
} | ||
self::$PATH_QUARANTINE = self::$ROOT . self::$PATH_QUARANTINE; | ||
self::$PATH_LOGS = self::$ROOT . self::$PATH_LOGS; | ||
|
@@ -808,7 +808,7 @@ private function scan($iterator) | |
} | ||
} elseif (in_array($confirmation, array('2'))) { | ||
// Move to quarantine | ||
$quarantine = self::$PATH_QUARANTINE . str_replace(realpath(__DIR__), '', $_FILE_PATH); | ||
$quarantine = self::$PATH_QUARANTINE . str_replace(realpath(self::currentDirectory()), '', $_FILE_PATH); | ||
|
||
if (!is_dir(dirname($quarantine))) { | ||
if (!mkdir($concurrentDirectory = dirname($quarantine), 0755, true) && !is_dir($concurrentDirectory)) { | ||
|
@@ -1073,4 +1073,14 @@ private function convertToBytes($from) | |
|
||
return $number * pow(1024, $pow); | ||
} | ||
|
||
/** | ||
* Return real current path. | ||
* | ||
* @return string|string[]|null | ||
*/ | ||
public static function currentDirectory() | ||
{ | ||
return preg_replace('/^phar:\/\//i', '', __DIR__); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* PHP Antimalware Scanner. | ||
* | ||
* @author Marco Cesarato <[email protected]> | ||
* @copyright Copyright (c) 2019 | ||
* @copyright Copyright (c) 2020 | ||
* @license http://opensource.org/licenses/gpl-3.0.html GNU Public License | ||
* | ||
* @see https://github.com/marcocesarato/PHP-Antimalware-Scanner | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* PHP Antimalware Scanner. | ||
* | ||
* @author Marco Cesarato <[email protected]> | ||
* @copyright Copyright (c) 2019 | ||
* @copyright Copyright (c) 2020 | ||
* @license http://opensource.org/licenses/gpl-3.0.html GNU Public License | ||
* | ||
* @see https://github.com/marcocesarato/PHP-Antimalware-Scanner | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* PHP Antimalware Scanner. | ||
* | ||
* @author Marco Cesarato <[email protected]> | ||
* @copyright Copyright (c) 2019 | ||
* @copyright Copyright (c) 2020 | ||
* @license http://opensource.org/licenses/gpl-3.0.html GNU Public License | ||
* | ||
* @see https://github.com/marcocesarato/PHP-Antimalware-Scanner | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* PHP Antimalware Scanner. | ||
* | ||
* @author Marco Cesarato <[email protected]> | ||
* @copyright Copyright (c) 2019 | ||
* @copyright Copyright (c) 2020 | ||
* @license http://opensource.org/licenses/gpl-3.0.html GNU Public License | ||
* | ||
* @see https://github.com/marcocesarato/PHP-Antimalware-Scanner | ||
|
@@ -496,7 +496,7 @@ public static function helplist($type = null) | |
public static function helper() | ||
{ | ||
self::displayTitle('Help', 'black', 'cyan'); | ||
$dir = __DIR__; | ||
$dir = Application::currentDirectory(); | ||
$help = <<<EOD | ||
Arguments: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* PHP Antimalware Scanner. | ||
* | ||
* @author Marco Cesarato <[email protected]> | ||
* @copyright Copyright (c) 2019 | ||
* @copyright Copyright (c) 2020 | ||
* @license http://opensource.org/licenses/gpl-3.0.html GNU Public License | ||
* | ||
* @see https://github.com/marcocesarato/PHP-Antimalware-Scanner | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* PHP Antimalware Scanner. | ||
* | ||
* @author Marco Cesarato <[email protected]> | ||
* @copyright Copyright (c) 2019 | ||
* @copyright Copyright (c) 2020 | ||
* @license http://opensource.org/licenses/gpl-3.0.html GNU Public License | ||
* | ||
* @see https://github.com/marcocesarato/PHP-Antimalware-Scanner | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* PHP Antimalware Scanner. | ||
* | ||
* @author Marco Cesarato <[email protected]> | ||
* @copyright Copyright (c) 2019 | ||
* @copyright Copyright (c) 2020 | ||
* @license http://opensource.org/licenses/gpl-3.0.html GNU Public License | ||
* | ||
* @see https://github.com/marcocesarato/PHP-Antimalware-Scanner | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters