-
-
Save deniscsz/76d6517b009b5158694ba079d2073b89 to your computer and use it in GitHub Desktop.
MPERF-10565.diff - logging to a file that does not exist issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment