When I want to add an image with the [Select image] link, the page is only reloaded and IMCE not opens.
The problem seems to be on line 604 and 608 of imceimage.module
$remove_href = "javascript:imceImage.remove('$delta-$field_id')";
//$remove_link = '<a class="imceimage-remove" href="' . $href . '">' . t('Remove') . '</a>'; -> pb with $href -> replaced by :
$remove_link = '<a class="imceimage-remove" href="' . $remove_href . '">' . t('Remove') . '</a>';
$imce_url = url('imce');
$select_href = "javascript:imceImage.open('$imce_url', '$delta-$field_id')";
//$select_link = '<a href="' . $href . '" class="imceimage-add">' . t('Select Image') . '</a>'; -> pb with $href -> replaced by :
$select_link = '<a href="' . $select_href . '" class="imceimage-add">' . t('Select Image') . '</a>';
Comments
Comment #1
lucuhb commentedWhen URL of the image contains special characters, the file is checked as invalid image.
To resolve this problem, the url should be decoded before checking. A solution to make this, in _imceimage_image_to_filepath function :
This works with files with no special characters too.
Comment #2
donquixote commentedThanks for the report.
6.x-2.0-alpha2 contains an attempted fix.
I wonder, do we need to further escape the $imce_url, before it goes into the $select_href? addslashes?
Comment #3
lucuhb commentedI don't think it is necessary, it works for me