concrete/src/File/Image/Svg/Sanitizer.php
public function sanitizeFile($inputFilename, SanitizerOptions $options = null, $outputFilename = '')
    {
        $data = is_string($inputFilename) && $this->filesystem->isFile($inputFilename) ? $this->filesystem->get($inputFilename) : false;
        if ($data === false) {
            throw SanitizerException::create(SanitizerException::ERROR_FAILED_TO_READ_FILE);
        }
        $sanitizedData = $this->sanitizeData($data, $options);
        if ((string) $outputFilename === '') {
            $outputFilename = $inputFilename;
        }
        if ($outputFilename !== $inputFilename || $data !== $sanitizedData) {
            if ($this->filesystem->put($outputFilename, $sanitizedData) === false) {
                throw SanitizerException::create(SanitizerException::ERROR_FAILED_TO_WRITE_FILE);
            }
        }
    }
public function sanitizeFile($inputFilename, SanitizerOptions $options = null, $outputFilename = '')
    {
        $data = is_string($inputFilename) && $this->filesystem->isFile($inputFilename) ? $this->filesystem->get($inputFilename) : false;
        if ($data === false) {
            throw SanitizerException::create(SanitizerException::ERROR_FAILED_TO_READ_FILE);
        }
        $sanitizedData = $this->sanitizeData($data, $options);
        if ((string) $outputFilename === '') {
            $outputFilename = $inputFilename;
        }
        if ($outputFilename !== $inputFilename || $data !== $sanitizedData) {
            if ($this->filesystem->put($outputFilename, $sanitizedData) === false) {
                throw SanitizerException::create(SanitizerException::ERROR_FAILED_TO_WRITE_FILE);
            }
        }
    }
public function sanitizeFile ( $ inputFilename , SanitizerOptions $ options = null , $ outputFilename = '' ) { $ data = is_string ( $ inputFilename ) && $ this -> filesystem -> isFile ( $ inputFilename ) ? $ this -> filesystem -> get ( $ inputFilename ) : false ; if ( $ data === false ) { throw SanitizerException :: create ( SanitizerException :: ERROR_FAILED_TO_READ_FILE ) ; } $ sanitizedData = $ this -> sanitizeData ( $ data , $ options ) ; if ( ( string ) $ outputFilename === '' ) { $ outputFilename = $ inputFilename ; } if ( $ outputFilename !== $ inputFilename || $ data !== $ sanitizedData ) { if ( $ this -> filesystem -> put ( $ outputFilename , $ sanitizedData ) === false ) { throw SanitizerException :: create ( SanitizerException :: ERROR_FAILED_TO_WRITE_FILE ) ; } } }
Sanitize a file containing an SVG document.

@param string $inputFilename the input filename
@param \Concrete\Core\File\Image\Svg\SanitizerOptions $options the sanitizer options (if NULL, we'll use the default ones)
@param string $outputFilename the output filename (if empty, we'll overwrite $inputFilename)

@throws \Concrete\Core\File\Image\Svg\SanitizerException in case of errors
Sanitize a file containing an SVG document .