I noticed in the Magento CMS editor TinyMCE, the image thumbnails are set as the following format after a base64 encode of the shortcode {{media url="wysiwyg/foobar.gif"}}
index.php/admin/cms_wysiwyg/directive/___directive/e3ttZWRpYSB1cmw9Ind5c2l...
This is happening on nginx and not on apache. Perhaps it's an environmental issue however my question aims to solve this on the Magento layer.
My question is, how does Magento decode this ___directive...
URL? and where?
Best Answer
The code for building these types of links appears to be done in getImageHtmlDeclaration function in the file /app/code/core/Mage/Cms/Helper/Wysiwyg/Images.php
The code for displaying these images is in the file /app/code/core/Mage/Adminhtml/controllers/Cms/WysiwygController.php
Here is loads the parameter, urlDecodes it using the core helper, uses the email template to produce the real url to the image.
I would suggest to look into file /lib/Varien/Filter/Template.php as this has the function filter which appears to be where the final url change happens. This will take the image in format:
And convert to a real url format.