undo-ransomware / ransomware_detection

:arrows_counterclockwise: Ransomware recovery app for Nextcloud
https://apps.nextcloud.com/apps/ransomware_detection
GNU Affero General Public License v3.0
22 stars 6 forks source link

Fix undefined index: pathinfo(...)['extension'] #8

Closed lars-sh closed 5 years ago

lars-sh commented 5 years ago

I just saw a lot log messages in my error logs and figured out, that PHPs pathinfo(...) returns index "extension" if any extension is present only.

Documentation: http://php.net/manual/function.pathinfo.php Error message: Undefined index: extension at [...]/apps/ransomware_detection/lib/Analyzer/FileCorruptionAnalyzer.php#88

codecov-io commented 5 years ago

Codecov Report

Merging #8 into master will increase coverage by 0.03%. The diff coverage is 85.71%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master       #8      +/-   ##
============================================
+ Coverage     76.42%   76.45%   +0.03%     
- Complexity      417      421       +4     
============================================
  Files            35       35              
  Lines          1285     1287       +2     
============================================
+ Hits            982      984       +2     
  Misses          303      303
Impacted Files Coverage Δ Complexity Δ
lib/Analyzer/FileCorruptionAnalyzer.php 10.52% <0%> (ø) 17 <0> (+1) :arrow_up:
lib/Analyzer/FileExtensionAnalyzer.php 100% <100%> (ø) 8 <0> (+1) :arrow_up:
lib/Analyzer/FileTypeFunnellingAnalyzer.php 100% <100%> (ø) 21 <0> (+2) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c173595...7af1039. Read the comment docs.

ilovemilk commented 5 years ago

Thank you for your contribution. Looks very good!