SiteUrl.php
public static function normalizePath($path) {
		// remove fragment/query
		list($path, ) = explode('#', $path, 2);
		list($path, ) = explode('?', $path, 2);

		return trim($path, '/ ');
	}
public static function normalizePath($path) {
		// remove fragment/query
		list($path, ) = explode('#', $path, 2);
		list($path, ) = explode('?', $path, 2);

		return trim($path, '/ ');
	}
Trim and remove fragment/querystring from a path

@param string $path URL path
@return string