Elite_360_, if in post I have link to full image with built-in thumbnail, like this:
[yrl=httр://someserver.net/0000000.htm][iмg]httр://someserver.net/0000000m.jpg[/iмg][/yrl]
then regexp work not correctly. And as a result, I have in post follow html:
HTML Code:
<div class="content"><img src="http://savepic.net/7168271.htm" target="_blank"><a href="http://savepic.net/7168271m.jpg" style="max-width: 100%;max-height: 100%;padding: 2px;"></a></div>
and of couse its give me wrong result:
I use next code for replace embeded Images:
PHP Code:
$post['message'] = preg_replace (
'/<a href="([^"]+)\.(gif|png|jpg|jpeg)"([^>]*)>([^<]+)<\/a>/i',
'<img src="\\1.\\2" alt="\\4" />',
$post['message']
);
It`s work fine with attachments and with regular images.