Log in
Model

AvailablePath

Magento\MediaStorage\Model\File\Validator\AvailablePath

What it does

This validator class checks if file and directory paths are safe to use by validating them against configurable lists of protected and available path patterns.

Developers use it to prevent unauthorized file access and local file inclusion (LFI) attacks by ensuring operations only occur in designated directories.

It supports wildcard patterns for flexible path matching and blocks directory traversal attempts.

Public Methods

  • setPaths()
  • setProtectedPaths()
  • addProtectedPath()
  • getProtectedPaths()
  • setAvailablePaths()
  • addAvailablePath()
  • getAvailablePaths()
  • isValid()