Temporary image parsing fix from mdawaffe until a more robust attachment API is ready. fixes #3287

git-svn-id: https://develop.svn.wordpress.org/trunk@4427 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith 2006-10-27 03:58:53 +00:00
parent b247fdc973
commit d1d4eab47c

View File

@ -13,9 +13,9 @@ function wp_upload_display( $dims = false, $href = '' ) {
$class = 'text';
$innerHTML = get_attachment_innerHTML( $id, false, $dims );
if ( $image_src = strstr($innerHTML, 'src="') ) {
$image_src = explode('"', $image_src);
$image_src = $image_src[1];
if ( $image_src = strstr($innerHTML, 'src=') ) {
preg_match("/src=(\"|')(.+?)\\1/", $image_src, $matches);
$image_src = $matches[2];
$image_rel = wp_make_link_relative($image_src);
$class = 'image';
$innerHTML = ' ' . str_replace($image_src, $image_rel, $innerHTML);