Created
January 16, 2014 20:31
-
-
Save LeeSaferite/8462876 to your computer and use it in GitHub Desktop.
Mage_Cms_Helper_Wysiwyg_Images has a bug when you have the /media directory symlinked in to the deployment location (At least as of EE 1.13.1)
This file contains 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
<?php | |
/** | |
* Return URL based on current selected directory or root directory for startup | |
* | |
* @return string | |
*/ | |
public function getCurrentUrl() | |
{ | |
if (!$this->_currentUrl) { | |
$mediaDir = Mage::getConfig()->getOptions()->getMediaDir(); | |
$path = str_replace(realpath($mediaDir), '', $this->getCurrentPath()); | |
$path = trim($path, DS); | |
$this->_currentUrl = Mage::app()->getStore($this->_storeId)->getBaseUrl('media') . $this->convertPathToUrl($path) . '/'; | |
} | |
return $this->_currentUrl; | |
} |
This file contains 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
<?php | |
/** | |
* Return URL based on current selected directory or root directory for startup | |
* | |
* @return string | |
*/ | |
public function getCurrentUrl() | |
{ | |
if (!$this->_currentUrl) { | |
$path = str_replace(Mage::getConfig()->getOptions()->getMediaDir(), '', $this->getCurrentPath()); | |
$path = trim($path, DS); | |
$this->_currentUrl = Mage::app()->getStore($this->_storeId)->getBaseUrl('media') . | |
$this->convertPathToUrl($path) . '/'; | |
} | |
return $this->_currentUrl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment