Make WordPress Core

Changeset 9115


Ignore:
Timestamp:
10/09/2008 09:49:00 PM (15 years ago)
Author:
azaozz
Message:

Press This: URL fixes for images, props noel, see #7732

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/press-this.php

    r9103 r9115  
    6262    // insert the post with nothing in it, to get an ID
    6363    $post_ID = wp_insert_post($quick, true);
    64 
     64   
    6565    $content = $_REQUEST['content'];
    6666
     
    8282    if ( is_wp_error($post_ID)) {
    8383        wp_die($id);
    84         wp_delete_post($post_ID);error_log('2');
     84        wp_delete_post($post_ID);
    8585    // error handling for media_sideload
    8686    } elseif ( is_wp_error($upload)) {
     
    9898    check_admin_referer('press-this');
    9999    $post_ID = press_it();
    100     error_log($post_ID);
    101100    $posted =  $post_ID;
    102     //wp_redirect('press-this.php?posted=' . press_it());
    103101}
    104102
     
    126124        <h2><label for="embed-code"><?php _e('Embed Code') ?></label></h2>
    127125        <div class="titlewrap" >
    128             <textarea name="embed-code" id="embed-code" rows="8" cols="40"><?php echo $selection; ?></textarea>
    129 
     126            <textarea name="embed-code" id="embed-code" rows="8" cols="40"><?php echo format_to_edit($selection, true); ?></textarea>
    130127        </div>
    131128        <p id="options"><a href="#" class="select button"><?php _e('Insert Video'); ?></a> <a href="#" class="close button"><?php _e('Cancel'); ?></a></p>
     
    193190            $sources = array();
    194191            foreach ($matches[3] as $src) {
    195                 error_log($src);
    196192                // if no http in url
    197193                if(strpos($src, 'http') === false)
    198194                    // if it doesn't have a relative uri
    199                     if( strpos($src, '../') === false && strpos($src, './') === false && strpos($src, '/') === true)
     195                    if( strpos($src, '../') === false && strpos($src, './') === false && strpos($src, '/') === 0)
    200196                        $src = 'http://'.str_replace('//','/', $host['host'].'/'.$src);
    201197                    else
    202198                        $src = 'http://'.str_replace('//','/', $host['host'].'/'.dirname($host['path']).'/'.$src);
    203 
    204199                $sources[] = clean_url($src);
    205                 error_log($src);
    206200            }
    207201            return "'" . implode("','", $sources) . "'";
     
    261255                insert_editor("\n\n" + '<p style="text-align: center;"><a href="<?php echo $url; ?>"><img src="' + img +'" alt="' + desc + '" /></a></p>');
    262256            }
    263             /*tinyMCE.activeEditor.resizeToContent();*/
    264257            return false;
    265258        }
     
    500493                    <textarea name="content" id="content" style="width:100%;" class="mceEditor" rows="15">
    501494                    <?php if ($selection) echo wp_richedit_pre($selection); ?>
    502                     <p>via <a href="<?php echo $url ?>"><?php echo $title; ?></a>.</p>
     495                    <?php if ($url) { ?><p>via <a href="<?php echo $url ?>"><?php echo $title; ?></a>.</p><?php } ?>
    503496                    </textarea>
    504497                </div>
Note: See TracChangeset for help on using the changeset viewer.