Make WordPress Core

Changeset 3392


Ignore:
Timestamp:
01/02/2006 08:55:45 PM (19 years ago)
Author:
ryan
Message:

Decode entities in inline uploader. fixes #2208

File:
1 edited

Legend:

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

    r3329 r3392  
    3333case 'delete':
    3434
    35 if ( !current_user_can('edit_post', (int) $attachment) )   
     35if ( !current_user_can('edit_post', (int) $attachment) )
    3636    die(__('You are not allowed to delete this attachment.').' <a href="'.basename(__FILE__)."?post=$post&amp;all=$all&amp;action=upload\">".__('Go back').'</a>');
    3737
     
    297297/* Define any variables we'll need, such as alternate URLs. */
    298298<?php echo $script; ?>
    299 
     299function htmldecode(st) {
     300    o = document.getElementById('htmldecode');
     301    if (! o) {
     302        o = document.createElement("A");
     303        o.id = "htmldecode"
     304    }
     305    o.innerHTML = st;
     306    r = o.innerHTML;
     307    return r;
     308}
    300309function cancelUpload() {
    301310    o = document.getElementById('uploadForm');
     
    333342        img = imgb[n];
    334343    }
    335     if ( ol.innerHTML == notlinked ) {
     344    if ( ol.innerHTML == htmldecode(notlinked) ) {
    336345        od.innerHTML = ab[n]+img+'</a>';
    337346        ol.innerHTML = linkedtoimage;
    338     } else if ( ol.innerHTML == linkedtoimage ) {
     347    } else if ( ol.innerHTML == htmldecode(linkedtoimage) ) {
    339348        od.innerHTML = aa[n]+img+'</a>';
    340349        ol.innerHTML = linkedtopage;
     
    349358    oi=document.getElementById('p'+n);
    350359    ih=oi.innerHTML;
    351     if ( ol.innerHTML == linkedtofile ) {
     360    if ( ol.innerHTML == htmldecode(linkedtofile) ) {
    352361        od.innerHTML = aa[n];
    353362        ol.innerHTML = linkedtopage;
     
    362371    o = document.getElementById('image'+n);
    363372    oi = document.getElementById('I'+n);
    364     if ( oi.innerHTML == usingthumbnail ) {
     373    if ( oi.innerHTML == htmldecode(usingthumbnail) ) {
    365374        o.src = srcb[n];
    366375        oi.innerHTML = usingoriginal;
     
    374383    o = document.getElementById('p'+n);
    375384    oi = document.getElementById('I'+n);
    376     if ( oi.innerHTML == usingtitle ) {
     385    if ( oi.innerHTML == htmldecode(usingtitle) ) {
    377386        o.innerHTML = filename[n];
    378387        oi.innerHTML = usingfilename;
    379     } else if ( oi.innerHTML == usingfilename && icon[n] != '' ) {
     388    } else if ( oi.innerHTML == htmldecode(usingfilename) && icon[n] != '' ) {
    380389        o.innerHTML = icon[n];
    381390        oi.innerHTML = usingicon;
     
    467476    width: 128px;
    468477}
    469 .usingicon a {
    470 }
    471478.usingtext {
    472479    padding: 3px;
     
    475482    width: 122px;
    476483}
    477 .usingtext a {
    478 }
    479484.filetype {
    480485    font-size: 80%;
     
    484489    text-decoration: none;
    485490}
    486 
    487491#upload-menu {
    488492    background: #fff;
     
    494498    width: 100%;
    495499}
    496 
    497500#upload-menu li {
    498501    float: left;
    499502    margin: 0 0 0 .75em;
    500503}
    501 
    502504#upload-menu a {
    503505    display: block;
     
    507509    border-top: 3px solid #fff;
    508510}
    509 
    510511#upload-menu .current a {
    511512    background: #dfe8f1;
    512513    border-right: 2px solid #448abd;
    513514}
    514 
    515515#upload-menu a:hover {
    516516    background: #dfe8f1;
    517517    color: #000;
    518518}
    519 
    520 
    521519.tip {
    522520    color: rgb(68, 138, 189);
     
    599597    padding: 0.25em;
    600598}
    601 
    602599#submit input:active {
    603600    background: #f4f4f4;
     
    615612    margin: 3px 8px;
    616613    line-height: 2em;
    617    
    618614}
    619615#links textarea {
Note: See TracChangeset for help on using the changeset viewer.