Make WordPress Core

Ticket #10749: link-template.php.patch

File link-template.php.patch, 1.3 KB (added by noel, 17 years ago)

link-template fixes for press this tools link

  • link-template.php

     
    16481648 */
    16491649function get_shortcut_link() {
    16501650        $link = "javascript:
    1651                         var d=document,
    1652                         w=window,
    1653                         e=w.getSelection,
    1654                         k=d.getSelection,
     1651                        var d=document, 
     1652                        w=window, 
     1653                        e=w.getSelection, 
     1654                        k=d.getSelection, 
    16551655                        x=d.selection,
    16561656                        s=(e?e():(k)?k():(x?x.createRange().text:0)),
    16571657                        f='" . admin_url('press-this.php') . "',
    16581658                        l=d.location,
    16591659                        e=encodeURIComponent,
    1660                         g=f+'?u='+e(l.href)+'&t='+e(d.title)+'&s='+e(s)+'&v=2';
    1661                         function a(){
    1662                                 if(!w.open(g,'t','toolbar=0,resizable=0,scrollbars=1,status=1,width=720,height=570')){
    1663                                         l.href=g;
    1664                                 }
    1665                         }";
    1666                         if (strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false)
    1667                                 $link .= 'setTimeout(a,0);';
    1668                         else
    1669                                 $link .= 'a();';
     1660                        u=f+'?u='+e(l.href)+'&t='+e(d.title)+'&s='+e(s)+'&v=4';
     1661                        a=function(){if(!w.open(u,'t','toolbar=0,resizable=0,status=1,width=720,height=570'))l.href=u;};
     1662                        if (/Firefox/.test(navigator.userAgent)) setTimeout(a, 0); else a();
     1663                        void(0)";
    16701664
    1671                         $link .= "void(0);";
    1672 
    16731665        $link = str_replace(array("\r", "\n", "\t"),  '', $link);
    16741666
    16751667        return apply_filters('shortcut_link', $link);