From f0d0e6964836b3a7a9d936f2127f33e02371b5e7 Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 2 Dec 2005 22:39:41 +0000 Subject: [PATCH] Eliminate eval. Props ringmaster. fixes #2002 git-svn-id: http://svn.automattic.com/wordpress/trunk@3263 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/inline-uploading.php | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/wp-admin/inline-uploading.php b/wp-admin/inline-uploading.php index 200a6f3ce0..7da2498588 100644 --- a/wp-admin/inline-uploading.php +++ b/wp-admin/inline-uploading.php @@ -171,6 +171,12 @@ linkedtopage = '$__linked_to_page'; linkedtofile = '$__linked_to_file'; usingthumbnail = '$__using_thumbnail'; usingoriginal = '$__using_original'; +var aa = new Array(); +var ab = new Array(); +var imga = new Array(); +var imgb = new Array(); +var srca = new Array(); +var srcb = new Array(); "; foreach ( $attachments as $key => $attachment ) { $ID = $attachment['ID']; @@ -192,8 +198,8 @@ usingoriginal = '$__using_original'; $image = & $attachment; if ( ($image['width'] > 128 || $image['height'] > 96) && !empty($image['thumb']) && file_exists(dirname($image['file']).'/'.$image['thumb']) ) { $src = str_replace(basename($image['guid']), $image['thumb'], $image['guid']); - $script .= "src{$ID}a = '$src'; -src{$ID}b = '{$image['guid']}'; + $script .= "srca[{$ID}] = '$src'; +srcb[{$ID}] = '{$image['guid']}'; "; $thumb = 'true'; $thumbtext = $__using_thumbnail; @@ -207,10 +213,10 @@ src{$ID}b = '{$image['guid']}'; $xpadding = (128 - $image['uwidth']) / 2; $ypadding = (96 - $image['uheight']) / 2; $style .= "#target{$ID} img { padding: {$ypadding}px {$xpadding}px; }\n"; - $script .= "a{$ID}a = ''; -a{$ID}b = ''; -img{$ID}a = '\"{$image['post_title']}\"'; -img{$ID}b = '\"{$image['post_title']}\"'; + $script .= "aa[{$ID}] = ''; +ab[{$ID}] = ''; +imga[{$ID}] = '\"{$image['post_title']}\"'; +imgb[{$ID}] = '\"{$image['post_title']}\"'; "; $html .= "