lib/URLHelper.php
public static function user_trailingslashit( $link ) {
		$link_parts = parse_url($link);

		if ( !$link_parts ) {
			return $link;
		}

		if ( isset($link_parts['path']) && $link_parts['path'] != '/' ) {
			$new_path = user_trailingslashit($link_parts['path']);

			if ( $new_path != $link_parts['path'] ) {
				$link = str_replace($link_parts['path'], $new_path, $link);
			}
		}
		return $link;
	}
public static function user_trailingslashit( $link ) {
		$link_parts = parse_url($link);

		if ( !$link_parts ) {
			return $link;
		}

		if ( isset($link_parts['path']) && $link_parts['path'] != '/' ) {
			$new_path = user_trailingslashit($link_parts['path']);

			if ( $new_path != $link_parts['path'] ) {
				$link = str_replace($link_parts['path'], $new_path, $link);
			}
		}
		return $link;
	}
public static function user_trailingslashit ( $ link ) { $ link_parts = parse_url ( $ link ) ; if ( ! $ link_parts ) { return $ link ; } if ( isset ( $ link_parts [ 'path' ] ) && $ link_parts [ 'path' ] != '/' ) { $ new_path = user_trailingslashit ( $ link_parts [ 'path' ] ) ; if ( $ new_path != $ link_parts [ 'path' ] ) { $ link = str_replace ( $ link_parts [ 'path' ] , $ new_path , $ link ) ; } } return $ link ; }
Pass links through user_trailingslashit handling query strings properly

@param string $link
@return string
Pass links through user_trailingslashit handling query strings properly