Skip to content

Commit

Permalink
Merge branch 'OpenMage:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
sreichel authored Aug 7, 2024
2 parents a7fe45c + 4005bc3 commit c7d6aeb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/Mage.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public static function getOpenMageVersionInfo(): array
return [
'major' => '20',
'minor' => '10',
'patch' => '0',
'patch' => '2',
'stability' => '', // beta,alpha,rc
'number' => '', // 1,2,3,0.3.7,x.7.z.92 @see https://semver.org/#spec-item-9
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
*/
class Mage_Adminhtml_Model_System_Config_Backend_File extends Mage_Core_Model_Config_Data
{
public const SYSTEM_FILESYSTEM_REGEX = '/{{([a-z_]+)}}(.*)/';

/**
* Upload max file size in kilobytes
*
Expand Down Expand Up @@ -144,6 +146,12 @@ protected function _getUploadDir()
*/
protected function _getUploadRoot($token)
{
$value = Mage::getStoreConfig($token) ?? '';
if (strlen($value) && preg_match(self::SYSTEM_FILESYSTEM_REGEX, $value, $matches) !== false) {
$dir = str_replace('root_dir', 'base_dir', $matches[1]);
$path = str_replace('/', DS, $matches[2]);
return Mage::getConfig()->getOptions()->getData($dir) . $path;
}
return Mage::getBaseDir('media');
}

Expand Down

0 comments on commit c7d6aeb

Please sign in to comment.