Ticket #3078: 3078.diff

File 3078.diff, 0.8 kB (added by mdawaffe, 2 years ago)
  • wp-includes/functions.php

    old new  
    606606                        $uri = @func_get_arg(2); 
    607607        } 
    608608 
     609        if ( $frag = strstr($uri, '#') ) 
     610                $uri = substr($uri, 0, -strlen($frag)); 
     611        else 
     612                $frag = ''; 
     613 
    609614        if ( preg_match('|^https?://|i', $uri, $matches) ) { 
    610615                $protocol = $matches[0]; 
    611616                $uri = substr($uri, strlen($protocol)); 
     
    645650                        $ret .= "$k=$v"; 
    646651                } 
    647652        } 
    648         $ret = $protocol . $base . $ret
     653        $ret = $protocol . $base . $ret . $frag
    649654        if ( get_magic_quotes_gpc() ) 
    650655                $ret = stripslashes($ret); // parse_str() adds slashes if magicquotes is on.  See: http://php.net/parse_str 
    651656        return trim($ret, '?');