Well, it seems that it works, though <br seems a little bit like workaround )))
Does not work for me – I’ve a got a lot of
“
<img class=”alignnone size-medium wp-image-203″ style=”float: left; margin-right: 18px;” title=”KonvoyT-K” src=”http://www.bgudkov.ru/wp-content/uploads/2011/05/KonvoyT-K-300×97.png” alt=”т” width=”300″ height=”97″ />” style links with
between <a and <img.
We have ungreedy regexp here, so something can go wrong if there is a and no <img after it eventually. Otherwise the first <img will match
Also
$pattern = ‘/(<a([^>]*?)href=”([^”]*\.)’.$this->image_type.'”([^>]*?)>.*<img([^>]*?)src=”([^”]*\.)’.$this->image_type.'”([^>]*?)\><\/a>)/iesU’;
with \. before extensions seems better so that images like “imagepng” without dot are ignored