mirror of
https://git.freebsd.org/ports.git
synced 2025-07-16 00:39:15 -04:00
Update to 1.8.1: - Add additional patches issued post-release - Stage support - Removed option for MySQL patch now contained in the release - Fix ./mage command by adding zlib to dependencies - Closes ports/187985 (commit of 1.7 was incomplete) - Adds option to support the REST Api. - Adds option to activate redis session module (disabled by default). - Rework cron.sh to do sane locking with lockf(1) - Add example cron entry PR: ports/188901 Submitted by: Melvyn Sopacua (maintainer) Approved by: maintainer (implicit), jadawin (mentor)
64 lines
2.9 KiB
Text
64 lines
2.9 KiB
Text
diff --git app/code/core/Mage/Cms/Helper/Wysiwyg/Images.php app/code/core/Mage/Cms/Helper/Wysiwyg/Images.php
|
|
index b106d09..0b6af65 100644
|
|
--- app/code/core/Mage/Cms/Helper/Wysiwyg/Images.php
|
|
+++ app/code/core/Mage/Cms/Helper/Wysiwyg/Images.php
|
|
@@ -49,6 +49,12 @@ class Mage_Cms_Helper_Wysiwyg_Images extends Mage_Core_Helper_Abstract
|
|
*/
|
|
protected $_storeId = null;
|
|
|
|
+ /**
|
|
+ * Images Storage root directory
|
|
+ * @var
|
|
+ */
|
|
+ protected $_storageRoot;
|
|
+
|
|
|
|
/**
|
|
* Set a specified store ID value
|
|
@@ -68,8 +74,13 @@ class Mage_Cms_Helper_Wysiwyg_Images extends Mage_Core_Helper_Abstract
|
|
*/
|
|
public function getStorageRoot()
|
|
{
|
|
- return Mage::getConfig()->getOptions()->getMediaDir() . DS . Mage_Cms_Model_Wysiwyg_Config::IMAGE_DIRECTORY
|
|
- . DS;
|
|
+ if (!$this->_storageRoot) {
|
|
+ $this->_storageRoot = realpath(
|
|
+ Mage::getConfig()->getOptions()->getMediaDir()
|
|
+ . DS . Mage_Cms_Model_Wysiwyg_Config::IMAGE_DIRECTORY
|
|
+ ) . DS;
|
|
+ }
|
|
+ return $this->_storageRoot;
|
|
}
|
|
|
|
/**
|
|
@@ -197,7 +208,7 @@ class Mage_Cms_Helper_Wysiwyg_Images extends Mage_Core_Helper_Abstract
|
|
public function getCurrentPath()
|
|
{
|
|
if (!$this->_currentPath) {
|
|
- $currentPath = realpath($this->getStorageRoot());
|
|
+ $currentPath = $this->getStorageRoot();
|
|
$node = $this->_getRequest()->getParam($this->getTreeNodeName());
|
|
if ($node) {
|
|
$path = realpath($this->convertIdToPath($node));
|
|
@@ -223,7 +234,7 @@ class Mage_Cms_Helper_Wysiwyg_Images extends Mage_Core_Helper_Abstract
|
|
public function getCurrentUrl()
|
|
{
|
|
if (!$this->_currentUrl) {
|
|
- $path = str_replace(Mage::getConfig()->getOptions()->getMediaDir(), '', $this->getCurrentPath());
|
|
+ $path = str_replace(realpath(Mage::getConfig()->getOptions()->getMediaDir()), '', $this->getCurrentPath());
|
|
$path = trim($path, DS);
|
|
$this->_currentUrl = Mage::app()->getStore($this->_storeId)->getBaseUrl('media') .
|
|
$this->convertPathToUrl($path) . '/';
|
|
diff --git app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php
|
|
index 19b3f45..af58ce3 100644
|
|
--- app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php
|
|
+++ app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php
|
|
@@ -89,7 +89,7 @@ class Mage_Cms_Model_Wysiwyg_Images_Storage extends Varien_Object
|
|
foreach ($collection as $key => $value) {
|
|
$rootChildParts = explode(DIRECTORY_SEPARATOR, substr($value->getFilename(), $storageRootLength));
|
|
|
|
- if (array_key_exists($rootChildParts[0], $conditions['plain'])
|
|
+ if (array_key_exists(end($rootChildParts), $conditions['plain'])
|
|
|| ($regExp && preg_match($regExp, $value->getFilename()))) {
|
|
$collection->removeItemByKey($key);
|
|
}
|