aboutsummaryrefslogtreecommitdiffstats
path: root/core/src/Util/get-url-parameter.js
blob: 6df264f009f0f7558babd94bb14172a986ec1c12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/**
 * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
 * SPDX-License-Identifier: AGPL-3.0-or-later
 */

/**
 * @param {any} name -
 */
export default function getURLParameter(name) {
	return decodeURIComponent(
		// eslint-disable-next-line no-sparse-arrays
		(new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search) || [, ''])[1].replace(/\+/g, '%20'),
	) || ''
}