WordPress.org

Make WordPress Core

Changeset 3398


Ignore:
Timestamp:
01/05/2006 01:43:30 AM (14 years ago)
Author:
ryan
Message:

Handle quotes in upload titles. fixes #2198

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/inline-uploading.php

    r3392 r3398  
    233233            $ypadding = (96 - $image['uheight']) / 2;
    234234            $style .= "#target{$ID} img { padding: {$ypadding}px {$xpadding}px; }\n";
    235             $script .= "aa[{$ID}] = '<a id=\"p{$ID}\" rel=\"attachment\" class=\"imagelink\" href=\"$href\" onclick=\"doPopup({$ID});return false;\" title=\"{$image['post_title']}\">';
    236 ab[{$ID}] = '<a class=\"imagelink\" href=\"{$image['guid']}\" onclick=\"doPopup({$ID});return false;\" title=\"{$image['post_title']}\">';
    237 imga[{$ID}] = '<img id=\"image{$ID}\" src=\"$src\" alt=\"{$image['post_title']}\" $height_width />';
    238 imgb[{$ID}] = '<img id=\"image{$ID}\" src=\"{$image['guid']}\" alt=\"{$image['post_title']}\" $height_width />';
     235            $title = htmlentities($image['post_title'], ENT_QUOTES);
     236            $script .= "aa[{$ID}] = '<a id=\"p{$ID}\" rel=\"attachment\" class=\"imagelink\" href=\"$href\" onclick=\"doPopup({$ID});return false;\" title=\"{$title}\">';
     237ab[{$ID}] = '<a class=\"imagelink\" href=\"{$image['guid']}\" onclick=\"doPopup({$ID});return false;\" title=\"{$title}\">';
     238imga[{$ID}] = '<img id=\"image{$ID}\" src=\"$src\" alt=\"{$title}\" $height_width />';
     239imgb[{$ID}] = '<img id=\"image{$ID}\" src=\"{$image['guid']}\" alt=\"{$title}\" $height_width />';
    239240";
    240241            $html .= "<div id='target{$ID}' class='attwrap left'>
    241242    <div id='div{$ID}' class='imagewrap' onclick=\"doPopup({$ID});\">
    242         <img id=\"image{$ID}\" src=\"$src\" alt=\"{$image['post_title']}\" $height_width />
     243        <img id=\"image{$ID}\" src=\"$src\" alt=\"{$title}\" $height_width />
    243244    </div>
    244245    {$noscript}
     
    252253";
    253254        } else {
    254             $title = $attachment['post_title'];
     255            $title = htmlentities($attachment['post_title'], ENT_QUOTES);
    255256            $filename = basename($attachment['guid']);
    256257            $icon = get_attachment_icon($ID);
    257258            $toggle_icon = "<a id=\"I{$ID}\" onclick=\"toggleOtherIcon({$ID});return false;\" href=\"javascript:void()\">$__using_title</a>";
    258             $script .= "aa[{$ID}] = '<a id=\"p{$ID}\" rel=\"attachment\" href=\"$href\" onclick=\"doPopup({$ID});return false;\" title=\"{$title}\">{$attachment['post_title']}</a>';
    259 ab[{$ID}] = '<a id=\"p{$ID}\" href=\"{$filename}\" onclick=\"doPopup({$ID});return false;\" title=\"{$title}\">{$attachment['post_title']}</a>';
    260 title[{$ID}] = '{$attachment['post_title']}';
     259            $script .= "aa[{$ID}] = '<a id=\"p{$ID}\" rel=\"attachment\" href=\"$href\" onclick=\"doPopup({$ID});return false;\" title=\"{$title}\">{$title}</a>';
     260ab[{$ID}] = '<a id=\"p{$ID}\" href=\"{$filename}\" onclick=\"doPopup({$ID});return false;\" title=\"{$title}\">{$title}</a>';
     261title[{$ID}] = '{$title}';
    261262filename[{$ID}] = '{$filename}';
    262263icon[{$ID}] = '{$icon}';
     
    264265            $html .= "<div id='target{$ID}' class='attwrap left'>
    265266    <div id='div{$ID}' class='otherwrap usingtext' onmousedown=\"selectLink({$ID})\" onclick=\"doPopup({$ID});return false;\">
    266         <a id=\"p{$ID}\" href=\"{$attachment['guid']}\" onmousedown=\"selectLink({$ID});\" onclick=\"return false;\">{$attachment['post_title']}</a>
     267        <a id=\"p{$ID}\" href=\"{$attachment['guid']}\" onmousedown=\"selectLink({$ID});\" onclick=\"return false;\">{$title}</a>
    267268    </div>
    268269    {$noscript}
Note: See TracChangeset for help on using the changeset viewer.