Quantcast
Viewing all articles
Browse latest Browse all 10

Avoid to getting black “skin image” in WYSIWYG on magento 1.4.0.1.


Faced with the problem of adding an image items in Magento 1.4.0.1 and finally found a solution to this problem.

To address this problem, the trick for the moment is in the file wysiwyg at the core.

in app/code/core/Mage/Cms/Helper/Wysiwyg/Images.php

Replace the line 136 around getImageHtmlDeclaration function with the following:

{code type=css}

public function getImageHtmlDeclaration($filename, $asIs = false)
{
$fileurl = $this->getCurrentUrl() . $filename;
$mediaPath = str_replace(Mage::getBaseUrl(’media’), ”, $fileurl);
$directive = sprintf(’{{media url=”%s”}}’, $mediaPath);
$directive = $fileurl;
if ($asIs) {
$html = sprintf(’Image may be NSFW.
Clik here to view.
‘, $directive);
} else {
$html = $directive;
// $directive = Mage::helper(’core’)->urlEncode($directive);
// $html = Mage::helper(’adminhtml’)->getUrl(’*/cms_wysiwyg/directive’, array(’___directive’ => $directive));
}
return $html;
}

{/code}

And that’s it, although it may be problematic to directly modify a file in the core.

Image may be NSFW.
Clik here to view.
Share/Bookmark

Viewing all articles
Browse latest Browse all 10

Trending Articles