Skip to content

Instantly share code, notes, and snippets.

@piotrekkaminski
Created April 8, 2019 18:04
Show Gist options
  • Select an option

  • Save piotrekkaminski/0596cae2d25bf467edbd3d3f03ab9f8f to your computer and use it in GitHub Desktop.

Select an option

Save piotrekkaminski/0596cae2d25bf467edbd3d3f03ab9f8f to your computer and use it in GitHub Desktop.

Revisions

  1. piotrekkaminski created this gist Apr 8, 2019.
    16 changes: 16 additions & 0 deletions MPERF-10565.diff
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    diff --git a/app/Mage.php b/app/Mage.php
    index 0e650eebb4f..9c18e222689 100644
    --- a/app/Mage.php
    +++ b/app/Mage.php
    @@ -798,9 +798,9 @@ public static function log($message, $level = null, $file = '', $forceLog = fals
    ',',
    (string) self::getConfig()->getNode('dev/log/allowedFileExtensions', Mage_Core_Model_Store::DEFAULT_CODE)
    );
    - $logValidator = new Zend_Validate_File_Extension($_allowedFileExtensions);
    $logDir = self::getBaseDir('var') . DS . 'log';
    - if (!$logValidator->isValid($logDir . DS . $file)) {
    + $validatedFileExtension = pathinfo($file, PATHINFO_EXTENSION);
    + if (!$validatedFileExtension || !in_array($validatedFileExtension, $_allowedFileExtensions)) {
    return;
    }