I'm working on a module that uses a link to a menu callback from a paged display. That requires the query string ?page=n in the destination. The link is formatted like this:
admin/my_module/44/delete?destination=admin/my_module%3Fpage%3D1
The link takes the user to a standard confirm form. Since the return destination contains a query string, I have to pass my path to confirm_form() as the array('path'=>'my/path', 'query'=>'query_string').

This is how I'm currently doing it in my _delete_confirm funtion:

	$destination = isset($_GET['destination']) ? urldecode($_GET['destination']) : 'admin/my_module';
	$destination = explode('?', $destination);
	$path = $destination[0];
	$query = isset($destination[1]) ? $destination[1] : '';
	if ($query) {
		$path = array('path'=>$path, 'query'=>$query);
	}
	return confirm_form($form,
		t('Are you sure?),
		$path,
		t('This action cannot be undone.'),
		t('Delete'),
		t('Cancel')
	);

It works just fine. But is there a better/cleaner way to handle this?