rararchiver icon indicating copy to clipboard operation
rararchiver copied to clipboard

Update RarArchiver.php

Open Underdog-01 opened this issue 6 years ago • 2 comments

  • repair archive for proper compression and create recovery records
  • requires Unix rar or WinRAR

re. Windows: WinRAR must reside in a default installation directory on the same drive to detect and use it

Signed-off-by: Chen Zhen [email protected]

Underdog-01 avatar Dec 22 '18 06:12 Underdog-01

Without this change, a Windows AV will likely falsely flag any created rar archive using this Class as a trojan. Trojan:Script/Foretype.A!ml or Trojan:HTML/Brocoiner.N!lib

I'm not sure if all the commands are necessary.. "-k" locks it which someone might want to remove. I suggest to run an AV scanner on the archive each time the commands are changed though just in case I am wrong about what is noted below.

These commands are likely mandatory for it to work properly... ( [FILENAME] is $this->filename ) Linux: rar -r -ma4 -av -rr [FILENAME]

Windows: rar -r -m4 -av -rr [FILENAME]

Underdog-01 avatar Dec 22 '18 06:12 Underdog-01

Updated with rar flags noted in the last comment. Logic added to check if shell_exec is available.

Underdog-01 avatar Dec 24 '18 05:12 Underdog-01