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

git-svn-id: http://svn.automattic.com/wordpress/trunk@4427 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2006-10-27 03:58:53 +00:00
parent 1001b4c5b8
commit 0b0c6b3f52
1 changed files with 3 additions and 3 deletions

View File

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