Edit File by line
/home/zeestwma/ceyloniy.../wp-conte.../plugins/extendif.../src/Shared/utils
File: get-url-parameter.js
import { sanitizeString } from '@shared/utils/sanitize';
[0] Fix | Delete
[1] Fix | Delete
export const getUrlParameter = (parameterName, cleanUrl = true) => {
[2] Fix | Delete
const urlParams = new URLSearchParams(window.location.search);
[3] Fix | Delete
if (!urlParams.has(parameterName)) return null;
[4] Fix | Delete
[5] Fix | Delete
const sanitizedParameter = sanitizeString(urlParams.get(parameterName));
[6] Fix | Delete
[7] Fix | Delete
if (cleanUrl) {
[8] Fix | Delete
urlParams.delete(parameterName);
[9] Fix | Delete
const cleanedSearchParameters = urlParams.toString();
[10] Fix | Delete
const searchParametersToUrl = cleanedSearchParameters
[11] Fix | Delete
? `?${cleanedSearchParameters}`
[12] Fix | Delete
: '';
[13] Fix | Delete
[14] Fix | Delete
window.history.replaceState(
[15] Fix | Delete
{},
[16] Fix | Delete
document.title,
[17] Fix | Delete
`${window.location.pathname}${searchParametersToUrl}`,
[18] Fix | Delete
);
[19] Fix | Delete
}
[20] Fix | Delete
[21] Fix | Delete
return sanitizedParameter;
[22] Fix | Delete
};
[23] Fix | Delete
[24] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function