I have a joomla plugin file called sige.php
attached here where around line 838 you will find this code:
$testUrl = '<a href="mailto:?subject=Zuenelli%20propone&body='.$mosConfig_live_site.'/plugins/content/sige/plugin_sige/socialshare.php?img='.rawurlencode($mosConfig_live_site.$rootfolder.$_images_dir_.'/Midsize/'.$images[$a]['filename']).'&name='.rawurlencode($title_iptc).'&caption='.rawurlencode($caption_iptc).'"';
//send link via email
$html .= $testUrl.' title="invia link via email" ><img src="'.$mosConfig_live_site.'/plugins/content/sige/plugin_sige/email.png" /></a>';
The jpg files that my client uploads into the folder /Midsize/
mentioned above sometimes have spaces in their names and sometimes they also contain latin characters/accents and this cannot be avoided. The code above works fine as the rawurlencode sorts all other parts of the URL that is generated on the fly in $testURL
except for the current file's name which is retreived from the array filename
So unfortunately when I run this code and click on the email button I get a url that looks like this:
http://localhost:8888/zuenelli/plugins/content/sige/plugin_sige/socialshare.php?img=http://localhost:8888/zuenelli/images/sda/galleries/giorno_librerietavoli/Midsize/Feg - 1 - (2).jpg
This does not work due to the spaces - when this mailto
code is launched and the outlook or mail window opens on pc or mac only the first part is clickable and all the parts after the space are just simple text).
Also the last part is being ignored:
The real link should be something link this:
What am I doing wrong?
thanks in advance