Guest User

Patch for functions.php - functions.patch

a guest
Jun 8th, 2011
126
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. *** functions.php Wed Jun 8 17:01:59 2011
  2. --- functions.php Wed Jun 8 17:04:25 2011
  3. ***************
  4. *** 1391,1402 ****
  5. $ret = '';
  6. if ( is_array( func_get_arg(0) ) ) {
  7. if ( @func_num_args() < 2 || false === @func_get_arg( 1 ) )
  8. ! $uri = $_SERVER['REQUEST_URI'];
  9. else
  10. $uri = @func_get_arg( 1 );
  11. } else {
  12. if ( @func_num_args() < 3 || false === @func_get_arg( 2 ) )
  13. ! $uri = $_SERVER['REQUEST_URI'];
  14. else
  15. $uri = @func_get_arg( 2 );
  16. }
  17. --- 1391,1408 ----
  18. $ret = '';
  19. if ( is_array( func_get_arg(0) ) ) {
  20. if ( @func_num_args() < 2 || false === @func_get_arg( 1 ) )
  21. ! if ( get_bloginfo('url') != '' )
  22. ! $uri = get_bloginfo('url') . $_SERVER['REQUEST_URI'];
  23. ! else
  24. ! $uri = $_SERVER['REQUEST_URI'];
  25. else
  26. $uri = @func_get_arg( 1 );
  27. } else {
  28. if ( @func_num_args() < 3 || false === @func_get_arg( 2 ) )
  29. ! if ( get_bloginfo('url') != '' )
  30. ! $uri = get_bloginfo('url') . $_SERVER['REQUEST_URI'];
  31. ! else
  32. ! $uri = $_SERVER['REQUEST_URI'];
  33. else
  34. $uri = @func_get_arg( 2 );
  35. }
  36. ***************
  37. *** 1444,1454 ****
  38. --- 1450,1463 ----
  39. unset( $qs[$k] );
  40. }
  41.  
  42. + $homeurl = str_replace(( is_ssl() ? 'https://' : 'http://' ), '', get_bloginfo('url'));
  43. +
  44. $ret = build_query( $qs );
  45. $ret = trim( $ret, '?' );
  46. $ret = preg_replace( '#=(&|$)#', '$1', $ret );
  47. $ret = $protocol . $base . $ret . $frag;
  48. $ret = rtrim( $ret, '?' );
  49. + $ret = str_replace($_SERVER['HTTP_HOST'], $homeurl, $ret);
  50. return $ret;
  51. }
RAW Paste Data